diff --git a/MakeSignedClient.bat b/MakeSignedClient.bat new file mode 100644 index 0000000..90434db --- /dev/null +++ b/MakeSignedClient.bat @@ -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 \ No newline at end of file diff --git a/MakeSignedClient.sh b/MakeSignedClient.sh new file mode 100644 index 0000000..83e964b --- /dev/null +++ b/MakeSignedClient.sh @@ -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" \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2ffc3d3..3e87175 100755 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,9 @@ - -buildscript { - repositories { - mavenCentral() - } - - dependencies { - classpath 'io.github.zebalu:teavm-gradle-plugin:1.0.0' - } +plugins { + id 'java' + id 'eclipse' + id 'org.teavm' version '0.9.2' } -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'io.github.zebalu.teavm-gradle-plugin' - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - sourceSets { main { java { @@ -30,57 +18,22 @@ repositories { } dependencies { - /** we use 0.6.1 due to performance issues on 7.0.0 */ - implementation 'org.teavm:teavm-platform:0.6.1' - implementation('org.teavm:teavm-classlib:0.6.1') { - exclude group: 'com.google.code.gson', module: 'gson' - } + teavm(teavm.libs.jso) + teavm(teavm.libs.jsoApis) } -teavm { - - compileScopes = null; - minifying = true; - maxTopLevelNames = 10000; - properties = null; - debugInformationGenerated = false; - sourceMapsGenerated = true; - sourceFilesCopied = false; - incremental = false; - transformers = null; - - /** Where to save the result */ - targetDirectory = file("javascript"); - - /** 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; +teavm.js { + obfuscated = true + sourceMap = true + targetFileName = "../classes.js" + optimization = org.teavm.gradle.api.OptimizationLevel.AGGRESSIVE; + outOfProcess = false + fastGlobalAnalysis = false + processMemory = 4048 + entryPointName = 'main' + mainClass = 'net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass' + outputDir = file("javascript") + properties = null + sourceMap = true + debugInformation = false } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index cc4fdc2..58499e4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6ce793f..78c860b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 2fe81a7..9d9cdba 100755 --- a/gradlew +++ b/gradlew @@ -1,21 +1,5 @@ #!/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 @@ -44,7 +28,7 @@ APP_NAME="Gradle" 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. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. 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\"" fi -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -154,19 +138,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=`expr $i + 1` + i=$((i+1)) done case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,9 +159,14 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=`save "$@"` +APP_ARGS=$(save "$@") # 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" "$@" diff --git a/gradlew.bat b/gradlew.bat index 9618d8d..f955316 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -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 @rem ########################################################################## @rem @@ -30,7 +14,7 @@ set APP_BASE_NAME=%~n0 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. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS= @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/src/lwjgl/java/net/PeytonPlayz585/shadow/opengl/GL11.java b/src/lwjgl/java/net/PeytonPlayz585/shadow/opengl/GL11.java new file mode 100644 index 0000000..4d9bd4b --- /dev/null +++ b/src/lwjgl/java/net/PeytonPlayz585/shadow/opengl/GL11.java @@ -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); + } +} \ No newline at end of file diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java index 57cd9e3..f1cfad6 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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. * */ class OpenGLObjects { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java index 5e3e84c..d7602a5 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java @@ -20,17 +20,23 @@ import javax.swing.JFileChooser; import javax.swing.JOptionPane; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformApplication { @@ -45,7 +51,7 @@ public class PlatformApplication { try { Desktop.getDesktop().browse(new URI(url)); } catch (Throwable var5) { - var5.printStackTrace(); + EagRuntime.debugPrintStackTrace(var5); } } @@ -59,10 +65,14 @@ public class PlatformApplication { } public static void setLocalStorage(String name, byte[] data) { - try(FileOutputStream f = new FileOutputStream(new File("_eagstorage."+name+".dat"))) { - f.write(data); - } catch (IOException e) { - e.printStackTrace(); + if(data == null) { + (new File("_eagstorage."+name+".dat")).delete(); + }else { + 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; } + public static void clearFileChooserResult() { + fileChooserHasResult = false; + fileChooserResultObject = null; + } + 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() { + + } + } diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java index e6c53d0..ba16a63 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java @@ -14,16 +14,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformAssets { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java index 78f678c..164bc04 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java @@ -14,16 +14,18 @@ import paulscode.sound.codecs.CodecJOrbis; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformAudio { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java index 9c55008..9adf74c 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java @@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformBufferFunctions { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java new file mode 100644 index 0000000..1f2a25f --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java @@ -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(); + } + } +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java index 69e5f00..198ce76 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java @@ -8,25 +8,29 @@ import java.util.List; import org.lwjgl.PointerBuffer; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformInput { 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 windowResized = true; @@ -179,7 +183,11 @@ public class PlatformInput { 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() { @@ -380,5 +388,19 @@ public class PlatformInput { public static boolean isFullscreen() { 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; + } + } } diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java index 6c02586..2989e56 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java @@ -2,6 +2,7 @@ package net.lax1dude.eaglercraft.v1_8.internal; import java.net.URI; import java.net.URISyntaxException; +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -11,16 +12,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformNetworking { @@ -86,7 +89,19 @@ public class PlatformNetworking { return playPackets.size() > 0 ? playPackets.remove(0) : null; } } - + + public static List readAllPacket() { + synchronized(playPackets) { + if(!playPackets.isEmpty()) { + List ret = new ArrayList<>(playPackets); + playPackets.clear(); + return ret; + }else { + return null; + } + } + } + public static int countAvailableReadData() { int total = 0; synchronized(playPackets) { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java index cf9f227..4abaaf7 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformOpenGL { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index 6bf684a..4173776 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -13,6 +13,7 @@ import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Random; import java.util.function.Consumer; import java.util.zip.DeflaterOutputStream; 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; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformRuntime { @@ -430,6 +433,10 @@ public class PlatformRuntime { return false; } + public static boolean isOfflineDownloadURL() { + return false; + } + public static IClientConfigAdapter getClientConfigAdapter() { 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(); + } } diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformUpdateSvc.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformUpdateSvc.java new file mode 100644 index 0000000..cd3cc71 --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformUpdateSvc.java @@ -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) { + + } +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java new file mode 100644 index 0000000..3b43ae0 --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java @@ -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 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 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; + } +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketPlayClient.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketPlayClient.java index 9edd9c3..0e20182 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketPlayClient.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketPlayClient.java @@ -13,16 +13,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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. * */ class WebSocketPlayClient extends WebSocketClient { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketServerQuery.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketServerQuery.java index 38365f7..42feb10 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketServerQuery.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/WebSocketServerQuery.java @@ -16,16 +16,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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. * */ class WebSocketServerQuery extends WebSocketClient implements IServerQuery { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLAllocator.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLAllocator.java index fcdba47..8167730 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLAllocator.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLAllocator.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerLWJGLAllocator { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLByteBuffer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLByteBuffer.java index 39e356d..d21926f 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLByteBuffer.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLByteBuffer.java @@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerLWJGLByteBuffer implements ByteBuffer { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLFloatBuffer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLFloatBuffer.java index f701f6b..5110c17 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLFloatBuffer.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLFloatBuffer.java @@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerLWJGLFloatBuffer implements FloatBuffer { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLIntBuffer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLIntBuffer.java index 7a5b3a5..6471eed 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLIntBuffer.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLIntBuffer.java @@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerLWJGLIntBuffer implements IntBuffer { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLShortBuffer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLShortBuffer.java index f9cbb8e..01e0198 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLShortBuffer.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerLWJGLShortBuffer.java @@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerLWJGLShortBuffer implements ShortBuffer { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java index f63265d..f2b5dd0 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java @@ -3,19 +3,25 @@ package net.lax1dude.eaglercraft.v1_8.internal.lwjgl; import java.util.ArrayList; 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.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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DesktopClientConfigAdapter implements IClientConfigAdapter { @@ -39,4 +45,69 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter { return null; } + @Override + public String getWorldsDB() { + return "desktop"; + } + + @Override + public JSONObject dumpConfig() { + return new JSONObject("{\"container\":null,\"worldsDB\":\"desktop\"}"); + } + + @Override + public List 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; + } + } diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java index f5e0102..434404e 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java @@ -11,21 +11,26 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LWJGLEntryPoint { + public static Thread mainThread = null; + public static void main_(String[] args) { + mainThread = Thread.currentThread(); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LaunchRenderDocDialog.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LaunchRenderDocDialog.java index 0945707..65540b3 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LaunchRenderDocDialog.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LaunchRenderDocDialog.java @@ -22,16 +22,18 @@ import java.awt.Dimension; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LaunchRenderDocDialog extends JDialog { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java index ca70434..1a5cec5 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java @@ -9,19 +9,20 @@ import java.io.InputStream; import java.util.Set; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 FolderResourcePack extends AbstractResourcePack { public FolderResourcePack(String resourcePackFileIn, String prefix) { super(resourcePackFileIn); diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java index 6563ed2..856bef1 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java @@ -6,19 +6,20 @@ import java.util.List; import java.util.function.Consumer; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 SYS { public static final Object VFS = null; diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java new file mode 100644 index 0000000..d346387 --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java @@ -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 recieveAllPacket() { + synchronized(MemoryConnection.serverToClientQueue) { + if(MemoryConnection.serverToClientQueue.size() == 0) { + return null; + }else { + List 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); + } + +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java new file mode 100644 index 0000000..e3f0372 --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java @@ -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 recieveAllPacket() { + synchronized(MemoryConnection.clientToServerQueue) { + if(MemoryConnection.clientToServerQueue.size() == 0) { + return null; + }else { + List ret = new ArrayList(MemoryConnection.clientToServerQueue); + MemoryConnection.clientToServerQueue.clear(); + return ret; + } + } + } + + public static IClientConfigAdapter getClientConfigAdapter() { + return DesktopClientConfigAdapter.instance; + } +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java new file mode 100644 index 0000000..c385289 --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java @@ -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); + } +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/DesktopIntegratedServer.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/DesktopIntegratedServer.java new file mode 100644 index 0000000..c6f213e --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/DesktopIntegratedServer.java @@ -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; + } + } + +} diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/MemoryConnection.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/MemoryConnection.java new file mode 100644 index 0000000..3398d3d --- /dev/null +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/MemoryConnection.java @@ -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 clientToServerQueue = new LinkedList(); + public static final List serverToClientQueue = new LinkedList(); + +} diff --git a/src/main/java/de/Hero/clickgui/ClickGui.java b/src/main/java/de/Hero/clickgui/ClickGui.java deleted file mode 100644 index ff1e079..0000000 --- a/src/main/java/de/Hero/clickgui/ClickGui.java +++ /dev/null @@ -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 frames; - public static int color = -1; - - public ClickGui() { - this.frames = new ArrayList(); - 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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/Component.java b/src/main/java/de/Hero/clickgui/component/Component.java deleted file mode 100644 index 5c5f448..0000000 --- a/src/main/java/de/Hero/clickgui/component/Component.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/Frame.java b/src/main/java/de/Hero/clickgui/component/Frame.java deleted file mode 100644 index 19bdc2d..0000000 --- a/src/main/java/de/Hero/clickgui/component/Frame.java +++ /dev/null @@ -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 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(); - 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 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; - } - -} diff --git a/src/main/java/de/Hero/clickgui/component/components/Button.java b/src/main/java/de/Hero/clickgui/component/components/Button.java deleted file mode 100644 index b0b9535..0000000 --- a/src/main/java/de/Hero/clickgui/component/components/Button.java +++ /dev/null @@ -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 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(); - 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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/components/sub/Checkbox.java b/src/main/java/de/Hero/clickgui/component/components/sub/Checkbox.java deleted file mode 100644 index afa9b29..0000000 --- a/src/main/java/de/Hero/clickgui/component/components/sub/Checkbox.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/components/sub/Keybind.java b/src/main/java/de/Hero/clickgui/component/components/sub/Keybind.java deleted file mode 100644 index 8d3c9c5..0000000 --- a/src/main/java/de/Hero/clickgui/component/components/sub/Keybind.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/components/sub/ModeButton.java b/src/main/java/de/Hero/clickgui/component/components/sub/ModeButton.java deleted file mode 100644 index 812c4f1..0000000 --- a/src/main/java/de/Hero/clickgui/component/components/sub/ModeButton.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/components/sub/Slider.java b/src/main/java/de/Hero/clickgui/component/components/sub/Slider.java deleted file mode 100644 index 61f6cfe..0000000 --- a/src/main/java/de/Hero/clickgui/component/components/sub/Slider.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/de/Hero/clickgui/component/components/sub/VisibleButton.java b/src/main/java/de/Hero/clickgui/component/components/sub/VisibleButton.java deleted file mode 100644 index aa310b0..0000000 --- a/src/main/java/de/Hero/clickgui/component/components/sub/VisibleButton.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/de/Hero/settings/Setting.java b/src/main/java/de/Hero/settings/Setting.java deleted file mode 100644 index c9f26ca..0000000 --- a/src/main/java/de/Hero/settings/Setting.java +++ /dev/null @@ -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 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 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; - } -} diff --git a/src/main/java/de/Hero/settings/SettingsManager.java b/src/main/java/de/Hero/settings/SettingsManager.java deleted file mode 100644 index 1254f16..0000000 --- a/src/main/java/de/Hero/settings/SettingsManager.java +++ /dev/null @@ -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 settings; - - public SettingsManager(){ - this.settings = new ArrayList(); - } - - public void rSetting(Setting in){ - this.settings.add(in); - } - - public ArrayList getSettings(){ - return this.settings; - } - - public ArrayList getSettingsByMod(Module mod){ - ArrayList out = new ArrayList(); - 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; - } - -} \ No newline at end of file diff --git a/src/main/java/net/FatalCodes/shadow/Shadow.java b/src/main/java/net/FatalCodes/shadow/Shadow.java deleted file mode 100644 index e2544ce..0000000 --- a/src/main/java/net/FatalCodes/shadow/Shadow.java +++ /dev/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; } -} diff --git a/src/main/java/net/FatalCodes/shadow/event/Event.java b/src/main/java/net/FatalCodes/shadow/event/Event.java deleted file mode 100644 index 00c9425..0000000 --- a/src/main/java/net/FatalCodes/shadow/event/Event.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.FatalCodes.shadow.event; - -public class Event { - - 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; - } - - -} \ No newline at end of file diff --git a/src/main/java/net/FatalCodes/shadow/event/EventDirection.java b/src/main/java/net/FatalCodes/shadow/event/EventDirection.java deleted file mode 100644 index e5335b2..0000000 --- a/src/main/java/net/FatalCodes/shadow/event/EventDirection.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.FatalCodes.shadow.event; - -public enum EventDirection { - OUTGOING, - INCOMING; -} diff --git a/src/main/java/net/FatalCodes/shadow/event/EventType.java b/src/main/java/net/FatalCodes/shadow/event/EventType.java deleted file mode 100644 index 2717f28..0000000 --- a/src/main/java/net/FatalCodes/shadow/event/EventType.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.FatalCodes.shadow.event; - -public enum EventType { - PRE, - POST; -} diff --git a/src/main/java/net/FatalCodes/shadow/module/Category.java b/src/main/java/net/FatalCodes/shadow/module/Category.java deleted file mode 100644 index 574a091..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/Category.java +++ /dev/null @@ -1,5 +0,0 @@ -package net.FatalCodes.shadow.module; - -public enum Category { - HUD, PVP, ADMIN -} diff --git a/src/main/java/net/FatalCodes/shadow/module/Module.java b/src/main/java/net/FatalCodes/shadow/module/Module.java deleted file mode 100644 index d41d245..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/Module.java +++ /dev/null @@ -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) { - - } - -} \ No newline at end of file diff --git a/src/main/java/net/FatalCodes/shadow/module/ModuleManager.java b/src/main/java/net/FatalCodes/shadow/module/ModuleManager.java deleted file mode 100644 index c37b5bf..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/ModuleManager.java +++ /dev/null @@ -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 mods; - - public ModuleManager() { - mods = new ArrayList(); - 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 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 modsInCategory(Category c){ - ArrayList 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); - } - } -} \ No newline at end of file diff --git a/src/main/java/net/FatalCodes/shadow/module/RenderModule.java b/src/main/java/net/FatalCodes/shadow/module/RenderModule.java deleted file mode 100644 index 623a8cd..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/RenderModule.java +++ /dev/null @@ -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; - } - -} \ No newline at end of file diff --git a/src/main/java/net/FatalCodes/shadow/module/hud/ClickGui.java b/src/main/java/net/FatalCodes/shadow/module/hud/ClickGui.java deleted file mode 100644 index e1710a7..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/hud/ClickGui.java +++ /dev/null @@ -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(); - } -} diff --git a/src/main/java/net/FatalCodes/shadow/module/hud/Drag.java b/src/main/java/net/FatalCodes/shadow/module/hud/Drag.java deleted file mode 100644 index 10c968e..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/hud/Drag.java +++ /dev/null @@ -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(); - } -} diff --git a/src/main/java/net/FatalCodes/shadow/module/pvp/AutoWtap.java b/src/main/java/net/FatalCodes/shadow/module/pvp/AutoWtap.java deleted file mode 100644 index e7163c2..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/pvp/AutoWtap.java +++ /dev/null @@ -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; - - } - } - } - -} - diff --git a/src/main/java/net/FatalCodes/shadow/module/pvp/NoHurtCam.java b/src/main/java/net/FatalCodes/shadow/module/pvp/NoHurtCam.java deleted file mode 100644 index 80c562c..0000000 --- a/src/main/java/net/FatalCodes/shadow/module/pvp/NoHurtCam.java +++ /dev/null @@ -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; - } - } - -} diff --git a/src/main/java/net/FatalCodes/shadow/ui/DragScreen.java b/src/main/java/net/FatalCodes/shadow/ui/DragScreen.java deleted file mode 100644 index a2f79af..0000000 --- a/src/main/java/net/FatalCodes/shadow/ui/DragScreen.java +++ /dev/null @@ -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); - } - -} diff --git a/src/main/java/net/PeytonPlayz585/shadow/BlockPosMSingleplayer.java b/src/main/java/net/PeytonPlayz585/shadow/BlockPosMSingleplayer.java new file mode 100644 index 0000000..49b1a8d --- /dev/null +++ b/src/main/java/net/PeytonPlayz585/shadow/BlockPosMSingleplayer.java @@ -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()); + } +} \ No newline at end of file diff --git a/src/main/java/net/PeytonPlayz585/shadow/ClearWater.java b/src/main/java/net/PeytonPlayz585/shadow/ClearWater.java index 8d7eddc..e4be9db 100644 --- a/src/main/java/net/PeytonPlayz585/shadow/ClearWater.java +++ b/src/main/java/net/PeytonPlayz585/shadow/ClearWater.java @@ -1,8 +1,10 @@ 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.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.Entity; 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.EmptyChunk; import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.client.Minecraft; public class ClearWater { public static void updateWaterOpacity(GameSettings p_updateWaterOpacity_0_, World p_updateWaterOpacity_1_) { @@ -77,7 +78,89 @@ public class ClearWater { } 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"); } } } diff --git a/src/main/java/net/PeytonPlayz585/shadow/Config.java b/src/main/java/net/PeytonPlayz585/shadow/Config.java index bbdef59..2afb0c1 100644 --- a/src/main/java/net/PeytonPlayz585/shadow/Config.java +++ b/src/main/java/net/PeytonPlayz585/shadow/Config.java @@ -38,6 +38,7 @@ public class Config { public static boolean chunkFixNether = false; public static boolean chunkFixEnd = false; public static WorldClient worldClient = null; + public static boolean waterOpacityChanged = false; public static boolean isAnimatedWater() { return Minecraft.getMinecraft().gameSettings.ofAnimatedWater != 2; diff --git a/src/main/java/net/PeytonPlayz585/shadow/WorldServerOF.java b/src/main/java/net/PeytonPlayz585/shadow/WorldServerOF.java new file mode 100644 index 0000000..e622d42 --- /dev/null +++ b/src/main/java/net/PeytonPlayz585/shadow/WorldServerOF.java @@ -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); +// } +// } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/PeytonPlayz585/shadow/gui/GuiOther.java b/src/main/java/net/PeytonPlayz585/shadow/gui/GuiOther.java index d68b569..e622b90 100644 --- a/src/main/java/net/PeytonPlayz585/shadow/gui/GuiOther.java +++ b/src/main/java/net/PeytonPlayz585/shadow/gui/GuiOther.java @@ -68,7 +68,7 @@ public class GuiOther extends GuiScreen implements GuiYesNoCallback { public void confirmClicked(boolean result, int id) { if (result) { - this.mc.gameSettings.resetSettings(); + //this.mc.gameSettings.resetSettings(); } this.mc.displayGuiScreen(this); diff --git a/src/main/java/net/PeytonPlayz585/shadow/gui/GuiShaders.java b/src/main/java/net/PeytonPlayz585/shadow/gui/GuiShaders.java index cbb7aa1..6bfe783 100644 --- a/src/main/java/net/PeytonPlayz585/shadow/gui/GuiShaders.java +++ b/src/main/java/net/PeytonPlayz585/shadow/gui/GuiShaders.java @@ -72,7 +72,7 @@ public class GuiShaders extends GuiScreen { java.util.Map languageMap = new java.util.HashMap<>(); 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(2, "High Performance PBR"); diff --git a/src/main/java/net/PeytonPlayz585/shadow/input/Controller.java b/src/main/java/net/PeytonPlayz585/shadow/input/Controller.java deleted file mode 100644 index 3d5d08d..0000000 --- a/src/main/java/net/PeytonPlayz585/shadow/input/Controller.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java index 2847903..0f16ecb 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java @@ -1,18 +1,22 @@ package net.lax1dude.eaglercraft.v1_8; +import java.util.List; + 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ArrayUtils { @@ -51,6 +55,16 @@ public class ArrayUtils { } return str; } + + public static void eaglerShuffle(List 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) { for (String item : array) { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/DecoderException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/DecoderException.java index 1b9a479..1816cb5 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/DecoderException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/DecoderException.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DecoderException extends RuntimeException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/Display.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/Display.java index 2e2d7d7..2f46e14 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/Display.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/Display.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Display { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java index 4030274..7347b73 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java @@ -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.IntBuffer; import java.nio.charset.StandardCharsets; +import java.text.DateFormat; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; 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.Logger; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EagRuntime { @@ -42,6 +47,7 @@ public class EagRuntime { private static final Logger logger = LogManager.getLogger("EagRuntime"); private static final Logger exceptionLogger = LogManager.getLogger("Exception"); private static boolean ssl = false; + private static boolean offlineDownloadURL = false; public static String getVersion() { return "EagRuntimeX 1.0"; @@ -51,6 +57,9 @@ public class EagRuntime { logger.info("Version: {}", getVersion()); PlatformRuntime.create(); ssl = PlatformRuntime.requireSSL(); + offlineDownloadURL = PlatformRuntime.isOfflineDownloadURL(); + UpdateService.initialize(); + EaglerXBungeeVersion.initialize(); EaglercraftGPU.warmUpCache(); } @@ -211,11 +220,15 @@ public class EagRuntime { public static long freeMemory() { return PlatformRuntime.freeMemory(); } - + public static boolean requireSSL() { return ssl; } + public static boolean isOfflineDownloadURL() { + return offlineDownloadURL; + } + public static void showPopup(String msg) { PlatformApplication.showPopup(msg); } @@ -244,6 +257,10 @@ public class EagRuntime { return PlatformApplication.getFileChooserResult(); } + public static void clearFileChooserResult() { + PlatformApplication.clearFileChooserResult(); + } + public static void setStorage(String name, byte[] data) { PlatformApplication.setLocalStorage(name, data); } @@ -271,4 +288,25 @@ public class EagRuntime { public static void openCreditsPopup(String 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 fixDateFormat(T input) { + input.setCalendar(getLocaleCalendar()); + return input; + } } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EagUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EagUtils.java index 081b3ac..4246350 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EagUtils.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EagUtils.java @@ -1,21 +1,28 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EagUtils { 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) { String ret = ""; @@ -24,6 +31,14 @@ public class EagUtils { } return ret; } + + public static String[] linesArray(String input) { + return splitPattern.split(input); + } + + public static List linesList(String input) { + return Arrays.asList(splitPattern.split(input)); + } public static int decodeHex(CharSequence num) { int ret = 0; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java index dd5fe96..99b44ba 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java @@ -6,16 +6,18 @@ import java.io.IOException; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerInputStream extends ByteArrayInputStream { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerXBungeeVersion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerXBungeeVersion.java new file mode 100644 index 0000000..9a53c77 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerXBungeeVersion.java @@ -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; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerZLIB.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerZLIB.java index 404ba21..839a481 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerZLIB.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglerZLIB.java @@ -7,16 +7,18 @@ import java.io.OutputStream; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerZLIB { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftRandom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftRandom.java index 63f69fe..2f98334 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftRandom.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftRandom.java @@ -1,16 +1,20 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglercraftRandom { @@ -25,7 +29,7 @@ public class EaglercraftRandom { private static int yee = 0; public EaglercraftRandom() { - this(System.currentTimeMillis() + (++yee)); + this(PlatformRuntime.randomSeed()); } public EaglercraftRandom(long seed) { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftSoundManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftSoundManager.java index 93a434a..98b9664 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftSoundManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftSoundManager.java @@ -25,16 +25,18 @@ import net.minecraft.util.MathHelper; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglercraftSoundManager { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftUUID.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftUUID.java index b79407a..d3d771d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftUUID.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftUUID.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglercraftUUID implements Comparable { @@ -223,6 +225,16 @@ public class EaglercraftUUID implements Comparable { 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 public int compareTo(EaglercraftUUID val) { return (this.msb < val.msb ? -1 diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index b47673d..a3f4656 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -1,5 +1,7 @@ package net.lax1dude.eaglercraft.v1_8; +import java.math.BigInteger; + public class EaglercraftVersion { @@ -7,9 +9,9 @@ public class EaglercraftVersion { /// Customize these to fit your fork: - public static final String projectForkName = ""; - public static final String projectForkVersion = ""; - public static final String projectForkVendor = ""; + public static final String projectForkName = "Shadow"; + public static final String projectForkVersion = "4.0"; + public static final String projectForkVendor = "PeytonPlayz585"; 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 // original repository for maintaining the project: - public static final String projectOriginName = "Shadow Client 3.0"; - public static final String projectOriginAuthor = "PeytonPlayz585"; - public static final String projectOriginRevision = ""; - public static final String projectOriginVersion = ""; + public static final String projectOriginName = "EaglercraftX"; + public static final String projectOriginAuthor = "lax1dude"; + public static final String projectOriginRevision = "1.8"; + 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: - public static final String mainMenuStringA = ""; - public static final String mainMenuStringB = projectOriginName + "" + - projectOriginRevision + "" + projectOriginVersion + ""; + public static final String mainMenuStringA = "Minecraft 1.8.8"; + public static final String mainMenuStringB = projectOriginName + " " + + projectOriginRevision + "-" + projectOriginVersion + " ultimate"; 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 mainMenuStringF = ""; + public static final String mainMenuStringE = projectForkName + " " + projectForkVersion; + public static final String mainMenuStringF = "Made by " + projectForkVendor; - public static final String mainMenuStringG = "Shadow Client 3.0"; - public static final String mainMenuStringH = "Optifine + Shaders"; + public static final String mainMenuStringG = "Collector's Edition"; + 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 forceDemoMode = false; + } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EncoderException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EncoderException.java index dc059d0..e4ab2a2 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EncoderException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EncoderException.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EncoderException extends RuntimeException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/ExceptionUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/ExceptionUtils.java index c4fa62c..07afb76 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/ExceptionUtils.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/ExceptionUtils.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ExceptionUtils { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/HString.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/HString.java index 51a4c8b..eeccb1d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/HString.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/HString.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 HString { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java index 68c86a4..b0294f4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java @@ -11,16 +11,18 @@ import java.util.Arrays; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 IOUtils { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/JDKBackports.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/JDKBackports.java index a60ac3f..5ab8570 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/JDKBackports.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/JDKBackports.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JDKBackports { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/Keyboard.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/Keyboard.java index 7e1adc6..c93c53f 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/Keyboard.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/Keyboard.java @@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Keyboard { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/Mouse.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/Mouse.java index 92f1ac8..9f1f3f9 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/Mouse.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/Mouse.java @@ -1,18 +1,21 @@ package net.lax1dude.eaglercraft.v1_8; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Mouse { @@ -89,4 +92,29 @@ public class Mouse { 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; + } + } + } + } + } } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/ThreadLocalRandom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/ThreadLocalRandom.java index 40497f7..57ef6d3 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/ThreadLocalRandom.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/ThreadLocalRandom.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ThreadLocalRandom { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerCacheProvider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerCacheProvider.java index f3747d3..13f1176 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerCacheProvider.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerCacheProvider.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface EaglerCacheProvider { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerLoadingCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerLoadingCache.java index 1ae329c..a9a7ecc 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerLoadingCache.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/cache/EaglerLoadingCache.java @@ -4,16 +4,18 @@ import java.util.HashMap; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerLoadingCache { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/CancellationException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/CancellationException.java index a30edbb..ac9a1b2 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/CancellationException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/CancellationException.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CancellationException extends IllegalStateException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ExecutionException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ExecutionException.java index ad06a2b..87ed91f 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ExecutionException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ExecutionException.java @@ -1,16 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ExecutionException extends RuntimeException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Executors.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Executors.java index d03a491..313cbe4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Executors.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Executors.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.futures; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Executors { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Future.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Future.java index 35753b5..48b2235 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Future.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Future.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.futures; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface Future { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/FutureTask.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/FutureTask.java index 4ffb410..abd6849 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/FutureTask.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/FutureTask.java @@ -4,16 +4,18 @@ import java.util.concurrent.Callable; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FutureTask implements RunnableFuture { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Futures.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Futures.java index 229aa2c..769da20 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Futures.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/Futures.java @@ -11,16 +11,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Futures { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFuture.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFuture.java index ad9fa81..d7247aa 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFuture.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFuture.java @@ -6,16 +6,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ListenableFuture extends Future { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java index e179f8d..b6c3c28 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java @@ -6,16 +6,18 @@ import java.util.concurrent.Callable; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ListenableFutureTask extends FutureTask implements ListenableFuture { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/RunnableFuture.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/RunnableFuture.java index 91041ab..6a653d9 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/RunnableFuture.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/futures/RunnableFuture.java @@ -1,18 +1,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface RunnableFuture extends Runnable, Future { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumCursorType.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumCursorType.java new file mode 100644 index 0000000..11f6dd1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumCursorType.java @@ -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; +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumEaglerConnectionState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumEaglerConnectionState.java index ee1d5e4..d44ed70 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumEaglerConnectionState.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumEaglerConnectionState.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumEaglerConnectionState { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformANGLE.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformANGLE.java index 3000e49..051b5f5 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformANGLE.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformANGLE.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumPlatformANGLE { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformAgent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformAgent.java index f4f6ff2..1ea4f44 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformAgent.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformAgent.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumPlatformAgent { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformOS.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformOS.java index 1d606da..b42f732 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformOS.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformOS.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; import net.minecraft.util.Util; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumPlatformOS { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformType.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformType.java index 3ab3c46..c0ba932 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformType.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformType.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumPlatformType { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumServerRateLimit.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumServerRateLimit.java index e96bb77..84a4989 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumServerRateLimit.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumServerRateLimit.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumServerRateLimit { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/FileChooserResult.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/FileChooserResult.java index 83a2899..e7c7076 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/FileChooserResult.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/FileChooserResult.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FileChooserResult { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/GLObjectMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/GLObjectMap.java index 6cfb2bc..f47b755 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/GLObjectMap.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/GLObjectMap.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GLObjectMap { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioHandle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioHandle.java index a69167b..2080b6c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioHandle.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioHandle.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IAudioHandle { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioResource.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioResource.java index 2cd22c6..c1d9d5b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioResource.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IAudioResource.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IAudioResource { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferArrayGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferArrayGL.java index d285d93..6a28b4d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferArrayGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferArrayGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBufferArrayGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferGL.java index 6b9a6aa..ce6479a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IBufferGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBufferGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java index ce5b223..63e1249 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java @@ -2,17 +2,22 @@ package net.lax1dude.eaglercraft.v1_8.internal; import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry; +import org.json.JSONObject; + /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IClientConfigAdapter { @@ -35,4 +40,29 @@ public interface IClientConfigAdapter { String getServerToJoin(); + String getWorldsDB(); + + JSONObject dumpConfig(); + + List getRelays(); + + boolean checkShaderGLErrors(); + + boolean isDemo(); + + boolean allowUpdateSvc(); + + boolean allowUpdateDL(); + + boolean isEnableDownloadOfflineButton(); + + String getDownloadOfflineButtonLink(); + + boolean useSpecialCursors(); + + boolean isLogInvalidCerts(); + + boolean isCheckRelaysForUpdates(); + + boolean isEnableSignatureBadge(); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IFramebufferGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IFramebufferGL.java index cb3963e..a6c33f8 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IFramebufferGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IFramebufferGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IFramebufferGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IObjectGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IObjectGL.java index 13127a1..14382bd 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IObjectGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IObjectGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IPCPacketData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IPCPacketData.java new file mode 100644 index 0000000..40f02b9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IPCPacketData.java @@ -0,0 +1,28 @@ +package net.lax1dude.eaglercraft.v1_8.internal; + +/** + * 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 IPCPacketData { + + public final String channel; + public final byte[] contents; + + public IPCPacketData(String channel, byte[] contents) { + this.channel = channel; + this.contents = contents; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IProgramGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IProgramGL.java index 50e3627..31b38b1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IProgramGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IProgramGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IProgramGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IQueryGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IQueryGL.java index 025bbe0..0dd5806 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IQueryGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IQueryGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IQueryGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IRenderbufferGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IRenderbufferGL.java index 9d3a322..5fcb530 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IRenderbufferGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IRenderbufferGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IRenderbufferGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IResourceHandle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IResourceHandle.java index 23414c2..ea388c6 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IResourceHandle.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IResourceHandle.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IResourceHandle { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IServerQuery.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IServerQuery.java index a53628e..ba97b26 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IServerQuery.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IServerQuery.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; import org.json.JSONObject; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IServerQuery { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IShaderGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IShaderGL.java index ee28961..e685a30 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IShaderGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IShaderGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IShaderGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/ITextureGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/ITextureGL.java index ff160b9..c073a19 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/ITextureGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/ITextureGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITextureGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IUniformGL.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IUniformGL.java index 98d1320..b152dc7 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IUniformGL.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/IUniformGL.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IUniformGL extends IObjectGL { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/KeyboardConstants.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/KeyboardConstants.java index 4310188..279c6d1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/KeyboardConstants.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/KeyboardConstants.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 KeyboardConstants { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/QueryResponse.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/QueryResponse.java index 05e8d95..3f95a0a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/QueryResponse.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/QueryResponse.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal; import org.json.JSONObject; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 QueryResponse { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/VFSFilenameIterator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/VFSFilenameIterator.java new file mode 100644 index 0000000..e90d99c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/VFSFilenameIterator.java @@ -0,0 +1,28 @@ +package net.lax1dude.eaglercraft.v1_8.internal; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2.BreakLoop; + +/** + * 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 interface VFSFilenameIterator { + + public default void end() { + throw new BreakLoop(); + } + + public void next(String entry); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/Buffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/Buffer.java index 0b08bd9..0aff7fc 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/Buffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/Buffer.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface Buffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ByteBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ByteBuffer.java index 9ca5456..b301853 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ByteBuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ByteBuffer.java @@ -1,16 +1,19 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; + /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ByteBuffer extends Buffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerBufferInputStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerBufferInputStream.java index c83c7fe..383f83e 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerBufferInputStream.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerBufferInputStream.java @@ -3,17 +3,20 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; import java.io.IOException; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerBufferInputStream extends InputStream { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/FloatBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/FloatBuffer.java index 7176306..73656cb 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/FloatBuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/FloatBuffer.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface FloatBuffer extends Buffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/IntBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/IntBuffer.java index 8a107a1..27b3360 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/IntBuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/IntBuffer.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IntBuffer extends Buffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ShortBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ShortBuffer.java index 3576652..b66bad6 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ShortBuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/ShortBuffer.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ShortBuffer extends Buffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/EaglerFileSystemException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/EaglerFileSystemException.java new file mode 100644 index 0000000..30419d9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/EaglerFileSystemException.java @@ -0,0 +1,34 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +/** + * 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 EaglerFileSystemException extends RuntimeException { + + public EaglerFileSystemException() { + } + + public EaglerFileSystemException(String message, Throwable cause) { + super(message, cause); + } + + public EaglerFileSystemException(String message) { + super(message); + } + + public EaglerFileSystemException(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSFilenameIteratorImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSFilenameIteratorImpl.java new file mode 100644 index 0000000..0311f15 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSFilenameIteratorImpl.java @@ -0,0 +1,33 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +import net.lax1dude.eaglercraft.v1_8.internal.VFSFilenameIterator; + +/** + * 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. + * + */ +class VFSFilenameIteratorImpl implements VFSFilenameIterator { + + protected VFSIterator2 itr; + + VFSFilenameIteratorImpl(VFSIterator2 itr) { + this.itr = itr; + } + + @Override + public void next(String entry) { + itr.next(new VFile2(entry)); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSIterator2.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSIterator2.java new file mode 100644 index 0000000..4aa5f4f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSIterator2.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +/** + * 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 interface VFSIterator2 { + + public static class BreakLoop extends RuntimeException { + public BreakLoop() { + super("iterator loop break request"); + } + } + + public default void end() { + throw new BreakLoop(); + } + + public void next(VFile2 entry); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSListFilenamesIteratorImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSListFilenamesIteratorImpl.java new file mode 100644 index 0000000..7f7183d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSListFilenamesIteratorImpl.java @@ -0,0 +1,35 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.internal.VFSFilenameIterator; + +/** + * 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. + * + */ +class VFSListFilenamesIteratorImpl implements VFSFilenameIterator { + + protected List list; + + VFSListFilenamesIteratorImpl(List list) { + this.list = list; + } + + @Override + public void next(String entry) { + list.add(entry); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSListFilesIteratorImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSListFilesIteratorImpl.java new file mode 100644 index 0000000..81d4476 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFSListFilesIteratorImpl.java @@ -0,0 +1,35 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.internal.VFSFilenameIterator; + +/** + * 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. + * + */ +class VFSListFilesIteratorImpl implements VFSFilenameIterator { + + protected List list; + + VFSListFilesIteratorImpl(List list) { + this.list = list; + } + + @Override + public void next(String entry) { + list.add(new VFile2(entry)); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java new file mode 100644 index 0000000..bff077e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java @@ -0,0 +1,254 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformFilesystem; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; + +/** + * 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 VFile2 { + + public static final String pathSeperator = "/"; + public static final String[] altPathSeperator = new String[] { "\\" }; + + public static String normalizePath(String p) { + for(int i = 0; i < altPathSeperator.length; ++i) { + p = p.replace(altPathSeperator[i], pathSeperator); + } + if(p.startsWith(pathSeperator)) { + p = p.substring(1); + } + if(p.endsWith(pathSeperator)) { + p = p.substring(0, p.length() - pathSeperator.length()); + } + return p; + } + + public static String[] splitPath(String p) { + String[] pth = normalizePath(p).split(pathSeperator); + for(int i = 0; i < pth.length; ++i) { + pth[i] = pth[i].trim(); + } + return pth; + } + + protected String path; + + public static String createPath(Object... p) { + ArrayList r = new ArrayList(); + for(int i = 0; i < p.length; ++i) { + if(p[i] == null) { + continue; + } + String gg = p[i].toString(); + if(gg == null) { + continue; + } + String[] parts = splitPath(gg); + for(int j = 0; j < parts.length; ++j) { + if(parts[j] == null || parts[j].equals(".")) { + continue; + }else if(parts[j].equals("..") && r.size() > 0) { + int k = r.size() - 1; + if(!r.get(k).equals("..")) { + r.remove(k); + }else { + r.add(".."); + } + }else { + r.add(parts[j]); + } + } + } + if(r.size() > 0) { + StringBuilder s = new StringBuilder(); + for(int i = 0; i < r.size(); ++i) { + if(i > 0) { + s.append(pathSeperator); + } + s.append(r.get(i)); + } + return s.toString(); + }else { + return null; + } + } + + public VFile2(Object... p) { + this.path = createPath(p); + } + + public InputStream getInputStream() { + assertNotRelative(); + return new VFileInputStream(PlatformFilesystem.eaglerRead(path)); + } + + public OutputStream getOutputStream() { + assertNotRelative(); + return new VFileOutputStream(this); + } + + public String toString() { + return path; + } + + public boolean isRelative() { + return path == null || path.contains(".."); + } + + public void assertNotRelative() { + if(isRelative()) throw new EaglerFileSystemException("Relative paths are not allowed: " + path); + } + + public boolean canRead() { + return !isRelative() && PlatformFilesystem.eaglerExists(path); + } + + public String getPath() { + return path.equals("unnamed") ? null : path; + } + + public String getName() { + int i = path.lastIndexOf(pathSeperator); + return i == -1 ? path : path.substring(i + 1); + } + + public static String getNameFromPath(String path) { + path = normalizePath(path); + int i = path.lastIndexOf(pathSeperator); + return i == -1 ? path : path.substring(i + 1); + } + + public boolean canWrite() { + return !isRelative(); + } + + public String getParent() { + if(path == null) { + return null; + } + int i = path.lastIndexOf(pathSeperator); + return i == -1 ? ".." : path.substring(0, i); + } + + public int hashCode() { + return path == null ? 0 : path.hashCode(); + } + + public boolean equals(Object o) { + return path != null && o != null && (o instanceof VFile2) && path.equals(((VFile2)o).path); + } + + public boolean exists() { + return !isRelative() && PlatformFilesystem.eaglerExists(path); + } + + public boolean delete() { + return !isRelative() && PlatformFilesystem.eaglerDelete(path); + } + + public boolean renameTo(String p) { + if(!isRelative() && PlatformFilesystem.eaglerMove(path, p)) { + return true; + } + return false; + } + + public boolean renameTo(VFile2 p) { + return renameTo(p.path); + } + + public int length() { + return isRelative() ? -1 : PlatformFilesystem.eaglerSize(path); + } + + public byte[] getAllBytes() { + assertNotRelative(); + if(!exists()) { + return null; + } + ByteBuffer readBuffer = PlatformFilesystem.eaglerRead(path); + try { + byte[] copyBuffer = new byte[readBuffer.remaining()]; + readBuffer.get(copyBuffer); + return copyBuffer; + }finally { + PlatformRuntime.freeByteBuffer(readBuffer); + } + } + + public String getAllChars() { + assertNotRelative(); + if(!exists()) { + return null; + } + return new String(getAllBytes(), StandardCharsets.UTF_8); + } + + public String[] getAllLines() { + assertNotRelative(); + if(!exists()) { + return null; + } + return EagUtils.linesArray(new String(getAllBytes(), StandardCharsets.UTF_8)); + } + + public void setAllChars(String bytes) { + setAllBytes(bytes.getBytes(StandardCharsets.UTF_8)); + } + + public void setAllBytes(byte[] bytes) { + assertNotRelative(); + ByteBuffer copyBuffer = PlatformRuntime.allocateByteBuffer(bytes.length); + try { + copyBuffer.put(bytes); + copyBuffer.flip(); + PlatformFilesystem.eaglerWrite(path, copyBuffer); + }finally { + PlatformRuntime.freeByteBuffer(copyBuffer); + } + } + + public void iterateFiles(VFSIterator2 itr, boolean recursive) { + assertNotRelative(); + PlatformFilesystem.eaglerIterate(path, new VFSFilenameIteratorImpl(itr), recursive); + } + + public List listFilenames(boolean recursive) { + List ret = new ArrayList(); + PlatformFilesystem.eaglerIterate(path, new VFSListFilenamesIteratorImpl(ret), recursive); + return ret; + } + + public List listFiles(boolean recursive) { + List ret = new ArrayList(); + PlatformFilesystem.eaglerIterate(path, new VFSListFilesIteratorImpl(ret), recursive); + return ret; + } + + public static int copyFile(VFile2 src, VFile2 dst) { + src.assertNotRelative(); + dst.assertNotRelative(); + return PlatformFilesystem.eaglerCopy(src.path, dst.path); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java new file mode 100644 index 0000000..ede2301 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +import java.io.IOException; +import java.io.InputStream; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; + +/** + * 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. + * + */ +class VFileInputStream extends InputStream { + + private ByteBuffer fileBuffer; + + VFileInputStream(ByteBuffer buffer) { + this.fileBuffer = buffer; + } + + @Override + public int read() throws IOException { + if(fileBuffer == null) { + throw new IOException("Stream is closed"); + } + if(fileBuffer.remaining() <= 0) { + return -1; + } + return (int)fileBuffer.get() & 0xFF; + } + + @Override + public int read(byte b[], int off, int len) throws IOException { + if(fileBuffer == null) { + throw new IOException("Stream is closed"); + } + int p = fileBuffer.position(); + int l = fileBuffer.limit(); + int r = l - p; + if(r < len) { + len = r; + } + if(len > 0) { + fileBuffer.get(b, off, len); + } + return len; + } + + @Override + public long skip(long n) throws IOException { + if(fileBuffer == null) { + throw new IOException("Stream is closed"); + } + int p = fileBuffer.position(); + int l = fileBuffer.limit(); + int r = l - p; + if(r < n) { + n = r; + } + if(n > 0) { + fileBuffer.position(p + (int)n); + } + return n; + } + + @Override + public int available() throws IOException { + return fileBuffer == null ? -1 : fileBuffer.remaining(); + } + + @Override + public void close() { + if(fileBuffer != null) { + PlatformRuntime.freeByteBuffer(fileBuffer); + fileBuffer = null; + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java new file mode 100644 index 0000000..bc23910 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java @@ -0,0 +1,54 @@ +package net.lax1dude.eaglercraft.v1_8.internal.vfs2; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformFilesystem; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; + +/** + * 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. + * + */ +class VFileOutputStream extends ByteArrayOutputStream { + + private final VFile2 vfsFile; + private boolean closed = false; + + VFileOutputStream(VFile2 vfsFile) { + super(256); + this.vfsFile = vfsFile; + } + + @Override + public void close() throws IOException { + if(!closed) { + closed = true; + ByteBuffer copyBuffer = PlatformRuntime.allocateByteBuffer(count); + try { + copyBuffer.put(buf, 0, count); + copyBuffer.flip(); + try { + PlatformFilesystem.eaglerWrite(vfsFile.path, copyBuffer); + }catch(Throwable t) { + throw new IOException("Could not write stream contents to file!", t); + } + }finally { + PlatformRuntime.freeByteBuffer(copyBuffer); + } + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONDataParserImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONDataParserImpl.java index 11f05a1..29bb566 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONDataParserImpl.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONDataParserImpl.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.json; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface JSONDataParserImpl { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeCodec.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeCodec.java index c1b6459..6299b4c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeCodec.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeCodec.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.json; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface JSONTypeCodec extends JSONTypeSerializer, JSONTypeDeserializer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeDeserializer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeDeserializer.java index e38dfbd..73c575c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeDeserializer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeDeserializer.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.json; import org.json.JSONException; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface JSONTypeDeserializer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeProvider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeProvider.java index 4c8b06f..8549dff 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeProvider.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeProvider.java @@ -35,18 +35,21 @@ import net.minecraft.client.resources.data.TextureMetadataSectionSerializer; import net.minecraft.network.ServerStatusResponse; import net.minecraft.util.ChatStyle; import net.minecraft.util.IChatComponent; +import net.minecraft.world.gen.ChunkProviderSettings; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JSONTypeProvider { @@ -147,6 +150,7 @@ public class JSONTypeProvider { registerType(LanguageMetadataSection.class, new LanguageMetadataSectionSerializer()); registerType(PackMetadataSection.class, new PackMetadataSectionSerializer()); registerType(AnimationMetadataSection.class, new AnimationMetadataSectionSerializer()); + registerType(ChunkProviderSettings.Factory.class, new ChunkProviderSettings.Serializer()); registerParser(new JSONDataParserString()); registerParser(new JSONDataParserReader()); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeSerializer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeSerializer.java index 444d62b..181b2d1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeSerializer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/JSONTypeSerializer.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.json; import org.json.JSONException; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface JSONTypeSerializer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserReader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserReader.java index 0bde8b4..1c355e1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserReader.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserReader.java @@ -9,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONDataParserImpl; import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JSONDataParserReader implements JSONDataParserImpl { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserStream.java index 4fb0999..4b260f9 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserStream.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserStream.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONDataParserImpl; import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JSONDataParserStream implements JSONDataParserImpl { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserString.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserString.java index e02292a..2218bf0 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserString.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/JSONDataParserString.java @@ -7,16 +7,18 @@ import org.json.JSONObject; import net.lax1dude.eaglercraft.v1_8.json.JSONDataParserImpl; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JSONDataParserString implements JSONDataParserImpl { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/SoundMapDeserializer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/SoundMapDeserializer.java index 19c78bb..ccbeca4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/SoundMapDeserializer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/json/impl/SoundMapDeserializer.java @@ -12,16 +12,18 @@ import net.minecraft.client.audio.SoundHandler.SoundMap; import net.minecraft.client.audio.SoundList; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundMapDeserializer implements JSONTypeDeserializer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/ILogRedirector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/ILogRedirector.java new file mode 100644 index 0000000..9bf3395 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/ILogRedirector.java @@ -0,0 +1,22 @@ +package net.lax1dude.eaglercraft.v1_8.log4j; + +/** + * 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 interface ILogRedirector { + + void log(String txt, boolean err); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Level.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Level.java index 74869cf..e191613 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Level.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Level.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.log4j; import java.io.PrintStream; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Level { @@ -24,11 +26,13 @@ public enum Level { public final int levelInt; public final String levelName; public final PrintStream stdout; + public final boolean isErr; private Level(int levelInt, String levelName, boolean stderr) { this.levelInt = levelInt; this.levelName = levelName; this.stdout = stderr ? System.err : System.out; + this.isErr = stderr; } PrintStream getPrintStream() { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/LogManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/LogManager.java index 8bf2007..3cc11e1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/LogManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/LogManager.java @@ -4,16 +4,18 @@ import java.util.HashMap; import java.util.Map; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LogManager { @@ -22,6 +24,7 @@ public class LogManager { public static final Object logLock = new Object(); public static Level logLevel = Level.DEBUG; + public static ILogRedirector logRedirector = null; public static Logger getLogger() { return getLogger("Minecraft"); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Logger.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Logger.java index fcd2e89..137ac39 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Logger.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/log4j/Logger.java @@ -1,6 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.log4j; -import java.io.PrintStream; import java.text.SimpleDateFormat; import java.util.Date; @@ -8,16 +7,18 @@ import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Logger { @@ -100,17 +101,20 @@ public class Logger { log(Level.FATAL, msg); } - private static final SimpleDateFormat fmt = new SimpleDateFormat("hh:mm:ss+SSS"); + private static final SimpleDateFormat fmt = EagRuntime.fixDateFormat(new SimpleDateFormat("hh:mm:ss+SSS")); private static final Date dateInstance = new Date(); public void log(Level level, String msg) { if(level.levelInt >= LogManager.logLevel.levelInt) { synchronized(LogManager.logLock) { - PrintStream ps = level.getPrintStream(); dateInstance.setTime(System.currentTimeMillis()); - ps.println("[" + fmt.format(dateInstance) + "]" + - "[" + Thread.currentThread().getName() + "/" + level.levelName + "]" + - "[" + loggerName + "]: " + msg); + String line = "[" + fmt.format(dateInstance) + "]" + + "[" + EagRuntime.currentThreadName() + "/" + level.levelName + "]" + + "[" + loggerName + "]: " + msg; + level.getPrintStream().println(line); + if(LogManager.logRedirector != null) { + LogManager.logRedirector.log(line, level.isErr); + } } } } @@ -118,11 +122,14 @@ public class Logger { public void log(Level level, String msg, Object... args) { if(level.levelInt >= LogManager.logLevel.levelInt) { synchronized(LogManager.logLock) { - PrintStream ps = level.getPrintStream(); dateInstance.setTime(System.currentTimeMillis()); - ps.println("[" + fmt.format(dateInstance) + "]" + - "[" + Thread.currentThread().getName() + "/" + level.levelName + "]" + - "[" + loggerName + "]: " + formatParams(msg, args)); + String line = "[" + fmt.format(dateInstance) + "]" + + "[" + EagRuntime.currentThreadName() + "/" + level.levelName + "]" + + "[" + loggerName + "]: " + formatParams(msg, args); + level.getPrintStream().println(line); + if(LogManager.logRedirector != null) { + LogManager.logRedirector.log(line, level.isErr); + } } } } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/AcceleratedEffectRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/AcceleratedEffectRenderer.java index fe2911e..6c3381d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/AcceleratedEffectRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/AcceleratedEffectRenderer.java @@ -7,16 +7,18 @@ import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AcceleratedEffectRenderer implements IAcceleratedParticleEngine { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFontRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFontRenderer.java index d7d1a76..d71e2a8 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFontRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFontRenderer.java @@ -12,16 +12,18 @@ import net.minecraft.client.settings.GameSettings; import net.minecraft.util.ResourceLocation; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerFontRenderer extends FontRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java index bfb74c1..877e537 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java @@ -24,16 +24,18 @@ import net.minecraft.util.ReportedException; import net.minecraft.util.ResourceLocation; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerTextureAtlasSprite { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/IAcceleratedParticleEngine.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/IAcceleratedParticleEngine.java index b54d5b1..33e21a7 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/IAcceleratedParticleEngine.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/IAcceleratedParticleEngine.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.minecraft; import net.minecraft.entity.Entity; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IAcceleratedParticleEngine { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/TextureAnimationCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/TextureAnimationCache.java index 7448a0e..fbf84e6 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/TextureAnimationCache.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/TextureAnimationCache.java @@ -16,16 +16,18 @@ import net.lax1dude.eaglercraft.v1_8.vector.Matrix3f; import net.minecraft.client.renderer.GLAllocation; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureAnimationCache { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/GameProfile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/GameProfile.java index aff587d..7d45576 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/GameProfile.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/GameProfile.java @@ -9,16 +9,18 @@ import com.google.common.collect.Multimap; import com.google.common.collect.MultimapBuilder; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GameProfile { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/Property.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/Property.java index d04c7a1..81de8eb 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/Property.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/Property.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.mojang.authlib; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Property { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/TexturesProperty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/TexturesProperty.java index 13425fb..bff12a8 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/TexturesProperty.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/TexturesProperty.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.ArrayUtils; import net.lax1dude.eaglercraft.v1_8.Base64; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TexturesProperty { @@ -74,7 +76,7 @@ public class TexturesProperty { model = meta.optString("model", model); } } - JSONObject capeObj = json.optJSONObject("SKIN"); + JSONObject capeObj = json.optJSONObject("CAPE"); if(capeObj != null) { cape = capeObj.optString("url"); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/UUIDTypeAdapter.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/UUIDTypeAdapter.java index 2b1ec17..50abb69 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/UUIDTypeAdapter.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/mojang/authlib/UUIDTypeAdapter.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.mojang.authlib; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 UUIDTypeAdapter { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/ByteBufEaglercraftImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/ByteBufEaglercraftImpl.java index 0a1846e..d0963a1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/ByteBufEaglercraftImpl.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/ByteBufEaglercraftImpl.java @@ -7,16 +7,18 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ByteBufEaglercraftImpl extends AbstractByteBuf { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/Unpooled.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/Unpooled.java index d1851a4..d25666a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/Unpooled.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/netty/Unpooled.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.netty; import java.nio.ByteBuffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Unpooled { @@ -38,5 +40,8 @@ public class Unpooled { public static ByteBuf buffer(byte[] data, int maxLength) { return ByteBuf.allocate(ByteBuffer.wrap(data), maxLength); } - + + public static ByteBuf wrappedBuffer(ByteBuf buf) { + return buf.duplicate(); + } } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DisplayList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DisplayList.java index 71c564d..c840319 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DisplayList.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DisplayList.java @@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL; import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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. * */ class DisplayList { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DrawUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DrawUtils.java index 131d997..a3adcca 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DrawUtils.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/DrawUtils.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionConstants; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DrawUtils { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EaglercraftGPU.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EaglercraftGPU.java index 8783db9..7922549 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EaglercraftGPU.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EaglercraftGPU.java @@ -23,16 +23,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglercraftGPU { @@ -386,7 +388,7 @@ public class EaglercraftGPU { FixedFunctionPipeline.optimize(); } - public static FixedFunctionPipeline lastRender = null; + private static FixedFunctionPipeline lastRender = null; private static int lastMode = 0; private static int lastCount = 0; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EffectPipelineFXAA.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EffectPipelineFXAA.java index 9427335..f61fe14 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EffectPipelineFXAA.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EffectPipelineFXAA.java @@ -16,16 +16,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import net.lax1dude.eaglercraft.v1_8.EagRuntime; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EffectPipelineFXAA { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java index f80b509..41edaec 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java @@ -28,16 +28,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunc import static net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionConstants.*; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FixedFunctionPipeline { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionShader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionShader.java index 9fd4ddb..3ca8754 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionShader.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionShader.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FixedFunctionShader { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GameOverlayFramebuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GameOverlayFramebuffer.java index 95cd90c..94a5402 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GameOverlayFramebuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GameOverlayFramebuffer.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GameOverlayFramebuffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GlStateManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GlStateManager.java index 3b2481e..066a447 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GlStateManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/GlStateManager.java @@ -11,16 +11,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GlStateManager { @@ -119,7 +121,7 @@ public class GlStateManager { static float clearColorA = 1.0f; static float clearDepth = -999.0f; - + private static GlStateManager.TextureState[] textureState = new GlStateManager.TextureState[32]; public static enum TexGen { @@ -232,10 +234,6 @@ public class GlStateManager { stateAlphaTest = true; } - public static final boolean isAlpha() { - return stateAlphaTest; - } - public static final void alphaFunc(int func, float ref) { if(func != GL_GREATER) { throw new UnsupportedOperationException("Only GL_GREATER alphaFunc is supported"); @@ -362,10 +360,6 @@ public class GlStateManager { } } - public static final boolean isBlend() { - return stateBlend; - } - public static final void globalDisableBlend() { if(stateBlend) { _wglDisable(GL_BLEND); @@ -454,10 +448,6 @@ public class GlStateManager { stateFog = true; } - public static final boolean isFogEnabled() { - return stateFog; - } - public static final void disableFog() { stateFog = false; } @@ -1199,6 +1189,18 @@ public class GlStateManager { FixedFunctionPipeline.flushCache(); } + public static boolean isAlpha() { + return stateAlphaTest; + } + + public static boolean isBlend() { + return stateBlend; + } + + public static boolean isFogEnabled() { + return stateFog; + } + public static int getBoundTexture() { return textureState[activeTexture].textureName; } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/IExtPipelineCompiler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/IExtPipelineCompiler.java index 14f2764..47f8135 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/IExtPipelineCompiler.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/IExtPipelineCompiler.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl; import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IExtPipelineCompiler { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ImageData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ImageData.java index 8be887a..71eb24d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ImageData.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ImageData.java @@ -1,157 +1,151 @@ package net.lax1dude.eaglercraft.v1_8.opengl; -import java.io.*; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.util.HashMap; +import java.io.InputStream; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.internal.PlatformAssets; +/** + * Copyright (c) 2022-2023 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 ImageData { - - public final int width; - public final int height; - public final IntBuffer pixels; - public final boolean alpha; - - public ImageData(int width, int height, int[] pixels, boolean alpha) { - this.width = width; - this.height = height; - this.pixels = (IntBuffer) ByteBuffer.allocateDirect(pixels.length * 4).asIntBuffer().put(pixels).flip(); - this.alpha = alpha; - } - - public ImageData(int width, int height, boolean alpha) { - this.width = width; - this.height = height; - this.pixels = ByteBuffer.allocateDirect(width * height * 4) - .asIntBuffer(); - this.alpha = alpha; - } - - public ImageData fillAlpha() { - for (int i = 0; i < pixels.limit(); i++) { - pixels.put(i, pixels.get(i) | 0xFF000000); - } - return this; - } - - public ImageData getSubImage(int x, int y, int pw, int ph) { - int[] img = new int[pw * ph]; - for (int i = 0; i < ph; i++) { - pixels.position((i + y) * this.width + x); - pixels.get(img, i * pw, pw); - } - return new ImageData(pw, ph, img, alpha); - } - - public static final ImageData loadImageFile(String path) { - try (InputStream inputStream = EagRuntime.getResourceStream(path)) { - if (inputStream != null) { - return loadImageFile(inputStream); - } - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - public static final ImageData loadImageFile(InputStream data) { - return PlatformAssets.loadImageFile(data); - } - - public static final ImageData loadImageFile(byte[] data) { - return PlatformAssets.loadImageFile(data); - } - - public void getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) { - for (int y = 0; y < h; y++) { - pixels.position(offset + (y + startY) * scansize + startX); - pixels.get(rgbArray, y * w, w); - } - } - - public void copyPixelsFrom(ImageData input, int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2) { - int cw = sx2 - sx1; - int ch = sy2 - sy1; - if (cw != dx2 - dx1 || ch != dy2 - dy1) { - throw new IllegalArgumentException("Width and height of the copied region must match the width and height of the pasted region"); - } - int[] srcPixels = input.getPixels(); - int[] dstPixels = getPixels(); - int srcOffset = sx1 + sy1 * input.width; - int dstOffset = dx1 + dy1 * width; - for (int y = 0; y < ch; y++) { - System.arraycopy(srcPixels, srcOffset, dstPixels, dstOffset, cw); - srcOffset += input.width; - dstOffset += width; - } - } - - public void drawLayer(ImageData input, int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2) { - int cw = sx2 - sx1; - int ch = sy2 - sy1; - if (cw != dx2 - dx1 || ch != dy2 - dy1) { - throw new IllegalArgumentException("Width and height of the copied region must match the width and height of the pasted region"); - } - int[] srcPixels = input.getPixels(); - int[] dstPixels = getPixels(); - int srcOffset = sx1 + sy1 * input.width; - int dstOffset = dx1 + dy1 * width; - for (int y = 0; y < ch; y++) { - for (int x = 0; x < cw; x++) { - int si = srcOffset + x; - int di = dstOffset + x; - int spx = srcPixels[si]; - int dpx = dstPixels[di]; - if ((spx & 0xFF000000) == 0xFF000000 || (dpx & 0xFF000000) == 0) { - dstPixels[di] = spx; - } else { - int sa = (spx >> 24) & 0xFF; - int da = (dpx >> 24) & 0xFF; - int r = ((spx >> 16) & 0xFF) * sa / 255; - int g = ((spx >> 8) & 0xFF) * sa / 255; - int b = (spx & 0xFF) * sa / 255; - int aa = (255 - sa) * da; - r += ((dpx >> 16) & 0xFF) * aa / 65025; - g += ((dpx >> 8) & 0xFF) * aa / 65025; - b += (dpx & 0xFF) * aa / 65025; - sa += da; - if (sa > 0xFF) sa = 0xFF; - dstPixels[di] = (sa << 24) | (r << 16) | (g << 8) | b; - } - } - srcOffset += input.width; - dstOffset += width; - } - } - - public ImageData swapRB() { - int[] dstPixels = getPixels(); - for (int i = 0; i < dstPixels.length; i++) { - int j = dstPixels[i]; - dstPixels[i] = (j & 0xFF00FF00) | ((j & 0x00FF0000) >> 16) | ((j & 0x000000FF) << 16); - } - return this; - } - - public static int swapRB(int c) { - return (c & 0xFF00FF00) | ((c & 0x00FF0000) >> 16) | ((c & 0x000000FF) << 16); - } - - HashMap pixelArray = new HashMap(); - - public int[] getPixels() { - if(pixelArray.containsKey(pixels)) { - return pixelArray.get(pixels); + + public final int width; + public final int height; + public final int[] pixels; + public final boolean alpha; + + public ImageData(int width, int height, int[] pixels, boolean alpha) { + this.width = width; + this.height = height; + this.pixels = pixels; + this.alpha = alpha; + } + + public ImageData(int width, int height, boolean alpha) { + this.width = width; + this.height = height; + this.pixels = new int[width * height]; + this.alpha = alpha; + } + + public ImageData fillAlpha() { + for(int i = 0; i < pixels.length; ++i) { + pixels[i] = pixels[i] | 0xFF000000; } - int[] dstPixels = new int[pixels.limit()]; - pixels.get(dstPixels); - pixelArray.put(pixels, dstPixels); - return dstPixels; - } + return this; + } + + public ImageData getSubImage(int x, int y, int pw, int ph) { + int[] img = new int[pw * ph]; + for(int i = 0; i < ph; ++i) { + System.arraycopy(pixels, (i + y) * this.width + x, img, i * pw, pw); + } + return new ImageData(pw, ph, img, alpha); + } -} \ No newline at end of file + public static final ImageData loadImageFile(String path) { + byte[] fileData = EagRuntime.getResourceBytes(path); + if(fileData != null) { + return loadImageFile(fileData); + }else { + return null; + } + } + + public static final ImageData loadImageFile(InputStream data) { + return PlatformAssets.loadImageFile(data); + } + + public static final ImageData loadImageFile(byte[] data) { + return PlatformAssets.loadImageFile(data); + } + + public void getRGB(int startX, int startY, int w, int h, + int[] rgbArray, int offset, int scansize) { + for(int y = 0; y < h; ++y) { + System.arraycopy(pixels, offset + (y + startY) * scansize + startX, rgbArray, y * w, w); + } + } + + public void copyPixelsFrom(ImageData input, int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2) { + if(sx2 - sx1 != dx2 - dx1) { + throw new IllegalArgumentException("Width of the copied region must match the" + + "width of the pasted region"); + } + int cw = sx2 - sx1; + if(sy2 - sy1 != dy2 - dy1) { + throw new IllegalArgumentException("Height of the copied region must match the" + + "height of the pasted region"); + } + int ch = sy2 - sy1; + for(int y = 0; y < ch; ++y) { + System.arraycopy(input.pixels, sx1 + (sy1 + y) * cw, pixels, dx1 + (dy1 + y) * cw, cw); + } + } + + public void drawLayer(ImageData input, int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2) { + if(sx2 - sx1 != dx2 - dx1) { + throw new IllegalArgumentException("Width of the copied region must match the" + + "width of the pasted region"); + } + int cw = sx2 - sx1; + if(sy2 - sy1 != dy2 - dy1) { + throw new IllegalArgumentException("Height of the copied region must match the" + + "height of the pasted region"); + } + int ch = sy2 - sy1; + for(int y = 0; y < ch; ++y) { + for(int x = 0; x < cw; ++x) { + int si = (sy1 + y) * cw + sx1 + x; + int di = (dy1 + y) * cw + dx1 + x; + int spx = input.pixels[si]; + int dpx = pixels[di]; + if((spx & 0xFF000000) == 0xFF000000 || (dpx & 0xFF000000) == 0) { + pixels[di] = spx; + }else { + int sa = (spx >> 24) & 0xFF; + int da = (dpx >> 24) & 0xFF; + int r = ((spx >> 16) & 0xFF) * sa / 255; + int g = ((spx >> 8) & 0xFF) * sa / 255; + int b = (spx & 0xFF) * sa / 255; + int aa = (255 - sa) * da; + r += ((dpx >> 16) & 0xFF) * aa / 65025; + g += ((dpx >> 8) & 0xFF) * aa / 65025; + b += (dpx & 0xFF) * aa / 65025; + sa += da; + if(sa > 0xFF) sa = 0xFF; + pixels[di] = ((sa) << 24) | (r << 16) | (g << 8) | b; + } + } + } + } + + public ImageData swapRB() { + for(int i = 0; i < pixels.length; ++i) { + int j = pixels[i]; + pixels[i] = (j & 0xFF00FF00) | ((j & 0x00FF0000) >> 16) | + ((j & 0x000000FF) << 16); + } + return this; + } + + public static int swapRB(int c) { + return (c & 0xFF00FF00) | ((c & 0x00FF0000) >> 16) | ((c & 0x000000FF) << 16); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java index 5f145bd..07ffff3 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java @@ -19,16 +19,18 @@ import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f; import net.lax1dude.eaglercraft.v1_8.vector.Vector4f; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InstancedFontRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java index 59d23b2..1762057 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java @@ -17,16 +17,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionCon import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InstancedParticleRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java index 79d9f4d..c110e6a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 OpenGlHelper { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/RealOpenGLEnums.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/RealOpenGLEnums.java index 17e5074..f306464 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/RealOpenGLEnums.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/RealOpenGLEnums.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RealOpenGLEnums { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java index b9de019..26c79cc 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java @@ -16,16 +16,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionCon import net.lax1dude.eaglercraft.v1_8.vector.Matrix3f; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SpriteLevelMixer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/StreamBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/StreamBuffer.java index e7f7b2c..d6a4461 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/StreamBuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/StreamBuffer.java @@ -7,16 +7,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StreamBuffer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/TextureCopyUtil.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/TextureCopyUtil.java index 3645808..32fb3ce 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/TextureCopyUtil.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/TextureCopyUtil.java @@ -12,16 +12,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionConstants; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureCopyUtil { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/VertexFormat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/VertexFormat.java index 09ef232..934a55b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/VertexFormat.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/VertexFormat.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 VertexFormat { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldRenderer.java index 5b800d8..b84cd69 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldRenderer.java @@ -15,16 +15,18 @@ import net.minecraft.client.renderer.GLAllocation; import net.minecraft.util.MathHelper; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldVertexBufferUploader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldVertexBufferUploader.java index b8999fd..18d3c29 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldVertexBufferUploader.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/WorldVertexBufferUploader.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl; import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldVertexBufferUploader { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/AbstractAcceleratedEffectRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/AbstractAcceleratedEffectRenderer.java index 519103c..ff51e29 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/AbstractAcceleratedEffectRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/AbstractAcceleratedEffectRenderer.java @@ -5,16 +5,18 @@ import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.Entity; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 abstract class AbstractAcceleratedEffectRenderer implements IAcceleratedParticleEngine { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ArrayListSerial.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ArrayListSerial.java index c1dbe1f..d0e8303 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ArrayListSerial.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ArrayListSerial.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; import java.util.ArrayList; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ArrayListSerial extends ArrayList implements ListSerial { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/CloudRenderWorker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/CloudRenderWorker.java index 3c0b784..789e7fe 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/CloudRenderWorker.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/CloudRenderWorker.java @@ -25,16 +25,18 @@ import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.util.MathHelper; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CloudRenderWorker { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DebugFramebufferView.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DebugFramebufferView.java index 0633c45..dc19044 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DebugFramebufferView.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DebugFramebufferView.java @@ -16,16 +16,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.ExtGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DebugFramebufferView { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DeferredStateManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DeferredStateManager.java index 5905b33..9aa9dc1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DeferredStateManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DeferredStateManager.java @@ -13,16 +13,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DeferredStateManager { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightInstance.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightInstance.java index b2057e2..e0c45ca 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightInstance.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightInstance.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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. * */ class DynamicLightInstance { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightManager.java index 8847817..1315b34 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/DynamicLightManager.java @@ -7,16 +7,18 @@ import java.util.List; import java.util.Map; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DynamicLightManager { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredConfig.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredConfig.java index 7d14b40..08e5c03 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredConfig.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredConfig.java @@ -14,16 +14,18 @@ import net.minecraft.client.resources.IResourceManager; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerDeferredConfig { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java index 1345353..7901451 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java @@ -72,16 +72,18 @@ import java.util.Iterator; import java.util.List; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerDeferredPipeline { @@ -378,6 +380,7 @@ public class EaglerDeferredPipeline { public void rebuild(EaglerDeferredConfig config) { destroy(); + DeferredStateManager.doCheckErrors = EagRuntime.getConfiguration().checkShaderGLErrors(); DeferredStateManager.checkGLError("Pre: rebuild pipeline"); this.config = config; this.currentWidth = -1; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ExtGLEnums.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ExtGLEnums.java index da1bdd2..a66c557 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ExtGLEnums.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ExtGLEnums.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ExtGLEnums { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java index 254f072..da1deb0 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java @@ -19,16 +19,18 @@ import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ForwardAcceleratedEffectRenderer extends AbstractAcceleratedEffectRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardRenderCallbackHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardRenderCallbackHandler.java index c5c69df..699e747 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardRenderCallbackHandler.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardRenderCallbackHandler.java @@ -6,16 +6,18 @@ import java.util.Comparator; import java.util.List; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ForwardRenderCallbackHandler { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java index 6bb487d..77ebb69 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java @@ -18,16 +18,18 @@ import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GBufferAcceleratedEffectRenderer extends AbstractAcceleratedEffectRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineCompiler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineCompiler.java index 0f3a476..4e257e4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineCompiler.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineCompiler.java @@ -19,16 +19,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GLAllocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GBufferPipelineCompiler implements IExtPipelineCompiler { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineProgramInstance.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineProgramInstance.java index b5d60c0..24555dd 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineProgramInstance.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferPipelineProgramInstance.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.GBufferExtPipelineShader; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GBufferPipelineProgramInstance { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java index bc6b103..8a44278 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java @@ -23,16 +23,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.MathHelper; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LensFlareMeshRenderer { @@ -99,7 +101,7 @@ public class LensFlareMeshRenderer { ghostsInstanceCount = 0; - float streakIntensity2 = 10.0f; + float streakIntensity2 = 4.0f; float scale = 5.0f; pushGhostQuadAbberated(copyBuffer, 0.4f, 0.15f * scale, 2, 0.5f, 0.9f, 0.2f, 0.04f * streakIntensity2); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LightSourceMesh.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LightSourceMesh.java index 14c9aa4..bdcd2ed 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LightSourceMesh.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LightSourceMesh.java @@ -18,16 +18,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LightSourceMesh { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ListSerial.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ListSerial.java index a0d283e..7d19b52 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ListSerial.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ListSerial.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; import java.util.List; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ListSerial extends List { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/NameTagRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/NameTagRenderer.java index 8f3aa42..7370359 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/NameTagRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/NameTagRenderer.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; import net.minecraft.entity.Entity; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NameTagRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfo.java index 84deb2b..df2e38d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfo.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfo.java @@ -8,16 +8,18 @@ import org.json.JSONException; import org.json.JSONObject; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderPackInfo { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfoReloadListener.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfoReloadListener.java index 9270e93..ba81c21 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfoReloadListener.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShaderPackInfoReloadListener.java @@ -10,16 +10,18 @@ import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.IResourceManagerReloadListener; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderPackInfoReloadListener implements IResourceManagerReloadListener { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShadersRenderPassFuture.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShadersRenderPassFuture.java index f0de018..f5af571 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShadersRenderPassFuture.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ShadersRenderPassFuture.java @@ -4,16 +4,18 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.Entity; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 abstract class ShadersRenderPassFuture { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/SkyboxRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/SkyboxRenderer.java index 1c5aeea..6d862da 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/SkyboxRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/SkyboxRenderer.java @@ -19,16 +19,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SkyboxRenderer { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/VertexMarkerState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/VertexMarkerState.java index 067ebc6..e2d86c7 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/VertexMarkerState.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/VertexMarkerState.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 VertexMarkerState { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfig.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfig.java index 3bd4044..7b29066 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfig.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfig.java @@ -13,16 +13,18 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiShaderConfig extends GuiScreen { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfigList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfigList.java index 4c7b498..680297d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfigList.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShaderConfigList.java @@ -15,16 +15,18 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiShaderConfigList extends GuiListExtended { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShadersNotSupported.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShadersNotSupported.java index 6ac9345..321bb0a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShadersNotSupported.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/gui/GuiShadersNotSupported.java @@ -5,16 +5,18 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiShadersNotSupported extends GuiScreen { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/GBufferExtPipelineShader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/GBufferExtPipelineShader.java index a841931..8fcea37 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/GBufferExtPipelineShader.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/GBufferExtPipelineShader.java @@ -6,16 +6,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GBufferExtPipelineShader extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/IProgramUniforms.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/IProgramUniforms.java index 947e118..15af7fc 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/IProgramUniforms.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/IProgramUniforms.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program; import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IProgramUniforms { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleForward.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleForward.java index c974c83..ac2749a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleForward.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleForward.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderAccelParticleForward extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleGBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleGBuffer.java index ebad238..334d018 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleGBuffer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderAccelParticleGBuffer.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderAccelParticleGBuffer extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBlurPass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBlurPass.java index 3dbaf97..573933b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBlurPass.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBlurPass.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderBloomBlurPass extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBrightPass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBrightPass.java index 1666566..d5e166e 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBrightPass.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderBloomBrightPass.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderBloomBrightPass extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsNoise3D.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsNoise3D.java index 8e8a489..0486c4c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsNoise3D.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsNoise3D.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderCloudsNoise3D extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSample.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSample.java index f186a2f..04131cc 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSample.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSample.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderCloudsSample extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsShapes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsShapes.java index ac30b17..8cdd29d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsShapes.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsShapes.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderCloudsShapes extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSunOcclusion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSunOcclusion.java index e2de5a5..33eae8d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSunOcclusion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderCloudsSunOcclusion.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderCloudsSunOcclusion extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderFXAA.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderFXAA.java index 27ed708..2abbdf8 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderFXAA.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderFXAA.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderFXAA extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferCombine.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferCombine.java index 65344b1..497b490 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferCombine.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferCombine.java @@ -12,16 +12,18 @@ import java.util.List; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderGBufferCombine extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferDebugView.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferDebugView.java index e7b2f6d..7037ccf 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferDebugView.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferDebugView.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderGBufferDebugView extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferFog.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferFog.java index 87f76d9..a158c5d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferFog.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderGBufferFog.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderGBufferFog extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderHandDepthMask.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderHandDepthMask.java index 8c9f6d8..a7d6e22 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderHandDepthMask.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderHandDepthMask.java @@ -7,16 +7,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderHandDepthMask extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensDistortion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensDistortion.java index 2283bb3..ff83e18 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensDistortion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensDistortion.java @@ -7,16 +7,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderLensDistortion extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensFlares.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensFlares.java index 42c5d8a..a8b69e3 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensFlares.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensFlares.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderLensFlares extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensSunOcclusion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensSunOcclusion.java index fd90c0f..5b81408 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensSunOcclusion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLensSunOcclusion.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderLensSunOcclusion extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightShaftsSample.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightShaftsSample.java index 01a18d7..c9f08e7 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightShaftsSample.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightShaftsSample.java @@ -10,16 +10,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderLightShaftsSample extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingPoint.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingPoint.java index 1ca5da7..73f5874 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingPoint.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingPoint.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderLightingPoint extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingSun.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingSun.java index a9b70db..0932c5a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingSun.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderLightingSun.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderLightingSun extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderMoonRender.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderMoonRender.java index 878b650..f870f7f 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderMoonRender.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderMoonRender.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderMoonRender extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureAvg.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureAvg.java index 5d68530..e4a092c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureAvg.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureAvg.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderPostExposureAvg extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureFinal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureFinal.java index 475a55a..494afe8 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureFinal.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderPostExposureFinal.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderPostExposureFinal extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterControl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterControl.java index f1fc95c..9aa934b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterControl.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterControl.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderRealisticWaterControl extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNoise.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNoise.java index 80e40b7..811355d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNoise.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNoise.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderRealisticWaterNoise extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNormalMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNormalMap.java index 07b242e..4dda2e5 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNormalMap.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderRealisticWaterNormalMap.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderRealisticWaterNormalMap extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojControl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojControl.java index 956f849..ac9f6c9 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojControl.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojControl.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderReprojControl extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojSSR.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojSSR.java index 22129ea..69fea20 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojSSR.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderReprojSSR.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderReprojSSR extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSSAOGenerate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSSAOGenerate.java index 978bf40..0e846bd 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSSAOGenerate.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSSAOGenerate.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderSSAOGenerate extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderShadowsSun.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderShadowsSun.java index 49f16db..bd318ab 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderShadowsSun.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderShadowsSun.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderShadowsSun extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxAtmosphere.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxAtmosphere.java index b3712fb..45ca071 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxAtmosphere.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxAtmosphere.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderSkyboxAtmosphere extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxIrradiance.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxIrradiance.java index a2200bd..8ab897b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxIrradiance.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxIrradiance.java @@ -9,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderSkyboxIrradiance extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRender.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRender.java index 4294b63..df798ac 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRender.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRender.java @@ -11,16 +11,18 @@ import java.util.ArrayList; import java.util.List; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderSkyboxRender extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRenderEnd.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRenderEnd.java index 9048a3c..39c62f1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRenderEnd.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderSkyboxRenderEnd.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderSkyboxRenderEnd extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderTonemap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderTonemap.java index b56980e..29add37 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderTonemap.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/PipelineShaderTonemap.java @@ -8,16 +8,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PipelineShaderTonemap extends ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompileException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompileException.java index 5062724..b519954 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompileException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompileException.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderCompileException extends ShaderException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompiler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompiler.java index bbb70bf..ae43195 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompiler.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderCompiler.java @@ -14,16 +14,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderCompiler { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderException.java index 20808e6..f33ef8c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderException.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderException extends IllegalStateException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderLinkException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderLinkException.java index 814efbd..259566e 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderLinkException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderLinkException.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderLinkException extends ShaderException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderProgram.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderProgram.java index 52c397c..acfc625 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderProgram.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderProgram.java @@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderProgram { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderSource.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderSource.java index cdacf3e..dea17ec 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderSource.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/ShaderSource.java @@ -16,16 +16,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShaderSource { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/SharedPipelineShaders.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/SharedPipelineShaders.java index 1319eb2..c2a902f 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/SharedPipelineShaders.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/program/SharedPipelineShaders.java @@ -5,16 +5,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SharedPipelineShaders { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerBitwisePackedTexture.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerBitwisePackedTexture.java index 7fd164d..5d37d21 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerBitwisePackedTexture.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerBitwisePackedTexture.java @@ -6,16 +6,18 @@ import java.io.InputStream; import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerBitwisePackedTexture { @@ -49,7 +51,7 @@ public class EaglerBitwisePackedTexture { v = is.read(); if(v == 0) { for(int i = 0, l = w * h; i < l; ++i) { - img.getPixels()[i] = is.read() | (is.read() << 8) | (is.read() << 16) | alpha; + img.pixels[i] = is.read() | (is.read() << 8) | (is.read() << 16) | alpha; } }else if(v == 1) { int paletteSize = is.read(); @@ -62,7 +64,7 @@ public class EaglerBitwisePackedTexture { byte[] readSet = new byte[is.read() | (is.read() << 8) | (is.read() << 16)]; is.read(readSet); for(int i = 0, l = w * h; i < l; ++i) { - img.getPixels()[i] = palette[getFromBits(i * bpp, bpp, readSet)]; + img.pixels[i] = palette[getFromBits(i * bpp, bpp, readSet)]; } }else { throw new IOException("Unknown EBP storage type: " + v); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java index 7e2ff49..399682a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java @@ -25,16 +25,18 @@ import net.minecraft.util.ReportedException; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerTextureAtlasSpritePBR extends EaglerTextureAtlasSprite { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EmissiveItems.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EmissiveItems.java index 3707f17..ef2fdb4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EmissiveItems.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EmissiveItems.java @@ -16,16 +16,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EmissiveItems implements IResourceManagerReloadListener { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/MetalsLUT.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/MetalsLUT.java index 4bf5fe9..77e739d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/MetalsLUT.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/MetalsLUT.java @@ -21,16 +21,18 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MetalsLUT implements IResourceManagerReloadListener { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRMaterialConstants.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRMaterialConstants.java index e526f0d..4bd425c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRMaterialConstants.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRMaterialConstants.java @@ -15,16 +15,18 @@ import net.minecraft.client.resources.IResourceManagerReloadListener; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PBRMaterialConstants implements IResourceManagerReloadListener { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java index cb4fdb9..8e12b0b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java @@ -11,16 +11,18 @@ import net.minecraft.client.resources.IResourceManager; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PBRTextureMapUtils { @@ -48,11 +50,11 @@ public class PBRTextureMapUtils { if(res.getResourcePackName().equals(resourcePack)) { ImageData toRet = TextureUtil.readBufferedImage(res.getInputStream()); if(ext.equals("_s")) { - for(int i = 0, j; i < toRet.getPixels().length; ++i) { + for(int i = 0, j; i < toRet.pixels.length; ++i) { // swap B and A, because labPBR support - int a = (toRet.getPixels()[i] >>> 24) & 0xFF; + int a = (toRet.pixels[i] >>> 24) & 0xFF; if(a == 0xFF) a = 0; - toRet.getPixels()[i] = (toRet.getPixels()[i] & 0x0000FFFF) | Math.min(a << 18, 0xFF0000) | 0xFF000000; + toRet.pixels[i] = (toRet.pixels[i] & 0x0000FFFF) | Math.min(a << 18, 0xFF0000) | 0xFF000000; } } return toRet; @@ -104,14 +106,14 @@ public class PBRTextureMapUtils { if(in.width != resX || in.height != resY) { out = new ImageData(resX, resY, true); if(in.width == 1 && in.height == 1) { - int px = in.getPixels()[0]; - for(int j = 0; j < out.getPixels().length; ++j) { - out.getPixels()[j] = px; + int px = in.pixels[0]; + for(int j = 0; j < out.pixels.length; ++j) { + out.pixels[j] = px; } }else { for(int y = 0; y < resY; ++y) { for(int x = 0; x < resX; ++x) { - out.getPixels()[y * resX + x] = in.getPixels()[((y * in.height / resY)) * in.width + (x * in.width / resX)]; + out.pixels[y * resX + x] = in.pixels[((y * in.height / resY)) * in.width + (x * in.width / resX)]; } } } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TemperaturesLUT.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TemperaturesLUT.java index 1540857..10c7138 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TemperaturesLUT.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TemperaturesLUT.java @@ -11,16 +11,18 @@ import net.minecraft.client.resources.IResourceManagerReloadListener; import net.minecraft.util.ResourceLocation; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TemperaturesLUT implements IResourceManagerReloadListener { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java index 089e8a8..b421a24 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java @@ -6,16 +6,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.MathHelper; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureClockPBRImpl extends EaglerTextureAtlasSpritePBR { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java index 325412a..1329348 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java @@ -8,16 +8,18 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; /** - * Copyright (c) 2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureCompassPBRImpl extends EaglerTextureAtlasSpritePBR { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/CustomSkin.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/CustomSkin.java index 39ce6e2..6a1ef71 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/CustomSkin.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/CustomSkin.java @@ -4,16 +4,18 @@ import net.minecraft.client.Minecraft; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CustomSkin { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/DefaultSkins.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/DefaultSkins.java index e1fd2bf..5c67d07 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/DefaultSkins.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/DefaultSkins.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.profile; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DefaultSkins { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java index 08fe502..8169db4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java @@ -17,16 +17,18 @@ import net.minecraft.nbt.NBTTagList; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerProfile { @@ -58,7 +60,7 @@ public class EaglerProfile { } } } - + public static SkinModel getActiveSkinModel() { if(presetSkinId == -1) { if(customSkinId >= 0 && customSkinId < customSkins.size()) { @@ -94,7 +96,7 @@ public class EaglerProfile { } } - public static byte[] getSkinPacket() throws IOException { + public static byte[] getSkinPacket() { if(presetSkinId == -1) { if(customSkinId >= 0 && customSkinId < customSkins.size()) { return SkinPackets.writeMySkinCustom(customSkins.get(customSkinId)); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerSkinTexture.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerSkinTexture.java index de9e444..2b746c1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerSkinTexture.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerSkinTexture.java @@ -9,16 +9,18 @@ import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.client.resources.IResourceManager; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerSkinTexture implements ITextureObject { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiAuthenticationScreen.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiAuthenticationScreen.java index 655d5bd..3dc82f4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiAuthenticationScreen.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiAuthenticationScreen.java @@ -11,16 +11,18 @@ import net.minecraft.client.multiplayer.GuiConnecting; import net.minecraft.client.resources.I18n; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiAuthenticationScreen extends GuiScreen { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiPasswordTextField.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiPasswordTextField.java index 5d23a10..26bc7f6 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiPasswordTextField.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiPasswordTextField.java @@ -4,16 +4,18 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiTextField; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2023 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiPasswordTextField extends GuiTextField { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java index 6bbfab6..fe27b62 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java @@ -1,15 +1,12 @@ package net.lax1dude.eaglercraft.v1_8.profile; -import net.PeytonPlayz585.shadow.CustomSky; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiDisconnected; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.resources.I18n; @@ -18,19 +15,20 @@ import net.minecraft.util.ResourceLocation; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import java.io.IOException; -import java.util.HashMap; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenEditProfile extends GuiScreen { @@ -300,7 +298,7 @@ public class GuiScreenEditProfile extends GuiScreen { byte[] rawSkin = new byte[16384]; for(int i = 0, j, k; i < 4096; ++i) { j = i << 2; - k = loadedSkin.getPixels()[i]; + k = loadedSkin.pixels[i]; rawSkin[j] = (byte)(k >> 24); rawSkin[j + 1] = (byte)(k >> 16); rawSkin[j + 2] = (byte)(k >> 8); @@ -463,4 +461,5 @@ public class GuiScreenEditProfile extends GuiScreen { EaglerProfile.setName(name); EaglerProfile.write(); } + } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/ServerSkinCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/ServerSkinCache.java index 6aff77c..f2f6abd 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/ServerSkinCache.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/ServerSkinCache.java @@ -17,16 +17,18 @@ import net.minecraft.network.play.client.C17PacketCustomPayload; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerSkinCache { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinConverter.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinConverter.java index ec65ffc..a91a05c 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinConverter.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinConverter.java @@ -3,34 +3,36 @@ package net.lax1dude.eaglercraft.v1_8.profile; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SkinConverter { public static void convert64x32to64x64(ImageData skinIn, ImageData skinOut) { - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 0, 0, 0, 0, 64, 32, 64, 64, false); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 24, 48, 20, 52, 4, 16, 8, 20, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 28, 48, 24, 52, 8, 16, 12, 20, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 20, 52, 16, 64, 8, 20, 12, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 24, 52, 20, 64, 4, 20, 8, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 28, 52, 24, 64, 0, 20, 4, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 32, 52, 28, 64, 12, 20, 16, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 40, 48, 36, 52, 44, 16, 48, 20, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 44, 48, 40, 52, 48, 16, 52, 20, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 36, 52, 32, 64, 48, 20, 52, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 40, 52, 36, 64, 44, 20, 48, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 44, 52, 40, 64, 40, 20, 44, 32, 64, 64); - copyRawPixels(skinIn.getPixels(), skinOut.getPixels(), 48, 52, 44, 64, 52, 20, 56, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 0, 0, 0, 0, 64, 32, 64, 64, false); + copyRawPixels(skinIn.pixels, skinOut.pixels, 24, 48, 20, 52, 4, 16, 8, 20, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 28, 48, 24, 52, 8, 16, 12, 20, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 20, 52, 16, 64, 8, 20, 12, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 24, 52, 20, 64, 4, 20, 8, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 28, 52, 24, 64, 0, 20, 4, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 32, 52, 28, 64, 12, 20, 16, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 40, 48, 36, 52, 44, 16, 48, 20, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 44, 48, 40, 52, 48, 16, 52, 20, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 36, 52, 32, 64, 48, 20, 52, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 40, 52, 36, 64, 44, 20, 48, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 44, 52, 40, 64, 40, 20, 44, 32, 64, 64); + copyRawPixels(skinIn.pixels, skinOut.pixels, 48, 52, 44, 64, 52, 20, 56, 32, 64, 64); } private static void copyRawPixels(int[] imageIn, int[] imageOut, int dx1, int dy1, int dx2, int dy2, int sx1, diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinModel.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinModel.java index 9574471..7956881 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinModel.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinModel.java @@ -4,16 +4,18 @@ import java.util.HashMap; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SkinModel { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPackets.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPackets.java index 28747ab..93dc6b6 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPackets.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPackets.java @@ -9,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; import net.minecraft.network.PacketBuffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SkinPackets { @@ -29,6 +31,7 @@ public class SkinPackets { public static final int PACKET_OTHER_SKIN_PRESET = 0x04; public static final int PACKET_OTHER_SKIN_CUSTOM = 0x05; public static final int PACKET_GET_SKIN_BY_URL = 0x06; + public static final int PACKET_INSTALL_NEW_SKIN = 0x07; public static void readPluginMessage(PacketBuffer buffer, ServerSkinCache skinCache) throws IOException { try { @@ -74,12 +77,12 @@ public class SkinPackets { } } - public static byte[] writeMySkinPreset(int skinId) throws IOException { + public static byte[] writeMySkinPreset(int skinId) { return new byte[] { (byte) PACKET_MY_SKIN_PRESET, (byte) (skinId >> 24), (byte) (skinId >> 16), (byte) (skinId >> 8), (byte) (skinId & 0xFF) }; } - public static byte[] writeMySkinCustom(CustomSkin customSkin) throws IOException { + public static byte[] writeMySkinCustom(CustomSkin customSkin) { byte[] packet = new byte[2 + customSkin.texture.length]; packet[0] = (byte) PACKET_MY_SKIN_CUSTOM; packet[1] = (byte) customSkin.model.id; @@ -87,6 +90,15 @@ public class SkinPackets { return packet; } + public static PacketBuffer writeCreateCustomSkull(byte[] customSkin) { + int len = 3 + customSkin.length; + PacketBuffer ret = new PacketBuffer(Unpooled.buffer(len, len)); + ret.writeByte(PACKET_INSTALL_NEW_SKIN); + ret.writeShort(customSkin.length); + ret.writeBytes(customSkin); + return ret; + } + public static PacketBuffer writeGetOtherSkin(EaglercraftUUID skinId) throws IOException { PacketBuffer ret = new PacketBuffer(Unpooled.buffer(17, 17)); ret.writeByte(PACKET_GET_OTHER_SKIN); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPreviewRenderer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPreviewRenderer.java index 9970932..1608c04 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPreviewRenderer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/profile/SkinPreviewRenderer.java @@ -1,25 +1,24 @@ package net.lax1dude.eaglercraft.v1_8.profile; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelZombie; import net.minecraft.client.renderer.RenderHelper; -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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SkinPreviewRenderer { @@ -72,8 +71,6 @@ public class SkinPreviewRenderer { model.render(null, 0.0f, 0.0f, (float)(System.currentTimeMillis() % 2000000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625f); - GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); - GlStateManager.popMatrix(); GlStateManager.disableLighting(); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/AddressResolver.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/AddressResolver.java index 560fdd3..de5b34d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/AddressResolver.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/AddressResolver.java @@ -5,16 +5,18 @@ import net.minecraft.client.multiplayer.ServerAddress; import net.minecraft.client.multiplayer.ServerData; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AddressResolver { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/CompressionNotSupportedException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/CompressionNotSupportedException.java index ed4ec6e..95471d3 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/CompressionNotSupportedException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/CompressionNotSupportedException.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.socket; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CompressionNotSupportedException extends UnsupportedOperationException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java index b70db02..69f681d 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java @@ -16,6 +16,7 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; import net.lax1dude.eaglercraft.v1_8.profile.GuiAuthenticationScreen; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiDisconnected; import net.minecraft.client.gui.GuiScreen; @@ -25,16 +26,18 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ConnectionHandshake { @@ -45,9 +48,14 @@ public class ConnectionHandshake { private static final int protocolV3 = 3; private static final Logger logger = LogManager.getLogger(); + + public static String pluginVersion = null; + public static String pluginBrand = null; public static boolean attemptHandshake(Minecraft mc, GuiConnecting connecting, GuiScreen ret, String password, boolean allowPlaintext) { try { + pluginVersion = null; + pluginBrand = null; ByteArrayOutputStream bao = new ByteArrayOutputStream(); DataOutputStream d = new DataOutputStream(bao); @@ -140,23 +148,15 @@ public class ConnectionHandshake { int msgLen = di.read(); byte[] dat = new byte[msgLen]; di.read(dat); - String brandStr = ArrayUtils.asciiString(dat); + pluginBrand = ArrayUtils.asciiString(dat); msgLen = di.read(); dat = new byte[msgLen]; di.read(dat); - String versionStr = ArrayUtils.asciiString(dat); + pluginVersion = ArrayUtils.asciiString(dat); - logger.info("Server version: {}", versionStr); - logger.info("Server brand: {}", brandStr); - - if(versionStr.equals("1.0.0") || versionStr.equals("1.0.1") || versionStr.equals("1.0.2") - || versionStr.equals("1.0.3") || versionStr.equals("1.0.4") || versionStr.equals("1.0.5")) { - mc.bungeeOutdatedMsgTimer = 80; - mc.bungeeOutdatedMsgVer = versionStr; - }else { - mc.bungeeOutdatedMsgTimer = 0; - } + logger.info("Server version: {}", pluginVersion); + logger.info("Server brand: {}", pluginBrand); int authType = di.read(); int saltLength = (int)di.readShort() & 0xFFFF; @@ -293,6 +293,21 @@ public class ConnectionHandshake { d.write(packetSkin); PlatformNetworking.writePlayPacket(bao.toByteArray()); + byte[] packetSignatureData = UpdateService.getClientSignatureData(); + if(packetSignatureData != null) { + bao.reset(); + d.writeByte(HandshakePacketTypes.PROTOCOL_CLIENT_PROFILE_DATA); + profileDataType = "update_cert_v1"; + d.writeByte(profileDataType.length()); + d.writeBytes(profileDataType); + if(packetSignatureData.length > 0xFFFF) { + throw new IOException("Update certificate login packet is too long: " + packetSignatureData.length); + } + d.writeShort(packetSignatureData.length); + d.write(packetSignatureData); + PlatformNetworking.writePlayPacket(bao.toByteArray()); + } + bao.reset(); d.writeByte(HandshakePacketTypes.PROTOCOL_CLIENT_FINISH_LOGIN); PlatformNetworking.writePlayPacket(bao.toByteArray()); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java index e825d55..53ff513 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java @@ -1,6 +1,7 @@ package net.lax1dude.eaglercraft.v1_8.socket; import java.io.IOException; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; import net.lax1dude.eaglercraft.v1_8.internal.PlatformNetworking; @@ -17,25 +18,30 @@ import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IChatComponent; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglercraftNetworkManager { - private final String address; - private INetHandler nethandler = null; - private EnumConnectionState packetState = EnumConnectionState.HANDSHAKING; - private final PacketBuffer temporaryBuffer; - private int debugPacketCounter = 0; + protected final String address; + protected INetHandler nethandler = null; + protected EnumConnectionState packetState = EnumConnectionState.HANDSHAKING; + protected final PacketBuffer temporaryBuffer; + protected int debugPacketCounter = 0; + + protected String pluginBrand = null; + protected String pluginVersion = null; public static final Logger logger = LogManager.getLogger("NetworkManager"); @@ -44,6 +50,19 @@ public class EaglercraftNetworkManager { this.temporaryBuffer = new PacketBuffer(Unpooled.buffer(0x1FFFF)); } + public void setPluginInfo(String pluginBrand, String pluginVersion) { + this.pluginBrand = pluginBrand; + this.pluginVersion = pluginVersion; + } + + public String getPluginBrand() { + return pluginBrand; + } + + public String getPluginVersion() { + return pluginVersion; + } + public void connect() { PlatformNetworking.startPlayConnection(address); } @@ -66,9 +85,13 @@ public class EaglercraftNetworkManager { public void processReceivedPackets() throws IOException { if(nethandler == null) return; - byte[] next; + List pkts = PlatformNetworking.readAllPacket(); - while((next = PlatformNetworking.readPlayPacket()) != null) { + if(pkts == null) { + return; + } + + for(byte[] next : pkts) { ++debugPacketCounter; try { ByteBuf nettyBuffer = Unpooled.buffer(next, next.length); @@ -83,6 +106,10 @@ public class EaglercraftNetworkManager { throw new IOException("Recieved a packet with type " + pktId + " which is invalid!"); } + if(pkt == null) { + throw new IOException("Recieved packet type " + pktId + " which is undefined in state " + packetState); + } + try { pkt.readPacketData(input); }catch(Throwable t) { @@ -166,9 +193,9 @@ public class EaglercraftNetworkManager { } } - private boolean clientDisconnected = false; + protected boolean clientDisconnected = false; - private void doClientDisconnect(IChatComponent msg) { + protected void doClientDisconnect(IChatComponent msg) { if(!clientDisconnected) { clientDisconnected = true; if(nethandler != null) { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EncryptionNotSupportedException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EncryptionNotSupportedException.java index faff717..dfec35e 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EncryptionNotSupportedException.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/EncryptionNotSupportedException.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.socket; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EncryptionNotSupportedException extends UnsupportedOperationException { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/GuiHandshakeApprove.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/GuiHandshakeApprove.java index a9f06dc..1783f85 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/GuiHandshakeApprove.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/GuiHandshakeApprove.java @@ -8,16 +8,18 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiHandshakeApprove extends GuiScreen { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/HandshakePacketTypes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/HandshakePacketTypes.java index 9534e76..a5ee6fb 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/HandshakePacketTypes.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/HandshakePacketTypes.java @@ -1,16 +1,18 @@ package net.lax1dude.eaglercraft.v1_8.socket; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 HandshakePacketTypes { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/RateLimitTracker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/RateLimitTracker.java index b756a52..659809b 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/RateLimitTracker.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/RateLimitTracker.java @@ -5,16 +5,18 @@ import java.util.Iterator; 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RateLimitTracker { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ServerQueryDispatch.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ServerQueryDispatch.java index 09cbd33..dceedc1 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ServerQueryDispatch.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/socket/ServerQueryDispatch.java @@ -6,16 +6,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerQueryDispatch { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/IntegratedServerState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/IntegratedServerState.java new file mode 100644 index 0000000..f6444ae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/IntegratedServerState.java @@ -0,0 +1,98 @@ +package net.lax1dude.eaglercraft.v1_8.sp; + +import net.lax1dude.eaglercraft.v1_8.sp.ipc.*; + +/** + * 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 IntegratedServerState { + + public static final int WORLD_WORKER_NOT_RUNNING = -2; + public static final int WORLD_WORKER_BOOTING = -1; + public static final int WORLD_NONE = 0; + public static final int WORLD_LOADING = 2; + public static final int WORLD_LOADED = 3; + public static final int WORLD_UNLOADING = 4; + public static final int WORLD_DELETING = 5; + public static final int WORLD_RENAMING = 6; + public static final int WORLD_DUPLICATING = 7; + public static final int WORLD_PAUSED = 9; + public static final int WORLD_LISTING = 10; + public static final int WORLD_SAVING = 11; + public static final int WORLD_IMPORTING = 12; + public static final int WORLD_EXPORTING = 13; + public static final int WORLD_GET_NBT = 14; + + public static final int WORLD_LIST_FILE = 15; + public static final int WORLD_FILE_READ = 16; + public static final int WORLD_FILE_WRITE = 17; + public static final int WORLD_FILE_MOVE = 18; + public static final int WORLD_FILE_COPY = 19; + public static final int WORLD_CLEAR_PLAYERS = 20; + + public static String getStateName(int i) { + switch(i) { + case WORLD_WORKER_NOT_RUNNING: return "WORLD_WORKER_NOT_RUNNING"; + case WORLD_WORKER_BOOTING: return "WORLD_WORKER_BOOTING"; + case WORLD_NONE: return "WORLD_NONE"; + case WORLD_LOADING: return "WORLD_LOADING"; + case WORLD_LOADED: return "WORLD_LOADED"; + case WORLD_UNLOADING: return "WORLD_UNLOADING"; + case WORLD_DELETING: return "WORLD_DELETING"; + case WORLD_RENAMING: return "WORLD_RENAMING"; + case WORLD_DUPLICATING: return "WORLD_DUPLICATING"; + case WORLD_PAUSED: return "WORLD_PAUSED"; + case WORLD_LISTING: return "WORLD_LISTING"; + case WORLD_SAVING: return "WORLD_SAVING"; + case WORLD_IMPORTING: return "WORLD_IMPORTING"; + case WORLD_EXPORTING: return "WORLD_EXPORTING"; + case WORLD_GET_NBT: return "WORLD_GET_NBT"; + case WORLD_LIST_FILE: return "WORLD_LIST_FILE"; + case WORLD_FILE_READ: return "WORLD_FILE_READ"; + case WORLD_FILE_WRITE: return "WORLD_FILE_WRITE"; + case WORLD_FILE_MOVE: return "WORLD_FILE_MOVE"; + case WORLD_FILE_COPY: return "WORLD_FILE_COPY"; + case WORLD_CLEAR_PLAYERS: return "WORLD_CLEAR_PLAYERS"; + default: return "INVALID"; + } + } + + public static boolean isACKValidInState(int ack, int state) { + switch(ack) { + case 0xFF: return state == WORLD_WORKER_BOOTING; + case IPCPacketFFProcessKeepAlive.EXITED: return true; + case IPCPacketFFProcessKeepAlive.FAILURE: return true; + case IPCPacket01StopServer.ID: return true; + case IPCPacket00StartServer.ID: return state == WORLD_LOADING; + case IPCPacket03DeleteWorld.ID: return state == WORLD_DELETING; + case IPCPacket06RenameWorldNBT.ID: return (state == WORLD_DUPLICATING || state == WORLD_RENAMING); + case IPCPacket07ImportWorld.ID: return state == WORLD_IMPORTING; + case IPCPacket0BPause.ID: + case IPCPacket19Autosave.ID: return (state == WORLD_SAVING || state == WORLD_PAUSED || state == WORLD_LOADED || state == WORLD_UNLOADING); + case IPCPacket12FileWrite.ID: return state == WORLD_FILE_WRITE; + case IPCPacket13FileCopyMove.ID: return (state == WORLD_FILE_MOVE || state == WORLD_FILE_COPY); + case IPCPacket18ClearPlayers.ID: return state == WORLD_CLEAR_PLAYERS; + default: return false; + } + } + + public static void assertState(int ack, int state) { + if(!isACKValidInState(ack, state)) { + String msg = "Recieved ACK " + ack + " while the client state was " + state + " '" + getStateName(state) + "'"; + throw new IllegalStateException(msg); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerSaveHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerSaveHandler.java new file mode 100644 index 0000000..ed74928 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerSaveHandler.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.sp; + +import net.minecraft.world.storage.SaveHandlerMP; +import net.minecraft.world.storage.WorldInfo; + +/** + * 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 SingleplayerSaveHandler extends SaveHandlerMP { + + private final WorldInfo worldInfo; + + public SingleplayerSaveHandler(WorldInfo worldInfo) { + this.worldInfo = worldInfo; + } + + public WorldInfo loadWorldInfo() { + return worldInfo; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java new file mode 100644 index 0000000..9bfa57d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java @@ -0,0 +1,586 @@ +package net.lax1dude.eaglercraft.v1_8.sp; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; + +import org.apache.commons.lang3.StringUtils; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; +import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; +import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.*; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.StringTranslate; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.WorldInfo; + +/** + * 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 SingleplayerServerController implements ISaveFormat { + + public static final String IPC_CHANNEL = "~!IPC"; + public static final String PLAYER_CHANNEL = "~!LOCAL_PLAYER"; + + private static int statusState = IntegratedServerState.WORLD_WORKER_NOT_RUNNING; + private static boolean loggingState = true; + private static String worldStatusString = ""; + private static float worldStatusProgress = 0.0f; + private static final LinkedList exceptions = new LinkedList(); + + public static final SingleplayerServerController instance = new SingleplayerServerController(); + public static final Logger logger = LogManager.getLogger("SingleplayerServerController"); + public static final List saveListCache = new ArrayList(); + public static final Map saveListMap = new HashMap(); + public static final List saveListNBT = new ArrayList(); + + private static boolean isPaused = false; + private static List integratedServerTPS = new ArrayList(); + private static long integratedServerLastTPSUpdate = 0; + public static final ClientIntegratedServerNetworkManager localPlayerNetworkManager = new ClientIntegratedServerNetworkManager(PLAYER_CHANNEL); + private static final List openLANChannels = new ArrayList(); + + private SingleplayerServerController() { + } + + public static void startIntegratedServerWorker() { + if(statusState == IntegratedServerState.WORLD_WORKER_NOT_RUNNING) { + exceptions.clear(); + statusState = IntegratedServerState.WORLD_WORKER_BOOTING; + loggingState = true; + ClientPlatformSingleplayer.startIntegratedServer(); + } + } + + public static boolean isIntegratedServerWorkerStarted() { + return statusState != IntegratedServerState.WORLD_WORKER_NOT_RUNNING && statusState != IntegratedServerState.WORLD_WORKER_BOOTING; + } + + public static boolean isIntegratedServerWorkerAlive() { + return statusState != IntegratedServerState.WORLD_WORKER_NOT_RUNNING; + } + + public static boolean isRunningSingleThreadMode() { + return ClientPlatformSingleplayer.isRunningSingleThreadMode(); + } + + public static boolean isReady() { + return statusState == IntegratedServerState.WORLD_NONE; + } + + public static boolean isWorldNotLoaded() { + return statusState == IntegratedServerState.WORLD_NONE || statusState == IntegratedServerState.WORLD_WORKER_NOT_RUNNING || + statusState == IntegratedServerState.WORLD_WORKER_BOOTING; + } + + public static boolean isWorldRunning() { + return statusState == IntegratedServerState.WORLD_LOADED || statusState == IntegratedServerState.WORLD_PAUSED || + statusState == IntegratedServerState.WORLD_LOADING || statusState == IntegratedServerState.WORLD_SAVING; + } + + public static boolean isWorldReady() { + return statusState == IntegratedServerState.WORLD_LOADED || statusState == IntegratedServerState.WORLD_PAUSED || + statusState == IntegratedServerState.WORLD_SAVING; + } + + public static int getStatusState() { + return statusState; + } + + public static boolean isChannelOpen(String ch) { + return openLANChannels.contains(ch); + } + + public static boolean isChannelNameAllowed(String ch) { + return !IPC_CHANNEL.equals(ch) && !PLAYER_CHANNEL.equals(ch); + } + + public static void openPlayerChannel(String ch) { + if(openLANChannels.contains(ch)) { + logger.error("Tried to open channel that already exists: \"{}\"", ch); + } else if (!isChannelNameAllowed(ch)) { + logger.error("Tried to open disallowed channel name: \"{}\"", ch); + }else { + openLANChannels.add(ch); + sendIPCPacket(new IPCPacket0CPlayerChannel(ch, true)); + PlatformWebRTC.serverLANCreatePeer(ch); + } + } + + public static void closePlayerChannel(String ch) { + if(!openLANChannels.remove(ch)) { + logger.error("Tried to close channel that doesn't exist: \"{}\"", ch); + }else { + sendIPCPacket(new IPCPacket0CPlayerChannel(ch, false)); + PlatformWebRTC.serverLANDisconnectPeer(ch); + } + } + + public static void openLocalPlayerChannel() { + localPlayerNetworkManager.isPlayerChannelOpen = true; + sendIPCPacket(new IPCPacket0CPlayerChannel(PLAYER_CHANNEL, true)); + } + + public static void closeLocalPlayerChannel() { + localPlayerNetworkManager.isPlayerChannelOpen = false; + sendIPCPacket(new IPCPacket0CPlayerChannel(PLAYER_CHANNEL, false)); + } + + private static void ensureReady() { + if(!isReady()) { + String msg = "Server is in state " + statusState + " '" + IntegratedServerState.getStateName(statusState) + "' which is not the 'WORLD_NONE' state for the requested IPC operation"; + throw new IllegalStateException(msg); + } + } + + private static void ensureWorldReady() { + if(!isWorldReady()) { + String msg = "Server is in state " + statusState + " '" + IntegratedServerState.getStateName(statusState) + "' which is not the 'WORLD_LOADED' state for the requested IPC operation"; + throw new IllegalStateException(msg); + } + } + + public static void launchEaglercraftServer(String folderName, int difficulty, int viewDistance, WorldSettings settings) { + ensureReady(); + clearTPS(); + if(settings != null) { + sendIPCPacket(new IPCPacket02InitWorld(folderName, settings.getGameType().getID(), + settings.getTerrainType().getWorldTypeID(), settings.getWorldName(), settings.getSeed(), + settings.areCommandsAllowed(), settings.isMapFeaturesEnabled(), settings.isBonusChestEnabled(), + settings.getHardcoreEnabled())); + } + statusState = IntegratedServerState.WORLD_LOADING; + worldStatusProgress = 0.0f; + sendIPCPacket(new IPCPacket00StartServer(folderName, EaglerProfile.getName(), difficulty, viewDistance, EagRuntime.getConfiguration().isDemo())); + } + + public static void clearTPS() { + integratedServerTPS.clear(); + integratedServerLastTPSUpdate = 0l; + } + + public static List getTPS() { + return integratedServerTPS; + } + + public static long getTPSAge() { + return System.currentTimeMillis() - integratedServerLastTPSUpdate; + } + + public static boolean hangupEaglercraftServer() { + LANServerController.closeLAN(); + if(isWorldRunning()) { + logger.error("Shutting down integrated server due to unexpected client hangup, this is a memleak"); + statusState = IntegratedServerState.WORLD_UNLOADING; + sendIPCPacket(new IPCPacket01StopServer()); + return true; + }else { + return false; + } + } + + public static boolean shutdownEaglercraftServer() { + LANServerController.closeLAN(); + if(isWorldRunning()) { + logger.info("Shutting down integrated server"); + statusState = IntegratedServerState.WORLD_UNLOADING; + sendIPCPacket(new IPCPacket01StopServer()); + return true; + }else { + return false; + } + } + + public static void autoSave() { + if(!isPaused) { + statusState = IntegratedServerState.WORLD_SAVING; + sendIPCPacket(new IPCPacket19Autosave()); + } + } + + public static void setPaused(boolean pause) { + if(statusState != IntegratedServerState.WORLD_LOADED && statusState != IntegratedServerState.WORLD_PAUSED && statusState != IntegratedServerState.WORLD_SAVING) { + return; + } + if(isPaused != pause) { + sendIPCPacket(new IPCPacket0BPause(pause)); + isPaused = pause; + } + } + + public static void runTick() { + List pktList = ClientPlatformSingleplayer.recieveAllPacket(); + if(pktList != null) { + IPCPacketData packetData; + for(int i = 0, l = pktList.size(); i < l; ++i) { + packetData = pktList.get(i); + if(packetData.channel.equals(SingleplayerServerController.IPC_CHANNEL)) { + IPCPacketBase ipc; + try { + ipc = IPCPacketManager.IPCDeserialize(packetData.contents); + }catch(IOException ex) { + throw new RuntimeException("Failed to deserialize IPC packet", ex); + } + handleIPCPacket(ipc); + }else if(packetData.channel.equals(SingleplayerServerController.PLAYER_CHANNEL)) { + if(localPlayerNetworkManager.getConnectStatus() != EnumEaglerConnectionState.CLOSED) { + localPlayerNetworkManager.addRecievedPacket(packetData.contents); + }else { + logger.warn("Recieved {} byte packet on closed local player connection", packetData.contents.length); + } + }else { + PlatformWebRTC.serverLANWritePacket(packetData.channel, packetData.contents); + } + } + } + + boolean logWindowState = PlatformApplication.isShowingDebugConsole(); + if(loggingState != logWindowState) { + loggingState = logWindowState; + sendIPCPacket(new IPCPacket21EnableLogging(logWindowState)); + } + + LANServerController.updateLANServer(); + } + + private static void handleIPCPacket(IPCPacketBase ipc) { + switch(ipc.id()) { + case IPCPacketFFProcessKeepAlive.ID: { + IPCPacketFFProcessKeepAlive pkt = (IPCPacketFFProcessKeepAlive)ipc; + IntegratedServerState.assertState(pkt.ack, statusState); + switch(pkt.ack) { + case 0xFF: + logger.info("Integrated server signaled a successful boot"); + sendIPCPacket(new IPCPacket14StringList(IPCPacket14StringList.LOCALE, StringTranslate.dump())); + statusState = IntegratedServerState.WORLD_NONE; + break; + case IPCPacket00StartServer.ID: + statusState = IntegratedServerState.WORLD_LOADED; + isPaused = false; + break; + case IPCPacket0BPause.ID: + case IPCPacket19Autosave.ID: + if(statusState != IntegratedServerState.WORLD_UNLOADING) { + statusState = isPaused ? IntegratedServerState.WORLD_PAUSED : IntegratedServerState.WORLD_LOADED; + } + break; + case IPCPacketFFProcessKeepAlive.FAILURE: + logger.error("Server signaled 'FAILURE' response in state '{}'", IntegratedServerState.getStateName(statusState)); + statusState = IntegratedServerState.WORLD_NONE; + callFailed = true; + break; + case IPCPacket01StopServer.ID: + LANServerController.closeLAN(); + localPlayerNetworkManager.isPlayerChannelOpen = false; + statusState = IntegratedServerState.WORLD_NONE; + break; + case IPCPacket06RenameWorldNBT.ID: + statusState = IntegratedServerState.WORLD_NONE; + break; + case IPCPacket03DeleteWorld.ID: + case IPCPacket07ImportWorld.ID: + case IPCPacket12FileWrite.ID: + case IPCPacket13FileCopyMove.ID: + case IPCPacket18ClearPlayers.ID: + statusState = IntegratedServerState.WORLD_NONE; + break; + case IPCPacketFFProcessKeepAlive.EXITED: + logger.error("Server signaled 'EXITED' response in state '{}'", IntegratedServerState.getStateName(statusState)); + if(ClientPlatformSingleplayer.canKillWorker()) { + ClientPlatformSingleplayer.killWorker(); + } + LANServerController.closeLAN(); + localPlayerNetworkManager.isPlayerChannelOpen = false; + statusState = IntegratedServerState.WORLD_WORKER_NOT_RUNNING; + callFailed = true; + break; + default: + logger.error("IPC acknowledge packet type 0x{} was not handled", Integer.toHexString(pkt.ack)); + break; + } + break; + } + case IPCPacket09RequestResponse.ID: { + IPCPacket09RequestResponse pkt = (IPCPacket09RequestResponse)ipc; + if(statusState == IntegratedServerState.WORLD_EXPORTING) { + statusState = IntegratedServerState.WORLD_NONE; + exportResponse = pkt.response; + }else { + logger.error("IPCPacket09RequestResponse was recieved but statusState was '{}' instead of 'WORLD_EXPORTING'", IntegratedServerState.getStateName(statusState)); + } + break; + } + case IPCPacket0DProgressUpdate.ID: { + IPCPacket0DProgressUpdate pkt = (IPCPacket0DProgressUpdate)ipc; + worldStatusString = pkt.updateMessage; + worldStatusProgress = pkt.updateProgress; + break; + } + case IPCPacket15Crashed.ID: { + exceptions.add((IPCPacket15Crashed)ipc); + if(exceptions.size() > 64) { + exceptions.remove(0); + } + break; + } + case IPCPacket16NBTList.ID: { + IPCPacket16NBTList pkt = (IPCPacket16NBTList)ipc; + if(pkt.opCode == IPCPacket16NBTList.WORLD_LIST && statusState == IntegratedServerState.WORLD_LISTING) { + statusState = IntegratedServerState.WORLD_NONE; + saveListNBT.clear(); + saveListNBT.addAll(pkt.nbtTagList); + loadSaveComparators(); + }else { + logger.error("IPC packet type 0x{} class '{}' contained invalid opCode {} in state {} '{}'", Integer.toHexString(ipc.id()), ipc.getClass().getSimpleName(), pkt.opCode, statusState, IntegratedServerState.getStateName(statusState)); + } + break; + } + case IPCPacket0CPlayerChannel.ID: { + IPCPacket0CPlayerChannel pkt = (IPCPacket0CPlayerChannel)ipc; + if(!pkt.open) { + if(pkt.channel.equals(PLAYER_CHANNEL)) { + LANServerController.closeLAN(); + localPlayerNetworkManager.isPlayerChannelOpen = false; + logger.error("Local player channel was closed"); + }else { + PlatformWebRTC.serverLANDisconnectPeer(pkt.channel); + } + } + break; + } + case IPCPacket14StringList.ID: { + IPCPacket14StringList pkt = (IPCPacket14StringList)ipc; + if(pkt.opCode == IPCPacket14StringList.SERVER_TPS) { + integratedServerTPS.clear(); + integratedServerTPS.addAll(pkt.stringList); + integratedServerLastTPSUpdate = System.currentTimeMillis(); + }else { + logger.warn("Strange string list type {} recieved!", pkt.opCode); + } + break; + } + case IPCPacket20LoggerMessage.ID: { + IPCPacket20LoggerMessage pkt = (IPCPacket20LoggerMessage)ipc; + PlatformApplication.addLogMessage(pkt.logMessage, pkt.isError); + break; + } + default: + throw new RuntimeException("Unexpected IPC packet type recieved on client: " + ipc.id()); + } + } + + public static void sendIPCPacket(IPCPacketBase ipc) { + byte[] pkt; + try { + pkt = IPCPacketManager.IPCSerialize(ipc); + }catch (IOException ex) { + throw new RuntimeException("Failed to serialize IPC packet", ex); + } + ClientPlatformSingleplayer.sendPacket(new IPCPacketData(IPC_CHANNEL, pkt)); + } + + + private static boolean callFailed = false; + + public static boolean didLastCallFail() { + boolean c = callFailed; + callFailed = false; + return c; + } + + public static void importWorld(String name, byte[] data, int format, byte gameRules) { + ensureReady(); + statusState = IntegratedServerState.WORLD_IMPORTING; + sendIPCPacket(new IPCPacket07ImportWorld(name, data, (byte)format, gameRules)); + } + + public static void exportWorld(String name, int format) { + ensureReady(); + statusState = IntegratedServerState.WORLD_EXPORTING; + if(format == IPCPacket05RequestData.REQUEST_LEVEL_EAG) { + name = name + (new String(new char[] { (char)253, (char)233, (char)233 })) + EaglerProfile.getName(); + } + sendIPCPacket(new IPCPacket05RequestData(name, (byte)format)); + } + + private static byte[] exportResponse = null; + + public static byte[] getExportResponse() { + byte[] dat = exportResponse; + exportResponse = null; + return dat; + } + + public static String worldStatusString() { + return worldStatusString; + } + + public static float worldStatusProgress() { + return worldStatusProgress; + } + + public static IPCPacket15Crashed worldStatusError() { + return exceptions.size() > 0 ? exceptions.remove(0) : null; + } + + public static IPCPacket15Crashed[] worldStatusErrors() { + int l = exceptions.size(); + if(l == 0) { + return null; + } + IPCPacket15Crashed[] pkts = exceptions.toArray(new IPCPacket15Crashed[l]); + exceptions.clear(); + return pkts; + } + + public static void clearPlayerData(String worldName) { + ensureReady(); + statusState = IntegratedServerState.WORLD_CLEAR_PLAYERS; + sendIPCPacket(new IPCPacket18ClearPlayers(worldName)); + } + + private static void loadSaveComparators() { + saveListMap.clear(); + saveListCache.clear(); + for(NBTTagCompound nbt : saveListNBT) { + String folderName = nbt.getString("folderNameEagler"); + if(!StringUtils.isEmpty(folderName)) { + WorldInfo worldinfo = new WorldInfo(nbt.getCompoundTag("Data")); + saveListMap.put(folderName, worldinfo); + String s1 = worldinfo.getWorldName(); + if (StringUtils.isEmpty(s1)) { + s1 = folderName; + } + + long i = 0L; + saveListCache.add(new SaveFormatComparator(folderName, s1, worldinfo.getLastTimePlayed(), i, + worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), + worldinfo.areCommandsAllowed(), nbt)); + } + } + } + + @Override + public String getName() { + return "eaglercraft"; + } + + @Override + public ISaveHandler getSaveLoader(String var1, boolean var2) { + return new SingleplayerSaveHandler(saveListMap.get(var1)); + } + + @Override + public List getSaveList() { + return saveListCache; + } + + @Override + public void flushCache() { + sendIPCPacket(new IPCPacket0EListWorlds()); + statusState = IntegratedServerState.WORLD_LISTING; + } + + @Override + public WorldInfo getWorldInfo(String var1) { + return saveListMap.get(var1); + } + + @Override + public boolean func_154335_d(String var1) { + return false; + } + + @Override + public boolean deleteWorldDirectory(String var1) { + sendIPCPacket(new IPCPacket03DeleteWorld(var1)); + statusState = IntegratedServerState.WORLD_DELETING; + return false; + } + + @Override + public void renameWorld(String var1, String var2) { + sendIPCPacket(new IPCPacket06RenameWorldNBT(var1, var2, false)); + statusState = IntegratedServerState.WORLD_RENAMING; + } + + public static void duplicateWorld(String var1, String var2) { + sendIPCPacket(new IPCPacket06RenameWorldNBT(var1, var2, true)); + statusState = IntegratedServerState.WORLD_DUPLICATING; + } + + @Override + public boolean func_154334_a(String var1) { + return false; + } + + @Override + public boolean isOldMapFormat(String var1) { + return false; + } + + @Override + public boolean convertMapFormat(String var1, IProgressUpdate var2) { + return false; + } + + @Override + public boolean canLoadWorld(String var1) { + return saveListMap.containsKey(var1); + } + + public static boolean canKillWorker() { + return ClientPlatformSingleplayer.canKillWorker(); + } + + public static void killWorker() { + statusState = IntegratedServerState.WORLD_WORKER_NOT_RUNNING; + ClientPlatformSingleplayer.killWorker(); + LANServerController.closeLAN(); + } + + public static void updateLocale(List dump) { + if(statusState != IntegratedServerState.WORLD_WORKER_NOT_RUNNING) { + sendIPCPacket(new IPCPacket14StringList(IPCPacket14StringList.LOCALE, dump)); + } + } + + public static void setDifficulty(int difficultyId) { + if(isWorldRunning()) { + sendIPCPacket(new IPCPacket0ASetWorldDifficulty((byte)difficultyId)); + } + } + + public static void configureLAN(net.minecraft.world.WorldSettings.GameType enumGameType, boolean allowCommands) { + sendIPCPacket(new IPCPacket17ConfigureLAN(enumGameType.getID(), allowCommands, LANServerController.currentICEServers)); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SkullCommand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SkullCommand.java new file mode 100644 index 0000000..ce73c22 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SkullCommand.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; +import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; +import net.lax1dude.eaglercraft.v1_8.profile.SkinPackets; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatComponentTranslation; + +/** + * 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 SkullCommand { + + private final Minecraft mc; + private boolean waitingForSelection = false; + + public SkullCommand(Minecraft mc) { + this.mc = mc; + } + + public void openFileChooser() { + EagRuntime.displayFileChooser("image/png", "png"); + waitingForSelection = true; + } + + public void tick() { + if(waitingForSelection && EagRuntime.fileChooserHasResult()) { + waitingForSelection = false; + FileChooserResult fr = EagRuntime.getFileChooserResult(); + if(fr == null || mc.thePlayer == null || mc.thePlayer.sendQueue == null) { + return; + } + ImageData loaded = ImageData.loadImageFile(fr.fileData); + if(loaded == null) { + mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("command.skull.error.invalid.png")); + return; + } + if(loaded.width != 64 || loaded.height > 64) { + mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("command.skull.error.invalid.skin", loaded.width, loaded.height)); + return; + } + byte[] rawSkin = new byte[loaded.pixels.length << 2]; + for(int i = 0, j, k; i < 4096; ++i) { + j = i << 2; + k = loaded.pixels[i]; + rawSkin[j] = (byte)(k >> 24); + rawSkin[j + 1] = (byte)(k >> 16); + rawSkin[j + 2] = (byte)(k >> 8); + rawSkin[j + 3] = (byte)(k & 0xFF); + } + mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("EAG|Skins-1.8", SkinPackets.writeCreateCustomSkull(rawSkin))); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/WorkerStartupFailedException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/WorkerStartupFailedException.java new file mode 100644 index 0000000..ca86bca --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/WorkerStartupFailedException.java @@ -0,0 +1,24 @@ +package net.lax1dude.eaglercraft.v1_8.sp; + +/** + * 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 WorkerStartupFailedException extends RuntimeException { + + public WorkerStartupFailedException(String msg) { + super(msg); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/CrashScreen.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/CrashScreen.java new file mode 100644 index 0000000..5792faf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/CrashScreen.java @@ -0,0 +1,30 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; + +/** + * 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 CrashScreen { + + public static void showCrashReportOverlay(String report, int x, int y, int w, int h) { + ClientPlatformSingleplayer.showCrashReportOverlay(report, x, y, w, h); + } + + public static void hideCrashReportOverlay() { + ClientPlatformSingleplayer.hideCrashReportOverlay(); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiIntegratedServerStartup.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiIntegratedServerStartup.java new file mode 100644 index 0000000..9e5349d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiIntegratedServerStartup.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSelectWorld; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiIntegratedServerStartup extends GuiScreen { + + private final GuiScreen backScreen; + private static final String[] dotDotDot = new String[] { "", ".", "..", "..." }; + + private int counter = 0; + + public GuiIntegratedServerStartup(GuiScreen backScreen) { + this.backScreen = backScreen; + } + + protected void keyTyped(char parChar1, int parInt1) { + } + + public void initGui() { + this.buttonList.clear(); + } + + public void updateScreen() { + ++counter; + if(counter > 1 && SingleplayerServerController.isIntegratedServerWorkerStarted()) { + mc.displayGuiScreen(new GuiSelectWorld(backScreen)); + }else if(counter == 2) { + SingleplayerServerController.startIntegratedServerWorker(); + } + } + + public void drawScreen(int i, int j, float f) { + this.drawBackground(0); + String txt = I18n.format("singleplayer.integratedStartup"); + int w = this.fontRendererObj.getStringWidth(txt); + this.drawString(this.fontRendererObj, txt + dotDotDot[(int)((System.currentTimeMillis() / 300L) % 4L)], (this.width - w) / 2, this.height / 2 - 50, 16777215); + super.drawScreen(i, j, f); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiNetworkSettingsButton.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiNetworkSettingsButton.java new file mode 100644 index 0000000..276b553 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiNetworkSettingsButton.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +/** + * 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 GuiNetworkSettingsButton extends Gui { + + private final GuiScreen screen; + private final String text; + private final Minecraft mc; + + public GuiNetworkSettingsButton(GuiScreen screen) { + this.screen = screen; + this.text = I18n.format("directConnect.lanWorldRelay"); + this.mc = Minecraft.getMinecraft(); + } + + public void drawScreen(int xx, int yy) { + GlStateManager.pushMatrix(); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + + int w = mc.fontRendererObj.getStringWidth(text); + boolean hover = xx > 1 && yy > 1 && xx < (w * 3 / 4) + 7 && yy < 12; + if(hover) { + Mouse.showCursor(EnumCursorType.HAND); + } + + drawString(mc.fontRendererObj, EnumChatFormatting.UNDERLINE + text, 5, 5, hover ? 0xFFEEEE22 : 0xFFCCCCCC); + + GlStateManager.popMatrix(); + } + + public void mouseClicked(int xx, int yy, int btn) { + int w = mc.fontRendererObj.getStringWidth(text); + if(xx > 2 && yy > 2 && xx < (w * 3 / 4) + 5 && yy < 12) { + if(LANServerController.supported()) { + mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenRelay(screen))); + }else { + mc.displayGuiScreen(new GuiScreenLANNotSupported(screen)); + } + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenAddRelay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenAddRelay.java new file mode 100644 index 0000000..7fa49f4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenAddRelay.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenAddRelay extends GuiScreen { + + /** This GUI's parent GUI. */ + private GuiScreenRelay parentGui; + private GuiTextField serverAddress; + private GuiTextField serverName; + + public GuiScreenAddRelay(GuiScreenRelay par1GuiScreen) { + this.parentGui = par1GuiScreen; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.serverName.updateCursorCounter(); + this.serverAddress.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.parentGui.addNewName = RelayManager.relayManager.makeNewRelayName(); + this.parentGui.addNewAddr = ""; + this.parentGui.addNewPrimary = RelayManager.relayManager.count() == 0; + int sslOff = EagRuntime.requireSSL() ? 36 : 0; + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12 + sslOff, I18n.format("addRelay.add"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12 + sslOff, I18n.format("gui.cancel"))); + this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.format("addRelay.primary") + ": " + (this.parentGui.addNewPrimary ? I18n.format("gui.yes") : I18n.format("gui.no")))); + this.serverName = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 100, 106, 200, 20); + this.serverAddress = new GuiTextField(4, this.fontRendererObj, this.width / 2 - 100, 66, 200, 20); + this.serverAddress.setMaxStringLength(128); + this.serverAddress.setFocused(true); + ((GuiButton) this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; + this.serverName.setText(this.parentGui.addNewName); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /** + * Fired when a control is clicked. This is the equivalent of + * ActionListener.actionPerformed(ActionEvent e). + */ + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id == 1) { + this.parentGui.confirmClicked(false, 0); + } else if (par1GuiButton.id == 0) { + this.parentGui.addNewName = this.serverName.getText(); + this.parentGui.addNewAddr = this.serverAddress.getText(); + this.parentGui.confirmClicked(true, 0); + } else if (par1GuiButton.id == 2) { + this.parentGui.addNewPrimary = !this.parentGui.addNewPrimary; + ((GuiButton) this.buttonList.get(2)).displayString = I18n.format("addRelay.primary") + ": " + (this.parentGui.addNewPrimary ? I18n.format("gui.yes") : I18n.format("gui.no")); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char par1, int par2) { + this.serverName.textboxKeyTyped(par1, par2); + this.serverAddress.textboxKeyTyped(par1, par2); + + if (par1 == 9) { + if (this.serverName.isFocused()) { + this.serverName.setFocused(false); + this.serverAddress.setFocused(true); + } else { + this.serverName.setFocused(true); + this.serverAddress.setFocused(false); + } + } + + if (par1 == 13) { + this.actionPerformed((GuiButton) this.buttonList.get(0)); + } + + ((GuiButton) this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + this.serverAddress.mouseClicked(par1, par2, par3); + this.serverName.mouseClicked(par1, par2, par3); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int par1, int par2, float par3) { + this.drawBackground(0); + this.drawCenteredString(this.fontRendererObj, I18n.format("addRelay.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addRelay.address"), this.width / 2 - 100, 53, 10526880); + this.drawString(this.fontRendererObj, I18n.format("addRelay.name"), this.width / 2 - 100, 94, 10526880); + if(EagRuntime.requireSSL()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("addServer.SSLWarn1"), this.width / 2, 169, 0xccccff); + this.drawCenteredString(this.fontRendererObj, I18n.format("addServer.SSLWarn2"), this.width / 2, 181, 0xccccff); + } + this.serverName.drawTextBox(); + this.serverAddress.drawTextBox(); + super.drawScreen(par1, par2, par3); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java new file mode 100644 index 0000000..11ed8cc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java @@ -0,0 +1,127 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.IPCPacket05RequestData; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiRenameWorld; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.resources.I18n; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.storage.WorldInfo; + +/** + * 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 GuiScreenBackupWorldSelection extends GuiScreen { + + private GuiScreen selectWorld; + + private GuiButton worldRecreate = null; + private GuiButton worldDuplicate = null; + private GuiButton worldExport = null; + private GuiButton worldConvert = null; + private GuiButton worldBackup = null; + private long worldSeed; + private NBTTagCompound levelDat; + + private String worldName; + + public GuiScreenBackupWorldSelection(GuiScreen selectWorld, String worldName, NBTTagCompound levelDat) { + this.selectWorld = selectWorld; + this.worldName = worldName; + this.levelDat = levelDat; + this.worldSeed = levelDat.getCompoundTag("Data").getLong("RandomSeed"); + } + + public void initGui() { + this.buttonList.add(worldRecreate = new GuiButton(1, this.width / 2 - 100, this.height / 5 + 5, I18n.format("singleplayer.backup.recreate"))); + this.buttonList.add(worldDuplicate = new GuiButton(2, this.width / 2 - 100, this.height / 5 + 30, I18n.format("singleplayer.backup.duplicate"))); + this.buttonList.add(worldExport = new GuiButton(3, this.width / 2 - 100, this.height / 5 + 80, I18n.format("singleplayer.backup.export"))); + this.buttonList.add(worldConvert = new GuiButton(4, this.width / 2 - 100, this.height / 5 + 105, I18n.format("singleplayer.backup.vanilla"))); + this.buttonList.add(worldBackup = new GuiButton(5, this.width / 2 - 100, this.height / 5 + 136, I18n.format("singleplayer.backup.clearPlayerData"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 155, I18n.format("gui.cancel"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.title", worldName), this.width / 2, this.height / 5 - 35, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.seed") + " " + worldSeed, this.width / 2, this.height / 5 + 62, 0xAAAAFF); + + int toolTipColor = 0xDDDDAA; + if(worldRecreate.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.recreate.tooltip"), this.width / 2, this.height / 5 - 12, toolTipColor); + }else if(worldDuplicate.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.duplicate.tooltip"), this.width / 2, this.height / 5 - 12, toolTipColor); + }else if(worldExport.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.export.tooltip"), this.width / 2, this.height / 5 - 12, toolTipColor); + }else if(worldConvert.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.vanilla.tooltip"), this.width / 2, this.height / 5 - 12, toolTipColor); + }else if(worldBackup.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.backup.clearPlayerData.tooltip"), this.width / 2, this.height / 5 - 12, toolTipColor); + } + + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(selectWorld); + }else if(par1GuiButton.id == 1) { + GuiCreateWorld cw = new GuiCreateWorld(selectWorld); + cw.func_146318_a(new WorldInfo(this.levelDat.getCompoundTag("Data"))); + this.mc.displayGuiScreen(cw); + }else if(par1GuiButton.id == 2) { + this.mc.displayGuiScreen(new GuiRenameWorld(this.selectWorld, this.worldName, true)); + }else if(par1GuiButton.id == 3) { + SingleplayerServerController.exportWorld(worldName, IPCPacket05RequestData.REQUEST_LEVEL_EAG); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(selectWorld, "singleplayer.busy.exporting.1", "singleplayer.failed.exporting.1", () -> { + byte[] b = SingleplayerServerController.getExportResponse(); + if(b != null) { + EagRuntime.downloadFileWithName(worldName + ".epk", b); + return true; + } + return false; + })); + }else if(par1GuiButton.id == 4) { + SingleplayerServerController.exportWorld(worldName, IPCPacket05RequestData.REQUEST_LEVEL_MCA); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(selectWorld, "singleplayer.busy.exporting.2", "singleplayer.failed.exporting.2", () -> { + byte[] b = SingleplayerServerController.getExportResponse(); + if(b != null) { + EagRuntime.downloadFileWithName(worldName + ".zip", b); + return true; + } + return false; + })); + }else if(par1GuiButton.id == 5) { + this.mc.displayGuiScreen(new GuiYesNo(this, I18n.format("singleplayer.backup.clearPlayerData.warning1"), + I18n.format("singleplayer.backup.clearPlayerData.warning2", worldName, EaglerProfile.getName()), 0)); + } + } + + public void confirmClicked(boolean par1, int par2) { + if(par1) { + SingleplayerServerController.clearPlayerData(worldName); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.clearplayers", "singleplayer.failed.clearplayers", () -> SingleplayerServerController.isReady())); + }else { + mc.displayGuiScreen(this); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenChangeRelayTimeout.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenChangeRelayTimeout.java new file mode 100644 index 0000000..74271da --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenChangeRelayTimeout.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenChangeRelayTimeout extends GuiScreen { + + private GuiScreen parent; + private GuiSlider2 slider; + private String title; + + public GuiScreenChangeRelayTimeout(GuiScreen parent) { + this.parent = parent; + } + + public void initGui() { + title = I18n.format("networkSettings.relayTimeoutTitle"); + buttonList.clear(); + buttonList.add(new GuiButton(0, width / 2 - 100, height / 3 + 55, I18n.format("gui.done"))); + buttonList.add(new GuiButton(1, width / 2 - 100, height / 3 + 85, I18n.format("gui.cancel"))); + slider = new GuiSlider2(0, width / 2 - 100, height / 3 + 10, 200, 20, (mc.gameSettings.relayTimeout - 1) / 14.0f, 1.0f) { + public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { + if(super.mousePressed(par1Minecraft, par2, par3)) { + this.displayString = "" + (int)((sliderValue * 14.0f) + 1.0f) + "s"; + return true; + }else { + return false; + } + } + public void mouseDragged(Minecraft par1Minecraft, int par2, int par3) { + super.mouseDragged(par1Minecraft, par2, par3); + this.displayString = "" + (int)((sliderValue * 14.0f) + 1.0f) + "s"; + } + }; + slider.displayString = "" + mc.gameSettings.relayTimeout + "s"; + } + + public void actionPerformed(GuiButton btn) { + if(btn.id == 0) { + mc.gameSettings.relayTimeout = (int)((slider.sliderValue * 14.0f) + 1.0f); + mc.gameSettings.saveOptions(); + mc.displayGuiScreen(parent); + }else if(btn.id == 1) { + mc.displayGuiScreen(parent); + } + } + + public void drawScreen(int par1, int par2, float par3) { + drawBackground(0); + drawCenteredString(fontRendererObj, title, width / 2, height / 3 - 20, 0xFFFFFF); + slider.drawButton(mc, par1, par2); + super.drawScreen(par1, par2, par3); + } + + public void mouseClicked(int mx, int my, int button) { + slider.mousePressed(mc, mx, my); + super.mouseClicked(mx, my, button); + } + + public void mouseReleased(int par1, int par2, int par3) { + if(par3 == 0) { + slider.mouseReleased(par1, par2); + } + super.mouseReleased(par1, par2, par3); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java new file mode 100644 index 0000000..83d5329 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiScreenServerList; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenConnectOption extends GuiScreen { + + private final GuiMultiplayer guiScreen; + private String title; + private String prompt; + + private final GuiNetworkSettingsButton relaysButton; + + public GuiScreenConnectOption(GuiMultiplayer guiScreen) { + this.guiScreen = guiScreen; + this.relaysButton = new GuiNetworkSettingsButton(this); + } + + public void initGui() { + title = I18n.format("selectServer.direct"); + prompt = I18n.format("directConnect.prompt"); + buttonList.clear(); + buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 - 60 + 90, I18n.format("directConnect.serverJoin"))); + buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 - 60 + 115, I18n.format("directConnect.lanWorld"))); + buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 - 60 + 155, I18n.format("gui.cancel"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + mc.displayGuiScreen(guiScreen); + }else if(par1GuiButton.id == 1) { + mc.displayGuiScreen(new GuiScreenServerList(guiScreen, guiScreen.getSelectedServer())); + }else if(par1GuiButton.id == 2) { + if(LANServerController.supported()) { + mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenLANConnect(guiScreen))); + }else { + mc.displayGuiScreen(new GuiScreenLANNotSupported(this)); + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, title, this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawCenteredString(this.fontRendererObj, prompt, this.width / 2, this.height / 4 - 60 + 55, 0x999999); + super.drawScreen(par1, par2, par3); + relaysButton.drawScreen(par1, par2); + } + + protected void mouseClicked(int par1, int par2, int par3) { + relaysButton.mouseClicked(par1, par2, par3); + super.mouseClicked(par1, par2, par3); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenCreateWorldSelection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenCreateWorldSelection.java new file mode 100644 index 0000000..80ef57e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenCreateWorldSelection.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenCreateWorldSelection extends GuiScreen { + + private GuiScreen mainmenu; + private GuiButton worldCreate = null; + private GuiButton worldImport = null; + private GuiButton worldVanilla = null; + private boolean isImportingEPK = false; + private boolean isImportingMCA = false; + + public GuiScreenCreateWorldSelection(GuiScreen mainmenu) { + this.mainmenu = mainmenu; + } + + public void initGui() { + this.buttonList.add(worldCreate = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 40, I18n.format("singleplayer.create.create"))); + this.buttonList.add(worldImport = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 65, I18n.format("singleplayer.create.import"))); + this.buttonList.add(worldVanilla = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 90, I18n.format("singleplayer.create.vanilla"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 130, I18n.format("gui.cancel"))); + } + + public void updateScreen() { + if(EagRuntime.fileChooserHasResult() && (isImportingEPK || isImportingMCA)) { + FileChooserResult fr = EagRuntime.getFileChooserResult(); + if(fr != null) { + this.mc.displayGuiScreen(new GuiScreenNameWorldImport(mainmenu, fr, isImportingEPK ? 0 : (isImportingMCA ? 1 : -1))); + } + isImportingEPK = isImportingMCA = false; + } + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.create.title"), this.width / 2, this.height / 4, 16777215); + + int toolTipColor = 0xDDDDAA; + if(worldCreate.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.create.create.tooltip"), this.width / 2, this.height / 4 + 20, toolTipColor); + }else if(worldImport.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.create.import.tooltip"), this.width / 2, this.height / 4 + 20, toolTipColor); + }else if(worldVanilla.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.create.vanilla.tooltip"), this.width / 2, this.height / 4 + 20, toolTipColor); + } + + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(mainmenu); + }else if(par1GuiButton.id == 1) { + this.mc.displayGuiScreen(new GuiCreateWorld(mainmenu)); + }else if(par1GuiButton.id == 2) { + isImportingEPK = true; + EagRuntime.displayFileChooser(null, "epk"); + }else if(par1GuiButton.id == 3) { + isImportingMCA = true; + EagRuntime.displayFileChooser(null, "zip"); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoIntegratedServerFailed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoIntegratedServerFailed.java new file mode 100644 index 0000000..09e04d1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoIntegratedServerFailed.java @@ -0,0 +1,38 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenDemoIntegratedServerFailed extends GuiScreen { + + private String str1; + private String str2; + + public GuiScreenDemoIntegratedServerFailed() { + this.str1 = I18n.format("singleplayer.failed.demo.title"); + this.str2 = I18n.format("singleplayer.failed.demo.desc"); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(fontRendererObj, str1, this.width / 2, 70, 11184810); + this.drawCenteredString(fontRendererObj, str2, this.width / 2, 90, 16777215); + super.drawScreen(par1, par2, par3); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoIntegratedServerStartup.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoIntegratedServerStartup.java new file mode 100644 index 0000000..4a351d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoIntegratedServerStartup.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.WorkerStartupFailedException; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.IPCPacket15Crashed; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenDemoIntegratedServerStartup extends GuiScreen { + + private final GuiScreen contScreen; + private static final String[] dotDotDot = new String[] { "", ".", "..", "..." }; + + private int counter = 0; + + public GuiScreenDemoIntegratedServerStartup(GuiScreen contScreen) { + this.contScreen = contScreen; + } + + protected void keyTyped(char parChar1, int parInt1) { + } + + public void initGui() { + this.buttonList.clear(); + } + + public void updateScreen() { + ++counter; + if(counter == 2) { + try { + SingleplayerServerController.startIntegratedServerWorker(); + }catch(WorkerStartupFailedException ex) { + mc.displayGuiScreen(new GuiScreenIntegratedServerFailed(ex.getMessage(), new GuiScreenDemoIntegratedServerFailed())); + return; + } + }else if(counter > 2) { + IPCPacket15Crashed[] crashReport = SingleplayerServerController.worldStatusErrors(); + if(crashReport != null) { + mc.displayGuiScreen(GuiScreenIntegratedServerBusy.createException(new GuiScreenDemoIntegratedServerFailed(), "singleplayer.failed.notStarted", crashReport)); + }else if(SingleplayerServerController.isIntegratedServerWorkerStarted()) { + mc.displayGuiScreen(contScreen); + } + } + } + + public void drawScreen(int i, int j, float f) { + this.drawBackground(0); + String txt = I18n.format("singleplayer.integratedStartup"); + int w = this.fontRendererObj.getStringWidth(txt); + this.drawString(this.fontRendererObj, txt + dotDotDot[(int)((System.currentTimeMillis() / 300L) % 4L)], (this.width - w) / 2, this.height / 2 - 50, 16777215); + super.drawScreen(i, j, f); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java new file mode 100644 index 0000000..5cf47ee --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.world.demo.DemoWorldServer; + +/** + * 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 GuiScreenDemoPlayWorldSelection extends GuiScreen { + + private GuiScreen mainmenu; + private GuiButton playWorld = null; + private GuiButton joinWorld = null; + + public GuiScreenDemoPlayWorldSelection(GuiScreen mainmenu) { + this.mainmenu = mainmenu; + } + + public void initGui() { + this.buttonList.add(playWorld = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 40, I18n.format("singleplayer.demo.create.create"))); + this.buttonList.add(joinWorld = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 65, I18n.format("singleplayer.demo.create.join"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 130, I18n.format("gui.cancel"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.demo.create.title"), this.width / 2, this.height / 4, 16777215); + + int toolTipColor = 0xDDDDAA; + if(playWorld.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.demo.create.create.tooltip"), this.width / 2, this.height / 4 + 20, toolTipColor); + }else if(joinWorld.isMouseOver()) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.demo.create.join.tooltip"), this.width / 2, this.height / 4 + 20, toolTipColor); + } + + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(mainmenu); + }else if(par1GuiButton.id == 1) { + this.mc.gameSettings.hasCreatedDemoWorld = true; + this.mc.gameSettings.saveOptions(); + this.mc.launchIntegratedServer("Demo World", "Demo World", DemoWorldServer.demoWorldSettings); + }else if(par1GuiButton.id == 2) { + if(LANServerController.supported()) { + this.mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenLANConnect(mainmenu))); + }else { + this.mc.displayGuiScreen(new GuiScreenLANNotSupported(mainmenu)); + } + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerBusy.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerBusy.java new file mode 100644 index 0000000..53b8287 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerBusy.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import java.util.function.BiConsumer; +import java.util.function.BooleanSupplier; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.IPCPacket15Crashed; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenIntegratedServerBusy extends GuiScreen { + + public final GuiScreen menu; + private GuiButton killTask; + public final String failMessage; + private BooleanSupplier checkTaskComplete; + private Runnable taskKill; + private String lastStatus; + private String currentStatus; + private BiConsumer onException; + private int areYouSure; + + private long startStartTime; + + private static final Runnable defaultTerminateAction = () -> { + if(SingleplayerServerController.canKillWorker()) { + SingleplayerServerController.killWorker(); + Minecraft.getMinecraft().displayGuiScreen(new GuiScreenIntegratedServerFailed("singleplayer.failed.killed", new GuiMainMenu())); + }else { + EagRuntime.showPopup("Cannot kill worker tasks on desktop runtime!"); + } + }; + + public static GuiScreen createException(GuiScreen ok, String msg, IPCPacket15Crashed[] exceptions) { + ok = new GuiScreenIntegratedServerFailed(msg, ok); + if(exceptions != null) { + for(int i = exceptions.length - 1; i >= 0; --i) { + ok = new GuiScreenIntegratedServerCrashed(ok, exceptions[i].crashReport); + } + } + return ok; + } + + private static final BiConsumer defaultExceptionAction = (t, u) -> { + GuiScreenIntegratedServerBusy tt = (GuiScreenIntegratedServerBusy) t; + Minecraft.getMinecraft().displayGuiScreen(createException(tt.menu, tt.failMessage, u)); + }; + + public GuiScreenIntegratedServerBusy(GuiScreen menu, String progressMessage, String failMessage, BooleanSupplier checkTaskComplete) { + this(menu, progressMessage, failMessage, checkTaskComplete, defaultExceptionAction, defaultTerminateAction); + } + + public GuiScreenIntegratedServerBusy(GuiScreen menu, String progressMessage, String failMessage, BooleanSupplier checkTaskComplete, BiConsumer exceptionAction) { + this(menu, progressMessage, failMessage, checkTaskComplete, exceptionAction, defaultTerminateAction); + } + + public GuiScreenIntegratedServerBusy(GuiScreen menu, String progressMessage, String failMessage, BooleanSupplier checkTaskComplete, Runnable onTerminate) { + this(menu, progressMessage, failMessage, checkTaskComplete, defaultExceptionAction, onTerminate); + } + + public GuiScreenIntegratedServerBusy(GuiScreen menu, String progressMessage, String failMessage, BooleanSupplier checkTaskComplete, BiConsumer onException, Runnable onTerminate) { + this.menu = menu; + this.failMessage = failMessage; + this.checkTaskComplete = checkTaskComplete; + this.onException = onException; + this.taskKill = onTerminate; + this.lastStatus = SingleplayerServerController.worldStatusString(); + this.currentStatus = progressMessage; + } + + public void initGui() { + if(startStartTime == 0) this.startStartTime = System.currentTimeMillis(); + areYouSure = 0; + this.buttonList.add(killTask = new GuiButton(0, this.width / 2 - 100, this.height / 3 + 50, I18n.format("singleplayer.busy.killTask"))); + killTask.enabled = false; + } + + public boolean doesGuiPauseGame() { + return false; + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + int top = this.height / 3; + + long millis = System.currentTimeMillis(); + + String str = I18n.format(currentStatus); + + long dots = (millis / 500l) % 4l; + this.drawString(fontRendererObj, str + (dots > 0 ? "." : "") + (dots > 1 ? "." : "") + (dots > 2 ? "." : ""), (this.width - this.fontRendererObj.getStringWidth(str)) / 2, top + 10, 0xFFFFFF); + + if(areYouSure > 0) { + this.drawCenteredString(fontRendererObj, I18n.format("singleplayer.busy.cancelWarning"), this.width / 2, top + 25, 0xFF8888); + }else { + float prog = SingleplayerServerController.worldStatusProgress(); + if(this.currentStatus.equals(this.lastStatus) && prog > 0.01f) { + this.drawCenteredString(fontRendererObj, (prog > 1.0f ? ("(" + (prog > 1000000.0f ? "" + (int)(prog / 1000000.0f) + "MB" : + (prog > 1000.0f ? "" + (int)(prog / 1000.0f) + "kB" : "" + (int)prog + "B")) + ")") : "" + (int)(prog * 100.0f) + "%"), this.width / 2, top + 25, 0xFFFFFF); + }else { + long elapsed = (millis - startStartTime) / 1000l; + if(elapsed > 3) { + this.drawCenteredString(fontRendererObj, "(" + elapsed + "s)", this.width / 2, top + 25, 0xFFFFFF); + } + } + } + + super.drawScreen(par1, par2, par3); + } + + public void updateScreen() { + long millis = System.currentTimeMillis(); + if(millis - startStartTime > 6000l && SingleplayerServerController.canKillWorker()) { + killTask.enabled = true; + } + if(SingleplayerServerController.didLastCallFail() || !SingleplayerServerController.isIntegratedServerWorkerAlive()) { + onException.accept(this, SingleplayerServerController.worldStatusErrors()); + return; + } + if(checkTaskComplete.getAsBoolean()) { + this.mc.displayGuiScreen(menu); + } + String str = SingleplayerServerController.worldStatusString(); + if(!lastStatus.equals(str)) { + lastStatus = str; + currentStatus = str; + } + killTask.displayString = I18n.format(areYouSure > 0 ? "singleplayer.busy.confirmCancel" : "singleplayer.busy.killTask"); + if(areYouSure > 0) { + --areYouSure; + } + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + if(areYouSure <= 0) { + areYouSure = 80; + }else if(areYouSure <= 65) { + taskKill.run(); + } + } + } + + public boolean shouldHangupIntegratedServer() { + return false; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerCrashed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerCrashed.java new file mode 100644 index 0000000..fb97ea4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerCrashed.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenIntegratedServerCrashed extends GuiScreen { + + private GuiScreen mainmenu; + private String crashReport; + + public GuiScreenIntegratedServerCrashed(GuiScreen mainmenu, String crashReport) { + this.mainmenu = mainmenu; + this.crashReport = crashReport; + } + + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height - 50, I18n.format("singleplayer.crashed.continue"))); + ScaledResolution res = new ScaledResolution(mc); + int i = res.getScaleFactor(); + CrashScreen.showCrashReportOverlay(crashReport, 90 * i, 60 * i, (width - 180) * i, (height - 130) * i); + } + + public void onGuiClosed() { + CrashScreen.hideCrashReportOverlay(); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + + this.drawCenteredString(fontRendererObj, I18n.format("singleplayer.crashed.title"), this.width / 2, 25, 0xFFAAAA); + this.drawCenteredString(fontRendererObj, I18n.format("singleplayer.crashed.checkConsole"), this.width / 2, 40, 0xBBBBBB); + + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(mainmenu); + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerFailed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerFailed.java new file mode 100644 index 0000000..2e6a88b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerFailed.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenIntegratedServerFailed extends GuiScreen { + + private String str1; + private String str2; + private GuiScreen cont; + + public GuiScreenIntegratedServerFailed(String str1, String str2, GuiScreen cont) { + this.str1 = I18n.format(str1); + this.str2 = I18n.format(str2); + this.cont = cont; + } + + public GuiScreenIntegratedServerFailed(String str2, GuiScreen cont) { + this.str1 = I18n.format("singleplayer.failed.title"); + this.str2 = I18n.format(str2); + this.cont = cont; + } + + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 6 + 96, I18n.format("singleplayer.crashed.continue"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(fontRendererObj, str1, this.width / 2, 70, 11184810); + this.drawCenteredString(fontRendererObj, str2, this.width / 2, 90, 16777215); + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(cont); + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerStartup.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerStartup.java new file mode 100644 index 0000000..5b8e5c6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenIntegratedServerStartup.java @@ -0,0 +1,75 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.WorkerStartupFailedException; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.IPCPacket15Crashed; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSelectWorld; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenIntegratedServerStartup extends GuiScreen { + + private final GuiScreen backScreen; + private static final String[] dotDotDot = new String[] { "", ".", "..", "..." }; + + private int counter = 0; + + public GuiScreenIntegratedServerStartup(GuiScreen backScreen) { + this.backScreen = backScreen; + } + + protected void keyTyped(char parChar1, int parInt1) { + } + + public void initGui() { + this.buttonList.clear(); + } + + public void updateScreen() { + ++counter; + if(counter == 2) { + try { + SingleplayerServerController.startIntegratedServerWorker(); + }catch(WorkerStartupFailedException ex) { + mc.displayGuiScreen(new GuiScreenIntegratedServerFailed(ex.getMessage(), new GuiMainMenu())); + return; + } + }else if(counter > 2) { + IPCPacket15Crashed[] crashReport = SingleplayerServerController.worldStatusErrors(); + if(crashReport != null) { + mc.displayGuiScreen(GuiScreenIntegratedServerBusy.createException(new GuiMainMenu(), "singleplayer.failed.notStarted", crashReport)); + }else if(SingleplayerServerController.isIntegratedServerWorkerStarted()) { + GuiScreen cont = new GuiSelectWorld(backScreen); + if(SingleplayerServerController.isRunningSingleThreadMode()) { + cont = new GuiScreenIntegratedServerFailed("singleplayer.failed.singleThreadWarning.1", "singleplayer.failed.singleThreadWarning.2", cont); + } + mc.displayGuiScreen(cont); + } + } + } + + public void drawScreen(int i, int j, float f) { + this.drawBackground(0); + String txt = I18n.format("singleplayer.integratedStartup"); + int w = this.fontRendererObj.getStringWidth(txt); + this.drawString(this.fontRendererObj, txt + dotDotDot[(int)((System.currentTimeMillis() / 300L) % 4L)], (this.width - w) / 2, this.height / 2 - 50, 16777215); + super.drawScreen(i, j, f); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANConnect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANConnect.java new file mode 100644 index 0000000..c6b0aba --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANConnect.java @@ -0,0 +1,91 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenLANConnect extends GuiScreen { + + private final GuiScreen parent; + private GuiTextField codeTextField; + private final GuiNetworkSettingsButton relaysButton; + + private static String lastCode = ""; + + public GuiScreenLANConnect(GuiScreen parent) { + this.parent = parent; + this.relaysButton = new GuiNetworkSettingsButton(this); + } + + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("directConnect.lanWorldJoin"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel"))); + this.codeTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, this.height / 4 + 27, 200, 20); + this.codeTextField.setMaxStringLength(48); + this.codeTextField.setFocused(true); + this.codeTextField.setText(lastCode); + this.buttonList.get(0).enabled = this.codeTextField.getText().trim().length() > 0; + } + + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + lastCode = this.codeTextField.getText().trim(); + } + + protected void keyTyped(char par1, int par2) { + if (this.codeTextField.textboxKeyTyped(par1, par2)) { + ((GuiButton) this.buttonList.get(0)).enabled = this.codeTextField.getText().trim().length() > 0; + } else if (par2 == 28) { + this.actionPerformed(this.buttonList.get(0)); + } + } + + public void updateScreen() { + this.codeTextField.updateCursorCounter(); + } + + protected void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + this.codeTextField.mouseClicked(par1, par2, par3); + this.relaysButton.mouseClicked(par1, par2, par3); + } + + public void drawScreen(int xx, int yy, float pt) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectServer.direct"), this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("directConnect.lanWorldCode"), this.width / 2 - 100, this.height / 4 + 12, 10526880); + this.drawCenteredString(this.fontRendererObj, I18n.format("directConnect.networkSettingsNote"), this.width / 2, this.height / 4 + 63, 10526880); + this.drawCenteredString(this.fontRendererObj, I18n.format("directConnect.ipGrabNote"), this.width / 2, this.height / 4 + 77, 10526880); + this.codeTextField.drawTextBox(); + super.drawScreen(xx, yy, pt); + this.relaysButton.drawScreen(xx, yy); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 1) { + mc.displayGuiScreen(parent); + }else if(par1GuiButton.id == 0) { + mc.displayGuiScreen(new GuiScreenLANConnecting(parent, this.codeTextField.getText().trim())); + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANConnecting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANConnecting.java new file mode 100644 index 0000000..38b6ecb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANConnecting.java @@ -0,0 +1,125 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket; +import net.lax1dude.eaglercraft.v1_8.sp.socket.NetHandlerSingleplayerLogin; +import net.minecraft.client.LoadingScreenRenderer; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentText; + +import java.io.IOException; + +/** + * 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 GuiScreenLANConnecting extends GuiScreen { + + private final GuiScreen parent; + private final String code; + private final RelayServer relay; + + private boolean completed = false; + + private LANClientNetworkManager networkManager = null; + + private int renderCount = 0; + + public GuiScreenLANConnecting(GuiScreen parent, String code) { + this.parent = parent; + this.code = code; + this.relay = null; + } + + public GuiScreenLANConnecting(GuiScreen parent, String code, RelayServer relay) { + this.parent = parent; + this.code = code; + this.relay = relay; + } + + public boolean doesGuiPauseGame() { + return false; + } + + public void updateScreen() { + if(networkManager != null) { + if (networkManager.isChannelOpen()) { + try { + networkManager.processReceivedPackets(); + } catch (IOException ex) { + } + } else { + if (networkManager.checkDisconnected()) { + this.mc.getSession().reset(); + if (mc.currentScreen == this) { + mc.loadWorld(null); + mc.displayGuiScreen(new GuiDisconnected(parent, "connect.failed", new ChatComponentText("LAN Connection Refused"))); + } + } + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + if(completed) { + String message = I18n.format("connect.authorizing"); + this.drawString(fontRendererObj, message, (this.width - this.fontRendererObj.getStringWidth(message)) / 2, this.height / 3 + 10, 0xFFFFFF); + }else { + LoadingScreenRenderer ls = mc.loadingScreen; + + String message = I18n.format("lanServer.pleaseWait"); + this.drawString(fontRendererObj, message, (this.width - this.fontRendererObj.getStringWidth(message)) / 2, this.height / 3 + 10, 0xFFFFFF); + + PlatformWebRTC.startRTCLANClient(); + + if(++renderCount > 1) { + RelayServerSocket sock; + if(relay == null) { + sock = RelayManager.relayManager.getWorkingRelay((str) -> ls.resetProgressAndMessage("Connecting: " + str), 0x02, code); + }else { + sock = RelayManager.relayManager.connectHandshake(relay, 0x02, code); + } + if(sock == null) { + this.mc.displayGuiScreen(new GuiScreenNoRelays(parent, I18n.format("noRelay.worldNotFound1").replace("$code$", code), + I18n.format("noRelay.worldNotFound2").replace("$code$", code), I18n.format("noRelay.worldNotFound3"))); + return; + } + + networkManager = LANClientNetworkManager.connectToWorld(sock, code, sock.getURI()); + if(networkManager == null) { + this.mc.displayGuiScreen(new GuiDisconnected(parent, "connect.failed", new ChatComponentText(I18n.format("noRelay.worldFail").replace("$code$", code)))); + return; + } + + completed = true; + + this.mc.getSession().setLAN(); + this.mc.clearTitles(); + networkManager.setConnectionState(EnumConnectionState.LOGIN); + networkManager.setNetHandler(new NetHandlerSingleplayerLogin(networkManager, mc, parent)); + networkManager.sendPacket(new C00PacketLoginStart(this.mc.getSession().getProfile(), EaglerProfile.getSkinPacket())); + } + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANInfo.java new file mode 100644 index 0000000..8890ec3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANInfo.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * Copyright (c) 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 GuiScreenLANInfo extends GuiScreen { + private GuiScreen parent; + + public GuiScreenLANInfo(GuiScreen parent) { + this.parent = parent; + } + + public void initGui() { + buttonList.clear(); + buttonList.add(new GuiButton(0, this.width / 2 - 100, height / 6 + 168, I18n.format("gui.continue"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanInfo.title"), this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.fontRendererObj.drawSplitString(I18n.format("lanInfo.desc.0") + "\n\n\n" + I18n.format("lanInfo.desc.1", I18n.format("menu.multiplayer"), I18n.format("menu.openToLan")), this.width / 2 - 100, this.height / 4 - 60 + 60, 200, -6250336); + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + mc.displayGuiScreen(parent); + } + } + + private static boolean hasShown = false; + + public static GuiScreen showLANInfoScreen(GuiScreen cont) { + if(!hasShown) { + hasShown = true; + return new GuiScreenLANInfo(cont); + }else { + return cont; + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANNotSupported.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANNotSupported.java new file mode 100644 index 0000000..1d1fc59 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenLANNotSupported.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenLANNotSupported extends GuiScreen { + + private GuiScreen cont; + + public GuiScreenLANNotSupported(GuiScreen cont) { + this.cont = cont; + } + + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 6 + 96, I18n.format("singleplayer.crashed.continue"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(fontRendererObj, I18n.format("singleplayer.notSupported.title"), this.width / 2, 70, 11184810); + this.drawCenteredString(fontRendererObj, I18n.format("singleplayer.notSupported.desc"), this.width / 2, 90, 16777215); + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(cont); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java new file mode 100644 index 0000000..264238c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java @@ -0,0 +1,155 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import org.apache.commons.lang3.StringUtils; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenNameWorldImport extends GuiScreen { + private GuiScreen parentGuiScreen; + private GuiTextField theGuiTextField; + private GuiButton loadSpawnChunksBtn; + private GuiButton enhancedGameRulesBtn; + private int importFormat; + private FileChooserResult world; + private String name; + private boolean timeToImport = false; + private boolean definetlyTimeToImport = false; + private boolean isImporting = false; + private boolean loadSpawnChunks = false; + private boolean enhancedGameRules = true; + + public GuiScreenNameWorldImport(GuiScreen menu, FileChooserResult world, int format) { + this.parentGuiScreen = menu; + this.importFormat = format; + this.world = world; + this.name = world.fileName; + if(name.length() > 4 && (name.endsWith(".epk") || name.endsWith(".zip"))) { + name = name.substring(0, name.length() - 4); + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + if(!timeToImport) { + this.theGuiTextField.updateCursorCounter(); + } + if(definetlyTimeToImport && !isImporting) { + isImporting = true; + SingleplayerServerController.importWorld(GuiCreateWorld.func_146317_a(mc.getSaveLoader(), this.theGuiTextField.getText().trim()), world.fileData, importFormat, (byte) ((loadSpawnChunks ? 2 : 0) | (enhancedGameRules ? 1 : 0))); + mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen, "singleplayer.busy.importing." + (importFormat + 1), "singleplayer.failed.importing." + (importFormat + 1), () -> SingleplayerServerController.isReady())); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + if(!timeToImport) { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("singleplayer.import.continue"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel"))); + this.theGuiTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, this.height / 4 + 3, 200, 20); + this.theGuiTextField.setFocused(true); + this.theGuiTextField.setText(name); + this.buttonList.add(loadSpawnChunksBtn = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format("singleplayer.import.loadSpawnChunks", loadSpawnChunks ? I18n.format("gui.yes") : I18n.format("gui.no")))); + this.buttonList.add(enhancedGameRulesBtn = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format("singleplayer.import.enhancedGameRules", enhancedGameRules ? I18n.format("gui.yes") : I18n.format("gui.no")))); + } + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /** + * Fired when a control is clicked. This is the equivalent of + * ActionListener.actionPerformed(ActionEvent e). + */ + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id == 1) { + EagRuntime.clearFileChooserResult(); + this.mc.displayGuiScreen(this.parentGuiScreen); + } else if (par1GuiButton.id == 0) { + this.buttonList.clear(); + timeToImport = true; + } else if (par1GuiButton.id == 2) { + loadSpawnChunks = !loadSpawnChunks; + loadSpawnChunksBtn.displayString = I18n.format("singleplayer.import.loadSpawnChunks", loadSpawnChunks ? I18n.format("gui.yes") : I18n.format("gui.no")); + } else if (par1GuiButton.id == 3) { + enhancedGameRules = !enhancedGameRules; + enhancedGameRulesBtn.displayString = I18n.format("singleplayer.import.enhancedGameRules", enhancedGameRules ? I18n.format("gui.yes") : I18n.format("gui.no")); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char par1, int par2) { + this.theGuiTextField.textboxKeyTyped(par1, par2); + ((GuiButton) this.buttonList.get(0)).enabled = this.theGuiTextField.getText().trim().length() > 0; + + if (par1 == 13) { + this.actionPerformed((GuiButton) this.buttonList.get(0)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + if(!timeToImport) { + this.theGuiTextField.mouseClicked(par1, par2, par3); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + if(!timeToImport) { + this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.import.title"), this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("singleplayer.import.enterName"), this.width / 2 - 100, this.height / 4 - 60 + 50, 10526880); + this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.seedNote"), this.width / 2, this.height / 4 + 90, -6250336); + this.theGuiTextField.drawTextBox(); + }else { + definetlyTimeToImport = true; + long dots = (System.currentTimeMillis() / 500l) % 4l; + String str = I18n.format("singleplayer.import.reading", world.fileName); + this.drawString(fontRendererObj, str + (dots > 0 ? "." : "") + (dots > 1 ? "." : "") + (dots > 2 ? "." : ""), (this.width - this.fontRendererObj.getStringWidth(str)) / 2, this.height / 3 + 10, 0xFFFFFF); + } + super.drawScreen(par1, par2, par3); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNoRelays.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNoRelays.java new file mode 100644 index 0000000..d4402d2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNoRelays.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiScreenNoRelays extends GuiScreen { + + private GuiScreen parent; + private String title1; + private String title2; + private String title3; + + public GuiScreenNoRelays(GuiScreen parent, String title) { + this.parent = parent; + this.title1 = title; + this.title2 = null; + this.title3 = null; + } + + public GuiScreenNoRelays(GuiScreen parent, String title1, String title2, String title3) { + this.parent = parent; + this.title1 = title1; + this.title2 = title2; + this.title3 = title3; + } + + public void initGui() { + buttonList.clear(); + buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 - 60 + 145, I18n.format("gui.cancel"))); + buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 - 60 + 115, I18n.format("directConnect.lanWorldRelay"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format(title1), this.width / 2, this.height / 4 - 60 + 70, 16777215); + if(title2 != null) { + this.drawCenteredString(this.fontRendererObj, I18n.format(title2), this.width / 2, this.height / 4 - 60 + 80, 0xCCCCCC); + } + if(title3 != null) { + this.drawCenteredString(this.fontRendererObj, I18n.format(title3), this.width / 2, this.height / 4 - 60 + 90, 0xCCCCCC); + } + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + mc.displayGuiScreen(parent); + }else if(par1GuiButton.id == 1) { + mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenRelay(parent))); + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenRelay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenRelay.java new file mode 100644 index 0000000..da4a48c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenRelay.java @@ -0,0 +1,218 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.*; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +import java.io.IOException; + +/** + * 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 GuiScreenRelay extends GuiScreen implements GuiYesNoCallback { + + private final GuiScreen screen; + private GuiSlotRelay slots; + private boolean hasPinged; + private boolean addingNew = false; + private boolean deleting = false; + int selected; + + private GuiButton deleteRelay; + private GuiButton setPrimary; + + private String tooltipString = null; + + private long lastRefresh = 0l; + + public GuiScreenRelay(GuiScreen screen) { + this.screen = screen; + } + + public void initGui() { + selected = -1; + buttonList.clear(); + buttonList.add(new GuiButton(0, this.width / 2 + 54, this.height - 28, 100, 20, I18n.format("gui.done"))); + buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("networkSettings.add"))); + buttonList.add(deleteRelay = new GuiButton(2, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("networkSettings.delete"))); + buttonList.add(setPrimary = new GuiButton(3, this.width / 2 + 54, this.height - 52, 100, 20, I18n.format("networkSettings.default"))); + buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 28, 100, 20, I18n.format("networkSettings.refresh"))); + buttonList.add(new GuiButton(5, this.width / 2 - 154, this.height - 28, 100, 20, I18n.format("networkSettings.loadDefaults"))); + buttonList.add(new GuiButton(6, this.width - 100, 0, 100, 20, I18n.format("networkSettings.downloadRelay"))); + updateButtons(); + this.slots = new GuiSlotRelay(this); + if(!hasPinged) { + hasPinged = true; + slots.relayManager.ping(); + } + } + + void updateButtons() { + if(selected < 0) { + deleteRelay.enabled = false; + setPrimary.enabled = false; + }else { + deleteRelay.enabled = true; + setPrimary.enabled = true; + } + } + + public void actionPerformed(GuiButton btn) { + if(btn.id == 0) { + RelayManager.relayManager.save(); + mc.displayGuiScreen(screen); + } else if(btn.id == 1) { + addingNew = true; + mc.displayGuiScreen(new GuiScreenAddRelay(this)); + } else if(btn.id == 2) { + if(selected >= 0) { + RelayServer srv = RelayManager.relayManager.get(selected); + mc.displayGuiScreen(new GuiYesNo(this, I18n.format("networkSettings.delete"), I18n.format("addRelay.removeText1") + + EnumChatFormatting.GRAY + " '" + srv.comment + "' (" + srv.address + ")", selected)); + deleting = true; + } + } else if(btn.id == 3) { + if(selected >= 0) { + slots.relayManager.setPrimary(selected); + selected = 0; + } + } else if(btn.id == 4) { + long millis = System.currentTimeMillis(); + if(millis - lastRefresh > 700l) { + lastRefresh = millis; + slots.relayManager.ping(); + } + lastRefresh += 60l; + } else if(btn.id == 5) { + slots.relayManager.loadDefaults(); + long millis = System.currentTimeMillis(); + if(millis - lastRefresh > 700l) { + lastRefresh = millis; + slots.relayManager.ping(); + } + lastRefresh += 60l; + } else if(btn.id == 6) { + EagRuntime.downloadFileWithName("EaglerSPRelay.zip", EagRuntime.getResourceBytes("relay_download.zip")); + } + } + + public void updateScreen() { + slots.relayManager.update(); + } + + private int mx = 0; + private int my = 0; + + int getFrameMouseX() { + return mx; + } + + int getFrameMouseY() { + return my; + } + + public void drawScreen(int par1, int par2, float par3) { + mx = par1; + my = par2; + slots.drawScreen(par1, par2, par3); + + if(tooltipString != null) { + int ww = mc.fontRendererObj.getStringWidth(tooltipString); + Gui.drawRect(par1 + 1, par2 - 14, par1 + ww + 7, par2 - 2, 0xC0000000); + screen.drawString(mc.fontRendererObj, tooltipString, par1 + 4, par2 - 12, 0xFF999999); + tooltipString = null; + } + + this.drawCenteredString(fontRendererObj, I18n.format("networkSettings.title"), this.width / 2, 16, 16777215); + + String str = I18n.format("networkSettings.relayTimeout") + " " + mc.gameSettings.relayTimeout; + int w = fontRendererObj.getStringWidth(str); + this.drawString(fontRendererObj, str, 3, 3, 0xDDDDDD); + + GlStateManager.pushMatrix(); + GlStateManager.translate(w + 7, 4, 0.0f); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + str = EnumChatFormatting.UNDERLINE + I18n.format("networkSettings.relayTimeoutChange"); + int w2 = fontRendererObj.getStringWidth(str); + boolean b = par1 > w + 5 && par1 < w + 7 + w2 * 3 / 4 && par2 > 3 && par2 < 11; + if(b) Mouse.showCursor(EnumCursorType.HAND); + this.drawString(fontRendererObj, EnumChatFormatting.UNDERLINE + I18n.format("networkSettings.relayTimeoutChange"), 0, 0, b ? 0xCCCCCC : 0x999999); + GlStateManager.popMatrix(); + + super.drawScreen(par1, par2, par3); + } + + protected void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + if(par3 == 0) { + String str = I18n.format("networkSettings.relayTimeout") + " " + mc.gameSettings.relayTimeout; + int w = fontRendererObj.getStringWidth(str); + str = I18n.format("networkSettings.relayTimeoutChange"); + int w2 = fontRendererObj.getStringWidth(str); + if(par1 > w + 5 && par1 < w + 7 + w2 * 3 / 4 && par2 > 3 && par2 < 11) { + this.mc.displayGuiScreen(new GuiScreenChangeRelayTimeout(this)); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } + } + } + + void setToolTip(String str) { + tooltipString = str; + } + + String addNewName; + String addNewAddr; + boolean addNewPrimary; + + public void confirmClicked(boolean par1, int par2) { + if(par1) { + if(addingNew) { + RelayManager.relayManager.addNew(addNewAddr, addNewName, addNewPrimary); + addNewAddr = null; + addNewName = null; + addNewPrimary = false; + selected = -1; + updateButtons(); + }else if(deleting) { + RelayManager.relayManager.remove(par2); + selected = -1; + updateButtons(); + } + } + addingNew = false; + deleting = false; + this.mc.displayGuiScreen(this); + } + + static Minecraft getMinecraft(GuiScreenRelay screen) { + return screen.mc; + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.slots.handleMouseInput(); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenSingleplayerConnecting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenSingleplayerConnecting.java new file mode 100644 index 0000000..ff7d193 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenSingleplayerConnecting.java @@ -0,0 +1,127 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager; +import net.lax1dude.eaglercraft.v1_8.sp.socket.NetHandlerSingleplayerLogin; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentText; + +/** + * 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 GuiScreenSingleplayerConnecting extends GuiScreen { + + private GuiScreen menu; + private String message; + private GuiButton killTask; + private ClientIntegratedServerNetworkManager networkManager = null; + private int timer = 0; + + private long startStartTime; + private boolean hasOpened = false; + + public GuiScreenSingleplayerConnecting(GuiScreen menu, String message) { + this.menu = menu; + this.message = message; + } + + public void initGui() { + if(startStartTime == 0) this.startStartTime = System.currentTimeMillis(); + this.buttonList.add(killTask = new GuiButton(0, this.width / 2 - 100, this.height / 3 + 50, I18n.format("singleplayer.busy.killTask"))); + killTask.enabled = false; + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + float f = 2.0f; + int top = this.height / 3; + + long millis = System.currentTimeMillis(); + + long dots = (millis / 500l) % 4l; + this.drawString(fontRendererObj, message + (dots > 0 ? "." : "") + (dots > 1 ? "." : "") + (dots > 2 ? "." : ""), (this.width - this.fontRendererObj.getStringWidth(message)) / 2, top + 10, 0xFFFFFF); + + long elapsed = (millis - startStartTime) / 1000l; + if(elapsed > 3) { + this.drawCenteredString(fontRendererObj, "(" + elapsed + "s)", this.width / 2, top + 25, 0xFFFFFF); + } + + super.drawScreen(par1, par2, par3); + } + + public boolean doesGuiPauseGame() { + return false; + } + + public void updateScreen() { + ++timer; + if (timer > 1) { + if (this.networkManager == null) { + this.networkManager = SingleplayerServerController.localPlayerNetworkManager; + this.networkManager.connect(); + } else { + if (this.networkManager.isChannelOpen()) { + if (!hasOpened) { + hasOpened = true; + this.mc.getSession().setLAN(); + this.mc.clearTitles(); + this.networkManager.setConnectionState(EnumConnectionState.LOGIN); + this.networkManager.setNetHandler(new NetHandlerSingleplayerLogin(this.networkManager, this.mc, this.menu)); + this.networkManager.sendPacket(new C00PacketLoginStart(this.mc.getSession().getProfile(), EaglerProfile.getSkinPacket())); + } + try { + this.networkManager.processReceivedPackets(); + } catch (IOException ex) { + } + } else { + if (this.networkManager.checkDisconnected()) { + this.mc.getSession().reset(); + if (mc.currentScreen == this) { + mc.loadWorld(null); + mc.displayGuiScreen(new GuiDisconnected(menu, "connect.failed", new ChatComponentText("Worker Connection Refused"))); + } + } + } + } + } + + long millis = System.currentTimeMillis(); + if(millis - startStartTime > 6000l && SingleplayerServerController.canKillWorker()) { + killTask.enabled = true; + } + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + SingleplayerServerController.killWorker(); + this.mc.loadWorld((WorldClient)null); + this.mc.getSession().reset(); + this.mc.displayGuiScreen(menu); + } + } + + public boolean shouldHangupIntegratedServer() { + return false; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java new file mode 100644 index 0000000..d7bd7b3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java @@ -0,0 +1,198 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.minecraft.client.LoadingScreenRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.WorldSettings; + +/** + * 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 GuiShareToLan extends GuiScreen { + /** + * A reference to the screen object that created this. Used for navigating + * between screens. + */ + private final GuiScreen parentScreen; + private GuiButton buttonAllowCommandsToggle; + private GuiButton buttonGameMode; + private GuiButton buttonHiddenToggle; + + /** + * The currently selected game mode. One of 'survival', 'creative', or + * 'adventure' + */ + private String gameMode; + + /** + * True if 'Allow Cheats' is currently enabled + */ + private boolean allowCommands = false; + + private final GuiNetworkSettingsButton relaysButton; + + private boolean hiddenToggle = false; + + private GuiTextField codeTextField; + + public GuiShareToLan(GuiScreen par1GuiScreen, String gameMode) { + this.parentScreen = par1GuiScreen; + this.relaysButton = new GuiNetworkSettingsButton(this); + this.gameMode = gameMode; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 140, 20, + I18n.format("lanServer.start"))); + this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 140, 20, + I18n.format("gui.cancel"))); + this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 135, 140, 20, + I18n.format("selectWorld.gameMode"))); + this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 135, 140, 20, + I18n.format("selectWorld.allowCommands"))); + this.buttonGameMode.enabled = this.buttonAllowCommandsToggle.enabled = !mc.isDemo(); + this.buttonList.add(this.buttonHiddenToggle = new GuiButton(105, this.width / 2 - 75, 165, 140, 20, + I18n.format("lanServer.hidden"))); + this.codeTextField = new GuiTextField(0, this.fontRendererObj, this.width / 2 - 100, 80, 200, 20); + this.codeTextField.setText(mc.thePlayer.getName() + "'s World"); + this.codeTextField.setFocused(true); + this.codeTextField.setMaxStringLength(252); + this.func_74088_g(); + } + + private void func_74088_g() { + this.buttonGameMode.displayString = I18n.format("selectWorld.gameMode") + ": " + + I18n.format("selectWorld.gameMode." + this.gameMode); + this.buttonAllowCommandsToggle.displayString = I18n.format("selectWorld.allowCommands") + + " "; + this.buttonHiddenToggle.displayString = I18n.format("lanServer.hidden") + + " "; + + if (this.allowCommands) { + this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + + I18n.format("options.on"); + } else { + this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + + I18n.format("options.off"); + } + + if (this.hiddenToggle) { + this.buttonHiddenToggle.displayString = this.buttonHiddenToggle.displayString + + I18n.format("options.on"); + } else { + this.buttonHiddenToggle.displayString = this.buttonHiddenToggle.displayString + + I18n.format("options.off"); + } + } + + /** + * Fired when a control is clicked. This is the equivalent of + * ActionListener.actionPerformed(ActionEvent e). + */ + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.id == 102) { + this.mc.displayGuiScreen(this.parentScreen); + } else if (par1GuiButton.id == 104) { + if(!mc.isDemo()) { + if (this.gameMode.equals("survival")) { + this.gameMode = "creative"; + } else if (this.gameMode.equals("creative")) { + this.gameMode = "adventure"; + } else if (this.gameMode.equals("adventure")) { + this.gameMode = "spectator"; + } else { + this.gameMode = "survival"; + } + + this.func_74088_g(); + } + } else if (par1GuiButton.id == 103) { + if(!mc.isDemo()) { + this.allowCommands = !this.allowCommands; + this.func_74088_g(); + } + } else if (par1GuiButton.id == 105) { + this.hiddenToggle = !this.hiddenToggle; + this.func_74088_g(); + } else if (par1GuiButton.id == 101) { + if (LANServerController.isLANOpen()) { + return; + } + PlatformWebRTC.startRTCLANServer(); + String worldName = this.codeTextField.getText().trim(); + if (worldName.isEmpty()) { + worldName = mc.thePlayer.getName() + "'s World"; + } + if (worldName.length() >= 252) { + worldName = worldName.substring(0, 252); + } + this.mc.displayGuiScreen(null); + LoadingScreenRenderer ls = mc.loadingScreen; + String code = LANServerController.shareToLAN((str) -> ls.resetProgressAndMessage(str), worldName, hiddenToggle); + if (code != null) { + SingleplayerServerController.configureLAN(WorldSettings.GameType.getByName(this.gameMode), this.allowCommands); + this.mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(I18n.format("lanServer.opened") + .replace("$relay$", LANServerController.getCurrentURI()).replace("$code$", code))); + } else { + SingleplayerServerController.configureLAN(mc.theWorld.getWorldInfo().getGameType(), false); + this.mc.displayGuiScreen(new GuiScreenNoRelays(this, "noRelay.titleFail")); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.title"), this.width / 2, + 35, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.worldName"), this.width / 2, + 62, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.otherPlayers"), + this.width / 2, 112, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.ipGrabNote"), + this.width / 2, 195, 16777215); + super.drawScreen(par1, par2, par3); + this.relaysButton.drawScreen(par1, par2); + this.codeTextField.drawTextBox(); + } + + public void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + this.relaysButton.mouseClicked(par1, par2, par3); + this.codeTextField.mouseClicked(par1, par2, par3); + } + + protected void keyTyped(char c, int k) { + super.keyTyped(c, k); + this.codeTextField.textboxKeyTyped(c, k); + } + + public void updateScreen() { + super.updateScreen(); + this.codeTextField.updateCursorCounter(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiSlider2.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiSlider2.java new file mode 100644 index 0000000..12dc29c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiSlider2.java @@ -0,0 +1,103 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; + +/** + * 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 GuiSlider2 extends GuiButton { + /** The value of this slider control. */ + public float sliderValue = 1.0F; + public float sliderMax = 1.0F; + + /** Is this slider control being dragged. */ + public boolean dragging = false; + + public GuiSlider2(int par1, int par2, int par3, int par4, int par5, float par6, float par7) { + super(par1, par2, par3, par4, par5, (int)(par6 * par7 * 100.0F) + "%"); + this.sliderValue = par6; + this.sliderMax = par7; + } + + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this + * button and 2 if it IS hovering over this button. + */ + protected int getHoverState(boolean par1) { + return 0; + } + + /** + * Fired when the mouse button is dragged. Equivalent of + * MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) { + if (this.visible) { + if (this.dragging) { + this.sliderValue = (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8); + + if (this.sliderValue < 0.0F) { + this.sliderValue = 0.0F; + } + + if (this.sliderValue > 1.0F) { + this.sliderValue = 1.0F; + } + + this.displayString = (int)(this.sliderValue * this.sliderMax * 100.0F) + "%"; + } + + if(this.enabled) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of + * MouseListener.mousePressed(MouseEvent e). + */ + public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { + if (super.mousePressed(par1Minecraft, par2, par3)) { + this.sliderValue = (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8); + + if (this.sliderValue < 0.0F) { + this.sliderValue = 0.0F; + } + + if (this.sliderValue > 1.0F) { + this.sliderValue = 1.0F; + } + + this.displayString = (int)(this.sliderValue * this.sliderMax * 100.0F) + "%"; + this.dragging = true; + return true; + } else { + return false; + } + } + + /** + * Fired when the mouse button is released. Equivalent of + * MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int par1, int par2) { + this.dragging = false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiSlotRelay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiSlotRelay.java new file mode 100644 index 0000000..f9eee32 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiSlotRelay.java @@ -0,0 +1,150 @@ +package net.lax1dude.eaglercraft.v1_8.sp.gui; + +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQuery; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.util.ResourceLocation; + +/** + * 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. + * + */ +class GuiSlotRelay extends GuiSlot { + + private static final ResourceLocation eaglerGuiTex = new ResourceLocation("eagler:gui/eagler_gui.png"); + + final GuiScreenRelay screen; + final RelayManager relayManager; + + public GuiSlotRelay(GuiScreenRelay screen) { + super(GuiScreenRelay.getMinecraft(screen), screen.width, screen.height, 32, screen.height - 64, 26); + this.screen = screen; + this.relayManager = RelayManager.relayManager; + } + + @Override + protected int getSize() { + return relayManager.count(); + } + + @Override + protected void elementClicked(int var1, boolean var2, int var3, int var4) { + screen.selected = var1; + screen.updateButtons(); + } + + @Override + protected boolean isSelected(int var1) { + return screen.selected == var1; + } + + @Override + protected void drawBackground() { + screen.drawDefaultBackground(); + } + + @Override + protected void drawSlot(int id, int xx, int yy, int width, int height, int ii) { + if(id < relayManager.count()) { + this.mc.getTextureManager().bindTexture(Gui.icons); + RelayServer srv = relayManager.get(id); + String comment = srv.comment; + int var15 = 0; + int var16 = 0; + String str = null; + int h = 12; + long ping = srv.getPing(); + if(ping == 0l) { + var16 = 5; + str = "No Connection"; + }else if(ping < 0l) { + var15 = 1; + var16 = (int) (Minecraft.getSystemTime() / 100L + (long) (id * 2) & 7L); + if (var16 > 4) { + var16 = 8 - var16; + } + str = "Polling..."; + }else { + RelayQuery.VersionMismatch vm = srv.getPingCompatible(); + if(!vm.isCompatible()) { + var16 = 5; + switch(vm) { + case CLIENT_OUTDATED: + str = "Outdated Client!"; + break; + case RELAY_OUTDATED: + str = "Outdated Relay!"; + break; + default: + case UNKNOWN: + str = "Incompatible Relay!"; + break; + } + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GlStateManager.pushMatrix(); + GlStateManager.translate(xx + 205, yy + 11, 0.0f); + GlStateManager.scale(0.6f, 0.6f, 0.6f); + screen.drawTexturedModalRect(0, 0, 0, 144, 16, 16); + GlStateManager.popMatrix(); + h += 10; + }else { + String pingComment = srv.getPingComment().trim(); + if(pingComment.length() > 0) { + comment = pingComment; + } + str = "" + ping + "ms"; + if (ping < 150L) { + var16 = 0; + } else if (ping < 300L) { + var16 = 1; + } else if (ping < 600L) { + var16 = 2; + } else if (ping < 1000L) { + var16 = 3; + } else { + var16 = 4; + } + } + } + + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + screen.drawTexturedModalRect(xx + 205, yy, 0 + var15 * 10, 176 + var16 * 8, 10, 8); + if(srv.isPrimary()) { + GlStateManager.pushMatrix(); + GlStateManager.translate(xx + 4, yy + 5, 0.0f); + GlStateManager.scale(0.8f, 0.8f, 0.8f); + this.mc.getTextureManager().bindTexture(eaglerGuiTex); + screen.drawTexturedModalRect(0, 0, 48, 0, 16, 16); + GlStateManager.popMatrix(); + } + + screen.drawString(mc.fontRendererObj, comment, xx + 22, yy + 2, 0xFFFFFFFF); + screen.drawString(mc.fontRendererObj, srv.address, xx + 22, yy + 12, 0xFF999999); + + if(str != null) { + int mx = screen.getFrameMouseX(); + int my = screen.getFrameMouseY(); + int rx = xx + 202; + if(mx > rx && mx < rx + 13 && my > yy - 1 && my < yy + h) { + screen.setToolTip(str); + } + } + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCInputStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCInputStream.java new file mode 100644 index 0000000..1022033 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCInputStream.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.IOException; +import java.io.InputStream; + +/** + * 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 IPCInputStream extends InputStream { + + private byte[] currentBuffer = null; + private int idx = 0; + private int markIDX = 0; + private String errorName = null; + + public void feedBuffer(byte[] b) { + currentBuffer = b; + idx = 0; + errorName = null; + markIDX = 0; + } + + public void nameBuffer(String str) { + errorName = str; + } + + @Override + public int read() throws IOException { + try { + return ((int)currentBuffer[idx++]) & 0xFF; + }catch(ArrayIndexOutOfBoundsException a) { + throw new IOException("IPCInputStream buffer underflow" + (errorName == null ? "," : (" (while deserializing '" + errorName + "')")) + " no bytes remaining", a); + } + } + + @Override + public int read(byte b[], int off, int len) throws IOException { + if(idx + len > currentBuffer.length) { + throw new IOException("IPCInputStream buffer underflow" + (errorName == null ? "," : (" (while deserializing '" + errorName + "')")) + " tried to read " + len + " when there are only " + (currentBuffer.length - idx) + " bytes remaining", new ArrayIndexOutOfBoundsException(idx + len - 1)); + } + if(off + len > b.length) { + throw new ArrayIndexOutOfBoundsException(off + len - 1); + } + System.arraycopy(currentBuffer, idx, b, off, len); + idx += len; + return len; + } + + public void markIndex() { + markIDX = idx; + } + + public void rewindIndex() { + idx = markIDX; + } + + public byte[] getLeftover() { + if(currentBuffer.length - idx <= 0) { + return null; + } + + byte[] buf = new byte[currentBuffer.length - idx]; + System.arraycopy(currentBuffer, idx, buf, 0, currentBuffer.length - idx); + + return buf; + } + + public int getLeftoverCount() { + return currentBuffer.length - idx; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCOutputStream.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCOutputStream.java new file mode 100644 index 0000000..e5aa8fd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCOutputStream.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * 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 IPCOutputStream extends OutputStream { + + private String className = null; + private byte[] currentBuffer = null; + private int idx = 0; + private int originalSize = 0; + + public void feedBuffer(byte[] buf, String clazzName) { + currentBuffer = buf; + idx = 0; + originalSize = buf.length; + className = clazzName; + } + + public byte[] returnBuffer() { + if(className != null && currentBuffer.length != originalSize) { + System.err.println("WARNING: Packet '" + className + "' was supposed to be " + originalSize + " bytes but buffer has grown by " + (currentBuffer.length - originalSize) + " to " + currentBuffer.length + " bytes"); + } + return currentBuffer; + } + + void growBuffer(int i) { + int ii = currentBuffer.length; + int iii = i - ii; + if(iii > 0) { + byte[] n = new byte[i]; + System.arraycopy(currentBuffer, 0, n, 0, ii); + currentBuffer = n; + } + } + + @Override + public void write(int b) throws IOException { + if(idx >= currentBuffer.length) { + growBuffer(idx + 1); + } + currentBuffer[idx++] = (byte) b; + } + + @Override + public void write(byte b[], int off, int len) throws IOException { + if(idx + len > currentBuffer.length) { + growBuffer(idx + len); + } + System.arraycopy(b, off, currentBuffer, idx, len); + idx += len; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket00StartServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket00StartServer.java new file mode 100644 index 0000000..a8d4f98 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket00StartServer.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket00StartServer implements IPCPacketBase { + + public static final int ID = 0x00; + + public String worldName; + public String ownerName; + public int initialDifficulty; + public int initialViewDistance; + public boolean demoMode; + + public IPCPacket00StartServer() { + } + + public IPCPacket00StartServer(String worldName, String ownerName, int initialDifficulty, int initialViewDistance, boolean demoMode) { + this.worldName = worldName; + this.ownerName = ownerName; + this.initialDifficulty = initialDifficulty; + this.initialViewDistance = initialViewDistance; + this.demoMode = demoMode; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldName = bin.readUTF(); + ownerName = bin.readUTF(); + initialDifficulty = bin.readByte(); + initialViewDistance = bin.readByte(); + demoMode = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + bin.writeUTF(ownerName); + bin.writeByte(initialDifficulty); + bin.writeByte(initialViewDistance); + bin.writeBoolean(demoMode); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName) + IPCPacketBase.strLen(ownerName) + 3; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket01StopServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket01StopServer.java new file mode 100644 index 0000000..0864015 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket01StopServer.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket01StopServer implements IPCPacketBase { + + public static final int ID = 0x01; + + public IPCPacket01StopServer() { + } + + @Override + public void deserialize(DataInput bin) throws IOException { + } + + @Override + public void serialize(DataOutput bin) throws IOException { + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 0; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket02InitWorld.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket02InitWorld.java new file mode 100644 index 0000000..d7817c1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket02InitWorld.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket02InitWorld implements IPCPacketBase { + + public static final int ID = 0x02; + + public String worldName; + public byte gamemode; + public byte worldType; + public String worldArgs; + public long seed; + public boolean cheats; + public boolean structures; + public boolean bonusChest; + public boolean hardcore; + + public IPCPacket02InitWorld() { + } + + public IPCPacket02InitWorld(String worldName, int gamemode, int worldType, String worldArgs, long seed, boolean cheats, boolean structures, boolean bonusChest, boolean hardcore) { + this.worldName = worldName; + this.gamemode = (byte)gamemode; + this.worldType = (byte)worldType; + this.worldArgs = worldArgs; + this.seed = seed; + this.cheats = cheats; + this.structures = structures; + this.bonusChest = bonusChest; + this.hardcore = hardcore; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldName = bin.readUTF(); + gamemode = bin.readByte(); + worldType = bin.readByte(); + worldArgs = bin.readUTF(); + seed = bin.readLong(); + cheats = bin.readBoolean(); + structures = bin.readBoolean(); + bonusChest = bin.readBoolean(); + hardcore = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + bin.writeByte(gamemode); + bin.writeByte(worldType); + bin.writeUTF(worldArgs); + bin.writeLong(seed); + bin.writeBoolean(cheats); + bin.writeBoolean(structures); + bin.writeBoolean(bonusChest); + bin.writeBoolean(hardcore); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName) + 1 + 1 + IPCPacketBase.strLen(worldArgs) + 8 + 4; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket03DeleteWorld.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket03DeleteWorld.java new file mode 100644 index 0000000..30aeec8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket03DeleteWorld.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket03DeleteWorld implements IPCPacketBase { + + public static final int ID = 0x03; + + public String worldName; + + public IPCPacket03DeleteWorld() { + } + + public IPCPacket03DeleteWorld(String worldName) { + this.worldName = worldName; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldName = bin.readUTF(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket04RenameWorld.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket04RenameWorld.java new file mode 100644 index 0000000..c403798 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket04RenameWorld.java @@ -0,0 +1,67 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket04RenameWorld implements IPCPacketBase { + + public static final int ID = 0x04; + + public String worldOldName; + public String worldNewName; + public String displayName; + public boolean copy; + + public IPCPacket04RenameWorld() { + } + + public IPCPacket04RenameWorld(String worldOldName, String worldNewName, String displayName, boolean copy) { + this.worldOldName = worldOldName; + this.worldNewName = worldNewName; + this.displayName = displayName; + this.copy = copy; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldOldName = bin.readUTF(); + worldNewName = bin.readUTF(); + displayName = bin.readUTF(); + copy = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldOldName); + bin.writeUTF(worldNewName); + bin.writeUTF(displayName); + bin.writeBoolean(copy); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldOldName) + IPCPacketBase.strLen(worldNewName) + IPCPacketBase.strLen(displayName) + 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket05RequestData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket05RequestData.java new file mode 100644 index 0000000..a809f78 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket05RequestData.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket05RequestData implements IPCPacketBase { + + public static final int ID = 0x05; + + public static final byte REQUEST_LEVEL_DAT = 0x00; + public static final byte REQUEST_LEVEL_EAG = 0x01; + public static final byte REQUEST_LEVEL_MCA = 0x02; + + public String worldName; + public byte request; + + public IPCPacket05RequestData() { + } + + public IPCPacket05RequestData(String worldName, byte request) { + this.worldName = worldName; + this.request = request; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldName = bin.readUTF(); + request = bin.readByte(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + bin.writeByte(request); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName) + 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket06RenameWorldNBT.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket06RenameWorldNBT.java new file mode 100644 index 0000000..ed9e577 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket06RenameWorldNBT.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket06RenameWorldNBT implements IPCPacketBase { + + public static final int ID = 0x06; + + public String worldName; + public String displayName; + public boolean duplicate; + + public IPCPacket06RenameWorldNBT() { + } + + public IPCPacket06RenameWorldNBT(String worldName, String displayName, boolean duplicate) { + this.worldName = worldName; + this.displayName = displayName; + this.duplicate = duplicate; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + this.worldName = bin.readUTF(); + this.displayName = bin.readUTF(); + this.duplicate = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + bin.writeUTF(displayName); + bin.writeBoolean(duplicate); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName) + IPCPacketBase.strLen(displayName) + 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket07ImportWorld.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket07ImportWorld.java new file mode 100644 index 0000000..9ddf8ed --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket07ImportWorld.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket07ImportWorld implements IPCPacketBase { + + public static final int ID = 0x07; + public byte gameRules; + + public String worldName; + public byte[] worldData; + public byte worldFormat; + + public static final byte WORLD_FORMAT_EAG = 0x00; + public static final byte WORLD_FORMAT_MCA = 0x01; + + public IPCPacket07ImportWorld() { + } + + public IPCPacket07ImportWorld(String worldName, byte[] worldData, byte worldFormat, byte gameRules) { + this.worldName = worldName; + this.worldData = worldData; + this.worldFormat = worldFormat; + this.gameRules = gameRules; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldName = bin.readUTF(); + worldData = new byte[bin.readInt()]; + worldFormat = bin.readByte(); + gameRules = bin.readByte(); + bin.readFully(worldData); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + bin.writeInt(worldData.length); + bin.writeByte(worldFormat); + bin.writeByte(gameRules); + bin.write(worldData); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName) + worldData.length + 6; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket09RequestResponse.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket09RequestResponse.java new file mode 100644 index 0000000..23968a9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket09RequestResponse.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket09RequestResponse implements IPCPacketBase { + + public static final int ID = 0x09; + + public byte[] response; + + public IPCPacket09RequestResponse() { + } + + public IPCPacket09RequestResponse(byte[] dat) { + this.response = dat; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + response = new byte[bin.readInt()]; + bin.readFully(response); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeInt(response.length); + bin.write(response); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 4 + response.length; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0ASetWorldDifficulty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0ASetWorldDifficulty.java new file mode 100644 index 0000000..4b29f09 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0ASetWorldDifficulty.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket0ASetWorldDifficulty implements IPCPacketBase { + + public static final int ID = 0x0A; + + public byte difficulty; + + public IPCPacket0ASetWorldDifficulty() { + } + + public IPCPacket0ASetWorldDifficulty(byte difficulty) { + this.difficulty = difficulty; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + difficulty = bin.readByte(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeByte(difficulty); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0BPause.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0BPause.java new file mode 100644 index 0000000..c11bd2b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0BPause.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket0BPause implements IPCPacketBase { + + public static final int ID = 0x0B; + + public boolean pause; + + public IPCPacket0BPause() { + } + + public IPCPacket0BPause(boolean pause) { + this.pause = pause; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + pause = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeBoolean(pause); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0CPlayerChannel.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0CPlayerChannel.java new file mode 100644 index 0000000..803ea1d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0CPlayerChannel.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket0CPlayerChannel implements IPCPacketBase { + + public static final int ID = 0x0C; + + public String channel; + public boolean open; + + public IPCPacket0CPlayerChannel() { + } + + public IPCPacket0CPlayerChannel(String channel, boolean open) { + this.channel = channel; + this.open = open; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + channel = bin.readUTF(); + open = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(channel); + bin.writeBoolean(open); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(channel) + 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0DProgressUpdate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0DProgressUpdate.java new file mode 100644 index 0000000..b78ae70 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0DProgressUpdate.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket0DProgressUpdate implements IPCPacketBase { + + public static final int ID = 0x0D; + + public String updateMessage; + public float updateProgress; + + public IPCPacket0DProgressUpdate() { + } + + public IPCPacket0DProgressUpdate(String updateMessage, float updateProgress) { + this.updateMessage = updateMessage == null ? "" : updateMessage; + this.updateProgress = updateProgress; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + updateMessage = bin.readUTF(); + updateProgress = bin.readFloat(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(updateMessage); + bin.writeFloat(updateProgress); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(updateMessage) + 4; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0EListWorlds.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0EListWorlds.java new file mode 100644 index 0000000..1649ad9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0EListWorlds.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket0EListWorlds implements IPCPacketBase { + + public static final int ID = 0x0E; + + public IPCPacket0EListWorlds() { + } + + @Override + public void deserialize(DataInput bin) throws IOException { + } + + @Override + public void serialize(DataOutput bin) throws IOException { + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 0; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0FListFiles.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0FListFiles.java new file mode 100644 index 0000000..099c89e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket0FListFiles.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket0FListFiles implements IPCPacketBase { + + public static final int ID = 0x0F; + + public String path; + + public IPCPacket0FListFiles() { + } + + public IPCPacket0FListFiles(String path) { + this.path = path; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + this.path = bin.readUTF(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(path); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(path); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket10FileRead.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket10FileRead.java new file mode 100644 index 0000000..7395562 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket10FileRead.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket10FileRead implements IPCPacketBase { + + public static final int ID = 0x10; + + public String file; + + public IPCPacket10FileRead() { + } + + public IPCPacket10FileRead(String file) { + this.file = file; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + file = bin.readUTF(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(file); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(file); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket12FileWrite.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket12FileWrite.java new file mode 100644 index 0000000..1445196 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket12FileWrite.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket12FileWrite implements IPCPacketBase { + + public static final int ID = 0x12; + + public String path; + public byte[] data; + + public IPCPacket12FileWrite() { + } + + public IPCPacket12FileWrite(String path, byte[] data) { + this.path = path; + this.data = data; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + path = bin.readUTF(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(path); + bin.writeInt(data.length); + bin.write(data); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(path) + 4 + data.length; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket13FileCopyMove.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket13FileCopyMove.java new file mode 100644 index 0000000..7a1296a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket13FileCopyMove.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket13FileCopyMove implements IPCPacketBase { + + public static final int ID = 0x13; + + public String fileOldName; + public String fileNewName; + public boolean copy; + + public IPCPacket13FileCopyMove() { + } + + public IPCPacket13FileCopyMove(String fileOldName, String fileNewName, boolean copy) { + this.fileOldName = fileOldName; + this.fileNewName = fileNewName; + this.copy = copy; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + fileOldName = bin.readUTF(); + fileNewName = bin.readUTF(); + copy = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(fileOldName); + bin.writeUTF(fileNewName); + bin.writeBoolean(copy); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(fileOldName) + IPCPacketBase.strLen(fileNewName) + 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java new file mode 100644 index 0000000..b8b7da3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java @@ -0,0 +1,95 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * 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 IPCPacket14StringList implements IPCPacketBase { + + public static final int ID = 0x14; + + public static final int FILE_LIST = 0x0; + public static final int LOCALE = 0x1; + public static final int STAT_GUID = 0x2; + public static final int SERVER_TPS = 0x3; + + public int opCode; + public final List stringList; + + public IPCPacket14StringList() { + stringList = new ArrayList(); + } + + public IPCPacket14StringList(int opcode, String[] list) { + stringList = new ArrayList(); + for(String s : list) { + s = s.trim(); + if(s.length() > 0) { + stringList.add(s); + } + } + this.opCode = opcode; + } + + public IPCPacket14StringList(int opcode, List list) { + stringList = new ArrayList(); + for(String s : list) { + s = s.trim(); + if(s.length() > 0) { + stringList.add(s); + } + } + this.opCode = opcode; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + stringList.clear(); + opCode = bin.readByte(); + int len = bin.readInt(); + for(int i = 0; i < len; ++i) { + stringList.add(bin.readUTF()); + } + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeByte(opCode); + bin.writeInt(stringList.size()); + for(String str : stringList) { + bin.writeUTF(str); + } + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + int len = 5; + for(String str : stringList) { + len += IPCPacketBase.strLen(str); + } + return len; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java new file mode 100644 index 0000000..3912964 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 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 IPCPacket15Crashed implements IPCPacketBase { + + public static final int ID = 0x15; + + public String crashReport; + + public IPCPacket15Crashed() { + } + + public IPCPacket15Crashed(String crashReport) { + this.crashReport = crashReport; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + crashReport = bin.readUTF(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(crashReport); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(crashReport); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java new file mode 100644 index 0000000..e388b63 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java @@ -0,0 +1,110 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 IPCPacket16NBTList implements IPCPacketBase { + + public static final int ID = 0x16; + + public static final int WORLD_LIST = 0x0; + + public int opCode; + public final List tagList; + public final List nbtTagList; + + public IPCPacket16NBTList() { + tagList = new LinkedList(); + nbtTagList = new LinkedList(); + } + + public IPCPacket16NBTList(int opcode, NBTTagCompound[] list) { + this(opcode, Arrays.asList(list)); + } + + public IPCPacket16NBTList(int opcode, List list) { + tagList = new LinkedList(); + nbtTagList = list; + for(int i = 0, size = list.size(); i < size; ++i) { + NBTTagCompound tag = list.get(i); + try { + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + CompressedStreamTools.write(tag, new DataOutputStream(bao)); + tagList.add(bao.toByteArray()); + }catch(IOException e) { + System.err.println("Failed to write tag '" + tag.getId() + "' (#" + i + ") in IPCPacket16NBTList"); + } + } + opCode = opcode; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + tagList.clear(); + nbtTagList.clear(); + opCode = bin.readInt(); + int count = bin.readInt(); + for(int i = 0; i < count; ++i) { + byte[] toRead = new byte[bin.readInt()]; + bin.readFully(toRead); + tagList.add(toRead); + try { + nbtTagList.add(CompressedStreamTools.read(new DataInputStream(new ByteArrayInputStream(toRead)))); + }catch(IOException e) { + System.err.println("Failed to read tag #" + i + " in IPCPacket16NBTList"); + } + } + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeInt(opCode); + bin.writeInt(tagList.size()); + for(byte[] str : tagList) { + bin.writeInt(str.length); + bin.write(str); + } + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + int len = 8; + for(byte[] str : tagList) { + len += 4; + len += str.length; + } + return len; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket17ConfigureLAN.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket17ConfigureLAN.java new file mode 100644 index 0000000..272dbc2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket17ConfigureLAN.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * 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 IPCPacket17ConfigureLAN implements IPCPacketBase { + + public static final int ID = 0x17; + + public int gamemode; + public boolean cheats; + public final List iceServers; + + public IPCPacket17ConfigureLAN() { + iceServers = new ArrayList(); + } + + public IPCPacket17ConfigureLAN(int gamemode, boolean cheats, List iceServers) { + this.gamemode = gamemode; + this.cheats = cheats; + this.iceServers = iceServers; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + gamemode = bin.readUnsignedByte(); + cheats = bin.readBoolean(); + iceServers.clear(); + int iceCount = bin.readUnsignedByte(); + for(int i = 0; i < iceCount; ++i) { + iceServers.add(bin.readUTF()); + } + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeByte(gamemode); + bin.writeBoolean(cheats); + bin.writeByte(iceServers.size()); + for(int i = 0, l = iceServers.size(); i < l; ++i) { + bin.writeUTF(iceServers.get(i)); + } + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + int s = 0; + for(int i = 0, l = iceServers.size(); i < l; ++i) { + s += 2; + s += iceServers.get(i).length(); + } + return 2 + 1 + s; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket18ClearPlayers.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket18ClearPlayers.java new file mode 100644 index 0000000..81a396b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket18ClearPlayers.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket18ClearPlayers implements IPCPacketBase { + + public static final int ID = 0x18; + + public String worldName = null; + + public IPCPacket18ClearPlayers(String worldName) { + this.worldName = worldName; + } + + public IPCPacket18ClearPlayers() { + } + + @Override + public void deserialize(DataInput bin) throws IOException { + worldName = bin.readUTF(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(worldName); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(worldName); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket19Autosave.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket19Autosave.java new file mode 100644 index 0000000..20841cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket19Autosave.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket19Autosave implements IPCPacketBase { + + public static final int ID = 0x19; + + public IPCPacket19Autosave() { + } + + @Override + public void deserialize(DataInput bin) throws IOException { + } + + @Override + public void serialize(DataOutput bin) throws IOException { + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 0; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket20LoggerMessage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket20LoggerMessage.java new file mode 100644 index 0000000..9babf0b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket20LoggerMessage.java @@ -0,0 +1,64 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket20LoggerMessage implements IPCPacketBase { + + public static final int ID = 0x20; + + public String logMessage; + public boolean isError; + + public IPCPacket20LoggerMessage() { + } + + public IPCPacket20LoggerMessage(String logMessage, boolean isError) { + this.logMessage = logMessage; + this.isError = isError; + } + + public IPCPacket20LoggerMessage(String logMessage) { + this.logMessage = logMessage; + this.isError = false; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + this.logMessage = bin.readUTF(); + this.isError = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeUTF(this.logMessage); + bin.writeBoolean(this.isError); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return IPCPacketBase.strLen(logMessage) + 1; + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket21EnableLogging.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket21EnableLogging.java new file mode 100644 index 0000000..7c9423d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket21EnableLogging.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacket21EnableLogging implements IPCPacketBase { + + public static final int ID = 0x21; + + public boolean enable; + + public IPCPacket21EnableLogging() { + } + + public IPCPacket21EnableLogging(boolean enable) { + this.enable = enable; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + enable = bin.readBoolean(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeBoolean(enable); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketBase.java new file mode 100644 index 0000000..48e6dbf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketBase.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 interface IPCPacketBase { + + public void deserialize(DataInput bin) throws IOException; + public void serialize(DataOutput bin) throws IOException; + public int id(); + public int size(); + + public static int strLen(String s) { + int strlen = s.length(); + int utflen = 2; + int c; + + for (int i = 0; i < strlen; ++i) { + c = s.charAt(i); + if ((c >= 0x0001) && (c <= 0x007F)) { + ++utflen; + } else if (c > 0x07FF) { + utflen += 3; + } else { + utflen += 2; + } + } + + return utflen; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketFFProcessKeepAlive.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketFFProcessKeepAlive.java new file mode 100644 index 0000000..5553bd3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketFFProcessKeepAlive.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * 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 IPCPacketFFProcessKeepAlive implements IPCPacketBase { + + public static final int ID = 0xFF; + + public static final int KEEPALIVE = 0; + public static final int FAILURE = 0xFE; + public static final int EXITED = 0xFC; + + public int ack; + + public IPCPacketFFProcessKeepAlive() { + } + + public IPCPacketFFProcessKeepAlive(int ack) { + this.ack = ack; + } + + @Override + public void deserialize(DataInput bin) throws IOException { + ack = bin.readUnsignedByte(); + } + + @Override + public void serialize(DataOutput bin) throws IOException { + bin.writeByte(ack); + } + + @Override + public int id() { + return ID; + } + + @Override + public int size() { + return 1; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java new file mode 100644 index 0000000..7f382c1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.ipc; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.function.Supplier; + +/** + * 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 IPCPacketManager { + + public static final HashMap> mappings = new HashMap(); + + public static final IPCInputStream IPC_INPUT_STREAM = new IPCInputStream(); + public static final IPCOutputStream IPC_OUTPUT_STREAM = new IPCOutputStream(); + + public static final DataInputStream IPC_DATA_INPUT_STREAM = new DataInputStream(IPC_INPUT_STREAM); + public static final DataOutputStream IPC_DATA_OUTPUT_STREAM = new DataOutputStream(IPC_OUTPUT_STREAM); + + static { + mappings.put(IPCPacket00StartServer.ID, () -> new IPCPacket00StartServer()); + mappings.put(IPCPacket01StopServer.ID, () -> new IPCPacket01StopServer()); + mappings.put(IPCPacket02InitWorld.ID, () -> new IPCPacket02InitWorld()); + mappings.put(IPCPacket03DeleteWorld.ID, () -> new IPCPacket03DeleteWorld()); + mappings.put(IPCPacket05RequestData.ID, () -> new IPCPacket05RequestData()); + mappings.put(IPCPacket06RenameWorldNBT.ID, () -> new IPCPacket06RenameWorldNBT()); + mappings.put(IPCPacket07ImportWorld.ID, () -> new IPCPacket07ImportWorld()); + mappings.put(IPCPacket09RequestResponse.ID, () -> new IPCPacket09RequestResponse()); + mappings.put(IPCPacket0ASetWorldDifficulty.ID, () -> new IPCPacket0ASetWorldDifficulty()); + mappings.put(IPCPacket0BPause.ID, () -> new IPCPacket0BPause()); + mappings.put(IPCPacket0CPlayerChannel.ID, () -> new IPCPacket0CPlayerChannel()); + mappings.put(IPCPacket0DProgressUpdate.ID, () -> new IPCPacket0DProgressUpdate()); + mappings.put(IPCPacket0EListWorlds.ID, () -> new IPCPacket0EListWorlds()); + mappings.put(IPCPacket0FListFiles.ID, () -> new IPCPacket0FListFiles()); + mappings.put(IPCPacket10FileRead.ID, () -> new IPCPacket10FileRead()); + mappings.put(IPCPacket12FileWrite.ID, () -> new IPCPacket12FileWrite()); + mappings.put(IPCPacket13FileCopyMove.ID, () -> new IPCPacket13FileCopyMove()); + mappings.put(IPCPacket14StringList.ID, () -> new IPCPacket14StringList()); + mappings.put(IPCPacket15Crashed.ID, () -> new IPCPacket15Crashed()); + mappings.put(IPCPacket16NBTList.ID, () -> new IPCPacket16NBTList()); + mappings.put(IPCPacket17ConfigureLAN.ID, () -> new IPCPacket17ConfigureLAN()); + mappings.put(IPCPacket18ClearPlayers.ID, () -> new IPCPacket18ClearPlayers()); + mappings.put(IPCPacket19Autosave.ID, () -> new IPCPacket19Autosave()); + mappings.put(IPCPacket20LoggerMessage.ID, () -> new IPCPacket20LoggerMessage()); + mappings.put(IPCPacket21EnableLogging.ID, () -> new IPCPacket21EnableLogging()); + mappings.put(IPCPacketFFProcessKeepAlive.ID, () -> new IPCPacketFFProcessKeepAlive()); + } + + public static byte[] IPCSerialize(IPCPacketBase pkt) throws IOException { + + IPC_OUTPUT_STREAM.feedBuffer(new byte[pkt.size() + 1], pkt.getClass().getSimpleName()); + IPC_OUTPUT_STREAM.write(pkt.id()); + pkt.serialize(IPC_DATA_OUTPUT_STREAM); + + return IPC_OUTPUT_STREAM.returnBuffer(); + } + + public static IPCPacketBase IPCDeserialize(byte[] pkt) throws IOException { + + IPC_INPUT_STREAM.feedBuffer(pkt); + int i = IPC_INPUT_STREAM.read(); + + Supplier pk = mappings.get(Integer.valueOf(i)); + if(pk == null) { + throw new IOException("Packet type 0x" + Integer.toHexString(i) + " doesn't exist"); + } + + IPCPacketBase p = pk.get(); + + IPC_INPUT_STREAM.nameBuffer(p.getClass().getSimpleName()); + + p.deserialize(IPC_DATA_INPUT_STREAM); + + int lo = IPC_INPUT_STREAM.getLeftoverCount(); + if(lo > 0) { + System.err.println("Packet type 0x" + Integer.toHexString(i) + " class '" + p.getClass().getSimpleName() + "' was size " + (pkt.length - 1) + " but only " + (pkt.length - 1 - lo) + " bytes were read"); + } + + return p; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java new file mode 100644 index 0000000..57a738a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java @@ -0,0 +1,413 @@ +package net.lax1dude.eaglercraft.v1_8.sp.lan; + +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.*; +import net.minecraft.network.EnumPacketDirection; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** + * 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 LANClientNetworkManager extends EaglercraftNetworkManager { + + private static final Logger logger = LogManager.getLogger("LANClientNetworkManager"); + + private static final int PRE = 0, INIT = 1, SENT_ICE_CANDIDATE = 2, SENT_DESCRIPTION = 3; + + public static final int fragmentSize = 0xFF00; + + private static final String[] initStateNames = new String[] { "PRE", "INIT", "SENT_ICE_CANDIDATE", "SENT_DESCRIPTION" }; + + public final String displayCode; + public final String displayRelay; + + private boolean firstPacket = true; + + private LANClientNetworkManager(String displayCode, String displayRelay) { + super(""); + this.displayCode = displayCode; + this.displayRelay = displayRelay; + this.nethandler = null; + } + + @Override + public void connect() { + fragmentedPacket.clear(); + firstPacket = true; + } + + @Override + public EnumEaglerConnectionState getConnectStatus() { + return clientDisconnected ? EnumEaglerConnectionState.CLOSED : EnumEaglerConnectionState.CONNECTED; + } + + public static LANClientNetworkManager connectToWorld(RelayServerSocket sock, String displayCode, String displayRelay) { + PlatformWebRTC.clearLANClientState(); + int connectState = PRE; + IPacket pkt; + mainLoop: while(!sock.isClosed()) { + if((pkt = sock.readPacket()) != null) { + if(pkt instanceof IPacket00Handshake) { + if(connectState == PRE) { + + // %%%%%% Process IPacket00Handshake %%%%%% + + logger.info("Relay [{}|{}] recieved handshake, client id: {}", displayRelay, displayCode, ((IPacket00Handshake)pkt).connectionCode); + connectState = INIT; + + }else { + sock.close(); + logger.error("Relay [{}|{}] unexpected packet: IPacket00Handshake in state {}", displayRelay, displayCode, initStateNames[connectState]); + return null; + } + }else if(pkt instanceof IPacket01ICEServers) { + if(connectState == INIT) { + + // %%%%%% Process IPacket01ICEServers %%%%%% + + IPacket01ICEServers ipkt = (IPacket01ICEServers) pkt; + + // print servers + logger.info("Relay [{}|{}] provided ICE servers:", displayRelay, displayCode); + List servers = new ArrayList(); + for(ICEServerSet.RelayServer srv : ipkt.servers) { + logger.info("Relay [{}|{}] {}: {}", displayRelay, displayCode, srv.type.name(), srv.address); + servers.add(srv.getICEString()); + } + + // process + PlatformWebRTC.clientLANSetICEServersAndConnect(servers.toArray(new String[servers.size()])); + + // await result + long lm = System.currentTimeMillis(); + do { + String c = PlatformWebRTC.clientLANAwaitDescription(); + if(c != null) { + logger.info("Relay [{}|{}] client sent description", displayRelay, displayCode); + + // 'this.descriptionHandler' was called, send result: + sock.writePacket(new IPacket04Description("", c)); + + connectState = SENT_DESCRIPTION; + continue mainLoop; + } + EagUtils.sleep(20l); + }while(System.currentTimeMillis() - lm < 5000l); + + // no description was sent + sock.close(); + logger.error("Relay [{}|{}] client provide description timeout", displayRelay, displayCode); + return null; + + }else { + sock.close(); + logger.error("Relay [{}|{}] unexpected packet: IPacket01ICEServers in state {}", displayRelay, displayCode, initStateNames[connectState]); + return null; + } + }else if(pkt instanceof IPacket03ICECandidate) { + if(connectState == SENT_ICE_CANDIDATE) { + + // %%%%%% Process IPacket03ICECandidate %%%%%% + + IPacket03ICECandidate ipkt = (IPacket03ICECandidate) pkt; + + // process + logger.info("Relay [{}|{}] recieved server ICE candidate", displayRelay, displayCode); + PlatformWebRTC.clientLANSetICECandidate(ipkt.candidate); + + // await result + long lm = System.currentTimeMillis(); + do { + if(PlatformWebRTC.clientLANAwaitChannel()) { + logger.info("Relay [{}|{}] client opened data channel", displayRelay, displayCode); + + // 'this.remoteDataChannelHandler' was called, success + sock.writePacket(new IPacket05ClientSuccess(ipkt.peerId)); + sock.close(); + return new LANClientNetworkManager(displayCode, displayRelay); + + } + EagUtils.sleep(20l); + }while(System.currentTimeMillis() - lm < 5000l); + + // no channel was opened + sock.writePacket(new IPacket06ClientFailure(ipkt.peerId)); + sock.close(); + logger.error("Relay [{}|{}] client open data channel timeout", displayRelay, displayCode); + return null; + + }else { + sock.close(); + logger.error("Relay [{}|{}] unexpected packet: IPacket03ICECandidate in state {}", displayRelay, displayCode, initStateNames[connectState]); + return null; + } + }else if(pkt instanceof IPacket04Description) { + if(connectState == SENT_DESCRIPTION) { + + // %%%%%% Process IPacket04Description %%%%%% + + IPacket04Description ipkt = (IPacket04Description) pkt; + + // process + logger.info("Relay [{}|{}] recieved server description", displayRelay, displayCode); + PlatformWebRTC.clientLANSetDescription(ipkt.description); + + // await result + long lm = System.currentTimeMillis(); + do { + String c = PlatformWebRTC.clientLANAwaitICECandidate(); + if(c != null) { + logger.info("Relay [{}|{}] client sent ICE candidate", displayRelay, displayCode); + + // 'this.iceCandidateHandler' was called, send result: + sock.writePacket(new IPacket03ICECandidate("", c)); + + connectState = SENT_ICE_CANDIDATE; + continue mainLoop; + } + EagUtils.sleep(20l); + }while(System.currentTimeMillis() - lm < 5000l); + + // no ice candidates were sent + sock.close(); + logger.error("Relay [{}|{}] client provide ICE candidate timeout", displayRelay, displayCode); + return null; + + }else { + sock.close(); + logger.error("Relay [{}|{}] unexpected packet: IPacket04Description in state {}", displayRelay, displayCode, initStateNames[connectState]); + return null; + } + }else if(pkt instanceof IPacketFFErrorCode) { + + // %%%%%% Process IPacketFFErrorCode %%%%%% + + IPacketFFErrorCode ipkt = (IPacketFFErrorCode) pkt; + logger.error("Relay [{}|{}] connection failed: {}({}): {}", displayRelay, displayCode, IPacketFFErrorCode.code2string(ipkt.code), ipkt.code, ipkt.desc); + Throwable t; + while((t = sock.getException()) != null) { + logger.error(t); + } + sock.close(); + return null; + + }else { + + // %%%%%% Unexpected Packet %%%%%% + + logger.error("Relay [{}|{}] unexpected packet: {}", displayRelay, displayCode, pkt.getClass().getSimpleName()); + sock.close(); + return null; + } + } + EagUtils.sleep(20l); + } + return null; + } + + @Override + public void sendPacket(Packet pkt) { + if(!isChannelOpen()) { + logger.error("Packet was sent on a closed connection: {}", pkt.getClass().getSimpleName()); + return; + } + + int i; + try { + i = packetState.getPacketId(EnumPacketDirection.SERVERBOUND, pkt); + }catch(Throwable t) { + logger.error("Incorrect packet for state: {}", pkt.getClass().getSimpleName()); + return; + } + + temporaryBuffer.clear(); + temporaryBuffer.writeVarIntToBuffer(i); + try { + pkt.writePacketData(temporaryBuffer); + }catch(IOException ex) { + logger.error("Failed to write packet {}!", pkt.getClass().getSimpleName()); + return; + } + + int len = temporaryBuffer.readableBytes(); + int fragmentSizeN1 = fragmentSize - 1; + if(len > fragmentSizeN1) { + do { + int readLen = len > fragmentSizeN1 ? fragmentSizeN1 : len; + byte[] frag = new byte[readLen + 1]; + temporaryBuffer.readBytes(frag, 1, readLen); + frag[0] = temporaryBuffer.readableBytes() == 0 ? (byte)0 : (byte)1; + PlatformWebRTC.clientLANSendPacket(frag); + }while((len = temporaryBuffer.readableBytes()) > 0); + }else { + byte[] bytes = new byte[len + 1]; + bytes[0] = 0; + temporaryBuffer.readBytes(bytes, 1, len); + PlatformWebRTC.clientLANSendPacket(bytes); + } + } + + @Override + public boolean isLocalChannel() { + return true; + } + + @Override + public boolean isChannelOpen() { + if (PlatformWebRTC.clientLANClosed()) { + clientDisconnected = true; + } + return !clientDisconnected; + } + + private List fragmentedPacket = new ArrayList(); + + @Override + public void processReceivedPackets() throws IOException { + if(this.nethandler != null) { + List packets = PlatformWebRTC.clientLANReadAllPacket(); + if(packets == null) { + return; + } + for(byte[] data : packets) { + byte[] fullData; + boolean compressed = false; + + if (data[0] == 0 || data[0] == 2) { + if(fragmentedPacket.isEmpty()) { + fullData = new byte[data.length - 1]; + System.arraycopy(data, 1, fullData, 0, fullData.length); + }else { + fragmentedPacket.add(data); + int len = 0; + int fragCount = fragmentedPacket.size(); + for(int i = 0; i < fragCount; ++i) { + len += fragmentedPacket.get(i).length - 1; + } + fullData = new byte[len]; + len = 0; + for(int i = 0; i < fragCount; ++i) { + byte[] f = fragmentedPacket.get(i); + System.arraycopy(f, 1, fullData, len, f.length - 1); + len += f.length - 1; + } + fragmentedPacket.clear(); + } + compressed = data[0] == 2; + } else if (data[0] == 1) { + fragmentedPacket.add(data); + continue; + } else { + logger.error("Recieved {} byte fragment of unknown type: {}", data.length, ((int)data[0] & 0xFF)); + continue; + } + + if(compressed) { + if(fullData.length < 4) { + throw new IOException("Recieved invalid " + fullData.length + " byte compressed packet"); + } + ByteArrayInputStream bi = new ByteArrayInputStream(fullData); + int i = (bi.read() << 24) | (bi.read() << 16) | (bi.read() << 8) | bi.read(); + InputStream inflaterInputStream = EaglerZLIB.newInflaterInputStream(bi); + fullData = new byte[i]; + inflaterInputStream.read(fullData); + } + + if(firstPacket) { + // 1.5 kick packet + if(fullData.length == 31 && fullData[0] == (byte)0xFF && fullData[1] == (byte)0x00 && fullData[2] == (byte)0x0E) { + logger.error("Detected a 1.5 LAN server!"); + this.closeChannel(new ChatComponentTranslation("singleplayer.outdatedLANServerKick")); + firstPacket = false; + return; + } + firstPacket = false; + } + + ByteBuf nettyBuffer = Unpooled.buffer(fullData, fullData.length); + nettyBuffer.writerIndex(fullData.length); + PacketBuffer input = new PacketBuffer(nettyBuffer); + int pktId = input.readVarIntFromBuffer(); + + Packet pkt; + try { + pkt = packetState.getPacket(EnumPacketDirection.CLIENTBOUND, pktId); + }catch(IllegalAccessException | InstantiationException ex) { + throw new IOException("Recieved a packet with type " + pktId + " which is invalid!"); + } + + if(pkt == null) { + throw new IOException("Recieved packet type " + pktId + " which is undefined in state " + packetState); + } + + try { + pkt.readPacketData(input); + }catch(Throwable t) { + throw new IOException("Failed to read packet type '" + pkt.getClass().getSimpleName() + "'", t); + } + + try { + pkt.processPacket(nethandler); + }catch(Throwable t) { + logger.error("Failed to process {}! It'll be skipped for debug purposes.", pkt.getClass().getSimpleName()); + logger.error(t); + } + } + } + } + + @Override + public void closeChannel(IChatComponent reason) { + if(!PlatformWebRTC.clientLANClosed()) { + PlatformWebRTC.clientLANCloseConnection(); + } + if(nethandler != null) { + nethandler.onDisconnect(reason); + } + clientDisconnected = true; + } + + @Override + public boolean checkDisconnected() { + if(PlatformWebRTC.clientLANClosed()) { + clientDisconnected = false; + try { + processReceivedPackets(); // catch kick message + } catch (IOException e) { + } + doClientDisconnect(new ChatComponentTranslation("disconnect.endOfStream")); + } + return clientDisconnected; + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java new file mode 100644 index 0000000..425f34b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java @@ -0,0 +1,175 @@ +package net.lax1dude.eaglercraft.v1_8.sp.lan; + +import java.util.Iterator; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket03ICECandidate; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket04Description; + +/** + * 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. + * + */ +class LANClientPeer { + + private static final Logger logger = LogManager.getLogger("LANClientPeer"); + + private static final int PRE = 0, SENT_ICE_CANDIDATE = 2, SENT_DESCRIPTION = 3, CONNECTED = 4, CLOSED = 5; + + protected final String clientId; + + protected int state = PRE; + protected boolean dead = false; + + protected LANClientPeer(String clientId) { + this.clientId = clientId; + PlatformWebRTC.serverLANCreatePeer(clientId); + } + + protected void handleICECandidates(String candidates) { + if(state == SENT_DESCRIPTION) { + PlatformWebRTC.serverLANPeerICECandidates(clientId, candidates); + long millis = System.currentTimeMillis(); + do { + LANPeerEvent evt; + if((evt = PlatformWebRTC.serverLANGetEvent(clientId)) != null) { + if(evt instanceof LANPeerEvent.LANPeerICECandidateEvent) { + LANServerController.lanRelaySocket.writePacket(new IPacket03ICECandidate(clientId, ((LANPeerEvent.LANPeerICECandidateEvent)evt).candidates)); + state = SENT_ICE_CANDIDATE; + return; + }else if(evt instanceof LANPeerEvent.LANPeerDisconnectEvent) { + logger.error("LAN client '{}' disconnected while waiting for server ICE candidates", clientId); + }else { + logger.error("LAN client '{}' had an accident: {}", clientId, evt.getClass().getSimpleName()); + } + disconnect(); + return; + } + EagUtils.sleep(20l); + }while(System.currentTimeMillis() - millis < 5000l); + logger.error("Getting server ICE candidates for '{}' timed out!", clientId); + disconnect(); + }else { + logger.error("Relay [{}] unexpected IPacket03ICECandidate for '{}'", LANServerController.lanRelaySocket.getURI(), clientId); + } + } + + protected void handleDescription(String description) { + if(state == PRE) { + PlatformWebRTC.serverLANPeerDescription(clientId, description); + long millis = System.currentTimeMillis(); + do { + LANPeerEvent evt; + if((evt = PlatformWebRTC.serverLANGetEvent(clientId)) != null) { + if(evt instanceof LANPeerEvent.LANPeerDescriptionEvent) { + LANServerController.lanRelaySocket.writePacket(new IPacket04Description(clientId, ((LANPeerEvent.LANPeerDescriptionEvent)evt).description)); + state = SENT_DESCRIPTION; + return; + }else if(evt instanceof LANPeerEvent.LANPeerDisconnectEvent) { + logger.error("LAN client '{}' disconnected while waiting for server description", clientId); + }else { + logger.error("LAN client '{}' had an accident: {}", clientId, evt.getClass().getSimpleName()); + } + disconnect(); + return; + } + EagUtils.sleep(20l); + }while(System.currentTimeMillis() - millis < 5000l); + logger.error("Getting server description for '{}' timed out!", clientId); + disconnect(); + }else { + logger.error("Relay [{}] unexpected IPacket04Description for '{}'", LANServerController.lanRelaySocket.getURI(), clientId); + } + } + + protected void handleSuccess() { + if(state == SENT_ICE_CANDIDATE) { + long millis = System.currentTimeMillis(); + do { + LANPeerEvent evt; + while((evt = PlatformWebRTC.serverLANGetEvent(clientId)) != null && evt instanceof LANPeerEvent.LANPeerICECandidateEvent) { + // skip ice candidates + } + if(evt != null) { + if(evt instanceof LANPeerEvent.LANPeerDataChannelEvent) { + SingleplayerServerController.openPlayerChannel(clientId); + state = CONNECTED; + return; + }else if(evt instanceof LANPeerEvent.LANPeerDisconnectEvent) { + logger.error("LAN client '{}' disconnected while waiting for connection", clientId); + }else { + logger.error("LAN client '{}' had an accident: {}", clientId, evt.getClass().getSimpleName()); + } + disconnect(); + return; + } + EagUtils.sleep(20l); + }while(System.currentTimeMillis() - millis < 5000l); + logger.error("Getting server description for '{}' timed out!", clientId); + disconnect(); + }else { + logger.error("Relay [{}] unexpected IPacket05ClientSuccess for '{}'", LANServerController.lanRelaySocket.getURI(), clientId); + } + } + + protected void handleFailure() { + if(state == SENT_ICE_CANDIDATE) { + logger.error("Client '{}' failed to connect", clientId); + disconnect(); + }else { + logger.error("Relay [{}] unexpected IPacket06ClientFailure for '{}'", LANServerController.lanRelaySocket.getURI(), clientId); + } + } + + protected void update() { + if(state == CONNECTED) { + List l = PlatformWebRTC.serverLANGetAllEvent(clientId); + if(l == null) { + return; + } + Iterator itr = l.iterator(); + while(state == CONNECTED && itr.hasNext()) { + LANPeerEvent evt = itr.next(); + if(evt instanceof LANPeerEvent.LANPeerPacketEvent) { + ClientPlatformSingleplayer.sendPacket(new IPCPacketData(clientId, ((LANPeerEvent.LANPeerPacketEvent)evt).payload)); + }else if(evt instanceof LANPeerEvent.LANPeerDisconnectEvent) { + logger.info("LAN client '{}' disconnected", clientId); + disconnect(); + }else { + logger.error("LAN client '{}' had an accident: {}", clientId, evt.getClass().getSimpleName()); + disconnect(); + } + } + } + } + + protected void disconnect() { + if(!dead) { + if(state == CONNECTED) { + SingleplayerServerController.closePlayerChannel(clientId); + } + state = CLOSED; + PlatformWebRTC.serverLANDisconnectPeer(clientId); + dead = true; + } + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANPeerEvent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANPeerEvent.java new file mode 100644 index 0000000..1485ed7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANPeerEvent.java @@ -0,0 +1,103 @@ +package net.lax1dude.eaglercraft.v1_8.sp.lan; + +/** + * 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 interface LANPeerEvent { + + String getPeerId(); + + public static class LANPeerICECandidateEvent implements LANPeerEvent { + + public final String clientId; + public final String candidates; + + public LANPeerICECandidateEvent(String clientId, String candidates) { + this.clientId = clientId; + this.candidates = candidates; + } + + @Override + public String getPeerId() { + return clientId; + } + + } + + public static class LANPeerDescriptionEvent implements LANPeerEvent { + + public final String clientId; + public final String description; + + public LANPeerDescriptionEvent(String clientId, String description) { + this.clientId = clientId; + this.description = description; + } + + @Override + public String getPeerId() { + return clientId; + } + + } + + public static class LANPeerDataChannelEvent implements LANPeerEvent { + + public final String clientId; + + public LANPeerDataChannelEvent(String clientId) { + this.clientId = clientId; + } + + @Override + public String getPeerId() { + return clientId; + } + + } + + public static class LANPeerPacketEvent implements LANPeerEvent { + + public final String clientId; + public final byte[] payload; + + public LANPeerPacketEvent(String clientId, byte[] payload) { + this.clientId = clientId; + this.payload = payload; + } + + @Override + public String getPeerId() { + return clientId; + } + + } + + public static class LANPeerDisconnectEvent implements LANPeerEvent { + + public final String clientId; + + public LANPeerDisconnectEvent(String clientId) { + this.clientId = clientId; + } + + @Override + public String getPeerId() { + return clientId; + } + + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANServerController.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANServerController.java new file mode 100644 index 0000000..7d6b951 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANServerController.java @@ -0,0 +1,207 @@ +package net.lax1dude.eaglercraft.v1_8.sp.lan; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.*; + +/** + * 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 LANServerController { + + public static final Logger logger = LogManager.getLogger("IntegratedServerLAN"); + + public static final List currentICEServers = new ArrayList(); + + static RelayServerSocket lanRelaySocket = null; + + private static String currentCode = null; + + public static String shareToLAN(Consumer progressCallback, String worldName, boolean worldHidden) { + currentCode = null; + RelayServerSocket sock = RelayManager.relayManager.getWorkingRelay((str) -> progressCallback.accept("Connecting: " + str), + RelayManager.preferredRelayVersion, worldName + (worldHidden ? ";1" : ";0")); + if(sock == null) { + lanRelaySocket = null; + return null; + }else { + progressCallback.accept("Opening: " + sock.getURI()); + IPacket00Handshake hs = (IPacket00Handshake)sock.readPacket(); + lanRelaySocket = sock; + String code = hs.connectionCode; + logger.info("Relay [{}] connected as 'server', code: {}", sock.getURI(), code); + progressCallback.accept("Opened '" + code + "' on " + sock.getURI()); + long millis = System.currentTimeMillis(); + do { + if(sock.isClosed()) { + logger.info("Relay [{}] connection lost", sock.getURI()); + lanRelaySocket = null; + return null; + } + IPacket pkt = sock.readPacket(); + if(pkt != null) { + if(pkt instanceof IPacket01ICEServers) { + IPacket01ICEServers ipkt = (IPacket01ICEServers)pkt; + logger.info("Relay [{}] provided ICE servers:", sock.getURI()); + currentICEServers.clear(); + for(net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.ICEServerSet.RelayServer srv : ipkt.servers) { + logger.info("Relay [{}] {}: {}", sock.getURI(), srv.type.name(), srv.address); + currentICEServers.add(srv.getICEString()); + } + PlatformWebRTC.serverLANInitializeServer(currentICEServers.toArray(new String[currentICEServers.size()])); + return currentCode = code; + }else { + logger.error("Relay [{}] unexpected packet: {}", sock.getURI(), pkt.getClass().getSimpleName()); + closeLAN(); + return null; + } + } + EagUtils.sleep(50l); + }while(System.currentTimeMillis() - millis < 1000l); + logger.info("Relay [{}] relay provide ICE servers timeout", sock.getURI()); + closeLAN(); + return null; + } + } + + public static String getCurrentURI() { + return lanRelaySocket == null ? "" : lanRelaySocket.getURI(); + } + + public static String getCurrentCode() { + return currentCode == null ? "" : currentCode; + } + + public static void closeLAN() { + closeLANNoKick(); + cleanupLAN(); + if (isLANOpen()) { + PlatformWebRTC.serverLANCloseServer(); + } + } + + public static void closeLANNoKick() { + if(lanRelaySocket != null) { + lanRelaySocket.close(); + lanRelaySocket = null; + currentCode = null; + } + } + + public static void cleanupLAN() { + Iterator itr = clients.values().iterator(); + while(itr.hasNext()) { + itr.next().disconnect(); + } + clients.clear(); + } + + public static boolean hasPeers() { + return PlatformWebRTC.countPeers() > 0; + } + + public static boolean isHostingLAN() { + return lanRelaySocket != null || PlatformWebRTC.countPeers() > 0; + } + + public static boolean isLANOpen() { + return lanRelaySocket != null; + } + + private static final Map clients = new HashMap(); + + public static void updateLANServer() { + if(lanRelaySocket != null) { + IPacket pkt; + while((pkt = lanRelaySocket.readPacket()) != null) { + if(pkt instanceof IPacket02NewClient) { + IPacket02NewClient ipkt = (IPacket02NewClient) pkt; + if(clients.containsKey(ipkt.clientId)) { + logger.error("Relay [{}] relay provided duplicate client '{}'", lanRelaySocket.getURI(), ipkt.clientId); + }else { + clients.put(ipkt.clientId, new LANClientPeer(ipkt.clientId)); + } + }else if(pkt instanceof IPacket03ICECandidate) { + IPacket03ICECandidate ipkt = (IPacket03ICECandidate) pkt; + LANClientPeer c = clients.get(ipkt.peerId); + if(c != null) { + c.handleICECandidates(ipkt.candidate); + }else { + logger.error("Relay [{}] relay sent IPacket03ICECandidate for unknown client '{}'", lanRelaySocket.getURI(), ipkt.peerId); + } + }else if(pkt instanceof IPacket04Description) { + IPacket04Description ipkt = (IPacket04Description) pkt; + LANClientPeer c = clients.get(ipkt.peerId); + if(c != null) { + c.handleDescription(ipkt.description); + }else { + logger.error("Relay [{}] relay sent IPacket04Description for unknown client '{}'", lanRelaySocket.getURI(), ipkt.peerId); + } + }else if(pkt instanceof IPacket05ClientSuccess) { + IPacket05ClientSuccess ipkt = (IPacket05ClientSuccess) pkt; + LANClientPeer c = clients.get(ipkt.clientId); + if(c != null) { + c.handleSuccess(); + }else { + logger.error("Relay [{}] relay sent IPacket05ClientSuccess for unknown client '{}'", lanRelaySocket.getURI(), ipkt.clientId); + } + }else if(pkt instanceof IPacket06ClientFailure) { + IPacket06ClientFailure ipkt = (IPacket06ClientFailure) pkt; + LANClientPeer c = clients.get(ipkt.clientId); + if(c != null) { + c.handleFailure(); + }else { + logger.error("Relay [{}] relay sent IPacket06ClientFailure for unknown client '{}'", lanRelaySocket.getURI(), ipkt.clientId); + } + }else if(pkt instanceof IPacketFFErrorCode) { + IPacketFFErrorCode ipkt = (IPacketFFErrorCode) pkt; + logger.error("Relay [{}] error code thrown: {}({}): {}", lanRelaySocket.getURI(), IPacketFFErrorCode.code2string(ipkt.code), ipkt.code, ipkt.desc); + Throwable t; + while((t = lanRelaySocket.getException()) != null) { + logger.error(t); + } + }else { + logger.error("Relay [{}] unexpected packet: {}", lanRelaySocket.getURI(), pkt.getClass().getSimpleName()); + } + } + if(lanRelaySocket.isClosed()) { + lanRelaySocket = null; + } + } + Iterator itr = clients.values().iterator(); + while(itr.hasNext()) { + LANClientPeer cl = itr.next(); + cl.update(); + if(cl.dead) { + itr.remove(); + } + } + } + + public static boolean supported() { + return PlatformWebRTC.supported(); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANServerList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANServerList.java new file mode 100644 index 0000000..a9bd002 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANServerList.java @@ -0,0 +1,166 @@ +package net.lax1dude.eaglercraft.v1_8.sp.lan; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQuery; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket07LocalWorlds; + +/** + * 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 LANServerList { + + private final List lanServersList = new LinkedList(); + private final Map lanServersQueryList = new LinkedHashMap(); + private final Set deadURIs = new HashSet(); + + private long lastRefresh = 0l; + private int refreshCounter = 0; + + public boolean update() { + long millis = System.currentTimeMillis(); + if(millis - lastRefresh > 20000l) { + if(++refreshCounter < 10) { + refresh(); + }else { + lastRefresh = millis; + } + }else { + boolean changed = false; + Iterator> itr = lanServersQueryList.entrySet().iterator(); + while(itr.hasNext()) { + Entry etr = itr.next(); + String uri = etr.getKey(); + RelayWorldsQuery q = etr.getValue(); + if(!q.isQueryOpen()) { + itr.remove(); + if(q.isQueryFailed()) { + deadURIs.add(uri); + Iterator itr2 = lanServersList.iterator(); + while(itr2.hasNext()) { + if(itr2.next().lanServerRelay.address.equals(uri)) { + itr2.remove(); + changed = true; + } + } + }else { + RelayServer rl = RelayManager.relayManager.getByURI(uri); + Iterator itr2 = lanServersList.iterator(); + while(itr2.hasNext()) { + LanServer l = itr2.next(); + if(l.lanServerRelay.address.equals(uri)) { + l.flagged = false; + } + } + if(rl != null) { + Iterator itr3 = q.getWorlds().iterator(); + yee: while(itr3.hasNext()) { + IPacket07LocalWorlds.LocalWorld l = itr3.next(); + itr2 = lanServersList.iterator(); + while(itr2.hasNext()) { + LanServer l2 = itr2.next(); + if(l2.lanServerRelay.address.equals(uri) && l2.lanServerCode.equals(l.worldCode)) { + l2.lanServerMotd = l.worldName; + l2.flagged = true; + continue yee; + } + } + lanServersList.add(new LanServer(l.worldName, rl, l.worldCode)); + changed = true; + } + } + itr2 = lanServersList.iterator(); + while(itr2.hasNext()) { + LanServer l = itr2.next(); + if(l.lanServerRelay.address.equals(uri)) { + if(!l.flagged) { + itr2.remove(); + changed = true; + } + } + } + } + } + } + return changed; + } + return false; + } + + public void forceRefresh() { + deadURIs.clear(); + refreshCounter = 0; + refresh(); + } + + private void refresh() { + lastRefresh = System.currentTimeMillis(); + if(PlatformWebRTC.supported()) { + for(int i = 0, l = RelayManager.relayManager.count(); i < l; ++i) { + RelayServer srv = RelayManager.relayManager.get(i); + if(!lanServersQueryList.containsKey(srv.address) && !deadURIs.contains(srv.address)) { + lanServersQueryList.put(srv.address, PlatformWebRTC.openRelayWorldsQuery(srv.address)); + } + } + } + } + + public LanServer getServer(int idx) { + return lanServersList.get(idx); + } + + public int countServers() { + return lanServersList.size(); + } + + public class LanServer { + + private String lanServerMotd; + private RelayServer lanServerRelay; + private String lanServerCode; + + protected boolean flagged = true; + + protected LanServer(String lanServerMotd, RelayServer lanServerRelay, String lanServerCode) { + this.lanServerMotd = lanServerMotd; + this.lanServerRelay = lanServerRelay; + this.lanServerCode = lanServerCode; + } + + public String getLanServerMotd() { + return lanServerMotd; + } + + public RelayServer getLanServerRelay() { + return lanServerRelay; + } + + public String getLanServerCode() { + return lanServerCode; + } + + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayEntry.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayEntry.java new file mode 100644 index 0000000..0094056 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayEntry.java @@ -0,0 +1,30 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay; + +/** + * 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 RelayEntry { + + public final String address; + public final String comment; + public final boolean primary; + + public RelayEntry(String address, String comment, boolean primary) { + this.address = address; + this.comment = comment; + this.primary = primary; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java new file mode 100644 index 0000000..d431bdb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java @@ -0,0 +1,360 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay; + +import java.io.ByteArrayOutputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Consumer; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket00Handshake; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacketFFErrorCode; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +/** + * 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 RelayManager { + + public static final Logger logger = LogManager.getLogger("RelayManager"); + + public static final RelayManager relayManager = new RelayManager(); + public static final int preferredRelayVersion = 1; + + private final List relays = new ArrayList(); + private long lastPingThrough = 0l; + + public void load(NBTTagList relayConfig) { + relays.clear(); + if(relayConfig != null && relayConfig.tagCount() > 0) { + boolean gotAPrimary = false; + for(int i = 0, l = relayConfig.tagCount(); i < l; ++i) { + NBTTagCompound relay = relayConfig.getCompoundTagAt(i); + boolean p = relay.getBoolean("primary"); + if(p) { + if(gotAPrimary) { + p = false; + }else { + gotAPrimary = true; + } + } + relays.add(new RelayServer(relay.getString("addr"), relay.getString("comment"), p)); + } + } + sort(); + } + + public void save() { + try { + NBTTagList lst = new NBTTagList(); + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer srv = relays.get(i); + NBTTagCompound etr = new NBTTagCompound(); + etr.setString("addr", srv.address); + etr.setString("comment", srv.comment); + etr.setBoolean("primary", srv.isPrimary()); + lst.appendTag(etr); + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("relays", lst); + + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + CompressedStreamTools.writeCompressed(nbttagcompound, bao); + EagRuntime.setStorage("r", bao.toByteArray()); + } catch (Exception exception) { + logger.error("Couldn\'t save relay list!"); + logger.error(exception); + } + } + + private void sort() { + if(relays.isEmpty()) { + return; + } + int j = -1; + for(int i = 0, l = relays.size(); i < l; ++i) { + if(relays.get(i).isPrimary()) { + if(j == -1) { + j = i; + }else { + relays.get(i).setPrimary(false); + } + } + } + if(j == -1) { + boolean found = false; + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer srv = relays.get(i); + if(srv.getPing() > 0l) { + found = true; + srv.setPrimary(true); + break; + } + } + if(!found) { + relays.get(0).setPrimary(true); + } + }else { + RelayServer srv = relays.remove(j); + relays.add(0, srv); + } + } + + public void ping() { + lastPingThrough = System.currentTimeMillis(); + for(int i = 0, l = relays.size(); i < l; ++i) { + relays.get(i).ping(); + } + } + + public void update() { + for(int i = 0, l = relays.size(); i < l; ++i) { + relays.get(i).update(); + } + } + + public void close() { + for(int i = 0, l = relays.size(); i < l; ++i) { + relays.get(i).close(); + } + } + + public int count() { + return relays.size(); + } + + public RelayServer get(int idx) { + return relays.get(idx); + } + + public void add(String addr, String comment, boolean primary) { + lastPingThrough = 0l; + int i = relays.size(); + relays.add(new RelayServer(addr, comment, false)); + if(primary) { + setPrimary0(i); + } + save(); + } + + public void addNew(String addr, String comment, boolean primary) { + lastPingThrough = 0l; + int i = relays.size(); + int j = primary || i == 0 ? 0 : 1; + RelayServer newServer = new RelayServer(addr, comment, false); + relays.add(j, newServer); + newServer.ping(); + if(primary) { + setPrimary0(j); + } + save(); + } + + public void setPrimary(int idx) { + setPrimary0(idx); + save(); + } + + private void setPrimary0(int idx) { + if(idx >= 0 && idx < relays.size()) { + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer srv = relays.get(i); + if(srv.isPrimary()) { + srv.setPrimary(false); + } + } + RelayServer pr = relays.remove(idx); + pr.setPrimary(true); + relays.add(0, pr); + } + } + + public void remove(int idx) { + RelayServer srv = relays.remove(idx); + srv.close(); + sort(); + save(); + } + + public RelayServer getPrimary() { + if(!relays.isEmpty()) { + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer srv = relays.get(i); + if(srv.isPrimary()) { + return srv; + } + } + sort(); + save(); + return getPrimary(); + }else { + return null; + } + } + + public RelayServerSocket connectHandshake(RelayServer relay, int type, String code) { + RelayServerSocket sock = relay.openSocket(); + while(!sock.isClosed()) { + if(sock.isOpen()) { + sock.writePacket(new IPacket00Handshake(type, preferredRelayVersion, code)); + while(!sock.isClosed()) { + IPacket pkt = sock.nextPacket(); + if(pkt != null) { + if(pkt instanceof IPacket00Handshake) { + return sock; + }else if(pkt instanceof IPacketFFErrorCode) { + IPacketFFErrorCode ipkt = (IPacketFFErrorCode) pkt; + logger.error("Relay [{}] failed: {}({}): {}", relay.address, IPacketFFErrorCode.code2string(ipkt.code), ipkt.code, ipkt.desc); + Throwable t; + while((t = sock.getException()) != null) { + logger.error(t); + } + sock.close(); + return null; + }else { + logger.error("Relay [{}] unexpected packet: {}", relay.address, pkt.getClass().getSimpleName()); + sock.close(); + return null; + } + } + EagUtils.sleep(20l); + } + } + EagUtils.sleep(20l); + } + logger.error("Relay [{}] connection failed!", relay.address); + Throwable t; + while((t = sock.getException()) != null) { + logger.error(t); + } + return null; + } + + private final List brokenServers = new LinkedList(); + + public RelayServerSocket getWorkingRelay(Consumer progressCallback, int type, String code) { + brokenServers.clear(); + if(!relays.isEmpty()) { + long millis = System.currentTimeMillis(); + if(millis - lastPingThrough < 10000l) { + RelayServer relay = getPrimary(); + if(relay.getPing() > 0l && relay.getPingCompatible().isCompatible()) { + progressCallback.accept(relay.address); + RelayServerSocket sock = connectHandshake(relay, type, code); + if(sock != null) { + if(!sock.isFailed()) { + return sock; + } + }else { + brokenServers.add(relay); + } + } + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer relayEtr = relays.get(i); + if(relayEtr != relay) { + if(relayEtr.getPing() > 0l && relayEtr.getPingCompatible().isCompatible()) { + progressCallback.accept(relayEtr.address); + RelayServerSocket sock = connectHandshake(relayEtr, type, code); + if(sock != null) { + if(!sock.isFailed()) { + return sock; + } + }else { + brokenServers.add(relayEtr); + } + } + } + } + } + return getWorkingCodeRelayActive(progressCallback, type, code); + }else { + return null; + } + } + + private RelayServerSocket getWorkingCodeRelayActive(Consumer progressCallback, int type, String code) { + if(!relays.isEmpty()) { + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer srv = relays.get(i); + if(!brokenServers.contains(srv)) { + progressCallback.accept(srv.address); + RelayServerSocket sock = connectHandshake(srv, type, code); + if(sock != null) { + if(!sock.isFailed()) { + return sock; + } + }else { + brokenServers.add(srv); + } + } + } + return null; + }else { + return null; + } + } + + public void loadDefaults() { + int setPrimary = relays.size(); + eee: for(RelayEntry etr : EagRuntime.getConfiguration().getRelays()) { + for(RelayServer exEtr : relays) { + if(exEtr.address.equalsIgnoreCase(etr.address)) { + continue eee; + } + } + relays.add(new RelayServer(etr)); + } + setPrimary(setPrimary); + } + + public String makeNewRelayName() { + String str = "Relay Server #" + (relays.size() + 1); + for(int i = relays.size() + 2, l = relays.size() + 50; i < l; ++i) { + if(str.equalsIgnoreCase("Relay Server #" + i)) { + str = "Relay Server #" + (i + 1); + } + } + eee: while(true) { + for(int i = 0, l = relays.size(); i < l; ++i) { + if(str.equalsIgnoreCase(relays.get(i).comment)) { + str = str + "_"; + continue eee; + } + } + break; + } + return str; + } + + public RelayServer getByURI(String uri) { + Iterator itr = relays.iterator(); + while(itr.hasNext()) { + RelayServer rl = itr.next(); + if(rl.address.equals(uri)) { + return rl; + } + } + return null; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayQuery.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayQuery.java new file mode 100644 index 0000000..455fef8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayQuery.java @@ -0,0 +1,43 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay; + +/** + * 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 interface RelayQuery { + + enum RateLimit { + NONE, FAILED, BLOCKED, FAILED_POSSIBLY_LOCKED, LOCKED, NOW_LOCKED + } + + enum VersionMismatch { + COMPATIBLE, CLIENT_OUTDATED, RELAY_OUTDATED, UNKNOWN; + public boolean isCompatible() { + return this == COMPATIBLE; + } + } + + boolean isQueryOpen(); + boolean isQueryFailed(); + RateLimit isQueryRateLimit(); + void close(); + + int getVersion(); + String getComment(); + String getBrand(); + long getPing(); + + VersionMismatch getCompatible(); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayServer.java new file mode 100644 index 0000000..9d46432 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayServer.java @@ -0,0 +1,144 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay; + +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQuery.VersionMismatch; +import net.minecraft.client.Minecraft; + +/** + * 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 RelayServer { + + public final String address; + public final String comment; + private boolean primary; + + private RelayQuery query = null; + private int queriedVersion = -1; + private String queriedComment; + private String queriedVendor; + private VersionMismatch queriedCompatible; + private long ping = 0l; + private long workingPing = 0l; + public long lastPing = 0l; + + public RelayServer(String address, String comment, boolean primary) { + this.address = address; + this.comment = comment; + this.primary = primary; + } + + public RelayServer(RelayEntry etr) { + this(etr.address, etr.comment, etr.primary); + } + + public boolean isPrimary() { + return primary; + } + + public void setPrimary(boolean primaryee) { + primary = primaryee; + } + + public long getPing() { + return ping; + } + + public long getWorkingPing() { + return workingPing; + } + + public int getPingVersion() { + return queriedVersion; + } + + public String getPingComment() { + return queriedComment == null ? "" : queriedComment; + } + + public String getPingVendor() { + return queriedVendor == null ? "" : queriedVendor; + } + + public VersionMismatch getPingCompatible() { + return queriedCompatible; + } + + public void pingBlocking() { + ping(); + while(getPing() < 0l) { + EagUtils.sleep(250l); + update(); + } + } + + public void ping() { + if(PlatformWebRTC.supported()) { + close(); + query = PlatformWebRTC.openRelayQuery(address); + queriedVersion = -1; + queriedComment = null; + queriedVendor = null; + queriedCompatible = VersionMismatch.UNKNOWN; + ping = -1l; + }else { + query = null; + queriedVersion = 1; + queriedComment = "LAN NOT SUPPORTED"; + queriedVendor = "NULL"; + queriedCompatible = VersionMismatch.CLIENT_OUTDATED; + ping = -1l; + } + } + + public void update() { + if(query != null && !query.isQueryOpen()) { + if(query.isQueryFailed()) { + queriedVersion = -1; + queriedComment = null; + queriedVendor = null; + queriedCompatible = VersionMismatch.UNKNOWN; + ping = 0l; + }else { + queriedVersion = query.getVersion(); + queriedComment = query.getComment(); + queriedVendor = query.getBrand(); + ping = query.getPing(); + queriedCompatible = query.getCompatible(); + workingPing = ping; + } + lastPing = System.currentTimeMillis(); + query = null; + } + } + + public void close() { + if(query != null && query.isQueryOpen()) { + query.close(); + query = null; + queriedVersion = -1; + queriedComment = null; + queriedVendor = null; + queriedCompatible = VersionMismatch.UNKNOWN; + ping = 0l; + } + } + + public RelayServerSocket openSocket() { + return PlatformWebRTC.openRelayConnection(address, Minecraft.getMinecraft().gameSettings.relayTimeout * 1000); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayServerSocket.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayServerSocket.java new file mode 100644 index 0000000..e21cb85 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayServerSocket.java @@ -0,0 +1,38 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay; + +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket; + +/** + * 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 interface RelayServerSocket { + + boolean isOpen(); + boolean isClosed(); + void close(); + + boolean isFailed(); + Throwable getException(); + + void writePacket(IPacket pkt); + + IPacket readPacket(); + IPacket nextPacket(); + + RelayQuery.RateLimit getRatelimitHistory(); + + String getURI(); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayWorldsQuery.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayWorldsQuery.java new file mode 100644 index 0000000..787b8a8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayWorldsQuery.java @@ -0,0 +1,34 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay; + +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQuery.VersionMismatch; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket07LocalWorlds; + +/** + * 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 interface RelayWorldsQuery { + + boolean isQueryOpen(); + boolean isQueryFailed(); + RelayQuery.RateLimit isQueryRateLimit(); + void close(); + + List getWorlds(); + + VersionMismatch getCompatible(); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/ICEServerSet.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/ICEServerSet.java new file mode 100644 index 0000000..2ac4b9d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/ICEServerSet.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +/** + * Copyright (c) 2022 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 ICEServerSet { + + public static enum RelayType { + STUN, TURN; + } + + public static class RelayServer { + + public final RelayType type; + public final String address; + public final String username; + public final String password; + + protected RelayServer(RelayType type, String address, String username, String password) { + this.type = type; + this.address = address; + this.username = username; + this.password = password; + } + + protected RelayServer(RelayType type, String address) { + this.type = type; + this.address = address; + this.username = null; + this.password = null; + } + + public String getICEString() { + if(username == null) { + return address; + }else { + return address + ";" + username + ";" + password; + } + } + + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java new file mode 100644 index 0000000..e88f0ef --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java @@ -0,0 +1,165 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; + +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +/** + * Copyright (c) 2022 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 IPacket { + + private static final Logger logger = LogManager.getLogger("RelayPacket"); + + private static final Map> definedPacketClasses = new HashMap(); + private static final Map,Integer> definedPacketIds = new HashMap(); + + private static void register(int id, Class clazz) { + definedPacketClasses.put(id, clazz); + definedPacketIds.put(clazz, id); + } + + static { + register(0x00, IPacket00Handshake.class); + register(0x01, IPacket01ICEServers.class); + register(0x02, IPacket02NewClient.class); + register(0x03, IPacket03ICECandidate.class); + register(0x04, IPacket04Description.class); + register(0x05, IPacket05ClientSuccess.class); + register(0x06, IPacket06ClientFailure.class); + register(0x07, IPacket07LocalWorlds.class); + register(0x69, IPacket69Pong.class); + register(0x70, IPacket70SpecialUpdate.class); + register(0xFE, IPacketFEDisconnectClient.class); + register(0xFF, IPacketFFErrorCode.class); + } + + public static IPacket readPacket(DataInputStream input) throws IOException { + int i = input.read(); + try { + Class clazz = definedPacketClasses.get(i); + if(clazz == null) { + throw new IOException("Unknown packet type: " + i); + } + IPacket pkt = clazz.newInstance(); + pkt.read(input); + return pkt; + } catch (InstantiationException | IllegalAccessException e) { + throw new IOException("Unknown packet type: " + i); + } + } + + public static byte[] writePacket(IPacket packet) throws IOException { + Integer i = definedPacketIds.get(packet.getClass()); + if(i != null) { + int len = packet.packetLength(); + ByteArrayOutputStream bao = len == -1 ? new ByteArrayOutputStream() : + new ByteArrayOutputStream(len + 1); + bao.write(i); + packet.write(new DataOutputStream(bao)); + byte[] ret = bao.toByteArray(); + if(len != -1 && ret.length != len + 1) { + logger.error("writePacket buffer for packet {} {} by {} bytes", packet.getClass().getSimpleName(), + (len + 1 < ret.length ? "overflowed" : "underflowed"), + (len + 1 < ret.length ? ret.length - len - 1 : len + 1 - ret.length)); + } + return ret; + }else { + throw new IOException("Unknown packet type: " + packet.getClass().getSimpleName()); + } + } + + public void read(DataInputStream input) throws IOException { + } + + public void write(DataOutputStream output) throws IOException { + } + + public int packetLength() { + return -1; + } + + public static String readASCII(InputStream is, int len) throws IOException { + char[] ret = new char[len]; + for(int i = 0; i < len; ++i) { + int j = is.read(); + if(j < 0) { + return null; + } + ret[i] = (char)j; + } + return new String(ret); + } + + public static void writeASCII(OutputStream is, String txt) throws IOException { + for(int i = 0, l = txt.length(); i < l; ++i) { + is.write((int)txt.charAt(i)); + } + } + + public static String readASCII8(InputStream is) throws IOException { + int i = is.read(); + if(i < 0) { + return null; + }else { + return readASCII(is, i); + } + } + + public static void writeASCII8(OutputStream is, String txt) throws IOException { + if(txt == null) { + is.write(0); + }else { + int l = txt.length(); + is.write(l); + for(int i = 0; i < l; ++i) { + is.write((int)txt.charAt(i)); + } + } + } + + public static String readASCII16(InputStream is) throws IOException { + int hi = is.read(); + int lo = is.read(); + if(hi < 0 || lo < 0) { + return null; + }else { + return readASCII(is, (hi << 8) | lo); + } + } + + public static void writeASCII16(OutputStream is, String txt) throws IOException { + if(txt == null) { + is.write(0); + is.write(0); + }else { + int l = txt.length(); + is.write((l >> 8) & 0xFF); + is.write(l & 0xFF); + for(int i = 0; i < l; ++i) { + is.write((int)txt.charAt(i)); + } + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket00Handshake.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket00Handshake.java new file mode 100644 index 0000000..1c22490 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket00Handshake.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket00Handshake extends IPacket { + + public int connectionType = 0; + public int connectionVersion = 1; + public String connectionCode = null; + + public IPacket00Handshake() { + } + + public IPacket00Handshake(int connectionType, int connectionVersion, + String connectionCode) { + this.connectionType = connectionType; + this.connectionVersion = connectionVersion; + this.connectionCode = connectionCode; + } + + @Override + public void read(DataInputStream input) throws IOException { + connectionType = input.read(); + connectionVersion = input.read(); + connectionCode = IPacket.readASCII8(input); + } + + @Override + public void write(DataOutputStream output) throws IOException { + output.write(connectionType); + output.write(connectionVersion); + IPacket.writeASCII8(output, connectionCode); + } + + @Override + public int packetLength() { + return 1 + 1 + (connectionCode != null ? 1 + connectionCode.length() : 0); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket01ICEServers.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket01ICEServers.java new file mode 100644 index 0000000..7d32761 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket01ICEServers.java @@ -0,0 +1,53 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; + +/** + * Copyright (c) 2022 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 IPacket01ICEServers extends IPacket { + + public final Collection servers; + + public IPacket01ICEServers() { + servers = new ArrayList(); + } + + public void read(DataInputStream input) throws IOException { + servers.clear(); + int l = input.readUnsignedShort(); + for(int i = 0; i < l; ++i) { + char type = (char)input.read(); + ICEServerSet.RelayType typeEnum; + if(type == 'S') { + typeEnum = ICEServerSet.RelayType.STUN; + }else if(type == 'T') { + typeEnum = ICEServerSet.RelayType.TURN; + }else { + throw new IOException("Unknown/Unsupported Relay Type: '" + type + "'"); + } + servers.add(new ICEServerSet.RelayServer( + typeEnum, + readASCII16(input), + readASCII8(input), + readASCII8(input) + )); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket02NewClient.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket02NewClient.java new file mode 100644 index 0000000..76ab9f5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket02NewClient.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket02NewClient extends IPacket { + + public String clientId; + + public IPacket02NewClient(String clientId) { + this.clientId = clientId; + } + + public IPacket02NewClient() { + } + + public void read(DataInputStream input) throws IOException { + clientId = readASCII8(input); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket03ICECandidate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket03ICECandidate.java new file mode 100644 index 0000000..985f040 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket03ICECandidate.java @@ -0,0 +1,49 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket03ICECandidate extends IPacket { + + public String peerId; + public String candidate; + + public IPacket03ICECandidate(String peerId, String desc) { + this.peerId = peerId; + this.candidate = desc; + } + + public IPacket03ICECandidate() { + } + + public void read(DataInputStream input) throws IOException { + peerId = readASCII8(input); + candidate = readASCII16(input); + } + + public void write(DataOutputStream output) throws IOException { + writeASCII8(output, peerId); + writeASCII16(output, candidate); + } + + public int packetLength() { + return 1 + peerId.length() + 2 + candidate.length(); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket04Description.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket04Description.java new file mode 100644 index 0000000..6bc3f8f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket04Description.java @@ -0,0 +1,49 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket04Description extends IPacket { + + public String peerId; + public String description; + + public IPacket04Description(String peerId, String desc) { + this.peerId = peerId; + this.description = desc; + } + + public IPacket04Description() { + } + + public void read(DataInputStream input) throws IOException { + peerId = readASCII8(input); + description = readASCII16(input); + } + + public void write(DataOutputStream output) throws IOException { + writeASCII8(output, peerId); + writeASCII16(output, description); + } + + public int packetLength() { + return 1 + peerId.length() + 2 + description.length(); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket05ClientSuccess.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket05ClientSuccess.java new file mode 100644 index 0000000..240e964 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket05ClientSuccess.java @@ -0,0 +1,45 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket05ClientSuccess extends IPacket { + + public String clientId; + + public IPacket05ClientSuccess() { + } + + public IPacket05ClientSuccess(String clientId) { + this.clientId = clientId; + } + + public void read(DataInputStream input) throws IOException { + clientId = readASCII8(input); + } + + public void write(DataOutputStream output) throws IOException { + writeASCII8(output, clientId); + } + + public int packetLength() { + return 1 + clientId.length(); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket06ClientFailure.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket06ClientFailure.java new file mode 100644 index 0000000..9506c37 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket06ClientFailure.java @@ -0,0 +1,45 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket06ClientFailure extends IPacket { + + public String clientId; + + public IPacket06ClientFailure() { + } + + public IPacket06ClientFailure(String clientId) { + this.clientId = clientId; + } + + public void read(DataInputStream input) throws IOException { + clientId = readASCII8(input); + } + + public void write(DataOutputStream output) throws IOException { + writeASCII8(output, clientId); + } + + public int packetLength() { + return 1 + clientId.length(); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket07LocalWorlds.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket07LocalWorlds.java new file mode 100644 index 0000000..923e179 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket07LocalWorlds.java @@ -0,0 +1,50 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Copyright (c) 2022 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 IPacket07LocalWorlds extends IPacket { + + public static class LocalWorld { + + public final String worldName; + public final String worldCode; + + public LocalWorld(String worldName, String worldCode) { + this.worldName = worldName; + this.worldCode = worldCode; + } + + } + + public final List worldsList; + + public IPacket07LocalWorlds() { + this.worldsList = new ArrayList(); + } + + public void read(DataInputStream input) throws IOException { + int l = input.read(); + for(int i = 0; i < l; ++i) { + worldsList.add(new LocalWorld(readASCII8(input), readASCII8(input))); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket69Pong.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket69Pong.java new file mode 100644 index 0000000..589ca92 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket69Pong.java @@ -0,0 +1,45 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacket69Pong extends IPacket { + + public int protcolVersion; + public String comment; + public String brand; + + public IPacket69Pong(int protcolVersion, String comment, String brand) { + if(comment.length() > 255) { + comment = comment.substring(0, 256); + } + this.protcolVersion = protcolVersion; + this.comment = comment; + this.brand = brand; + } + + public IPacket69Pong() { + } + + public void read(DataInputStream output) throws IOException { + protcolVersion = output.read(); + comment = readASCII8(output); + brand = readASCII8(output); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket70SpecialUpdate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket70SpecialUpdate.java new file mode 100644 index 0000000..1bdd463 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket70SpecialUpdate.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * 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 IPacket70SpecialUpdate extends IPacket { + + public static final int OPERATION_UPDATE_CERTIFICATE = 0x69; + + public int operation; + public byte[] updatePacket; + + public IPacket70SpecialUpdate() { + } + + public IPacket70SpecialUpdate(int operation, byte[] updatePacket) { + this.operation = operation; + this.updatePacket = updatePacket; + } + + @Override + public void read(DataInputStream input) throws IOException { + operation = input.read(); + updatePacket = new byte[input.readUnsignedShort()]; + input.read(updatePacket); + } + + @Override + public void write(DataOutputStream output) throws IOException { + output.write(operation); + output.writeShort(updatePacket.length); + output.write(updatePacket); + } + + @Override + public int packetLength() { + return 3 + updatePacket.length; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacketFEDisconnectClient.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacketFEDisconnectClient.java new file mode 100644 index 0000000..77a787f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacketFEDisconnectClient.java @@ -0,0 +1,67 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; + +/** + * Copyright (c) 2022 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 IPacketFEDisconnectClient extends IPacket { + + public static final int TYPE_FINISHED_SUCCESS = 0x00; + public static final int TYPE_FINISHED_FAILED = 0x01; + public static final int TYPE_TIMEOUT = 0x02; + public static final int TYPE_INVALID_OPERATION = 0x03; + public static final int TYPE_INTERNAL_ERROR = 0x04; + public static final int TYPE_SERVER_DISCONNECT = 0x05; + public static final int TYPE_UNKNOWN = 0xFF; + + public String clientId; + public int code; + public String reason; + + public IPacketFEDisconnectClient() { + } + + public IPacketFEDisconnectClient(String clientId, int code, String reason) { + this.clientId = clientId; + this.code = code; + this.reason = reason; + } + + public void read(DataInputStream input) throws IOException { + clientId = readASCII8(input); + code = input.read(); + reason = readASCII16(input); + } + + public void write(DataOutputStream output) throws IOException { + writeASCII8(output, clientId); + output.write(code); + writeASCII16(output, reason); + } + + public int packetLength() { + return -1; + } + + public static final ByteBuffer ratelimitPacketTooMany = ByteBuffer.wrap(new byte[] { (byte)0xFC, (byte)0x00 }); + public static final ByteBuffer ratelimitPacketBlock = ByteBuffer.wrap(new byte[] { (byte)0xFC, (byte)0x01 }); + public static final ByteBuffer ratelimitPacketBlockLock = ByteBuffer.wrap(new byte[] { (byte)0xFC, (byte)0x02 }); + public static final ByteBuffer ratelimitPacketLocked = ByteBuffer.wrap(new byte[] { (byte)0xFC, (byte)0x03 }); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacketFFErrorCode.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacketFFErrorCode.java new file mode 100644 index 0000000..4475d75 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacketFFErrorCode.java @@ -0,0 +1,82 @@ +package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Copyright (c) 2022 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 IPacketFFErrorCode extends IPacket { + + public static final int TYPE_INTERNAL_ERROR = 0x00; + public static final int TYPE_PROTOCOL_VERSION = 0x01; + public static final int TYPE_INVALID_PACKET = 0x02; + public static final int TYPE_ILLEGAL_OPERATION = 0x03; + public static final int TYPE_CODE_LENGTH = 0x04; + public static final int TYPE_INCORRECT_CODE = 0x05; + public static final int TYPE_SERVER_DISCONNECTED = 0x06; + public static final int TYPE_UNKNOWN_CLIENT = 0x07; + + public static final String[] packetTypes = new String[0x08]; + + static { + packetTypes[TYPE_INTERNAL_ERROR] = "TYPE_INTERNAL_ERROR"; + packetTypes[TYPE_PROTOCOL_VERSION] = "TYPE_PROTOCOL_VERSION"; + packetTypes[TYPE_INVALID_PACKET] = "TYPE_INVALID_PACKET"; + packetTypes[TYPE_ILLEGAL_OPERATION] = "TYPE_ILLEGAL_OPERATION"; + packetTypes[TYPE_CODE_LENGTH] = "TYPE_CODE_LENGTH"; + packetTypes[TYPE_INCORRECT_CODE] = "TYPE_INCORRECT_CODE"; + packetTypes[TYPE_SERVER_DISCONNECTED] = "TYPE_SERVER_DISCONNECTED"; + packetTypes[TYPE_UNKNOWN_CLIENT] = "TYPE_UNKNOWN_CLIENT"; + } + + public static String code2string(int i) { + if(i >= 0 || i < packetTypes.length) { + return packetTypes[i]; + }else { + return "UNKNOWN"; + } + } + + public int code; + public String desc; + + public IPacketFFErrorCode() { + } + + public IPacketFFErrorCode(int code, String desc) { + this.code = code; + this.desc = desc; + } + + @Override + public void read(DataInputStream input) throws IOException { + code = input.read(); + desc = readASCII16(input); + } + + @Override + public void write(DataOutputStream input) throws IOException { + input.write(code); + writeASCII16(input, desc); + } + + @Override + public int packetLength() { + return 1 + 2 + desc.length(); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/ClientCommandDummy.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/ClientCommandDummy.java new file mode 100644 index 0000000..3654b0e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/ClientCommandDummy.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; + +/** + * 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 ClientCommandDummy extends CommandBase { + + private final String commandName; + private final int permissionLevel; + private final String commandUsage; + + public ClientCommandDummy(String commandName, int permissionLevel, String commandUsage) { + this.commandName = commandName; + this.permissionLevel = permissionLevel; + this.commandUsage = commandUsage; + } + + @Override + public String getCommandName() { + return commandName; + } + + @Override + public int getRequiredPermissionLevel() { + return permissionLevel; + } + + @Override + public String getCommandUsage(ICommandSender var1) { + return commandUsage; + } + + @Override + public void processCommand(ICommandSender var1, String[] var2) throws CommandException { + var1.addChatMessage(new ChatComponentTranslation("command.clientStub")); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/CrashReportHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/CrashReportHelper.java new file mode 100644 index 0000000..e36ec2c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/CrashReportHelper.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import java.util.concurrent.Callable; + +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.minecraft.crash.CrashReportCategory; + +/** + * 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 CrashReportHelper { + + public static void addIntegratedServerBlockInfo(CrashReportCategory category, final BlockPos pos, final Block blockIn, + final int blockData) { + final int i = Block.getIdFromBlock(blockIn); + category.addCrashSectionCallable("Block type", new Callable() { + public String call() throws Exception { + try { + return HString.format("ID #%d (%s // %s)", new Object[] { Integer.valueOf(i), + blockIn.getUnlocalizedName(), blockIn.getClass().getName() }); + } catch (Throwable var2) { + return "ID #" + i; + } + } + }); + category.addCrashSectionCallable("Block data value", new Callable() { + public String call() throws Exception { + if (blockData < 0) { + return "Unknown? (Got " + blockData + ")"; + } else { + String s = HString.format("%4s", new Object[] { Integer.toBinaryString(blockData) }).replace(" ", + "0"); + return HString.format("%1$d / 0x%1$X / 0b%2$s", new Object[] { Integer.valueOf(blockData), s }); + } + } + }); + category.addCrashSectionCallable("Block location", new Callable() { + public String call() throws Exception { + return CrashReportCategory.getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ())); + } + }); + } + + public static void addIntegratedServerBlockInfo(CrashReportCategory category, final BlockPos pos, final IBlockState state) { + category.addCrashSectionCallable("Block", new Callable() { + public String call() throws Exception { + return state.toString(); + } + }); + category.addCrashSectionCallable("Block location", new Callable() { + public String call() throws Exception { + return CrashReportCategory.getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ())); + } + }); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerChunkLoader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerChunkLoader.java new file mode 100644 index 0000000..5fcd552 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerChunkLoader.java @@ -0,0 +1,119 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import net.PeytonPlayz585.shadow.Config; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.AnvilChunkLoader; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 EaglerChunkLoader extends AnvilChunkLoader { + + private static final String hex = "0123456789ABCDEF"; + private static final Logger logger = LogManager.getLogger("EaglerChunkLoader"); + + public static String getChunkPath(int x, int z) { + int unsignedX = x + 1900000; + int unsignedZ = z + 1900000; + + char[] path = new char[12]; + for(int i = 5; i >= 0; --i) { + path[i] = hex.charAt((unsignedX >> (i * 4)) & 0xF); + path[i + 6] = hex.charAt((unsignedZ >> (i * 4)) & 0xF); + } + + return new String(path); + } + + public static ChunkCoordIntPair getChunkCoords(String filename) { + String strX = filename.substring(0, 6); + String strZ = filename.substring(6); + + int retX = 0; + int retZ = 0; + + for(int i = 0; i < 6; ++i) { + retX |= hex.indexOf(strX.charAt(i)) << (i << 2); + retZ |= hex.indexOf(strZ.charAt(i)) << (i << 2); + } + + return new ChunkCoordIntPair(retX - 1900000, retZ - 1900000); + } + + public final VFile2 chunkDirectory; + + public EaglerChunkLoader(VFile2 chunkDirectory) { + this.chunkDirectory = chunkDirectory; + } + + @Override + public Chunk loadChunk(World var1, int var2, int var3) throws IOException { + VFile2 file = new VFile2(chunkDirectory, getChunkPath(var2, var3) + ".dat"); + if(!file.exists()) { + return null; + } + try { + NBTTagCompound nbt; + try(InputStream is = file.getInputStream()) { + nbt = CompressedStreamTools.readCompressed(is); + } + Config.fixChunkLoading(); + return checkedReadChunkFromNBT(var1, var2, var3, nbt); + }catch(Throwable t) { + + } + return null; + } + + @Override + public void saveChunk(World var1, Chunk var2) throws IOException, MinecraftException { + NBTTagCompound chunkData = new NBTTagCompound(); + this.writeChunkToNBT(var2, var1, chunkData); + NBTTagCompound fileData = new NBTTagCompound(); + fileData.setTag("Level", chunkData); + VFile2 file = new VFile2(chunkDirectory, getChunkPath(var2.xPosition, var2.zPosition) + ".dat"); + try(OutputStream os = file.getOutputStream()) { + CompressedStreamTools.writeCompressed(fileData, os); + } + } + + @Override + public void saveExtraChunkData(World var1, Chunk var2) throws IOException { + // ? + } + + @Override + public void chunkTick() { + // ? + } + + @Override + public void saveExtraData() { + // ? + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java new file mode 100644 index 0000000..a090efa --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java @@ -0,0 +1,499 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.ILogRedirector; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.*; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.EnumConnectionState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.network.NetHandlerLoginServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringTranslate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings.GameType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.export.WorldConverterEPK; +import net.lax1dude.eaglercraft.v1_8.sp.server.export.WorldConverterMCA; +import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.socket.IntegratedServerPlayerNetworkManager; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 EaglerIntegratedServerWorker { + + public static final Logger logger = LogManager.getLogger("EaglerIntegratedServer"); + + private static EaglerMinecraftServer currentProcess = null; + private static WorldSettings newWorldSettings = null; + + public static final EaglerSaveFormat saveFormat = new EaglerSaveFormat(EaglerSaveFormat.worldsFolder); + + private static final Map openChannels = new HashMap(); + + private static void processAsyncMessageQueue() { + List pktList = ServerPlatformSingleplayer.recieveAllPacket(); + if(pktList != null) { + IPCPacketData packetData; + for(int i = 0, l = pktList.size(); i < l; ++i) { + packetData = pktList.get(i); + if(packetData.channel.equals(SingleplayerServerController.IPC_CHANNEL)) { + IPCPacketBase ipc; + try { + ipc = IPCPacketManager.IPCDeserialize(packetData.contents); + }catch(IOException ex) { + throw new RuntimeException("Failed to deserialize IPC packet", ex); + } + handleIPCPacket(ipc); + }else { + IntegratedServerPlayerNetworkManager netHandler = openChannels.get(packetData.channel); + if(netHandler != null) { + netHandler.addRecievedPacket(packetData.contents); + }else { + logger.error("Recieved packet on channel that does not exist: \"{}\"", packetData.channel); + } + } + } + } + } + + public static void tick() { + List ocs = new ArrayList<>(openChannels.values()); + for(IntegratedServerPlayerNetworkManager i : ocs) { + i.tick(); + } + } + + public static EaglerMinecraftServer getServer() { + return currentProcess; + } + + public static boolean getChannelExists(String channel) { + return openChannels.containsKey(channel); + } + + public static void closeChannel(String channel) { + IntegratedServerPlayerNetworkManager netmanager = openChannels.remove(channel); + if(netmanager != null) { + netmanager.closeChannel(new ChatComponentText("End of stream")); + sendIPCPacket(new IPCPacket0CPlayerChannel(channel, false)); + } + } + + private static void startPlayerConnnection(String channel) { + if(openChannels.containsKey(channel)) { + logger.error("Tried opening player channel that already exists: {}", channel); + return; + } + if(currentProcess == null) { + logger.error("Tried opening player channel while server is stopped: {}", channel); + return; + } + IntegratedServerPlayerNetworkManager networkmanager = new IntegratedServerPlayerNetworkManager(channel); + networkmanager.setConnectionState(EnumConnectionState.LOGIN); + networkmanager.setNetHandler(new NetHandlerLoginServer(currentProcess, networkmanager)); + openChannels.put(channel, networkmanager); + } + + private static void handleIPCPacket(IPCPacketBase ipc) { + int id = ipc.id(); + try { + switch(id) { + case IPCPacket00StartServer.ID: { + IPCPacket00StartServer pkt = (IPCPacket00StartServer)ipc; + + if(!isServerStopped()) { + currentProcess.stopServer(); + } + + currentProcess = new EaglerMinecraftServer(pkt.worldName, pkt.ownerName, pkt.initialViewDistance, newWorldSettings, pkt.demoMode); + currentProcess.setBaseServerProperties(EnumDifficulty.getDifficultyEnum(pkt.initialDifficulty), newWorldSettings == null ? GameType.SURVIVAL : newWorldSettings.getGameType()); + currentProcess.startServer(); + + String[] worlds = EaglerSaveFormat.worldsList.getAllLines(); + if(worlds == null || (worlds.length == 1 && worlds[0].trim().length() <= 0)) { + worlds = null; + } + if(worlds == null) { + EaglerSaveFormat.worldsList.setAllChars(pkt.worldName); + }else { + boolean found = false; + for(String s : worlds) { + if(s.equals(pkt.worldName)) { + found = true; + break; + } + } + if(!found) { + String[] s = new String[worlds.length + 1]; + s[0] = pkt.worldName; + System.arraycopy(worlds, 0, s, 1, worlds.length); + EaglerSaveFormat.worldsList.setAllChars(String.join("\n", s)); + } + } + + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket00StartServer.ID)); + break; + } + case IPCPacket01StopServer.ID: { + if(currentProcess != null) { + currentProcess.stopServer(); + currentProcess = null; + } + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket01StopServer.ID)); + break; + } + case IPCPacket02InitWorld.ID: { + tryStopServer(); + IPCPacket02InitWorld pkt = (IPCPacket02InitWorld)ipc; + newWorldSettings = new WorldSettings(pkt.seed, GameType.getByID(pkt.gamemode), pkt.structures, + pkt.hardcore, WorldType.worldTypes[pkt.worldType]); + newWorldSettings.setWorldName(pkt.worldArgs); // "setWorldName" is actually for setting generator arguments, MCP fucked up + if(pkt.bonusChest) { + newWorldSettings.enableBonusChest(); + } + if(pkt.cheats) { + newWorldSettings.enableCommands(); + } + break; + } + case IPCPacket03DeleteWorld.ID: { + tryStopServer(); + IPCPacket03DeleteWorld pkt = (IPCPacket03DeleteWorld)ipc; + if(!saveFormat.deleteWorldDirectory(pkt.worldName)) { + sendTaskFailed(); + break; + } + String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines(); + if(worldsTxt != null) { + List newWorlds = new ArrayList(); + for(String str : worldsTxt) { + if(!str.equalsIgnoreCase(pkt.worldName)) { + newWorlds.add(str); + } + } + EaglerSaveFormat.worldsList.setAllChars(String.join("\n", newWorlds)); + } + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket03DeleteWorld.ID)); + break; + } + case IPCPacket05RequestData.ID: { + tryStopServer(); + IPCPacket05RequestData pkt = (IPCPacket05RequestData)ipc; + if(pkt.request == IPCPacket05RequestData.REQUEST_LEVEL_EAG) { + sendIPCPacket(new IPCPacket09RequestResponse(WorldConverterEPK.exportWorld(pkt.worldName))); + }else if(pkt.request == IPCPacket05RequestData.REQUEST_LEVEL_MCA) { + sendIPCPacket(new IPCPacket09RequestResponse(WorldConverterMCA.exportWorld(pkt.worldName))); + }else { + logger.error("Unknown IPCPacket05RequestData type {}", ((int)pkt.request & 0xFF)); + sendTaskFailed(); + } + break; + } + case IPCPacket06RenameWorldNBT.ID: { + tryStopServer(); + IPCPacket06RenameWorldNBT pkt = (IPCPacket06RenameWorldNBT)ipc; + boolean b = false; + if(pkt.duplicate) { + b = saveFormat.duplicateWorld(pkt.worldName, pkt.displayName); + }else { + b = saveFormat.renameWorld(pkt.worldName, pkt.displayName); + } + if(!b) { + sendTaskFailed(); + break; + } + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket06RenameWorldNBT.ID)); + break; + } + case IPCPacket07ImportWorld.ID: { + tryStopServer(); + IPCPacket07ImportWorld pkt = (IPCPacket07ImportWorld)ipc; + try { + if(pkt.worldFormat == IPCPacket07ImportWorld.WORLD_FORMAT_EAG) { + WorldConverterEPK.importWorld(pkt.worldData, pkt.worldName); + }else if(pkt.worldFormat == IPCPacket07ImportWorld.WORLD_FORMAT_MCA) { + WorldConverterMCA.importWorld(pkt.worldData, pkt.worldName, pkt.gameRules); + }else { + throw new IOException("Client requested an unsupported export format!"); + } + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket07ImportWorld.ID)); + }catch(IOException ex) { + sendIPCPacket(new IPCPacket15Crashed("COULD NOT IMPORT WORLD \"" + pkt.worldName + "\"!!!\n\n" + EagRuntime.getStackTrace(ex) + "\n\nFile is probably corrupt, try a different world")); + sendTaskFailed(); + } + break; + } + case IPCPacket0ASetWorldDifficulty.ID: { + IPCPacket0ASetWorldDifficulty pkt = (IPCPacket0ASetWorldDifficulty)ipc; + if(!isServerStopped()) { + currentProcess.setDifficultyForAllWorlds(EnumDifficulty.getDifficultyEnum(pkt.difficulty)); + }else { + logger.warn("Client tried to set difficulty while server was stopped"); + } + break; + } + case IPCPacket0BPause.ID: { + IPCPacket0BPause pkt = (IPCPacket0BPause)ipc; + if(!isServerStopped()) { + currentProcess.setPaused(pkt.pause); + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket0BPause.ID)); + }else { + logger.error("Client tried to {} while server was stopped", pkt.pause ? "pause" : "unpause"); + sendTaskFailed(); + } + break; + } + case IPCPacket0CPlayerChannel.ID: { + IPCPacket0CPlayerChannel pkt = (IPCPacket0CPlayerChannel)ipc; + if(!isServerStopped()) { + if(pkt.open) { + startPlayerConnnection(pkt.channel); + }else { + closeChannel(pkt.channel); + } + }else { + logger.error("Client tried to {} channel server was stopped", pkt.open ? "open" : "close"); + } + break; + } + case IPCPacket0EListWorlds.ID: { + IPCPacket0EListWorlds pkt = (IPCPacket0EListWorlds)ipc; + if(!isServerStopped()) { + logger.error("Client tried to list worlds while server was running"); + sendTaskFailed(); + }else { + String[] worlds = EaglerSaveFormat.worldsList.getAllLines(); + if(worlds == null) { + sendIPCPacket(new IPCPacket16NBTList(IPCPacket16NBTList.WORLD_LIST, new LinkedList())); + break; + } + LinkedHashSet updatedList = new LinkedHashSet(); + LinkedList sendListNBT = new LinkedList(); + boolean rewrite = false; + for(int i = 0; i < worlds.length; ++i) { + String w = worlds[i].trim(); + if(w.length() > 0) { + VFile2 vf = new VFile2(EaglerSaveFormat.worldsFolder, w, "level.dat"); + if(!vf.exists()) { + vf = new VFile2(EaglerSaveFormat.worldsFolder, w, "level.dat_old"); + } + if(vf.exists()) { + try(InputStream dat = vf.getInputStream()) { + if(updatedList.add(w)) { + NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(dat); + worldDatNBT.setString("folderNameEagler", w); + sendListNBT.add(worldDatNBT); + }else { + rewrite = true; + } + continue; + }catch(IOException e) { + // shit fuck + } + } + rewrite = true; + logger.error("World level.dat for '{}' was not found, attempting to delete", w); + if(!saveFormat.deleteWorldDirectory(w)) { + logger.error("Failed to delete '{}'! It will be removed from the worlds list anyway", w); + } + }else { + rewrite = true; + } + } + if(rewrite) { + EaglerSaveFormat.worldsList.setAllChars(String.join("\n", updatedList)); + } + sendIPCPacket(new IPCPacket16NBTList(IPCPacket16NBTList.WORLD_LIST, sendListNBT)); + } + break; + } + case IPCPacket14StringList.ID: { + IPCPacket14StringList pkt = (IPCPacket14StringList)ipc; + switch(pkt.opCode) { + case IPCPacket14StringList.LOCALE: + StringTranslate.init(pkt.stringList); + break; + //case IPCPacket14StringList.STAT_GUID: + // AchievementMap.init(pkt.stringList); + // AchievementList.init(); + // break; + default: + logger.error("Strange string list 0x{} with length{} recieved", Integer.toHexString(pkt.opCode), pkt.stringList.size()); + break; + } + break; + } + case IPCPacket17ConfigureLAN.ID: { + + IPCPacket17ConfigureLAN pkt = (IPCPacket17ConfigureLAN)ipc; + currentProcess.getConfigurationManager().configureLAN(pkt.gamemode, pkt.cheats); // don't use iceServers + + break; + } + case IPCPacket18ClearPlayers.ID: { + if(!isServerStopped()) { + logger.error("Client tried to clear players while server was running"); + sendTaskFailed(); + }else { + saveFormat.clearPlayers(((IPCPacket18ClearPlayers)ipc).worldName); + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket18ClearPlayers.ID)); + } + break; + } + case IPCPacket19Autosave.ID: { + if(!isServerStopped()) { + currentProcess.getConfigurationManager().saveAllPlayerData(); + currentProcess.saveAllWorlds(false); + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket19Autosave.ID)); + }else { + logger.error("Client tried to autosave while server was stopped"); + sendTaskFailed(); + } + break; + } + case IPCPacket21EnableLogging.ID: { + enableLoggingRedirector(((IPCPacket21EnableLogging)ipc).enable); + break; + } + default: + logger.error("IPC packet type 0x{} class \"{}\" was not handled", Integer.toHexString(id), ipc.getClass().getSimpleName()); + sendTaskFailed(); + break; + } + }catch(Throwable t) { + logger.error("IPC packet type 0x{} class \"{}\" was not processed correctly", Integer.toHexString(id), ipc.getClass().getSimpleName()); + logger.error(t); + sendIPCPacket(new IPCPacket15Crashed("IPC packet type 0x" + Integer.toHexString(id) + " class \"" + ipc.getClass().getSimpleName() + "\" was not processed correctly!\n\n" + EagRuntime.getStackTrace(t))); + sendTaskFailed(); + } + } + + public static void enableLoggingRedirector(boolean en) { + LogManager.logRedirector = en ? new ILogRedirector() { + @Override + public void log(String txt, boolean err) { + sendLogMessagePacket(txt, err); + } + } : null; + } + + public static void sendLogMessagePacket(String txt, boolean err) { + sendIPCPacket(new IPCPacket20LoggerMessage(txt, err)); + } + + public static void sendIPCPacket(IPCPacketBase ipc) { + byte[] pkt; + try { + pkt = IPCPacketManager.IPCSerialize(ipc); + }catch (IOException ex) { + throw new RuntimeException("Failed to serialize IPC packet", ex); + } + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(SingleplayerServerController.IPC_CHANNEL, pkt)); + } + + public static void reportTPS(List texts) { + sendIPCPacket(new IPCPacket14StringList(IPCPacket14StringList.SERVER_TPS, texts)); + } + + public static void sendTaskFailed() { + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacketFFProcessKeepAlive.FAILURE)); + } + + public static void sendProgress(String updateMessage, float updateProgress) { + sendIPCPacket(new IPCPacket0DProgressUpdate(updateMessage, updateProgress)); + } + + private static boolean isServerStopped() { + return currentProcess == null || !currentProcess.isServerRunning(); + } + + private static void tryStopServer() { + if(!isServerStopped()) { + currentProcess.stopServer(); + } + currentProcess = null; + } + + private static void mainLoop() { + processAsyncMessageQueue(); + + if(currentProcess != null) { + if(currentProcess.isServerRunning()) { + currentProcess.mainLoop(); + } + if(!currentProcess.isServerRunning()) { + currentProcess.stopServer(); + currentProcess = null; + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacket01StopServer.ID)); + } + }else { + EagUtils.sleep(50l); + } + } + + public static void serverMain() { + try { + currentProcess = null; + logger.info("Starting EaglercraftX integrated server worker..."); + + // signal thread startup successful + sendIPCPacket(new IPCPacketFFProcessKeepAlive(0xFF)); + + while(true) { + mainLoop(); + EagUtils.sleep(1l); + } + }catch(Throwable tt) { + if(tt instanceof ReportedException) { + String fullReport = ((ReportedException)tt).getCrashReport().getCompleteReport(); + logger.error(fullReport); + sendIPCPacket(new IPCPacket15Crashed(fullReport)); + }else { + logger.error("Server process encountered a fatal error!"); + logger.error(tt); + sendIPCPacket(new IPCPacket15Crashed("SERVER PROCESS EXITED!\n\n" + EagRuntime.getStackTrace(tt))); + } + }finally { + if(!isServerStopped()) { + try { + currentProcess.stopServer(); + }catch(Throwable t) { + logger.error("Encountered exception while stopping server!"); + logger.error(t); + } + } + logger.error("Server process exited!"); + sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacketFFProcessKeepAlive.EXITED)); + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerMinecraftServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerMinecraftServer.java new file mode 100644 index 0000000..b325d0f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerMinecraftServer.java @@ -0,0 +1,291 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Bootstrap; +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.EnumDifficulty; +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.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings.GameType; +import net.lax1dude.eaglercraft.v1_8.sp.server.skins.IntegratedSkinService; + +/** + * 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 EaglerMinecraftServer extends MinecraftServer { + + public static final Logger logger = EaglerIntegratedServerWorker.logger; + + public static final VFile2 savesDir = new VFile2("worlds"); + + protected EnumDifficulty difficulty; + protected GameType gamemode; + protected WorldSettings newWorldSettings; + protected boolean paused; + protected EaglerSaveHandler saveHandler; + protected IntegratedSkinService skinService; + + private long lastTPSUpdate = 0l; + + public static int counterTicksPerSecond = 0; + public static int counterChunkRead = 0; + public static int counterChunkGenerate = 0; + public static int counterChunkWrite = 0; + public static int counterTileUpdate = 0; + public static int counterLightUpdate = 0; + + private final List scheduledTasks = new LinkedList(); + + public EaglerMinecraftServer(String world, String owner, int viewDistance, WorldSettings currentWorldSettings, boolean demo) { + super(world); + Bootstrap.register(); + this.saveHandler = new EaglerSaveHandler(savesDir, world); + this.skinService = new IntegratedSkinService(new VFile2(saveHandler.getWorldDirectory(), "eagler/skulls")); + this.setServerOwner(owner); + logger.info("server owner: " + owner); + this.setDemo(demo); + this.canCreateBonusChest(currentWorldSettings != null && currentWorldSettings.isBonusChestEnabled()); + this.setBuildLimit(256); + this.setConfigManager(new EaglerPlayerList(this, viewDistance)); + this.newWorldSettings = currentWorldSettings; + this.paused = false; + } + + public IntegratedSkinService getSkinService() { + return skinService; + } + + public void setBaseServerProperties(EnumDifficulty difficulty, GameType gamemode) { + this.difficulty = difficulty; + this.gamemode = gamemode; + this.setCanSpawnAnimals(true); + this.setCanSpawnNPCs(true); + this.setAllowPvp(true); + this.setAllowFlight(true); + } + + @Override + public void addScheduledTask(Runnable var1) { + scheduledTasks.add(var1); + } + + @Override + protected boolean startServer() throws IOException { + logger.info("Starting integrated eaglercraft server version 1.8.8"); + this.loadAllWorlds(saveHandler, this.getWorldName(), newWorldSettings); + serverRunning = true; + return true; + } + + public void deleteWorldAndStopServer() { + super.deleteWorldAndStopServer(); + logger.info("Deleting world..."); + EaglerIntegratedServerWorker.saveFormat.deleteWorldDirectory(getFolderName()); + } + + public void mainLoop() { + long k = getCurrentTimeMillis(); + this.sendTPSToClient(k); + if(paused && this.playersOnline.size() <= 1) { + currentTime = k; + return; + } + + long j = k - this.currentTime; + if (j > 2000L && this.currentTime - this.timeOfLastWarning >= 15000L) { + logger.warn( + "Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", + new Object[] { Long.valueOf(j), Long.valueOf(j / 50L) }); + j = 100L; + this.currentTime = k - 100l; + this.timeOfLastWarning = this.currentTime; + } + + if (j < 0L) { + logger.warn("Time ran backwards! Did the system time change?"); + j = 0L; + this.currentTime = k; + } + + if (this.worldServers[0].areAllPlayersAsleep()) { + this.currentTime = k; + this.tick(); + ++counterTicksPerSecond; + } else { + if (j > 50L) { + this.currentTime += 50l; + this.tick(); + ++counterTicksPerSecond; + } + } + } + + public void updateTimeLightAndEntities() { + this.skinService.flushCache(); + super.updateTimeLightAndEntities(); + } + + protected void sendTPSToClient(long millis) { + if(millis - lastTPSUpdate > 1000l) { + lastTPSUpdate = millis; + if(serverRunning && this.worldServers != null) { + List lst = new ArrayList<>(Arrays.asList( + "TPS: " + counterTicksPerSecond + "/20", + "Chunks: " + countChunksLoaded(this.worldServers) + "/" + countChunksTotal(this.worldServers), + "Entities: " + countEntities(this.worldServers) + "+" + countTileEntities(this.worldServers), + "R: " + counterChunkRead + ", G: " + counterChunkGenerate + ", W: " + counterChunkWrite, + "TU: " + counterTileUpdate + ", LU: " + counterLightUpdate + )); + int players = countPlayerEntities(this.worldServers); + if(players > 1) { + lst.add("Players: " + players); + } + counterTicksPerSecond = counterChunkRead = counterChunkGenerate = 0; + counterChunkWrite = counterTileUpdate = counterLightUpdate = 0; + EaglerIntegratedServerWorker.reportTPS(lst); + } + } + } + + private static int countChunksLoaded(WorldServer[] worlds) { + int i = 0; + for(int j = 0; j < worlds.length; ++j) { + if(worlds[j] != null) { + i += worlds[j].theChunkProviderServer.getLoadedChunkCount(); + } + } + return i; + } + + private static int countChunksTotal(WorldServer[] worlds) { + int i = 0; + for(int j = 0; j < worlds.length; ++j) { + if(worlds[j] != null) { + List players = worlds[j].playerEntities; + for(int l = 0, n = players.size(); l < n; ++l) { + i += ((EntityPlayerMP)players.get(l)).loadedChunks.size(); + } + i += worlds[j].theChunkProviderServer.getLoadedChunkCount(); + } + } + return i; + } + + private static int countEntities(WorldServer[] worlds) { + int i = 0; + for(int j = 0; j < worlds.length; ++j) { + if(worlds[j] != null) { + i += worlds[j].loadedEntityList.size(); + } + } + return i; + } + + private static int countTileEntities(WorldServer[] worlds) { + int i = 0; + for(int j = 0; j < worlds.length; ++j) { + if(worlds[j] != null) { + i += worlds[j].loadedTileEntityList.size(); + } + } + return i; + } + + private static int countPlayerEntities(WorldServer[] worlds) { + int i = 0; + for(int j = 0; j < worlds.length; ++j) { + if(worlds[j] != null) { + i += worlds[j].playerEntities.size(); + } + } + return i; + } + + public void setPaused(boolean p) { + paused = p; + if(!p) { + currentTime = System.currentTimeMillis(); + } + } + + public boolean getPaused() { + return paused; + } + + @Override + public boolean canStructuresSpawn() { + return worldServers != null ? worldServers[0].getWorldInfo().isMapFeaturesEnabled() : newWorldSettings.isMapFeaturesEnabled(); + } + + @Override + public GameType getGameType() { + return worldServers != null ? worldServers[0].getWorldInfo().getGameType() : newWorldSettings.getGameType(); + } + + @Override + public EnumDifficulty getDifficulty() { + return difficulty; + } + + @Override + public boolean isHardcore() { + return worldServers != null ? worldServers[0].getWorldInfo().isHardcoreModeEnabled() : newWorldSettings.getHardcoreEnabled(); + } + + @Override + public int getOpPermissionLevel() { + return 4; + } + + @Override + public boolean func_181034_q() { + return true; + } + + @Override + public boolean func_183002_r() { + return true; + } + + @Override + public boolean isDedicatedServer() { + return false; + } + + @Override + public boolean func_181035_ah() { + return false; + } + + @Override + public boolean isCommandBlockEnabled() { + return true; + } + + @Override + public String shareToLAN(GameType var1, boolean var2) { + return null; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerPlayerList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerPlayerList.java new file mode 100644 index 0000000..f970123 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerPlayerList.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 EaglerPlayerList extends ServerConfigurationManager { + + private NBTTagCompound hostPlayerNBT = null; + + public EaglerPlayerList(MinecraftServer par1MinecraftServer, int viewDistance) { + super(par1MinecraftServer); + this.viewDistance = viewDistance; + } + + protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP) { + if (par1EntityPlayerMP.getName().equals(this.getServerInstance().getServerOwner())) { + this.hostPlayerNBT = new NBTTagCompound(); + par1EntityPlayerMP.writeToNBT(hostPlayerNBT); + } + super.writePlayerData(par1EntityPlayerMP); + } + + public NBTTagCompound getHostPlayerData() { + return this.hostPlayerNBT; + } + + public void playerLoggedOut(EntityPlayerMP playerIn) { + super.playerLoggedOut(playerIn); + ((EaglerMinecraftServer)getServerInstance()).skinService.unregisterPlayer(playerIn.getUniqueID()); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java new file mode 100644 index 0000000..6d4a3f9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +import com.google.common.collect.Lists; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +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.SaveFormatComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.SaveFormatOld; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; + +/** + * 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 EaglerSaveFormat extends SaveFormatOld { + + public static final VFile2 worldsList = new VFile2("worlds_list.txt"); + public static final VFile2 worldsFolder = new VFile2("worlds"); + + public EaglerSaveFormat(VFile2 parFile) { + super(parFile); + } + + public String getName() { + return "eagler"; + } + + public ISaveHandler getSaveLoader(String s, boolean flag) { + return new EaglerSaveHandler(this.savesDirectory, s); + } + + public List getSaveList() { + ArrayList arraylist = Lists.newArrayList(); + if(worldsList.exists()) { + String[] lines = worldsList.getAllLines(); + for (int i = 0; i < lines.length; ++i) { + String s = lines[i]; + WorldInfo worldinfo = this.getWorldInfo(s); + if (worldinfo != null + && (worldinfo.getSaveVersion() == 19132 || worldinfo.getSaveVersion() == 19133)) { + boolean flag = worldinfo.getSaveVersion() != this.getSaveVersion(); + String s1 = worldinfo.getWorldName(); + if (StringUtils.isEmpty(s1)) { + s1 = s; + } + + arraylist.add(new SaveFormatComparator(s, s1, worldinfo.getLastTimePlayed(), 0l, + worldinfo.getGameType(), flag, worldinfo.isHardcoreModeEnabled(), + worldinfo.areCommandsAllowed())); + } + } + } + return arraylist; + } + + public void clearPlayers(String worldFolder) { + VFile2 file1 = new VFile2(this.savesDirectory, worldFolder, "player"); + deleteFiles(file1.listFiles(true), null); + } + + protected int getSaveVersion() { + return 19133; // why notch? + } + + public boolean duplicateWorld(String worldFolder, String displayName) { + String newFolderName = displayName.replaceAll("[\\./\"]", "_"); + VFile2 newFolder = new VFile2(savesDirectory, newFolderName); + while((new VFile2(newFolder, "level.dat")).exists() || (new VFile2(newFolder, "level.dat_old")).exists()) { + newFolderName += "_"; + newFolder = new VFile2(savesDirectory, newFolderName); + } + VFile2 oldFolder = new VFile2(this.savesDirectory, worldFolder); + String oldPath = oldFolder.getPath(); + int totalSize = 0; + int lastUpdate = 0; + final VFile2 finalNewFolder = newFolder; + for(VFile2 vf : oldFolder.listFiles(true)) { + String fileNameRelative = vf.getPath().substring(oldPath.length() + 1); + totalSize += VFile2.copyFile(vf, new VFile2(finalNewFolder, fileNameRelative)); + if (totalSize - lastUpdate > 10000) { + lastUpdate = totalSize; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.duplicating", totalSize); + } + } + String[] worldsTxt = worldsList.getAllLines(); + if(worldsTxt == null || worldsTxt.length <= 0) { + worldsTxt = new String[] { newFolderName }; + }else { + String[] tmp = worldsTxt; + worldsTxt = new String[worldsTxt.length + 1]; + System.arraycopy(tmp, 0, worldsTxt, 0, tmp.length); + worldsTxt[worldsTxt.length - 1] = newFolderName; + } + worldsList.setAllChars(String.join("\n", worldsTxt)); + return renameWorld(newFolderName, displayName); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveHandler.java new file mode 100644 index 0000000..fea5398 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveHandler.java @@ -0,0 +1,39 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.IChunkLoader; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.SaveHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 EaglerSaveHandler extends SaveHandler { + + public EaglerSaveHandler(VFile2 savesDirectory, String directoryName) { + super(savesDirectory, directoryName); + } + + public IChunkLoader getChunkLoader(WorldProvider provider) { + return new EaglerChunkLoader(new VFile2(this.getWorldDirectory(), "level" + provider.getDimensionId())); + } + + public void saveWorldInfoWithPlayer(WorldInfo worldInformation, NBTTagCompound tagCompound) { + worldInformation.setSaveVersion(19133); + super.saveWorldInfoWithPlayer(worldInformation, tagCompound); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/ContextUtil.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/ContextUtil.java new file mode 100644 index 0000000..46e9099 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/ContextUtil.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes; + +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +/** + * 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 ContextUtil { + + public static final Logger LOGGER = LogManager.getLogger("ContextUtil"); + + private static boolean GUARD_CONTEXT = false; // disable guard, for stability + + public static void enterContext() { + if(!GUARD_CONTEXT) { + GUARD_CONTEXT = true; + LOGGER.info("Entered context"); + } + } + + public static void exitContext() { + if(GUARD_CONTEXT) { + GUARD_CONTEXT = false; + LOGGER.info("Exited context"); + } + } + + public static void __checkIntegratedContextValid(String id) { + if(GUARD_CONTEXT) { + throw new IllegalContextAccessException("Illegal integrated server class access: " + id); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/EaglerServerBootstrap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/EaglerServerBootstrap.java new file mode 100644 index 0000000..615be18 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/EaglerServerBootstrap.java @@ -0,0 +1,41 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes; + +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderSettings; + +/** + * 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 EaglerServerBootstrap { + + private static boolean isCLInit = false; + + public static void staticInit() { + if(isCLInit) { + return; + } + registerJSONTypes(); + isCLInit = true; + } + + public static void registerJSONTypes() { + JSONTypeProvider.registerType(IChatComponent.class, new IChatComponent.Serializer()); + JSONTypeProvider.registerType(ChatStyle.class, new ChatStyle.Serializer()); + JSONTypeProvider.registerType(ChunkProviderSettings.Factory.class, new ChunkProviderSettings.Serializer()); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/IllegalContextAccessException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/IllegalContextAccessException.java new file mode 100644 index 0000000..5210684 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/IllegalContextAccessException.java @@ -0,0 +1,27 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes; + +/** + * 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 IllegalContextAccessException extends RuntimeException { + + public IllegalContextAccessException() { + } + + public IllegalContextAccessException(String s) { + super(s); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/Block.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/Block.java new file mode 100644 index 0000000..fb8ee01 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/Block.java @@ -0,0 +1,1796 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockAir; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockAnvil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBarrier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBookshelf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBrewingStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockButtonStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockButtonWood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCactus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCake; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCarpet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCarrot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCauldron; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockClay; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCocoa; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockColored; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCompressedPowered; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCrops; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDaylightDetector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDeadBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoubleStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoubleStoneSlabNew; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoubleWoodSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDragonEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDropper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDynamicLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEnchantmentTable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEndPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEndPortalFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEnderChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFarmland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFenceGate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlowerPot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockGlass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockGlowstone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockGravel; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHalfStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHalfStoneSlabNew; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHalfWoodSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHardenedClay; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHay; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHugeMushroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockIce; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockJukebox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLadder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLever; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLilyPad; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockMelon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockMushroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockMycelium; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNetherBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNetherWart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNetherrack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNewLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNewLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNote; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockObsidian; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOre; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPackedIce; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPane; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonExtension; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonMoving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPotato; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPressurePlate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPressurePlateWeighted; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPrismarine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPumpkin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockQuartz; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRail; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailDetector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailPowered; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedSandstone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneLight; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneOre; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneRepeater; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneTorch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneWire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockReed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSandStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSapling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSeaLantern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSnowBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSoulSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSponge; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStainedGlass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStainedGlassPane; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStairs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStandingSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStaticLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTNT; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTorch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTrapDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWireHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockVine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWall; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWallSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWeb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWorkbench; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockYellowFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ObjectIntIdentityMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.RegistryNamespacedDefaultedByKey; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/Block"); + } + + /**+ + * ResourceLocation for the Air block + */ + private static final ResourceLocation AIR_ID = new ResourceLocation("air"); + public static final RegistryNamespacedDefaultedByKey blockRegistry = new RegistryNamespacedDefaultedByKey( + AIR_ID); + public static final ObjectIntIdentityMap BLOCK_STATE_IDS = new ObjectIntIdentityMap(); + private CreativeTabs displayOnCreativeTab; + public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F); + /**+ + * the wood sound type + */ + public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F); + /**+ + * the gravel sound type + */ + public static final Block.SoundType soundTypeGravel = new Block.SoundType("gravel", 1.0F, 1.0F); + public static final Block.SoundType soundTypeGrass = new Block.SoundType("grass", 1.0F, 1.0F); + public static final Block.SoundType soundTypePiston = new Block.SoundType("stone", 1.0F, 1.0F); + public static final Block.SoundType soundTypeMetal = new Block.SoundType("stone", 1.0F, 1.5F); + public static final Block.SoundType soundTypeGlass = new Block.SoundType("stone", 1.0F, 1.0F) { + public String getBreakSound() { + return "dig.glass"; + } + + public String getPlaceSound() { + return "step.stone"; + } + }; + public static final Block.SoundType soundTypeCloth = new Block.SoundType("cloth", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSand = new Block.SoundType("sand", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSnow = new Block.SoundType("snow", 1.0F, 1.0F); + public static final Block.SoundType soundTypeLadder = new Block.SoundType("ladder", 1.0F, 1.0F) { + public String getBreakSound() { + return "dig.wood"; + } + }; + public static final Block.SoundType soundTypeAnvil = new Block.SoundType("anvil", 0.3F, 1.0F) { + public String getBreakSound() { + return "dig.stone"; + } + + public String getPlaceSound() { + return "random.anvil_land"; + } + }; + public static final Block.SoundType SLIME_SOUND = new Block.SoundType("slime", 1.0F, 1.0F) { + public String getBreakSound() { + return "mob.slime.big"; + } + + public String getPlaceSound() { + return "mob.slime.big"; + } + + public String getStepSound() { + return "mob.slime.small"; + } + }; + protected boolean fullBlock; + protected int lightOpacity; + protected boolean translucent; + protected int lightValue; + protected boolean useNeighborBrightness; + protected float blockHardness; + protected float blockResistance; + protected boolean enableStats; + protected boolean needsRandomTick; + protected boolean isBlockContainer; + protected double minX; + protected double minY; + protected double minZ; + protected double maxX; + protected double maxY; + protected double maxZ; + public Block.SoundType stepSound; + public float blockParticleGravity; + protected final Material blockMaterial; + protected final MapColor field_181083_K; + public float slipperiness; + protected final BlockState blockState; + private IBlockState defaultBlockState; + private String unlocalizedName; + + public static int getIdFromBlock(Block blockIn) { + return blockRegistry.getIDForObject(blockIn); + } + + /**+ + * Get a unique ID for the given BlockState, containing both + * BlockID and metadata + */ + public static int getStateId(IBlockState state) { + Block block = state.getBlock(); + return getIdFromBlock(block) + (block.getMetaFromState(state) << 12); + } + + public static Block getBlockById(int id) { + return (Block) blockRegistry.getObjectById(id); + } + + /**+ + * Get a BlockState by it's ID (see getStateId) + */ + public static IBlockState getStateById(int id) { + int i = id & 4095; + int j = id >> 12 & 15; + return getBlockById(i).getStateFromMeta(j); + } + + public static Block getBlockFromItem(Item itemIn) { + return itemIn instanceof ItemBlock ? ((ItemBlock) itemIn).getBlock() : null; + } + + public static Block getBlockFromName(String name) { + ResourceLocation resourcelocation = new ResourceLocation(name); + if (blockRegistry.containsKey(resourcelocation)) { + return (Block) blockRegistry.getObject(resourcelocation); + } else { + try { + return (Block) blockRegistry.getObjectById(Integer.parseInt(name)); + } catch (NumberFormatException var3) { + return null; + } + } + } + + public boolean isFullBlock() { + return this.fullBlock; + } + + public int getLightOpacity() { + return this.lightOpacity; + } + + /**+ + * Used in the renderer to apply ambient occlusion + */ + public boolean isTranslucent() { + return this.translucent; + } + + public int getLightValue() { + return this.lightValue; + } + + /**+ + * Should block use the brightest neighbor light value as its + * own + */ + public boolean getUseNeighborBrightness() { + return this.useNeighborBrightness; + } + + /**+ + * Get a material of block + */ + public Material getMaterial() { + return this.blockMaterial; + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState state) { + return this.field_181083_K; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int var1) { + return this.getDefaultState(); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + if (iblockstate != null && !iblockstate.getPropertyNames().isEmpty()) { + throw new IllegalArgumentException("Don\'t know how to convert " + iblockstate + " back into data..."); + } else { + return 0; + } + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess var2, BlockPos var3) { + return iblockstate; + } + + public Block(Material parMaterial, MapColor parMapColor) { + this.enableStats = true; + this.stepSound = soundTypeStone; + this.blockParticleGravity = 1.0F; + this.slipperiness = 0.6F; + this.blockMaterial = parMaterial; + this.field_181083_K = parMapColor; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.fullBlock = this.isOpaqueCube(); + this.lightOpacity = this.isOpaqueCube() ? 255 : 0; + this.translucent = !parMaterial.blocksLight(); + this.blockState = this.createBlockState(); + this.setDefaultState(this.blockState.getBaseState()); + } + + protected Block(Material materialIn) { + this(materialIn, materialIn.getMaterialMapColor()); + } + + /**+ + * Sets the footstep sound for the block. Returns the object for + * convenience in constructing. + */ + protected Block setStepSound(Block.SoundType sound) { + this.stepSound = sound; + return this; + } + + /**+ + * Sets how much light is blocked going through this block. + * Returns the object for convenience in constructing. + */ + protected Block setLightOpacity(int opacity) { + this.lightOpacity = opacity; + return this; + } + + /**+ + * Sets the light value that the block emits. Returns resulting + * block instance for constructing convenience. Args: level + */ + protected Block setLightLevel(float value) { + this.lightValue = (int) (15.0F * value); + return this; + } + + /**+ + * Sets the the blocks resistance to explosions. Returns the + * object for convenience in constructing. + */ + protected Block setResistance(float resistance) { + this.blockResistance = resistance * 3.0F; + return this; + } + + /**+ + * Indicate if a material is a normal solid opaque cube + */ + public boolean isBlockNormalCube() { + return this.blockMaterial.blocksMovement() && this.isFullCube(); + } + + /**+ + * Used for nearly all game logic (non-rendering) purposes. Use + * Forge-provided isNormalCube(IBlockAccess, BlockPos) instead. + */ + public boolean isNormalCube() { + return this.blockMaterial.isOpaque() && this.isFullCube() && !this.canProvidePower(); + } + + public boolean isVisuallyOpaque() { + return this.blockMaterial.blocksMovement() && this.isFullCube(); + } + + public boolean isFullCube() { + return true; + } + + public boolean isPassable(IBlockAccess var1, BlockPos var2) { + return !this.blockMaterial.blocksMovement(); + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World var1, BlockPos var2) { + return false; + } + + /**+ + * Sets how many hits it takes to break a block. + */ + protected Block setHardness(float hardness) { + this.blockHardness = hardness; + if (this.blockResistance < hardness * 5.0F) { + this.blockResistance = hardness * 5.0F; + } + + return this; + } + + protected Block setBlockUnbreakable() { + this.setHardness(-1.0F); + return this; + } + + public float getBlockHardness(World worldIn, BlockPos pos) { + return this.blockHardness; + } + + /**+ + * Sets whether this block type will receive random update ticks + */ + protected Block setTickRandomly(boolean shouldTick) { + this.needsRandomTick = shouldTick; + return this; + } + + /**+ + * Returns whether or not this block is of a type that needs + * random ticking. Called for ref-counting purposes by + * ExtendedBlockStorage in order to broadly cull a chunk from + * the random chunk update list for efficiency's sake. + */ + public boolean getTickRandomly() { + return this.needsRandomTick; + } + + public boolean hasTileEntity() { + return this.isBlockContainer; + } + + protected final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { + this.minX = (double) minX; + this.minY = (double) minY; + this.minZ = (double) minZ; + this.maxX = (double) maxX; + this.maxY = (double) maxY; + this.maxZ = (double) maxZ; + } + + public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) { + Block block = worldIn.getBlockState(pos).getBlock(); + int i = worldIn.getCombinedLight(pos, block.getLightValue()); + if (i == 0 && block instanceof BlockSlab) { + pos = pos.down(); + block = worldIn.getBlockState(pos).getBlock(); + return worldIn.getCombinedLight(pos, block.getLightValue()); + } else { + return i; + } + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return enumfacing == EnumFacing.DOWN && this.minY > 0.0D ? true + : (enumfacing == EnumFacing.UP && this.maxY < 1.0D ? true + : (enumfacing == EnumFacing.NORTH && this.minZ > 0.0D ? true + : (enumfacing == EnumFacing.SOUTH && this.maxZ < 1.0D ? true + : (enumfacing == EnumFacing.WEST && this.minX > 0.0D ? true + : (enumfacing == EnumFacing.EAST && this.maxX < 1.0D ? true + : !iblockaccess.getBlockState(blockpos).getBlock() + .isOpaqueCube()))))); + } + + /**+ + * Whether this Block is solid on the given Side + */ + public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { + return worldIn.getBlockState(pos).getBlock().getMaterial().isSolid(); + } + + public AxisAlignedBB getSelectedBoundingBox(World var1, BlockPos blockpos) { + return new AxisAlignedBB((double) blockpos.getX() + this.minX, (double) blockpos.getY() + this.minY, + (double) blockpos.getZ() + this.minZ, (double) blockpos.getX() + this.maxX, + (double) blockpos.getY() + this.maxY, (double) blockpos.getZ() + this.maxZ); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, + List list, Entity collidingEntity) { + AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(worldIn, pos, state); + if (axisalignedbb != null && mask.intersectsWith(axisalignedbb)) { + list.add(axisalignedbb); + } + + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState var3) { + return new AxisAlignedBB((double) blockpos.getX() + this.minX, (double) blockpos.getY() + this.minY, + (double) blockpos.getZ() + this.minZ, (double) blockpos.getX() + this.maxX, + (double) blockpos.getY() + this.maxY, (double) blockpos.getZ() + this.maxZ); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return true; + } + + public boolean canCollideCheck(IBlockState var1, boolean var2) { + return this.isCollidable(); + } + + /**+ + * Returns if this block is collidable (only used by Fire). + * Args: x, y, z + */ + public boolean isCollidable() { + return true; + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + this.updateTick(world, blockpos, iblockstate, random); + } + + public void updateTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { + } + + /**+ + * Called when a player destroys this Block + */ + public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World var1, BlockPos var2, IBlockState var3, Block var4) { + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 10; + } + + public void onBlockAdded(World var1, BlockPos var2, IBlockState var3) { + } + + public void breakBlock(World var1, BlockPos var2, IBlockState var3) { + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return 1; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(this); + } + + /**+ + * Get the hardness of this Block relative to the ability of the + * given player + */ + public float getPlayerRelativeBlockHardness(EntityPlayer playerIn, World worldIn, BlockPos pos) { + float f = this.getBlockHardness(worldIn, pos); + return f < 0.0F ? 0.0F + : (!playerIn.canHarvestBlock(this) ? playerIn.getToolDigEfficiency(this) / f / 100.0F + : playerIn.getToolDigEfficiency(this) / f / 30.0F); + } + + /**+ + * Spawn this Block's drops into the World as EntityItems + */ + public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) { + this.dropBlockAsItemWithChance(worldIn, pos, state, 1.0F, forture); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + { + int j = this.quantityDroppedWithBonus(i, world.rand); + + for (int k = 0; k < j; ++k) { + if (world.rand.nextFloat() <= f) { + Item item = this.getItemDropped(iblockstate, world.rand, i); + if (item != null) { + spawnAsEntity(world, blockpos, new ItemStack(item, 1, this.damageDropped(iblockstate))); + } + } + } + } + } + + /**+ + * Spawns the given ItemStack as an EntityItem into the World at + * the given position + */ + public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack) { + if (worldIn.getGameRules().getBoolean("doTileDrops")) { + float f = 0.5F; + double d0 = (double) (worldIn.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d1 = (double) (worldIn.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d2 = (double) (worldIn.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(worldIn, (double) pos.getX() + d0, (double) pos.getY() + d1, + (double) pos.getZ() + d2, stack); + entityitem.setDefaultPickupDelay(); + worldIn.spawnEntityInWorld(entityitem); + } + } + + /**+ + * Spawns the given amount of experience into the World as XP + * orb entities + */ + protected void dropXpOnBlockBreak(World worldIn, BlockPos pos, int amount) { + { + while (amount > 0) { + int i = EntityXPOrb.getXPSplit(amount); + amount -= i; + worldIn.spawnEntityInWorld(new EntityXPOrb(worldIn, (double) pos.getX() + 0.5D, + (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, i)); + } + } + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState var1) { + return 0; + } + + /**+ + * Returns how much this block can resist explosions from the + * passed in entity. + */ + public float getExplosionResistance(Entity exploder) { + return this.blockResistance / 5.0F; + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World world, BlockPos blockpos, Vec3 vec3, Vec3 vec31) { + this.setBlockBoundsBasedOnState(world, blockpos); + vec3 = vec3.addVector((double) (-blockpos.getX()), (double) (-blockpos.getY()), (double) (-blockpos.getZ())); + vec31 = vec31.addVector((double) (-blockpos.getX()), (double) (-blockpos.getY()), (double) (-blockpos.getZ())); + Vec3 vec32 = vec3.getIntermediateWithXValue(vec31, this.minX); + Vec3 vec33 = vec3.getIntermediateWithXValue(vec31, this.maxX); + Vec3 vec34 = vec3.getIntermediateWithYValue(vec31, this.minY); + Vec3 vec35 = vec3.getIntermediateWithYValue(vec31, this.maxY); + Vec3 vec36 = vec3.getIntermediateWithZValue(vec31, this.minZ); + Vec3 vec37 = vec3.getIntermediateWithZValue(vec31, this.maxZ); + if (!this.isVecInsideYZBounds(vec32)) { + vec32 = null; + } + + if (!this.isVecInsideYZBounds(vec33)) { + vec33 = null; + } + + if (!this.isVecInsideXZBounds(vec34)) { + vec34 = null; + } + + if (!this.isVecInsideXZBounds(vec35)) { + vec35 = null; + } + + if (!this.isVecInsideXYBounds(vec36)) { + vec36 = null; + } + + if (!this.isVecInsideXYBounds(vec37)) { + vec37 = null; + } + + Vec3 vec38 = null; + if (vec32 != null && (vec38 == null || vec3.squareDistanceTo(vec32) < vec3.squareDistanceTo(vec38))) { + vec38 = vec32; + } + + if (vec33 != null && (vec38 == null || vec3.squareDistanceTo(vec33) < vec3.squareDistanceTo(vec38))) { + vec38 = vec33; + } + + if (vec34 != null && (vec38 == null || vec3.squareDistanceTo(vec34) < vec3.squareDistanceTo(vec38))) { + vec38 = vec34; + } + + if (vec35 != null && (vec38 == null || vec3.squareDistanceTo(vec35) < vec3.squareDistanceTo(vec38))) { + vec38 = vec35; + } + + if (vec36 != null && (vec38 == null || vec3.squareDistanceTo(vec36) < vec3.squareDistanceTo(vec38))) { + vec38 = vec36; + } + + if (vec37 != null && (vec38 == null || vec3.squareDistanceTo(vec37) < vec3.squareDistanceTo(vec38))) { + vec38 = vec37; + } + + if (vec38 == null) { + return null; + } else { + EnumFacing enumfacing = null; + if (vec38 == vec32) { + enumfacing = EnumFacing.WEST; + } + + if (vec38 == vec33) { + enumfacing = EnumFacing.EAST; + } + + if (vec38 == vec34) { + enumfacing = EnumFacing.DOWN; + } + + if (vec38 == vec35) { + enumfacing = EnumFacing.UP; + } + + if (vec38 == vec36) { + enumfacing = EnumFacing.NORTH; + } + + if (vec38 == vec37) { + enumfacing = EnumFacing.SOUTH; + } + + return new MovingObjectPosition( + vec38.addVector((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ()), + enumfacing, blockpos); + } + } + + /**+ + * Checks if a vector is within the Y and Z bounds of the block. + */ + private boolean isVecInsideYZBounds(Vec3 point) { + return point == null ? false + : point.yCoord >= this.minY && point.yCoord <= this.maxY && point.zCoord >= this.minZ + && point.zCoord <= this.maxZ; + } + + /**+ + * Checks if a vector is within the X and Z bounds of the block. + */ + private boolean isVecInsideXZBounds(Vec3 point) { + return point == null ? false + : point.xCoord >= this.minX && point.xCoord <= this.maxX && point.zCoord >= this.minZ + && point.zCoord <= this.maxZ; + } + + /**+ + * Checks if a vector is within the X and Y bounds of the block. + */ + private boolean isVecInsideXYBounds(Vec3 point) { + return point == null ? false + : point.xCoord >= this.minX && point.xCoord <= this.maxX && point.yCoord >= this.minY + && point.yCoord <= this.maxY; + } + + /**+ + * Called when this Block is destroyed by an Explosion + */ + public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.SOLID; + } + + public boolean canReplace(World worldIn, BlockPos pos, EnumFacing side, ItemStack stack) { + return this.canPlaceBlockOnSide(worldIn, pos, side); + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) { + return this.canPlaceBlockAt(worldIn, pos); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return world.getBlockState(blockpos).getBlock().blockMaterial.isReplaceable(); + } + + public boolean onBlockActivated(World var1, BlockPos var2, IBlockState var3, EntityPlayer var4, EnumFacing var5, + float var6, float var7, float var8) { + return false; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) { + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int i, EntityLivingBase var8) { + return this.getStateFromMeta(i); + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) { + } + + public Vec3 modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion) { + return motion; + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + } + + /**+ + * returns the block bounderies minX value + */ + public final double getBlockBoundsMinX() { + return this.minX; + } + + /**+ + * returns the block bounderies maxX value + */ + public final double getBlockBoundsMaxX() { + return this.maxX; + } + + /**+ + * returns the block bounderies minY value + */ + public final double getBlockBoundsMinY() { + return this.minY; + } + + /**+ + * returns the block bounderies maxY value + */ + public final double getBlockBoundsMaxY() { + return this.maxY; + } + + /**+ + * returns the block bounderies minZ value + */ + public final double getBlockBoundsMinZ() { + return this.minZ; + } + + /**+ + * returns the block bounderies maxZ value + */ + public final double getBlockBoundsMaxZ() { + return this.maxZ; + } + + public int getBlockColor() { + return 16777215; + } + + public int getRenderColor(IBlockState state) { + return 16777215; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { + return 16777215; + } + + public final int colorMultiplier(IBlockAccess worldIn, BlockPos pos) { + return this.colorMultiplier(worldIn, pos, 0); + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState var3, EnumFacing var4) { + return 0; + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return false; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World var1, BlockPos var2, IBlockState var3, Entity var4) { + } + + public int getStrongPower(IBlockAccess var1, BlockPos var2, IBlockState var3, EnumFacing var4) { + return 0; + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity var5) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[getIdFromBlock(this)]); + entityplayer.addExhaustion(0.025F); + if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(entityplayer)) { + ItemStack itemstack = this.createStackedBlock(iblockstate); + if (itemstack != null) { + spawnAsEntity(world, blockpos, itemstack); + } + } else { + int i = EnchantmentHelper.getFortuneModifier(entityplayer); + this.dropBlockAsItem(world, blockpos, iblockstate, i); + } + + } + + protected boolean canSilkHarvest() { + return this.isFullCube() && !this.isBlockContainer; + } + + protected ItemStack createStackedBlock(IBlockState state) { + int i = 0; + Item item = Item.getItemFromBlock(this); + if (item != null && item.getHasSubtypes()) { + i = this.getMetaFromState(state); + } + + return new ItemStack(item, 1, i); + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int fortune, EaglercraftRandom random) { + return this.quantityDropped(random); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World var1, BlockPos var2, IBlockState var3, EntityLivingBase var4, ItemStack var5) { + } + + public boolean func_181623_g() { + return !this.blockMaterial.isSolid() && !this.blockMaterial.isLiquid(); + } + + public Block setUnlocalizedName(String name) { + this.unlocalizedName = name; + return this; + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + } + + /**+ + * Returns the unlocalized name of the block with "tile." + * appended to the front. + */ + public String getUnlocalizedName() { + return "tile." + this.unlocalizedName; + } + + /**+ + * Called on both Client and Server when World#addBlockEvent is + * called + */ + public boolean onBlockEventReceived(World var1, BlockPos var2, IBlockState var3, int var4, int var5) { + return false; + } + + /**+ + * Return the state of blocks statistics flags - if the block is + * counted for mined and placed. + */ + public boolean getEnableStats() { + return this.enableStats; + } + + protected Block disableStats() { + this.enableStats = false; + return this; + } + + public int getMobilityFlag() { + return this.blockMaterial.getMaterialMobility(); + } + + /**+ + * Returns the default ambient occlusion value based on block + * opacity + */ + public float getAmbientOcclusionLightValue() { + return this.isBlockNormalCube() ? 0.2F : 1.0F; + } + + /**+ + * Block's chance to react to a living entity falling on it. + */ + public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) { + entityIn.fall(fallDistance, 1.0F); + } + + /**+ + * Called when an Entity lands on this Block. This method *must* + * update motionY because the entity will not do that on its own + */ + public void onLanded(World worldIn, Entity entityIn) { + entityIn.motionY = 0.0D; + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(this); + } + + public int getDamageValue(World worldIn, BlockPos pos) { + return this.damageDropped(worldIn.getBlockState(pos)); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, 0)); + } + + /**+ + * Returns the CreativeTab to display the given block on. + */ + public CreativeTabs getCreativeTabToDisplayOn() { + return this.displayOnCreativeTab; + } + + public Block setCreativeTab(CreativeTabs tab) { + this.displayOnCreativeTab = tab; + return this; + } + + public void onBlockHarvested(World var1, BlockPos var2, IBlockState var3, EntityPlayer var4) { + } + + /**+ + * Called similar to random ticks, but only when it is raining. + */ + public void fillWithRain(World worldIn, BlockPos pos) { + } + + /**+ + * Returns true only if block is flowerPot + */ + public boolean isFlowerPot() { + return false; + } + + public boolean requiresUpdates() { + return true; + } + + /**+ + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion explosionIn) { + return true; + } + + public boolean isAssociatedBlock(Block other) { + return this == other; + } + + public static boolean isEqualTo(Block blockIn, Block other) { + return blockIn != null && other != null ? (blockIn == other ? true : blockIn.isAssociatedBlock(other)) : false; + } + + public boolean hasComparatorInputOverride() { + return false; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) { + return 0; + } + + /**+ + * Possibly modify the given BlockState before rendering it on + * an Entity (Minecarts, Endermen, ...) + */ + public IBlockState getStateForEntityRender(IBlockState iblockstate) { + return iblockstate; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[0]); + } + + public BlockState getBlockState() { + return this.blockState; + } + + protected final void setDefaultState(IBlockState state) { + this.defaultBlockState = state; + } + + public final IBlockState getDefaultState() { + return this.defaultBlockState; + } + + /**+ + * Get the OffsetType for this Block. Determines if the model is + * rendered slightly offset. + */ + public Block.EnumOffsetType getOffsetType() { + return Block.EnumOffsetType.NONE; + } + + public String toString() { + return "Block{" + blockRegistry.getNameForObject(this) + "}"; + } + + public static void registerBlocks() { + bootstrapStates(); + registerBlock(0, (ResourceLocation) AIR_ID, (new BlockAir()).setUnlocalizedName("air")); + registerBlock(1, (String) "stone", (new BlockStone()).setHardness(1.5F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("stone")); + registerBlock(2, (String) "grass", + (new BlockGrass()).setHardness(0.6F).setStepSound(soundTypeGrass).setUnlocalizedName("grass")); + registerBlock(3, (String) "dirt", + (new BlockDirt()).setHardness(0.5F).setStepSound(soundTypeGravel).setUnlocalizedName("dirt")); + Block block = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston) + .setUnlocalizedName("stonebrick").setCreativeTab(CreativeTabs.tabBlock); + registerBlock(4, (String) "cobblestone", block); + Block block1 = (new BlockPlanks()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood) + .setUnlocalizedName("wood"); + registerBlock(5, (String) "planks", block1); + registerBlock(6, (String) "sapling", + (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling")); + registerBlock(7, (String) "bedrock", + (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston) + .setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F) + .setLightOpacity(3).setUnlocalizedName("water").disableStats()); + registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F) + .setLightOpacity(3).setUnlocalizedName("water").disableStats()); + registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F) + .setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); + registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F) + .setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); + registerBlock(12, (String) "sand", + (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("sand")); + registerBlock(13, (String) "gravel", + (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("gravel")); + registerBlock(14, (String) "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreGold")); + registerBlock(15, (String) "iron_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreIron")); + registerBlock(16, (String) "coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreCoal")); + registerBlock(17, (String) "log", (new BlockOldLog()).setUnlocalizedName("log")); + registerBlock(18, (String) "leaves", (new BlockOldLeaf()).setUnlocalizedName("leaves")); + registerBlock(19, (String) "sponge", + (new BlockSponge()).setHardness(0.6F).setStepSound(soundTypeGrass).setUnlocalizedName("sponge")); + registerBlock(20, (String) "glass", (new BlockGlass(Material.glass, false)).setHardness(0.3F) + .setStepSound(soundTypeGlass).setUnlocalizedName("glass")); + registerBlock(21, (String) "lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreLapis")); + registerBlock(22, (String) "lapis_block", + (new Block(Material.iron, MapColor.lapisColor)).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("blockLapis") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(23, (String) "dispenser", + (new BlockDispenser()).setHardness(3.5F).setStepSound(soundTypePiston).setUnlocalizedName("dispenser")); + Block block2 = (new BlockSandStone()).setStepSound(soundTypePiston).setHardness(0.8F) + .setUnlocalizedName("sandStone"); + registerBlock(24, (String) "sandstone", block2); + registerBlock(25, (String) "noteblock", (new BlockNote()).setHardness(0.8F).setUnlocalizedName("musicBlock")); + registerBlock(26, (String) "bed", (new BlockBed()).setStepSound(soundTypeWood).setHardness(0.2F) + .setUnlocalizedName("bed").disableStats()); + registerBlock(27, (String) "golden_rail", (new BlockRailPowered()).setHardness(0.7F) + .setStepSound(soundTypeMetal).setUnlocalizedName("goldenRail")); + registerBlock(28, (String) "detector_rail", (new BlockRailDetector()).setHardness(0.7F) + .setStepSound(soundTypeMetal).setUnlocalizedName("detectorRail")); + registerBlock(29, (String) "sticky_piston", (new BlockPistonBase(true)).setUnlocalizedName("pistonStickyBase")); + registerBlock(30, (String) "web", + (new BlockWeb()).setLightOpacity(1).setHardness(4.0F).setUnlocalizedName("web")); + registerBlock(31, (String) "tallgrass", + (new BlockTallGrass()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("tallgrass")); + registerBlock(32, (String) "deadbush", + (new BlockDeadBush()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("deadbush")); + registerBlock(33, (String) "piston", (new BlockPistonBase(false)).setUnlocalizedName("pistonBase")); + registerBlock(34, (String) "piston_head", (new BlockPistonExtension()).setUnlocalizedName("pistonBase")); + registerBlock(35, (String) "wool", (new BlockColored(Material.cloth)).setHardness(0.8F) + .setStepSound(soundTypeCloth).setUnlocalizedName("cloth")); + registerBlock(36, (String) "piston_extension", new BlockPistonMoving()); + registerBlock(37, (String) "yellow_flower", + (new BlockYellowFlower()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("flower1")); + registerBlock(38, (String) "red_flower", + (new BlockRedFlower()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("flower2")); + Block block3 = (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setLightLevel(0.125F) + .setUnlocalizedName("mushroom"); + registerBlock(39, (String) "brown_mushroom", block3); + Block block4 = (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass) + .setUnlocalizedName("mushroom"); + registerBlock(40, (String) "red_mushroom", block4); + registerBlock(41, (String) "gold_block", + (new Block(Material.iron, MapColor.goldColor)).setHardness(3.0F).setResistance(10.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("blockGold") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(42, (String) "iron_block", + (new Block(Material.iron, MapColor.ironColor)).setHardness(5.0F).setResistance(10.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("blockIron") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(43, (String) "double_stone_slab", (new BlockDoubleStoneSlab()).setHardness(2.0F) + .setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab")); + registerBlock(44, (String) "stone_slab", (new BlockHalfStoneSlab()).setHardness(2.0F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab")); + Block block5 = (new Block(Material.rock, MapColor.redColor)).setHardness(2.0F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabBlock); + registerBlock(45, (String) "brick_block", block5); + registerBlock(46, (String) "tnt", + (new BlockTNT()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("tnt")); + registerBlock(47, (String) "bookshelf", + (new BlockBookshelf()).setHardness(1.5F).setStepSound(soundTypeWood).setUnlocalizedName("bookshelf")); + registerBlock(48, (String) "mossy_cobblestone", + (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston) + .setUnlocalizedName("stoneMoss").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(49, (String) "obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("obsidian")); + registerBlock(50, (String) "torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F) + .setStepSound(soundTypeWood).setUnlocalizedName("torch")); + registerBlock(51, (String) "fire", (new BlockFire()).setHardness(0.0F).setLightLevel(1.0F) + .setStepSound(soundTypeCloth).setUnlocalizedName("fire").disableStats()); + registerBlock(52, (String) "mob_spawner", (new BlockMobSpawner()).setHardness(5.0F).setStepSound(soundTypeMetal) + .setUnlocalizedName("mobSpawner").disableStats()); + registerBlock(53, (String) "oak_stairs", + (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.OAK))) + .setUnlocalizedName("stairsWood")); + registerBlock(54, (String) "chest", + (new BlockChest(0)).setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("chest")); + registerBlock(55, (String) "redstone_wire", (new BlockRedstoneWire()).setHardness(0.0F) + .setStepSound(soundTypeStone).setUnlocalizedName("redstoneDust").disableStats()); + registerBlock(56, (String) "diamond_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreDiamond")); + registerBlock(57, (String) "diamond_block", + (new Block(Material.iron, MapColor.diamondColor)).setHardness(5.0F).setResistance(10.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("blockDiamond") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(58, (String) "crafting_table", + (new BlockWorkbench()).setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("workbench")); + registerBlock(59, (String) "wheat", (new BlockCrops()).setUnlocalizedName("crops")); + Block block6 = (new BlockFarmland()).setHardness(0.6F).setStepSound(soundTypeGravel) + .setUnlocalizedName("farmland"); + registerBlock(60, (String) "farmland", block6); + registerBlock(61, (String) "furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(soundTypePiston) + .setUnlocalizedName("furnace").setCreativeTab(CreativeTabs.tabDecorations)); + registerBlock(62, (String) "lit_furnace", (new BlockFurnace(true)).setHardness(3.5F) + .setStepSound(soundTypePiston).setLightLevel(0.875F).setUnlocalizedName("furnace")); + registerBlock(63, (String) "standing_sign", (new BlockStandingSign()).setHardness(1.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("sign").disableStats()); + registerBlock(64, (String) "wooden_door", (new BlockDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("doorOak").disableStats()); + registerBlock(65, (String) "ladder", + (new BlockLadder()).setHardness(0.4F).setStepSound(soundTypeLadder).setUnlocalizedName("ladder")); + registerBlock(66, (String) "rail", + (new BlockRail()).setHardness(0.7F).setStepSound(soundTypeMetal).setUnlocalizedName("rail")); + registerBlock(67, (String) "stone_stairs", + (new BlockStairs(block.getDefaultState())).setUnlocalizedName("stairsStone")); + registerBlock(68, (String) "wall_sign", (new BlockWallSign()).setHardness(1.0F).setStepSound(soundTypeWood) + .setUnlocalizedName("sign").disableStats()); + registerBlock(69, (String) "lever", + (new BlockLever()).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("lever")); + registerBlock(70, (String) "stone_pressure_plate", + (new BlockPressurePlate(Material.rock, BlockPressurePlate.Sensitivity.MOBS)).setHardness(0.5F) + .setStepSound(soundTypePiston).setUnlocalizedName("pressurePlateStone")); + registerBlock(71, (String) "iron_door", (new BlockDoor(Material.iron)).setHardness(5.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("doorIron").disableStats()); + registerBlock(72, (String) "wooden_pressure_plate", + (new BlockPressurePlate(Material.wood, BlockPressurePlate.Sensitivity.EVERYTHING)).setHardness(0.5F) + .setStepSound(soundTypeWood).setUnlocalizedName("pressurePlateWood")); + registerBlock(73, (String) "redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreRedstone").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(74, (String) "lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F) + .setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreRedstone")); + registerBlock(75, (String) "unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("notGate")); + registerBlock(76, (String) "redstone_torch", + (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(soundTypeWood) + .setUnlocalizedName("notGate").setCreativeTab(CreativeTabs.tabRedstone)); + registerBlock(77, (String) "stone_button", + (new BlockButtonStone()).setHardness(0.5F).setStepSound(soundTypePiston).setUnlocalizedName("button")); + registerBlock(78, (String) "snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(soundTypeSnow) + .setUnlocalizedName("snow").setLightOpacity(0)); + registerBlock(79, (String) "ice", (new BlockIce()).setHardness(0.5F).setLightOpacity(3) + .setStepSound(soundTypeGlass).setUnlocalizedName("ice")); + registerBlock(80, (String) "snow", + (new BlockSnowBlock()).setHardness(0.2F).setStepSound(soundTypeSnow).setUnlocalizedName("snow")); + registerBlock(81, (String) "cactus", + (new BlockCactus()).setHardness(0.4F).setStepSound(soundTypeCloth).setUnlocalizedName("cactus")); + registerBlock(82, (String) "clay", + (new BlockClay()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("clay")); + registerBlock(83, (String) "reeds", (new BlockReed()).setHardness(0.0F).setStepSound(soundTypeGrass) + .setUnlocalizedName("reeds").disableStats()); + registerBlock(84, (String) "jukebox", (new BlockJukebox()).setHardness(2.0F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("jukebox")); + registerBlock(85, (String) "fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.OAK.func_181070_c())) + .setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("fence")); + Block block7 = (new BlockPumpkin()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("pumpkin"); + registerBlock(86, (String) "pumpkin", block7); + registerBlock(87, (String) "netherrack", + (new BlockNetherrack()).setHardness(0.4F).setStepSound(soundTypePiston).setUnlocalizedName("hellrock")); + registerBlock(88, (String) "soul_sand", + (new BlockSoulSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("hellsand")); + registerBlock(89, (String) "glowstone", (new BlockGlowstone(Material.glass)).setHardness(0.3F) + .setStepSound(soundTypeGlass).setLightLevel(1.0F).setUnlocalizedName("lightgem")); + registerBlock(90, (String) "portal", (new BlockPortal()).setHardness(-1.0F).setStepSound(soundTypeGlass) + .setLightLevel(0.75F).setUnlocalizedName("portal")); + registerBlock(91, (String) "lit_pumpkin", (new BlockPumpkin()).setHardness(1.0F).setStepSound(soundTypeWood) + .setLightLevel(1.0F).setUnlocalizedName("litpumpkin")); + registerBlock(92, (String) "cake", (new BlockCake()).setHardness(0.5F).setStepSound(soundTypeCloth) + .setUnlocalizedName("cake").disableStats()); + registerBlock(93, (String) "unpowered_repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("diode").disableStats()); + registerBlock(94, (String) "powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("diode").disableStats()); + registerBlock(95, (String) "stained_glass", (new BlockStainedGlass(Material.glass)).setHardness(0.3F) + .setStepSound(soundTypeGlass).setUnlocalizedName("stainedGlass")); + registerBlock(96, (String) "trapdoor", (new BlockTrapDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("trapdoor").disableStats()); + registerBlock(97, (String) "monster_egg", + (new BlockSilverfish()).setHardness(0.75F).setUnlocalizedName("monsterStoneEgg")); + Block block8 = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston) + .setUnlocalizedName("stonebricksmooth"); + registerBlock(98, (String) "stonebrick", block8); + registerBlock(99, (String) "brown_mushroom_block", + (new BlockHugeMushroom(Material.wood, MapColor.dirtColor, block3)).setHardness(0.2F) + .setStepSound(soundTypeWood).setUnlocalizedName("mushroom")); + registerBlock(100, (String) "red_mushroom_block", + (new BlockHugeMushroom(Material.wood, MapColor.redColor, block4)).setHardness(0.2F) + .setStepSound(soundTypeWood).setUnlocalizedName("mushroom")); + registerBlock(101, (String) "iron_bars", (new BlockPane(Material.iron, true)).setHardness(5.0F) + .setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("fenceIron")); + registerBlock(102, (String) "glass_pane", (new BlockPane(Material.glass, false)).setHardness(0.3F) + .setStepSound(soundTypeGlass).setUnlocalizedName("thinGlass")); + Block block9 = (new BlockMelon()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("melon"); + registerBlock(103, (String) "melon_block", block9); + registerBlock(104, (String) "pumpkin_stem", (new BlockStem(block7)).setHardness(0.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("pumpkinStem")); + registerBlock(105, (String) "melon_stem", (new BlockStem(block9)).setHardness(0.0F).setStepSound(soundTypeWood) + .setUnlocalizedName("pumpkinStem")); + registerBlock(106, (String) "vine", + (new BlockVine()).setHardness(0.2F).setStepSound(soundTypeGrass).setUnlocalizedName("vine")); + registerBlock(107, (String) "fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.OAK)).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("fenceGate")); + registerBlock(108, (String) "brick_stairs", + (new BlockStairs(block5.getDefaultState())).setUnlocalizedName("stairsBrick")); + registerBlock(109, (String) "stone_brick_stairs", (new BlockStairs( + block8.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.DEFAULT))) + .setUnlocalizedName("stairsStoneBrickSmooth")); + registerBlock(110, (String) "mycelium", + (new BlockMycelium()).setHardness(0.6F).setStepSound(soundTypeGrass).setUnlocalizedName("mycel")); + registerBlock(111, (String) "waterlily", + (new BlockLilyPad()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("waterlily")); + Block block10 = (new BlockNetherBrick()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston) + .setUnlocalizedName("netherBrick").setCreativeTab(CreativeTabs.tabBlock); + registerBlock(112, (String) "nether_brick", block10); + registerBlock(113, (String) "nether_brick_fence", + (new BlockFence(Material.rock, MapColor.netherrackColor)).setHardness(2.0F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("netherFence")); + registerBlock(114, (String) "nether_brick_stairs", + (new BlockStairs(block10.getDefaultState())).setUnlocalizedName("stairsNetherBrick")); + registerBlock(115, (String) "nether_wart", (new BlockNetherWart()).setUnlocalizedName("netherStalk")); + registerBlock(116, (String) "enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F) + .setResistance(2000.0F).setUnlocalizedName("enchantmentTable")); + registerBlock(117, (String) "brewing_stand", + (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setUnlocalizedName("brewingStand")); + registerBlock(118, (String) "cauldron", (new BlockCauldron()).setHardness(2.0F).setUnlocalizedName("cauldron")); + registerBlock(119, (String) "end_portal", + (new BlockEndPortal(Material.portal)).setHardness(-1.0F).setResistance(6000000.0F)); + registerBlock(120, (String) "end_portal_frame", + (new BlockEndPortalFrame()).setStepSound(soundTypeGlass).setLightLevel(0.125F).setHardness(-1.0F) + .setUnlocalizedName("endPortalFrame").setResistance(6000000.0F) + .setCreativeTab(CreativeTabs.tabDecorations)); + registerBlock(121, (String) "end_stone", + (new Block(Material.rock, MapColor.sandColor)).setHardness(3.0F).setResistance(15.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("whiteStone") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(122, (String) "dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F) + .setStepSound(soundTypePiston).setLightLevel(0.125F).setUnlocalizedName("dragonEgg")); + registerBlock(123, (String) "redstone_lamp", + (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(soundTypeGlass) + .setUnlocalizedName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone)); + registerBlock(124, (String) "lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F) + .setStepSound(soundTypeGlass).setUnlocalizedName("redstoneLight")); + registerBlock(125, (String) "double_wooden_slab", (new BlockDoubleWoodSlab()).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("woodSlab")); + registerBlock(126, (String) "wooden_slab", (new BlockHalfWoodSlab()).setHardness(2.0F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("woodSlab")); + registerBlock(127, (String) "cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("cocoa")); + registerBlock(128, (String) "sandstone_stairs", + (new BlockStairs( + block2.getDefaultState().withProperty(BlockSandStone.TYPE, BlockSandStone.EnumType.SMOOTH))) + .setUnlocalizedName("stairsSandStone")); + registerBlock(129, (String) "emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("oreEmerald")); + registerBlock(130, (String) "ender_chest", (new BlockEnderChest()).setHardness(22.5F).setResistance(1000.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("enderChest").setLightLevel(0.5F)); + registerBlock(131, (String) "tripwire_hook", (new BlockTripWireHook()).setUnlocalizedName("tripWireSource")); + registerBlock(132, (String) "tripwire", (new BlockTripWire()).setUnlocalizedName("tripWire")); + registerBlock(133, (String) "emerald_block", + (new Block(Material.iron, MapColor.emeraldColor)).setHardness(5.0F).setResistance(10.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("blockEmerald") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(134, (String) "spruce_stairs", + (new BlockStairs( + block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.SPRUCE))) + .setUnlocalizedName("stairsWoodSpruce")); + registerBlock(135, (String) "birch_stairs", + (new BlockStairs( + block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.BIRCH))) + .setUnlocalizedName("stairsWoodBirch")); + registerBlock(136, (String) "jungle_stairs", + (new BlockStairs( + block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.JUNGLE))) + .setUnlocalizedName("stairsWoodJungle")); + registerBlock(137, (String) "command_block", (new BlockCommandBlock()).setBlockUnbreakable() + .setResistance(6000000.0F).setUnlocalizedName("commandBlock")); + registerBlock(138, (String) "beacon", (new BlockBeacon()).setUnlocalizedName("beacon").setLightLevel(1.0F)); + registerBlock(139, (String) "cobblestone_wall", (new BlockWall(block)).setUnlocalizedName("cobbleWall")); + registerBlock(140, (String) "flower_pot", + (new BlockFlowerPot()).setHardness(0.0F).setStepSound(soundTypeStone).setUnlocalizedName("flowerPot")); + registerBlock(141, (String) "carrots", (new BlockCarrot()).setUnlocalizedName("carrots")); + registerBlock(142, (String) "potatoes", (new BlockPotato()).setUnlocalizedName("potatoes")); + registerBlock(143, (String) "wooden_button", + (new BlockButtonWood()).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("button")); + registerBlock(144, (String) "skull", + (new BlockSkull()).setHardness(1.0F).setStepSound(soundTypePiston).setUnlocalizedName("skull")); + registerBlock(145, (String) "anvil", (new BlockAnvil()).setHardness(5.0F).setStepSound(soundTypeAnvil) + .setResistance(2000.0F).setUnlocalizedName("anvil")); + registerBlock(146, (String) "trapped_chest", + (new BlockChest(1)).setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("chestTrap")); + registerBlock(147, (String) "light_weighted_pressure_plate", + (new BlockPressurePlateWeighted(Material.iron, 15, MapColor.goldColor)).setHardness(0.5F) + .setStepSound(soundTypeWood).setUnlocalizedName("weightedPlate_light")); + registerBlock(148, (String) "heavy_weighted_pressure_plate", + (new BlockPressurePlateWeighted(Material.iron, 150)).setHardness(0.5F).setStepSound(soundTypeWood) + .setUnlocalizedName("weightedPlate_heavy")); + registerBlock(149, (String) "unpowered_comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("comparator").disableStats()); + registerBlock(150, (String) "powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F) + .setLightLevel(0.625F).setStepSound(soundTypeWood).setUnlocalizedName("comparator").disableStats()); + registerBlock(151, (String) "daylight_detector", new BlockDaylightDetector(false)); + registerBlock(152, (String) "redstone_block", + (new BlockCompressedPowered(Material.iron, MapColor.tntColor)).setHardness(5.0F).setResistance(10.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("blockRedstone") + .setCreativeTab(CreativeTabs.tabRedstone)); + registerBlock(153, (String) "quartz_ore", (new BlockOre(MapColor.netherrackColor)).setHardness(3.0F) + .setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("netherquartz")); + registerBlock(154, (String) "hopper", (new BlockHopper()).setHardness(3.0F).setResistance(8.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("hopper")); + Block block11 = (new BlockQuartz()).setStepSound(soundTypePiston).setHardness(0.8F) + .setUnlocalizedName("quartzBlock"); + registerBlock(155, (String) "quartz_block", block11); + registerBlock(156, (String) "quartz_stairs", + (new BlockStairs( + block11.getDefaultState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT))) + .setUnlocalizedName("stairsQuartz")); + registerBlock(157, (String) "activator_rail", (new BlockRailPowered()).setHardness(0.7F) + .setStepSound(soundTypeMetal).setUnlocalizedName("activatorRail")); + registerBlock(158, (String) "dropper", + (new BlockDropper()).setHardness(3.5F).setStepSound(soundTypePiston).setUnlocalizedName("dropper")); + registerBlock(159, (String) "stained_hardened_clay", (new BlockColored(Material.rock)).setHardness(1.25F) + .setResistance(7.0F).setStepSound(soundTypePiston).setUnlocalizedName("clayHardenedStained")); + registerBlock(160, (String) "stained_glass_pane", (new BlockStainedGlassPane()).setHardness(0.3F) + .setStepSound(soundTypeGlass).setUnlocalizedName("thinStainedGlass")); + registerBlock(161, (String) "leaves2", (new BlockNewLeaf()).setUnlocalizedName("leaves")); + registerBlock(162, (String) "log2", (new BlockNewLog()).setUnlocalizedName("log")); + registerBlock(163, (String) "acacia_stairs", + (new BlockStairs( + block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.ACACIA))) + .setUnlocalizedName("stairsWoodAcacia")); + registerBlock(164, (String) "dark_oak_stairs", + (new BlockStairs( + block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.DARK_OAK))) + .setUnlocalizedName("stairsWoodDarkOak")); + registerBlock(165, (String) "slime", (new BlockSlime()).setUnlocalizedName("slime").setStepSound(SLIME_SOUND)); + registerBlock(166, (String) "barrier", (new BlockBarrier()).setUnlocalizedName("barrier")); + registerBlock(167, (String) "iron_trapdoor", (new BlockTrapDoor(Material.iron)).setHardness(5.0F) + .setStepSound(soundTypeMetal).setUnlocalizedName("ironTrapdoor").disableStats()); + registerBlock(168, (String) "prismarine", (new BlockPrismarine()).setHardness(1.5F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("prismarine")); + registerBlock(169, (String) "sea_lantern", (new BlockSeaLantern(Material.glass)).setHardness(0.3F) + .setStepSound(soundTypeGlass).setLightLevel(1.0F).setUnlocalizedName("seaLantern")); + registerBlock(170, (String) "hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(soundTypeGrass) + .setUnlocalizedName("hayBlock").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(171, (String) "carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(soundTypeCloth) + .setUnlocalizedName("woolCarpet").setLightOpacity(0)); + registerBlock(172, (String) "hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("clayHardened")); + registerBlock(173, (String) "coal_block", + (new Block(Material.rock, MapColor.blackColor)).setHardness(5.0F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("blockCoal") + .setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(174, (String) "packed_ice", + (new BlockPackedIce()).setHardness(0.5F).setStepSound(soundTypeGlass).setUnlocalizedName("icePacked")); + registerBlock(175, (String) "double_plant", new BlockDoublePlant()); + registerBlock(176, (String) "standing_banner", (new BlockBanner.BlockBannerStanding()).setHardness(1.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("banner").disableStats()); + registerBlock(177, (String) "wall_banner", (new BlockBanner.BlockBannerHanging()).setHardness(1.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("banner").disableStats()); + registerBlock(178, (String) "daylight_detector_inverted", new BlockDaylightDetector(true)); + Block block12 = (new BlockRedSandstone()).setStepSound(soundTypePiston).setHardness(0.8F) + .setUnlocalizedName("redSandStone"); + registerBlock(179, (String) "red_sandstone", block12); + registerBlock(180, (String) "red_sandstone_stairs", (new BlockStairs( + block12.getDefaultState().withProperty(BlockRedSandstone.TYPE, BlockRedSandstone.EnumType.SMOOTH))) + .setUnlocalizedName("stairsRedSandStone")); + registerBlock(181, (String) "double_stone_slab2", (new BlockDoubleStoneSlabNew()).setHardness(2.0F) + .setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab2")); + registerBlock(182, (String) "stone_slab2", (new BlockHalfStoneSlabNew()).setHardness(2.0F).setResistance(10.0F) + .setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab2")); + registerBlock(183, (String) "spruce_fence_gate", + (new BlockFenceGate(BlockPlanks.EnumType.SPRUCE)).setHardness(2.0F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("spruceFenceGate")); + registerBlock(184, (String) "birch_fence_gate", + (new BlockFenceGate(BlockPlanks.EnumType.BIRCH)).setHardness(2.0F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("birchFenceGate")); + registerBlock(185, (String) "jungle_fence_gate", + (new BlockFenceGate(BlockPlanks.EnumType.JUNGLE)).setHardness(2.0F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("jungleFenceGate")); + registerBlock(186, (String) "dark_oak_fence_gate", + (new BlockFenceGate(BlockPlanks.EnumType.DARK_OAK)).setHardness(2.0F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("darkOakFenceGate")); + registerBlock(187, (String) "acacia_fence_gate", + (new BlockFenceGate(BlockPlanks.EnumType.ACACIA)).setHardness(2.0F).setResistance(5.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("acaciaFenceGate")); + registerBlock(188, (String) "spruce_fence", + (new BlockFence(Material.wood, BlockPlanks.EnumType.SPRUCE.func_181070_c())).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("spruceFence")); + registerBlock(189, (String) "birch_fence", + (new BlockFence(Material.wood, BlockPlanks.EnumType.BIRCH.func_181070_c())).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("birchFence")); + registerBlock(190, (String) "jungle_fence", + (new BlockFence(Material.wood, BlockPlanks.EnumType.JUNGLE.func_181070_c())).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("jungleFence")); + registerBlock(191, (String) "dark_oak_fence", + (new BlockFence(Material.wood, BlockPlanks.EnumType.DARK_OAK.func_181070_c())).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("darkOakFence")); + registerBlock(192, (String) "acacia_fence", + (new BlockFence(Material.wood, BlockPlanks.EnumType.ACACIA.func_181070_c())).setHardness(2.0F) + .setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("acaciaFence")); + registerBlock(193, (String) "spruce_door", (new BlockDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("doorSpruce").disableStats()); + registerBlock(194, (String) "birch_door", (new BlockDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("doorBirch").disableStats()); + registerBlock(195, (String) "jungle_door", (new BlockDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("doorJungle").disableStats()); + registerBlock(196, (String) "acacia_door", (new BlockDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("doorAcacia").disableStats()); + registerBlock(197, (String) "dark_oak_door", (new BlockDoor(Material.wood)).setHardness(3.0F) + .setStepSound(soundTypeWood).setUnlocalizedName("doorDarkOak").disableStats()); + blockRegistry.validateKey(); + + for (Block block13 : blockRegistry) { + if (block13.blockMaterial == Material.air) { + block13.useNeighborBrightness = false; + } else { + boolean flag = false; + boolean flag1 = block13 instanceof BlockStairs; + boolean flag2 = block13 instanceof BlockSlab; + boolean flag3 = block13 == block6; + boolean flag4 = block13.translucent; + boolean flag5 = block13.lightOpacity == 0; + if (flag1 || flag2 || flag3 || flag4 || flag5) { + flag = true; + } + + block13.useNeighborBrightness = flag; + } + } + + for (Block block14 : blockRegistry) { + for (IBlockState iblockstate : block14.getBlockState().getValidStates()) { + int i = blockRegistry.getIDForObject(block14) << 4 | block14.getMetaFromState(iblockstate); + BLOCK_STATE_IDS.put(iblockstate, i); + } + } + + } + + public static void bootstrapStates() { + BlockBed.bootstrapStates(); + BlockDirt.bootstrapStates(); + BlockDoor.bootstrapStates(); + BlockDoublePlant.bootstrapStates(); + BlockFlowerPot.bootstrapStates(); + BlockHugeMushroom.bootstrapStates(); + BlockLever.bootstrapStates(); + BlockLog.bootstrapStates(); + BlockNewLeaf.bootstrapStates(); + BlockNewLog.bootstrapStates(); + BlockOldLeaf.bootstrapStates(); + BlockOldLog.bootstrapStates(); + BlockPistonExtension.bootstrapStates(); + BlockPistonMoving.bootstrapStates(); + BlockPlanks.bootstrapStates(); + BlockPrismarine.bootstrapStates(); + BlockQuartz.bootstrapStates(); + BlockRail.bootstrapStates(); + BlockRailDetector.bootstrapStates(); + BlockRailPowered.bootstrapStates(); + BlockRedSandstone.bootstrapStates(); + BlockRedstoneComparator.bootstrapStates(); + BlockRedstoneWire.bootstrapStates(); + BlockSand.bootstrapStates(); + BlockSandStone.bootstrapStates(); + BlockSapling.bootstrapStates(); + BlockSilverfish.bootstrapStates(); + BlockSlab.bootstrapStates(); + BlockStairs.bootstrapStates(); + BlockStone.bootstrapStates(); + BlockStoneBrick.bootstrapStates(); + BlockStoneSlab.bootstrapStates(); + BlockStoneSlabNew.bootstrapStates(); + BlockTallGrass.bootstrapStates(); + BlockTrapDoor.bootstrapStates(); + BlockWall.bootstrapStates(); + BlockWoodSlab.bootstrapStates(); + } + + private static void registerBlock(int id, ResourceLocation textualID, Block block_) { + blockRegistry.register(id, textualID, block_); + } + + private static void registerBlock(int id, String textualID, Block block_) { + registerBlock(id, new ResourceLocation(textualID), block_); + } + + public static enum EnumOffsetType { + NONE, XZ, XYZ; + } + + public static class SoundType { + public final String soundName; + public final float volume; + public final float frequency; + + public SoundType(String name, float volume, float frequency) { + this.soundName = name; + this.volume = volume; + this.frequency = frequency; + } + + public float getVolume() { + return this.volume; + } + + public float getFrequency() { + return this.frequency; + } + + public String getBreakSound() { + return "dig." + this.soundName; + } + + public String getStepSound() { + return "step." + this.soundName; + } + + public String getPlaceSound() { + return this.getBreakSound(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAir.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAir.java new file mode 100644 index 0000000..7fe0957 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAir.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockAir extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockAir"); + } + + protected BlockAir() { + super(Material.air); + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return -1; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) { + return false; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World worldIn, BlockPos pos) { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAnvil.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAnvil.java new file mode 100644 index 0000000..2612acb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAnvil.java @@ -0,0 +1,200 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFallingBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerRepair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockAnvil extends BlockFalling { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockAnvil"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyInteger DAMAGE = PropertyInteger.create("damage", 0, 2); + + protected BlockAnvil() { + super(Material.anvil); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DAMAGE, + Integer.valueOf(0))); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, + int meta, EntityLivingBase placer) { + EnumFacing enumfacing = placer.getHorizontalFacing().rotateY(); + return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer) + .withProperty(FACING, enumfacing).withProperty(DAMAGE, Integer.valueOf(meta >> 2)); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumFacing side, float hitX, float hitY, float hitZ) { + { + playerIn.displayGui(new BlockAnvil.Anvil(worldIn, pos)); + } + return true; + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState state) { + return ((Integer) state.getValue(DAMAGE)).intValue(); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { + EnumFacing enumfacing = (EnumFacing) worldIn.getBlockState(pos).getValue(FACING); + if (enumfacing.getAxis() == EnumFacing.Axis.X) { + this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); + } else { + this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); + } + + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + } + + protected void onStartFalling(EntityFallingBlock fallingEntity) { + fallingEntity.setHurtEntities(true); + } + + public void onEndFalling(World parWorld, BlockPos parBlockPos) { + parWorld.playAuxSFX(1022, parBlockPos, 0); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { + return true; + } + + /**+ + * Possibly modify the given BlockState before rendering it on + * an Entity (Minecarts, Endermen, ...) + */ + public IBlockState getStateForEntityRender(IBlockState state) { + return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta & 3)).withProperty(DAMAGE, + Integer.valueOf((meta & 15) >> 2)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState state) { + int i = 0; + i = i | ((EnumFacing) state.getValue(FACING)).getHorizontalIndex(); + i = i | ((Integer) state.getValue(DAMAGE)).intValue() << 2; + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, DAMAGE }); + } + + public static class Anvil implements IInteractionObject { + private final World world; + private final BlockPos position; + + public Anvil(World worldIn, BlockPos pos) { + this.world = worldIn; + this.position = pos; + } + + public String getName() { + return "anvil"; + } + + public boolean hasCustomName() { + return false; + } + + public IChatComponent getDisplayName() { + return new ChatComponentTranslation(Blocks.anvil.getUnlocalizedName() + ".name", new Object[0]); + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { + return new ContainerRepair(playerInventory, this.world, this.position, playerIn); + } + + public String getGuiID() { + return "minecraft:anvil"; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBanner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBanner.java new file mode 100644 index 0000000..55a2492 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBanner.java @@ -0,0 +1,244 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBanner extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBanner"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15); + + protected BlockBanner() { + super(Material.wood); + float f = 0.25F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal("item.banner.white.name"); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) { + return true; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean func_181623_g() { + return true; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) { + return new TileEntityBanner(); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState state, EaglercraftRandom rand, int fortune) { + return Items.banner; + } + + public Item getItem(World worldIn, BlockPos pos) { + return Items.banner; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBanner) { + ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner) tileentity).getBaseColor()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("x"); + nbttagcompound.removeTag("y"); + nbttagcompound.removeTag("z"); + nbttagcompound.removeTag("id"); + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + spawnAsEntity(world, blockpos, itemstack); + } else { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); + } + + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { + return !this.func_181087_e(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos); + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) { + if (te instanceof TileEntityBanner) { + TileEntityBanner tileentitybanner = (TileEntityBanner) te; + ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner) te).getBaseColor()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + TileEntityBanner.func_181020_a(nbttagcompound, tileentitybanner.getBaseColor(), + tileentitybanner.func_181021_d()); + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + spawnAsEntity(worldIn, pos, itemstack); + } else { + super.harvestBlock(worldIn, player, pos, state, (TileEntity) null); + } + + } + + public static class BlockBannerHanging extends BlockBanner { + public BlockBannerHanging() { + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + EnumFacing enumfacing = (EnumFacing) iblockaccess.getBlockState(blockpos).getValue(FACING); + float f = 0.0F; + float f1 = 0.78125F; + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + switch (enumfacing) { + case NORTH: + default: + this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F); + break; + case SOUTH: + this.setBlockBounds(f2, f, 0.0F, f3, f1, f4); + break; + case WEST: + this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3); + break; + case EAST: + this.setBlockBounds(0.0F, f, f2, f4, f1, f3); + } + + } + + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (!world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock().getMaterial().isSolid()) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + } + + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getFront(i); + if (enumfacing.getAxis() == EnumFacing.Axis.Y) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } + } + + public static class BlockBannerStanding extends BlockBanner { + public BlockBannerStanding() { + this.setDefaultState(this.blockState.getBaseState().withProperty(ROTATION, Integer.valueOf(0))); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { + if (!worldIn.getBlockState(pos.down()).getBlock().getMaterial().isSolid()) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(ROTATION, Integer.valueOf(i)); + } + + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(ROTATION)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { ROTATION }); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBarrier.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBarrier.java new file mode 100644 index 0000000..b20e99c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBarrier.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBarrier extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBarrier"); + } + + protected BlockBarrier() { + super(Material.barrier); + this.setBlockUnbreakable(); + this.setResistance(6000001.0F); + this.disableStats(); + this.translucent = true; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return -1; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * Returns the default ambient occlusion value based on block + * opacity + */ + public float getAmbientOcclusionLightValue() { + return 1.0F; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World var1, BlockPos var2, IBlockState var3, float var4, int var5) { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBasePressurePlate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBasePressurePlate.java new file mode 100644 index 0000000..7125c78 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBasePressurePlate.java @@ -0,0 +1,238 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockBasePressurePlate extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBasePressurePlate"); + } + + protected BlockBasePressurePlate(Material materialIn) { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockBasePressurePlate(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + this.setBlockBoundsBasedOnState0(iblockaccess.getBlockState(blockpos)); + } + + protected void setBlockBoundsBasedOnState0(IBlockState state) { + boolean flag = this.getRedstoneStrength(state) > 0; + float f = 0.0625F; + if (flag) { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.03125F, 0.9375F); + } else { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.0625F, 0.9375F); + } + + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World worldIn) { + return 20; + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess var1, BlockPos var2) { + return true; + } + + public boolean func_181623_g() { + return true; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return this.canBePlacedOn(world, blockpos.down()); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!this.canBePlacedOn(world, blockpos.down())) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + } + + private boolean canBePlacedOn(World worldIn, BlockPos pos) { + return World.doesBlockHaveSolidTopSurface(worldIn, pos) + || worldIn.getBlockState(pos).getBlock() instanceof BlockFence; + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom random) { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { + { + int i = this.getRedstoneStrength(state); + if (i > 0) { + this.updateState(worldIn, pos, state, i); + } + } + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { + { + int i = this.getRedstoneStrength(state); + if (i == 0) { + this.updateState(worldIn, pos, state, i); + } + } + } + + /**+ + * Updates the pressure plate when stepped on + */ + protected void updateState(World worldIn, BlockPos pos, IBlockState state, int oldRedstoneStrength) { + int i = this.computeRedstoneStrength(worldIn, pos); + boolean flag = oldRedstoneStrength > 0; + boolean flag1 = i > 0; + if (oldRedstoneStrength != i) { + state = this.setRedstoneStrength(state, i); + worldIn.setBlockState(pos, state, 2); + this.updateNeighbors(worldIn, pos); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + + if (!flag1 && flag) { + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.1D, (double) pos.getZ() + 0.5D, + "random.click", 0.3F, 0.5F); + } else if (flag1 && !flag) { + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.1D, (double) pos.getZ() + 0.5D, + "random.click", 0.3F, 0.6F); + } + + if (flag1) { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + } + + /**+ + * Returns the cubic AABB inset by 1/8 on all sides + */ + protected AxisAlignedBB getSensitiveAABB(BlockPos pos) { + float f = 0.125F; + return new AxisAlignedBB((double) ((float) pos.getX() + 0.125F), (double) pos.getY(), + (double) ((float) pos.getZ() + 0.125F), (double) ((float) (pos.getX() + 1) - 0.125F), + (double) pos.getY() + 0.25D, (double) ((float) (pos.getZ() + 1) - 0.125F)); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + if (this.getRedstoneStrength(iblockstate) > 0) { + this.updateNeighbors(world, blockpos); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + /**+ + * Notify block and block below of changes + */ + protected void updateNeighbors(World worldIn, BlockPos pos) { + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) { + return this.getRedstoneStrength(state); + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) { + return side == EnumFacing.UP ? this.getRedstoneStrength(state) : 0; + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float f = 0.5F; + float f1 = 0.125F; + float f2 = 0.5F; + this.setBlockBounds(0.0F, 0.375F, 0.0F, 1.0F, 0.625F, 1.0F); + } + + public int getMobilityFlag() { + return 1; + } + + protected abstract int computeRedstoneStrength(World var1, BlockPos var2); + + protected abstract int getRedstoneStrength(IBlockState var1); + + protected abstract IBlockState setRedstoneStrength(IBlockState var1, int var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBeacon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBeacon.java new file mode 100644 index 0000000..377d0ee --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBeacon.java @@ -0,0 +1,152 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +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.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBeacon extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBeacon"); + } + + public BlockBeacon() { + super(Material.glass, MapColor.diamondColor); + this.setHardness(3.0F); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityBeacon(); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBeacon) { + entityplayer.displayGUIChest((TileEntityBeacon) tileentity); + entityplayer.triggerAchievement(StatList.field_181730_N); + } + } + return true; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, + ItemStack stack) { + super.onBlockPlacedBy(worldIn, pos, state, placer, stack); + if (stack.hasDisplayName()) { + TileEntity tileentity = worldIn.getTileEntity(pos); + if (tileentity instanceof TileEntityBeacon) { + ((TileEntityBeacon) tileentity).setName(stack.getDisplayName()); + } + } + + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBeacon) { + ((TileEntityBeacon) tileentity).updateBeacon(); + world.addBlockEvent(blockpos, this, 1, 0); + } + + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + public static void updateColorAsync(final World worldIn, final BlockPos glassPos) { + Chunk chunk = worldIn.getChunkFromBlockCoords(glassPos); + + for (int i = glassPos.getY() - 1; i >= 0; --i) { + final BlockPos blockpos = new BlockPos(glassPos.getX(), i, glassPos.getZ()); + if (!chunk.canSeeSky(blockpos)) { + break; + } + + IBlockState iblockstate = worldIn.getBlockState(blockpos); + if (iblockstate.getBlock() == Blocks.beacon) { + ((WorldServer) worldIn).addScheduledTask(new Runnable() { + public void run() { + TileEntity tileentity = worldIn.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBeacon) { + ((TileEntityBeacon) tileentity).updateBeacon(); + worldIn.addBlockEvent(blockpos, Blocks.beacon, 1, 0); + } + } + }); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBed.java new file mode 100644 index 0000000..911dcd4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBed.java @@ -0,0 +1,327 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBed extends BlockDirectional { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBed"); + } + + public static PropertyEnum PART; + public static final PropertyBool OCCUPIED = PropertyBool.create("occupied"); + + public static void bootstrapStates() { + PART = PropertyEnum.create("part", BlockBed.EnumPartType.class); + } + + public BlockBed() { + super(Material.cloth); + this.setDefaultState(this.blockState.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT) + .withProperty(OCCUPIED, Boolean.valueOf(false))); + this.setBedBounds(); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + if (iblockstate.getValue(PART) != BlockBed.EnumPartType.HEAD) { + blockpos = blockpos.offset((EnumFacing) iblockstate.getValue(FACING)); + iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock() != this) { + return true; + } + } + } + + if (world.provider.canRespawnHere() && world.getBiomeGenForCoords(blockpos) != BiomeGenBase.hell) { + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("bedSpawnPoint") && Math.abs(entityplayer.posX - (double) blockpos.getX()) <= 3.0D + && Math.abs(entityplayer.posY - (double) blockpos.getY()) <= 2.0D + && Math.abs(entityplayer.posZ - (double) blockpos.getZ()) <= 3.0D) { + BlockPos blockpos1 = BlockBed.getSafeExitLocation(world, blockpos, 0); + if (blockpos1 == null) { + blockpos1 = blockpos.up(); + } + entityplayer.setSpawnPoint(blockpos1.add(0.5F, 0.1F, 0.5F), false); + entityplayer.addChatComponentMessage(new ChatComponentTranslation("tile.bed.setspawn")); + if (entityplayer.isSneaking()) { + return true; + } + } + + if (((Boolean) iblockstate.getValue(OCCUPIED)).booleanValue()) { + EntityPlayer entityplayer1 = this.getPlayerInBed(world, blockpos); + if (entityplayer1 != null) { + entityplayer + .addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0])); + return true; + } + + iblockstate = iblockstate.withProperty(OCCUPIED, Boolean.valueOf(false)); + world.setBlockState(blockpos, iblockstate, 4); + } + + EntityPlayer.EnumStatus entityplayer$enumstatus = entityplayer.trySleep(blockpos); + if (entityplayer$enumstatus == EntityPlayer.EnumStatus.OK) { + iblockstate = iblockstate.withProperty(OCCUPIED, Boolean.valueOf(true)); + world.setBlockState(blockpos, iblockstate, 4); + return true; + } else { + if (entityplayer$enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) { + entityplayer + .addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0])); + } else if (entityplayer$enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) { + entityplayer + .addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0])); + } + + return true; + } + } else { + world.setBlockToAir(blockpos); + BlockPos blockpos1 = blockpos.offset(((EnumFacing) iblockstate.getValue(FACING)).getOpposite()); + if (world.getBlockState(blockpos1).getBlock() == this) { + world.setBlockToAir(blockpos1); + } + + world.newExplosion((Entity) null, (double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, 5.0F, true, true); + return true; + } + } + + private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos) { + for (EntityPlayer entityplayer : worldIn.playerEntities) { + if (entityplayer.isPlayerSleeping() && entityplayer.playerLocation.equals(pos)) { + return entityplayer; + } + } + + return null; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + this.setBedBounds(); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (iblockstate.getValue(PART) == BlockBed.EnumPartType.HEAD) { + if (world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock() != this) { + world.setBlockToAir(blockpos); + } + } else if (world.getBlockState(blockpos.offset(enumfacing)).getBlock() != this) { + world.setBlockToAir(blockpos); + { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + } + } + + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom var2, int var3) { + return iblockstate.getValue(PART) == BlockBed.EnumPartType.HEAD ? null : Items.bed; + } + + private void setBedBounds() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); + } + + /**+ + * Returns a safe BlockPos to disembark the bed + */ + public static BlockPos getSafeExitLocation(World worldIn, BlockPos pos, int tries) { + EnumFacing enumfacing = (EnumFacing) worldIn.getBlockState(pos).getValue(FACING); + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + + for (int l = 0; l <= 1; ++l) { + int i1 = i - enumfacing.getFrontOffsetX() * l - 1; + int j1 = k - enumfacing.getFrontOffsetZ() * l - 1; + int k1 = i1 + 2; + int l1 = j1 + 2; + + for (int i2 = i1; i2 <= k1; ++i2) { + for (int j2 = j1; j2 <= l1; ++j2) { + BlockPos blockpos = new BlockPos(i2, j, j2); + if (hasRoomForPlayer(worldIn, blockpos)) { + if (tries <= 0) { + return blockpos; + } + + --tries; + } + } + } + } + + return null; + } + + protected static boolean hasRoomForPlayer(World worldIn, BlockPos pos) { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) + && !worldIn.getBlockState(pos).getBlock().getMaterial().isSolid() + && !worldIn.getBlockState(pos.up()).getBlock().getMaterial().isSolid(); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int var5) { + if (iblockstate.getValue(PART) == BlockBed.EnumPartType.FOOT) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, 0); + } + + } + + public int getMobilityFlag() { + return 1; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.bed; + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) { + if (player.capabilities.isCreativeMode && state.getValue(PART) == BlockBed.EnumPartType.HEAD) { + BlockPos blockpos = pos.offset(((EnumFacing) state.getValue(FACING)).getOpposite()); + if (worldIn.getBlockState(blockpos).getBlock() == this) { + worldIn.setBlockToAir(blockpos); + } + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getHorizontal(i); + return (i & 8) > 0 + ? this.getDefaultState().withProperty(PART, BlockBed.EnumPartType.HEAD).withProperty(FACING, enumfacing) + .withProperty(OCCUPIED, Boolean.valueOf((i & 4) > 0)) + : this.getDefaultState().withProperty(PART, BlockBed.EnumPartType.FOOT).withProperty(FACING, + enumfacing); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { + if (state.getValue(PART) == BlockBed.EnumPartType.FOOT) { + IBlockState iblockstate = worldIn.getBlockState(pos.offset((EnumFacing) state.getValue(FACING))); + if (iblockstate.getBlock() == this) { + state = state.withProperty(OCCUPIED, iblockstate.getValue(OCCUPIED)); + } + } + + return state; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + if (iblockstate.getValue(PART) == BlockBed.EnumPartType.HEAD) { + i |= 8; + if (((Boolean) iblockstate.getValue(OCCUPIED)).booleanValue()) { + i |= 4; + } + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, PART, OCCUPIED }); + } + + public static enum EnumPartType implements IStringSerializable { + HEAD("head"), FOOT("foot"); + + private final String name; + + private EnumPartType(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBookshelf.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBookshelf.java new file mode 100644 index 0000000..96d12cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBookshelf.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBookshelf extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBookshelf"); + } + + public BlockBookshelf() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 3; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.book; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBreakable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBreakable.java new file mode 100644 index 0000000..7a35617 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBreakable.java @@ -0,0 +1,75 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBreakable extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBreakable"); + } + + private boolean ignoreSimilarity; + + protected BlockBreakable(Material materialIn, boolean ignoreSimilarityIn) { + this(materialIn, ignoreSimilarityIn, materialIn.getMaterialMapColor()); + } + + protected BlockBreakable(Material parMaterial, boolean parFlag, MapColor parMapColor) { + super(parMaterial, parMapColor); + this.ignoreSimilarity = parFlag; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (this == Blocks.glass || this == Blocks.stained_glass) { + if (iblockaccess.getBlockState(blockpos.offset(enumfacing.getOpposite())) != iblockstate) { + return true; + } + + if (block == this) { + return false; + } + } + + return !this.ignoreSimilarity && block == this ? false + : super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBrewingStand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBrewingStand.java new file mode 100644 index 0000000..b7b5e93 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBrewingStand.java @@ -0,0 +1,220 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBrewingStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBrewingStand extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBrewingStand"); + } + + public static final PropertyBool[] HAS_BOTTLE = new PropertyBool[] { PropertyBool.create("has_bottle_0"), + PropertyBool.create("has_bottle_1"), PropertyBool.create("has_bottle_2") }; + + public BlockBrewingStand() { + super(Material.iron); + this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_BOTTLE[0], Boolean.valueOf(false)) + .withProperty(HAS_BOTTLE[1], Boolean.valueOf(false)) + .withProperty(HAS_BOTTLE[2], Boolean.valueOf(false))); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal("item.brewingStand.name"); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityBrewingStand(); + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBoundsForItemRender(); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBrewingStand) { + entityplayer.displayGUIChest((TileEntityBrewingStand) tileentity); + entityplayer.triggerAchievement(StatList.field_181729_M); + } + } + return true; + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState var3, EntityLivingBase var4, + ItemStack itemstack) { + if (itemstack.hasDisplayName()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBrewingStand) { + ((TileEntityBrewingStand) tileentity).setName(itemstack.getDisplayName()); + } + } + + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + double d0 = (double) ((float) blockpos.getX() + 0.4F + random.nextFloat() * 0.2F); + double d1 = (double) ((float) blockpos.getY() + 0.7F + random.nextFloat() * 0.3F); + double d2 = (double) ((float) blockpos.getZ() + 0.4F + random.nextFloat() * 0.2F); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBrewingStand) { + InventoryHelper.dropInventoryItems(world, blockpos, (TileEntityBrewingStand) tileentity); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.brewing_stand; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.brewing_stand; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return Container.calcRedstone(world.getTileEntity(blockpos)); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState(); + + for (int j = 0; j < 3; ++j) { + iblockstate = iblockstate.withProperty(HAS_BOTTLE[j], Boolean.valueOf((i & 1 << j) > 0)); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + + for (int j = 0; j < 3; ++j) { + if (((Boolean) iblockstate.getValue(HAS_BOTTLE[j])).booleanValue()) { + i |= 1 << j; + } + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { HAS_BOTTLE[0], HAS_BOTTLE[1], HAS_BOTTLE[2] }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBush.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBush.java new file mode 100644 index 0000000..41e44f9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBush.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockBush extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockBush"); + } + + protected BlockBush() { + this(Material.plants); + } + + protected BlockBush(Material materialIn) { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockBush(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + this.setTickRandomly(true); + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) + && this.canPlaceBlockOn(world.getBlockState(blockpos.down()).getBlock()); + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) { + return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.farmland; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + this.checkAndDropBlock(world, blockpos, iblockstate); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + this.checkAndDropBlock(world, blockpos, iblockstate); + } + + protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state) { + if (!this.canBlockStay(worldIn, pos, state)) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockState(pos, Blocks.air.getDefaultState(), 3); + } + + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) { + return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButton.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButton.java new file mode 100644 index 0000000..b090689 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButton.java @@ -0,0 +1,365 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockButton extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockButton"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + private final boolean wooden; + + protected BlockButton(boolean wooden) { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, + Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.wooden = wooden; + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return this.wooden ? 30 : 20; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing) { + return func_181088_a(world, blockpos, enumfacing.getOpposite()); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + for (EnumFacing enumfacing : EnumFacing.values()) { + if (func_181088_a(world, blockpos, enumfacing)) { + return true; + } + } + + return false; + } + + protected static boolean func_181088_a(World parWorld, BlockPos parBlockPos, EnumFacing parEnumFacing) { + BlockPos blockpos = parBlockPos.offset(parEnumFacing); + return parEnumFacing == EnumFacing.DOWN ? World.doesBlockHaveSolidTopSurface(parWorld, blockpos) + : parWorld.getBlockState(blockpos).getBlock().isNormalCube(); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + return func_181088_a(world, blockpos, enumfacing.getOpposite()) + ? this.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, Boolean.valueOf(false)) + : this.getDefaultState().withProperty(FACING, EnumFacing.DOWN).withProperty(POWERED, + Boolean.valueOf(false)); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (this.checkForDrop(world, blockpos, iblockstate) + && !func_181088_a(world, blockpos, ((EnumFacing) iblockstate.getValue(FACING)).getOpposite())) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + } + + private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (this.canPlaceBlockAt(worldIn, pos)) { + return true; + } else { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + this.updateBlockBounds(iblockaccess.getBlockState(blockpos)); + } + + private void updateBlockBounds(IBlockState state) { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + boolean flag = ((Boolean) state.getValue(POWERED)).booleanValue(); + float f = 0.25F; + float f1 = 0.375F; + float f2 = (float) (flag ? 1 : 2) / 16.0F; + float f3 = 0.125F; + float f4 = 0.1875F; + switch (enumfacing) { + case EAST: + this.setBlockBounds(0.0F, 0.375F, 0.3125F, f2, 0.625F, 0.6875F); + break; + case WEST: + this.setBlockBounds(1.0F - f2, 0.375F, 0.3125F, 1.0F, 0.625F, 0.6875F); + break; + case SOUTH: + this.setBlockBounds(0.3125F, 0.375F, 0.0F, 0.6875F, 0.625F, f2); + break; + case NORTH: + this.setBlockBounds(0.3125F, 0.375F, 1.0F - f2, 0.6875F, 0.625F, 1.0F); + break; + case UP: + this.setBlockBounds(0.3125F, 0.0F, 0.375F, 0.6875F, 0.0F + f2, 0.625F); + break; + case DOWN: + this.setBlockBounds(0.3125F, 1.0F - f2, 0.375F, 0.6875F, 1.0F, 0.625F); + } + + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer var4, + EnumFacing var5, float var6, float var7, float var8) { + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + return true; + } else { + world.setBlockState(blockpos, iblockstate.withProperty(POWERED, Boolean.valueOf(true)), 3); + world.markBlockRangeForRenderUpdate(blockpos, blockpos); + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "random.click", 0.3F, 0.6F); + this.notifyNeighbors(world, blockpos, (EnumFacing) iblockstate.getValue(FACING)); + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + return true; + } + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + this.notifyNeighbors(world, blockpos, (EnumFacing) iblockstate.getValue(FACING)); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing var4) { + return ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing enumfacing) { + return !((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 0 + : (iblockstate.getValue(FACING) == enumfacing ? 15 : 0); + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + { + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + if (this.wooden) { + this.checkForArrows(world, blockpos, iblockstate); + } else { + world.setBlockState(blockpos, iblockstate.withProperty(POWERED, Boolean.valueOf(false))); + this.notifyNeighbors(world, blockpos, (EnumFacing) iblockstate.getValue(FACING)); + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "random.click", 0.3F, 0.5F); + world.markBlockRangeForRenderUpdate(blockpos, blockpos); + } + } + } + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float f = 0.1875F; + float f1 = 0.125F; + float f2 = 0.125F; + this.setBlockBounds(0.5F - f, 0.5F - f1, 0.5F - f2, 0.5F + f, 0.5F + f1, 0.5F + f2); + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState iblockstate, Entity var4) { + { + if (this.wooden) { + if (!((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + this.checkForArrows(world, blockpos, iblockstate); + } + } + } + } + + private void checkForArrows(World worldIn, BlockPos pos, IBlockState state) { + this.updateBlockBounds(state); + List list = worldIn.getEntitiesWithinAABB(EntityArrow.class, + new AxisAlignedBB((double) pos.getX() + this.minX, (double) pos.getY() + this.minY, + (double) pos.getZ() + this.minZ, (double) pos.getX() + this.maxX, + (double) pos.getY() + this.maxY, (double) pos.getZ() + this.maxZ)); + boolean flag = !list.isEmpty(); + boolean flag1 = ((Boolean) state.getValue(POWERED)).booleanValue(); + if (flag && !flag1) { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true))); + this.notifyNeighbors(worldIn, pos, (EnumFacing) state.getValue(FACING)); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, + "random.click", 0.3F, 0.6F); + } + + if (!flag && flag1) { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); + this.notifyNeighbors(worldIn, pos, (EnumFacing) state.getValue(FACING)); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, + "random.click", 0.3F, 0.5F); + } + + if (flag) { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + } + + private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing) { + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.offset(facing.getOpposite()), this); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing; + switch (i & 7) { + case 0: + enumfacing = EnumFacing.DOWN; + break; + case 1: + enumfacing = EnumFacing.EAST; + break; + case 2: + enumfacing = EnumFacing.WEST; + break; + case 3: + enumfacing = EnumFacing.SOUTH; + break; + case 4: + enumfacing = EnumFacing.NORTH; + break; + case 5: + default: + enumfacing = EnumFacing.UP; + } + + return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, + Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i; + switch ((EnumFacing) iblockstate.getValue(FACING)) { + case EAST: + i = 1; + break; + case WEST: + i = 2; + break; + case SOUTH: + i = 3; + break; + case NORTH: + i = 4; + break; + case UP: + default: + i = 5; + break; + case DOWN: + i = 0; + } + + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, POWERED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonStone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonStone.java new file mode 100644 index 0000000..a3e1dc9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonStone.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockButton; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockButtonStone extends BlockButton { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockButtonStone"); + } + + protected BlockButtonStone() { + super(false); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonWood.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonWood.java new file mode 100644 index 0000000..ffc853f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonWood.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockButton; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockButtonWood extends BlockButton { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockButtonWood"); + } + + protected BlockButtonWood() { + super(true); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCactus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCactus.java new file mode 100644 index 0000000..c70b6c9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCactus.java @@ -0,0 +1,159 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCactus extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCactus"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + + protected BlockCactus() { + super(Material.cactus); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + BlockPos blockpos1 = blockpos.up(); + if (world.isAirBlock(blockpos1)) { + int i; + for (i = 1; world.getBlockState(blockpos.down(i)).getBlock() == this; ++i) { + ; + } + + if (i < 3) { + int j = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (j == 15) { + world.setBlockState(blockpos1, this.getDefaultState()); + IBlockState iblockstate1 = iblockstate.withProperty(AGE, Integer.valueOf(0)); + world.setBlockState(blockpos, iblockstate1, 4); + this.onNeighborBlockChange(world, blockpos1, iblockstate1, this); + } else { + world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(j + 1)), 4); + } + + } + } + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState var3) { + float f = 0.0625F; + return new AxisAlignedBB((double) ((float) blockpos.getX() + f), (double) blockpos.getY(), + (double) ((float) blockpos.getZ() + f), (double) ((float) (blockpos.getX() + 1) - f), + (double) ((float) (blockpos.getY() + 1) - f), (double) ((float) (blockpos.getZ() + 1) - f)); + } + + public AxisAlignedBB getSelectedBoundingBox(World var1, BlockPos blockpos) { + float f = 0.0625F; + return new AxisAlignedBB((double) ((float) blockpos.getX() + f), (double) blockpos.getY(), + (double) ((float) blockpos.getZ() + f), (double) ((float) (blockpos.getX() + 1) - f), + (double) (blockpos.getY() + 1), (double) ((float) (blockpos.getZ() + 1) - f)); + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) ? this.canBlockStay(world, blockpos) : false; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + if (!this.canBlockStay(world, blockpos)) { + world.destroyBlock(blockpos, true); + } + + } + + public boolean canBlockStay(World worldIn, BlockPos pos) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid()) { + return false; + } + } + + Block block = worldIn.getBlockState(pos.down()).getBlock(); + return block == Blocks.cactus || block == Blocks.sand; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World var1, BlockPos var2, IBlockState var3, Entity entity) { + entity.attackEntityFrom(DamageSource.cactus, 1.0F); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AGE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCake.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCake.java new file mode 100644 index 0000000..a614b2b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCake.java @@ -0,0 +1,188 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCake extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCake"); + } + + public static final PropertyInteger BITES = PropertyInteger.create("bites", 0, 6); + + protected BlockCake() { + super(Material.cake); + this.setDefaultState(this.blockState.getBaseState().withProperty(BITES, Integer.valueOf(0))); + this.setTickRandomly(true); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + float f = 0.0625F; + float f1 = (float) (1 + ((Integer) iblockaccess.getBlockState(blockpos).getValue(BITES)).intValue() * 2) + / 16.0F; + float f2 = 0.5F; + this.setBlockBounds(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float f = 0.0625F; + float f1 = 0.5F; + this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState iblockstate) { + float f = 0.0625F; + float f1 = (float) (1 + ((Integer) iblockstate.getValue(BITES)).intValue() * 2) / 16.0F; + float f2 = 0.5F; + return new AxisAlignedBB((double) ((float) blockpos.getX() + f1), (double) blockpos.getY(), + (double) ((float) blockpos.getZ() + f), (double) ((float) (blockpos.getX() + 1) - f), + (double) ((float) blockpos.getY() + f2), (double) ((float) (blockpos.getZ() + 1) - f)); + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + return this.getCollisionBoundingBox(world, blockpos, world.getBlockState(blockpos)); + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + this.eatCake(world, blockpos, iblockstate, entityplayer); + return true; + } + + public void onBlockClicked(World world, BlockPos blockpos, EntityPlayer entityplayer) { + this.eatCake(world, blockpos, world.getBlockState(blockpos), entityplayer); + } + + private void eatCake(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) { + if (player.canEat(false)) { + player.triggerAchievement(StatList.field_181724_H); + player.getFoodStats().addStats(2, 0.1F); + int i = ((Integer) state.getValue(BITES)).intValue(); + if (i < 6) { + worldIn.setBlockState(pos, state.withProperty(BITES, Integer.valueOf(i + 1)), 3); + } else { + worldIn.setBlockToAir(pos); + } + + } + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) ? this.canBlockStay(world, blockpos) : false; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + if (!this.canBlockStay(world, blockpos)) { + world.setBlockToAir(blockpos); + } + + } + + private boolean canBlockStay(World worldIn, BlockPos pos) { + return worldIn.getBlockState(pos.down()).getBlock().getMaterial().isSolid(); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.cake; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(BITES, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(BITES)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { BITES }); + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return (7 - ((Integer) world.getBlockState(blockpos).getValue(BITES)).intValue()) * 2; + } + + public boolean hasComparatorInputOverride() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarpet.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarpet.java new file mode 100644 index 0000000..3324cb6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarpet.java @@ -0,0 +1,180 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCarpet extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCarpet"); + } + + public static final PropertyEnum COLOR = PropertyEnum.create("color", + EnumDyeColor.class); + + protected BlockCarpet() { + super(Material.carpet); + this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBoundsFromMeta(0); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMapColor(); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBoundsFromMeta(0); + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + this.setBlockBoundsFromMeta(0); + } + + protected void setBlockBoundsFromMeta(int meta) { + byte b0 = 0; + float f = (float) (1 * (1 + b0)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) && this.canBlockStay(world, blockpos); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.checkForDrop(world, blockpos, iblockstate); + } + + private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (!this.canBlockStay(worldIn, pos)) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } else { + return true; + } + } + + private boolean canBlockStay(World worldIn, BlockPos pos) { + return !worldIn.isAirBlock(pos.down()); + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return enumfacing == EnumFacing.UP ? true : super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (int i = 0; i < 16; ++i) { + list.add(new ItemStack(item, 1, i)); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { COLOR }); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance().getBoolean("clickToSit") + && entityplayer.getHeldItem() == null) { + EntityArrow arrow = new EntityArrow(world, blockpos.getX() + 0.5D, blockpos.getY() - 0.4375D, + blockpos.getZ() + 0.5D); + arrow.isChair = true; + world.spawnEntityInWorld(arrow); + entityplayer.mountEntity(arrow); + return true; + } + return super.onBlockActivated(world, blockpos, var3, entityplayer, var5, var6, var7, var8); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarrot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarrot.java new file mode 100644 index 0000000..ee4b88d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarrot.java @@ -0,0 +1,42 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCrops; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCarrot extends BlockCrops { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCarrot"); + } + + protected Item getSeed() { + return Items.carrot; + } + + protected Item getCrop() { + return Items.carrot; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCauldron.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCauldron.java new file mode 100644 index 0000000..569c230 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCauldron.java @@ -0,0 +1,260 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCauldron extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCauldron"); + } + + public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 3); + + public BlockCauldron() { + super(Material.iron, MapColor.stoneColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(LEVEL, Integer.valueOf(0))); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBoundsForItemRender(); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState iblockstate, Entity entity) { + int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); + float f = (float) blockpos.getY() + (6.0F + (float) (3 * i)) / 16.0F; + if (entity.isBurning() && i > 0 && entity.getEntityBoundingBox().minY <= (double) f) { + entity.extinguish(); + this.setWaterLevel(world, blockpos, iblockstate, i - 1); + } + + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack == null) { + return true; + } else { + int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); + Item item = itemstack.getItem(); + if (item == Items.water_bucket) { + if (i < 3) { + if (!entityplayer.capabilities.isCreativeMode) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + new ItemStack(Items.bucket)); + } + + entityplayer.triggerAchievement(StatList.field_181725_I); + this.setWaterLevel(world, blockpos, iblockstate, 3); + } + + return true; + } else if (item == Items.glass_bottle) { + if (i > 0) { + if (!entityplayer.capabilities.isCreativeMode) { + ItemStack itemstack2 = new ItemStack(Items.potionitem, 1, 0); + if (!entityplayer.inventory.addItemStackToInventory(itemstack2)) { + world.spawnEntityInWorld(new EntityItem(world, (double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + 1.5D, (double) blockpos.getZ() + 0.5D, itemstack2)); + } else if (entityplayer instanceof EntityPlayerMP) { + ((EntityPlayerMP) entityplayer).sendContainerToPlayer(entityplayer.inventoryContainer); + } + + entityplayer.triggerAchievement(StatList.field_181726_J); + --itemstack.stackSize; + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + } + + this.setWaterLevel(world, blockpos, iblockstate, i - 1); + } + + return true; + } else { + if (i > 0 && item instanceof ItemArmor) { + ItemArmor itemarmor = (ItemArmor) item; + if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER + && itemarmor.hasColor(itemstack)) { + itemarmor.removeColor(itemstack); + this.setWaterLevel(world, blockpos, iblockstate, i - 1); + entityplayer.triggerAchievement(StatList.field_181727_K); + return true; + } + } + + if (i > 0 && item instanceof ItemBanner && TileEntityBanner.getPatterns(itemstack) > 0) { + ItemStack itemstack1 = itemstack.copy(); + itemstack1.stackSize = 1; + TileEntityBanner.removeBannerData(itemstack1); + if (itemstack.stackSize <= 1 && !entityplayer.capabilities.isCreativeMode) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + itemstack1); + } else { + if (!entityplayer.inventory.addItemStackToInventory(itemstack1)) { + world.spawnEntityInWorld(new EntityItem(world, (double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + 1.5D, (double) blockpos.getZ() + 0.5D, itemstack1)); + } else if (entityplayer instanceof EntityPlayerMP) { + ((EntityPlayerMP) entityplayer).sendContainerToPlayer(entityplayer.inventoryContainer); + } + + entityplayer.triggerAchievement(StatList.field_181728_L); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + } + + if (!entityplayer.capabilities.isCreativeMode) { + this.setWaterLevel(world, blockpos, iblockstate, i - 1); + } + + return true; + } else { + return false; + } + } + } + } + } + + public void setWaterLevel(World worldIn, BlockPos pos, IBlockState state, int level) { + worldIn.setBlockState(pos, state.withProperty(LEVEL, Integer.valueOf(MathHelper.clamp_int(level, 0, 3))), 2); + worldIn.updateComparatorOutputLevel(pos, this); + } + + /**+ + * Called similar to random ticks, but only when it is raining. + */ + public void fillWithRain(World world, BlockPos blockpos) { + if (world.rand.nextInt(20) == 1) { + IBlockState iblockstate = world.getBlockState(blockpos); + if (((Integer) iblockstate.getValue(LEVEL)).intValue() < 3) { + world.setBlockState(blockpos, iblockstate.cycleProperty(LEVEL), 2); + } + + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.cauldron; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.cauldron; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return ((Integer) world.getBlockState(blockpos).getValue(LEVEL)).intValue(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(LEVEL)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { LEVEL }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockChest.java new file mode 100644 index 0000000..56f1840 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockChest.java @@ -0,0 +1,504 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityOcelot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryLargeChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ILockableContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockChest extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockChest"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public final int chestType; + + protected BlockChest(int type) { + super(Material.wood); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.chestType = type; + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 2; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + if (iblockaccess.getBlockState(blockpos.north()).getBlock() == this) { + this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F); + } else if (iblockaccess.getBlockState(blockpos.south()).getBlock() == this) { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F); + } else if (iblockaccess.getBlockState(blockpos.west()).getBlock() == this) { + this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } else if (iblockaccess.getBlockState(blockpos.east()).getBlock() == this) { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F); + } else { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.checkForSurroundingChests(world, blockpos, iblockstate); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos1 = blockpos.offset(enumfacing); + IBlockState iblockstate1 = world.getBlockState(blockpos1); + if (iblockstate1.getBlock() == this) { + this.checkForSurroundingChests(world, blockpos1, iblockstate1); + } + } + + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing()); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack itemstack) { + EnumFacing enumfacing = EnumFacing + .getHorizontal( + MathHelper.floor_double((double) (entitylivingbase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + .getOpposite(); + iblockstate = iblockstate.withProperty(FACING, enumfacing); + BlockPos blockpos1 = blockpos.north(); + BlockPos blockpos2 = blockpos.south(); + BlockPos blockpos3 = blockpos.west(); + BlockPos blockpos4 = blockpos.east(); + boolean flag = this == world.getBlockState(blockpos1).getBlock(); + boolean flag1 = this == world.getBlockState(blockpos2).getBlock(); + boolean flag2 = this == world.getBlockState(blockpos3).getBlock(); + boolean flag3 = this == world.getBlockState(blockpos4).getBlock(); + if (!flag && !flag1 && !flag2 && !flag3) { + world.setBlockState(blockpos, iblockstate, 3); + } else if (enumfacing.getAxis() != EnumFacing.Axis.X || !flag && !flag1) { + if (enumfacing.getAxis() == EnumFacing.Axis.Z && (flag2 || flag3)) { + if (flag2) { + world.setBlockState(blockpos3, iblockstate, 3); + } else { + world.setBlockState(blockpos4, iblockstate, 3); + } + + world.setBlockState(blockpos, iblockstate, 3); + } + } else { + if (flag) { + world.setBlockState(blockpos1, iblockstate, 3); + } else { + world.setBlockState(blockpos2, iblockstate, 3); + } + + world.setBlockState(blockpos, iblockstate, 3); + } + + if (itemstack.hasDisplayName()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityChest) { + ((TileEntityChest) tileentity).setCustomName(itemstack.getDisplayName()); + } + } + + } + + public IBlockState checkForSurroundingChests(World worldIn, BlockPos pos, IBlockState state) { + { + IBlockState iblockstate = worldIn.getBlockState(pos.north()); + IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); + IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); + IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + Block block = iblockstate.getBlock(); + Block block1 = iblockstate1.getBlock(); + Block block2 = iblockstate2.getBlock(); + Block block3 = iblockstate3.getBlock(); + if (block != this && block1 != this) { + boolean flag = block.isFullBlock(); + boolean flag1 = block1.isFullBlock(); + if (block2 == this || block3 == this) { + BlockPos blockpos1 = block2 == this ? pos.west() : pos.east(); + IBlockState iblockstate6 = worldIn.getBlockState(blockpos1.north()); + IBlockState iblockstate7 = worldIn.getBlockState(blockpos1.south()); + enumfacing = EnumFacing.SOUTH; + EnumFacing enumfacing2; + if (block2 == this) { + enumfacing2 = (EnumFacing) iblockstate2.getValue(FACING); + } else { + enumfacing2 = (EnumFacing) iblockstate3.getValue(FACING); + } + + if (enumfacing2 == EnumFacing.NORTH) { + enumfacing = EnumFacing.NORTH; + } + + Block block6 = iblockstate6.getBlock(); + Block block7 = iblockstate7.getBlock(); + if ((flag || block6.isFullBlock()) && !flag1 && !block7.isFullBlock()) { + enumfacing = EnumFacing.SOUTH; + } + + if ((flag1 || block7.isFullBlock()) && !flag && !block6.isFullBlock()) { + enumfacing = EnumFacing.NORTH; + } + } + } else { + BlockPos blockpos = block == this ? pos.north() : pos.south(); + IBlockState iblockstate4 = worldIn.getBlockState(blockpos.west()); + IBlockState iblockstate5 = worldIn.getBlockState(blockpos.east()); + enumfacing = EnumFacing.EAST; + EnumFacing enumfacing1; + if (block == this) { + enumfacing1 = (EnumFacing) iblockstate.getValue(FACING); + } else { + enumfacing1 = (EnumFacing) iblockstate1.getValue(FACING); + } + + if (enumfacing1 == EnumFacing.WEST) { + enumfacing = EnumFacing.WEST; + } + + Block block4 = iblockstate4.getBlock(); + Block block5 = iblockstate5.getBlock(); + if ((block2.isFullBlock() || block4.isFullBlock()) && !block3.isFullBlock() && !block5.isFullBlock()) { + enumfacing = EnumFacing.EAST; + } + + if ((block3.isFullBlock() || block5.isFullBlock()) && !block2.isFullBlock() && !block4.isFullBlock()) { + enumfacing = EnumFacing.WEST; + } + } + + state = state.withProperty(FACING, enumfacing); + worldIn.setBlockState(pos, state, 3); + return state; + } + } + + public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state) { + EnumFacing enumfacing = null; + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1)); + if (iblockstate.getBlock() == this) { + return state; + } + + if (iblockstate.getBlock().isFullBlock()) { + if (enumfacing != null) { + enumfacing = null; + break; + } + + enumfacing = enumfacing1; + } + } + + if (enumfacing != null) { + return state.withProperty(FACING, enumfacing.getOpposite()); + } else { + EnumFacing enumfacing2 = (EnumFacing) state.getValue(FACING); + if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) { + enumfacing2 = enumfacing2.getOpposite(); + } + + if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) { + enumfacing2 = enumfacing2.rotateY(); + } + + if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) { + enumfacing2 = enumfacing2.getOpposite(); + } + + return state.withProperty(FACING, enumfacing2); + } + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + int i = 0; + BlockPos blockpos1 = blockpos.west(); + BlockPos blockpos2 = blockpos.east(); + BlockPos blockpos3 = blockpos.north(); + BlockPos blockpos4 = blockpos.south(); + if (world.getBlockState(blockpos1).getBlock() == this) { + if (this.isDoubleChest(world, blockpos1)) { + return false; + } + + ++i; + } + + if (world.getBlockState(blockpos2).getBlock() == this) { + if (this.isDoubleChest(world, blockpos2)) { + return false; + } + + ++i; + } + + if (world.getBlockState(blockpos3).getBlock() == this) { + if (this.isDoubleChest(world, blockpos3)) { + return false; + } + + ++i; + } + + if (world.getBlockState(blockpos4).getBlock() == this) { + if (this.isDoubleChest(world, blockpos4)) { + return false; + } + + ++i; + } + + return i <= 1; + } + + private boolean isDoubleChest(World worldIn, BlockPos pos) { + if (worldIn.getBlockState(pos).getBlock() != this) { + return false; + } else { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == this) { + return true; + } + } + + return false; + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityChest) { + tileentity.updateContainingBlockInfo(); + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof IInventory) { + InventoryHelper.dropInventoryItems(world, blockpos, (IInventory) tileentity); + world.updateComparatorOutputLevel(blockpos, this); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + ILockableContainer ilockablecontainer = this.getLockableContainer(world, blockpos); + if (ilockablecontainer != null) { + entityplayer.displayGUIChest(ilockablecontainer); + if (this.chestType == 0) { + entityplayer.triggerAchievement(StatList.field_181723_aa); + } else if (this.chestType == 1) { + entityplayer.triggerAchievement(StatList.field_181737_U); + } + } + + return true; + } + } + + public ILockableContainer getLockableContainer(World worldIn, BlockPos pos) { + TileEntity tileentity = worldIn.getTileEntity(pos); + if (!(tileentity instanceof TileEntityChest)) { + return null; + } else { + Object object = (TileEntityChest) tileentity; + if (this.isBlocked(worldIn, pos)) { + return null; + } else { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos = pos.offset(enumfacing); + Block block = worldIn.getBlockState(blockpos).getBlock(); + if (block == this) { + if (this.isBlocked(worldIn, blockpos)) { + return null; + } + + TileEntity tileentity1 = worldIn.getTileEntity(blockpos); + if (tileentity1 instanceof TileEntityChest) { + if (enumfacing != EnumFacing.WEST && enumfacing != EnumFacing.NORTH) { + object = new InventoryLargeChest("container.chestDouble", (ILockableContainer) object, + (TileEntityChest) tileentity1); + } else { + object = new InventoryLargeChest("container.chestDouble", (TileEntityChest) tileentity1, + (ILockableContainer) object); + } + } + } + } + + return (ILockableContainer) object; + } + } + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityChest(); + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return this.chestType == 1; + } + + public int getWeakPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState var3, EnumFacing var4) { + if (!this.canProvidePower()) { + return 0; + } else { + int i = 0; + TileEntity tileentity = iblockaccess.getTileEntity(blockpos); + if (tileentity instanceof TileEntityChest) { + i = ((TileEntityChest) tileentity).numPlayersUsing; + } + + return MathHelper.clamp_int(i, 0, 15); + } + } + + public int getStrongPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate, + EnumFacing enumfacing) { + return enumfacing == EnumFacing.UP ? this.getWeakPower(iblockaccess, blockpos, iblockstate, enumfacing) : 0; + } + + private boolean isBlocked(World worldIn, BlockPos pos) { + return this.isBelowSolidBlock(worldIn, pos) || this.isOcelotSittingOnChest(worldIn, pos); + } + + private boolean isBelowSolidBlock(World worldIn, BlockPos pos) { + return worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); + } + + private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) { + for (Entity entity : worldIn.getEntitiesWithinAABB(EntityOcelot.class, + new AxisAlignedBB((double) pos.getX(), (double) (pos.getY() + 1), (double) pos.getZ(), + (double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1)))) { + EntityOcelot entityocelot = (EntityOcelot) entity; + if (entityocelot.isSitting()) { + return true; + } + } + + return false; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return Container.calcRedstoneFromInventory(this.getLockableContainer(world, blockpos)); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getFront(i); + if (enumfacing.getAxis() == EnumFacing.Axis.Y) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockClay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockClay.java new file mode 100644 index 0000000..74f3d09 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockClay.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockClay extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockClay"); + } + + public BlockClay() { + super(Material.clay); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.clay_ball; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 4; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCocoa.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCocoa.java new file mode 100644 index 0000000..e21f8af --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCocoa.java @@ -0,0 +1,237 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCocoa extends BlockDirectional implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCocoa"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 2); + + public BlockCocoa() { + super(Material.plants); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(AGE, + Integer.valueOf(0))); + this.setTickRandomly(true); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + if (!this.canBlockStay(world, blockpos, iblockstate)) { + this.dropBlock(world, blockpos, iblockstate); + } else if (world.rand.nextInt(5) == 0) { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (i < 2) { + world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(i + 1)), 2); + } + } + + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) { + pos = pos.offset((EnumFacing) state.getValue(FACING)); + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock() == Blocks.log + && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getSelectedBoundingBox(world, blockpos); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + int j = 4 + i * 2; + int k = 5 + i * 2; + float f = (float) j / 2.0F; + switch (enumfacing) { + case SOUTH: + this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float) k) / 16.0F, (15.0F - (float) j) / 16.0F, + (8.0F + f) / 16.0F, 0.75F, 0.9375F); + break; + case NORTH: + this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float) k) / 16.0F, 0.0625F, (8.0F + f) / 16.0F, 0.75F, + (1.0F + (float) j) / 16.0F); + break; + case WEST: + this.setBlockBounds(0.0625F, (12.0F - (float) k) / 16.0F, (8.0F - f) / 16.0F, (1.0F + (float) j) / 16.0F, + 0.75F, (8.0F + f) / 16.0F); + break; + case EAST: + this.setBlockBounds((15.0F - (float) j) / 16.0F, (12.0F - (float) k) / 16.0F, (8.0F - f) / 16.0F, 0.9375F, + 0.75F, (8.0F + f) / 16.0F); + } + + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack var5) { + EnumFacing enumfacing = EnumFacing.fromAngle((double) entitylivingbase.rotationYaw); + world.setBlockState(blockpos, iblockstate.withProperty(FACING, enumfacing), 2); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + if (!enumfacing.getAxis().isHorizontal()) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing.getOpposite()).withProperty(AGE, + Integer.valueOf(0)); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!this.canBlockStay(world, blockpos, iblockstate)) { + this.dropBlock(world, blockpos, iblockstate); + } + + } + + private void dropBlock(World worldIn, BlockPos pos, IBlockState state) { + worldIn.setBlockState(pos, Blocks.air.getDefaultState(), 3); + this.dropBlockAsItem(worldIn, pos, state, 0); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float var4, + int var5) { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + byte b0 = 1; + if (i >= 2) { + b0 = 3; + } + + for (int j = 0; j < b0; ++j) { + spawnAsEntity(world, blockpos, new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage())); + } + + } + + public Item getItem(World var1, BlockPos var2) { + return Items.dye; + } + + public int getDamageValue(World var1, BlockPos var2) { + return EnumDyeColor.BROWN.getDyeDamage(); + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState iblockstate, boolean var4) { + return ((Integer) iblockstate.getValue(AGE)).intValue() < 2; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return true; + } + + public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState iblockstate) { + world.setBlockState(blockpos, + iblockstate.withProperty(AGE, Integer.valueOf(((Integer) iblockstate.getValue(AGE)).intValue() + 1)), + 2); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(i)).withProperty(AGE, + Integer.valueOf((i & 15) >> 2)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + i = i | ((Integer) iblockstate.getValue(AGE)).intValue() << 2; + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, AGE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockColored.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockColored.java new file mode 100644 index 0000000..a3856b7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockColored.java @@ -0,0 +1,98 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockColored extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockColored"); + } + + public static final PropertyEnum COLOR = PropertyEnum.create("color", + EnumDyeColor.class); + + public BlockColored(Material materialIn) { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { + list.add(new ItemStack(item, 1, enumdyecolor.getMetadata())); + } + + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMapColor(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { COLOR }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCommandBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCommandBlock.java new file mode 100644 index 0000000..ce78344 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCommandBlock.java @@ -0,0 +1,181 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBlockLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCommandBlock extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCommandBlock"); + } + + public static final PropertyBool TRIGGERED = PropertyBool.create("triggered"); + + public BlockCommandBlock() { + super(Material.iron, MapColor.adobeColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(TRIGGERED, Boolean.valueOf(false))); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityCommandBlock(); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + { + boolean flag = world.isBlockPowered(blockpos); + boolean flag1 = ((Boolean) iblockstate.getValue(TRIGGERED)).booleanValue(); + if (flag && !flag1) { + world.setBlockState(blockpos, iblockstate.withProperty(TRIGGERED, Boolean.valueOf(true)), 4); + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } else if (!flag && flag1) { + world.setBlockState(blockpos, iblockstate.withProperty(TRIGGERED, Boolean.valueOf(false)), 4); + } + } + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityCommandBlock) { + ((TileEntityCommandBlock) tileentity).getCommandBlockLogic().trigger(world); + world.updateComparatorOutputLevel(blockpos, this); + } + + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 1; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + TileEntity tileentity = world.getTileEntity(blockpos); + return tileentity instanceof TileEntityCommandBlock + ? ((TileEntityCommandBlock) tileentity).getCommandBlockLogic().tryOpenEditCommandBlock(entityplayer) + : false; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + TileEntity tileentity = world.getTileEntity(blockpos); + return tileentity instanceof TileEntityCommandBlock + ? ((TileEntityCommandBlock) tileentity).getCommandBlockLogic().getSuccessCount() + : 0; + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState var3, EntityLivingBase var4, + ItemStack itemstack) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityCommandBlock) { + CommandBlockLogic commandblocklogic = ((TileEntityCommandBlock) tileentity).getCommandBlockLogic(); + if (itemstack.hasDisplayName()) { + commandblocklogic.setName(itemstack.getDisplayName()); + } + + { + commandblocklogic.setTrackOutput(world.getGameRules().getBoolean("sendCommandFeedback")); + } + } + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(TRIGGERED, Boolean.valueOf((i & 1) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + if (((Boolean) iblockstate.getValue(TRIGGERED)).booleanValue()) { + i |= 1; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { TRIGGERED }); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase var8) { + return this.getDefaultState().withProperty(TRIGGERED, Boolean.valueOf(false)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCompressedPowered.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCompressedPowered.java new file mode 100644 index 0000000..979e270 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCompressedPowered.java @@ -0,0 +1,54 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCompressedPowered extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCompressedPowered"); + } + + public BlockCompressedPowered(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState var3, EnumFacing var4) { + return 15; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockContainer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockContainer.java new file mode 100644 index 0000000..35bcc0e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockContainer.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.ITileEntityProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockContainer extends Block implements ITileEntityProvider { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockContainer"); + } + + protected BlockContainer(Material materialIn) { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockContainer(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + this.isBlockContainer = true; + } + + protected boolean func_181086_a(World parWorld, BlockPos parBlockPos, EnumFacing parEnumFacing) { + return parWorld.getBlockState(parBlockPos.offset(parEnumFacing)).getBlock().getMaterial() == Material.cactus; + } + + protected boolean func_181087_e(World parWorld, BlockPos parBlockPos) { + return this.func_181086_a(parWorld, parBlockPos, EnumFacing.NORTH) + || this.func_181086_a(parWorld, parBlockPos, EnumFacing.SOUTH) + || this.func_181086_a(parWorld, parBlockPos, EnumFacing.WEST) + || this.func_181086_a(parWorld, parBlockPos, EnumFacing.EAST); + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return -1; + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { + super.breakBlock(worldIn, pos, state); + worldIn.removeTileEntity(pos); + } + + /**+ + * Called on both Client and Server when World#addBlockEvent is + * called + */ + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) { + super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam); + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCrops.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCrops.java new file mode 100644 index 0000000..aa5f423 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCrops.java @@ -0,0 +1,213 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFarmland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockCrops extends BlockBush implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockCrops"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7); + + protected BlockCrops() { + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs) null); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.disableStats(); + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block block) { + return block == Blocks.farmland; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + super.updateTick(world, blockpos, iblockstate, random); + if (world.getLightFromNeighbors(blockpos.up()) >= 9) { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (i < 7) { + float f = getGrowthChance(this, world, blockpos); + if (random.nextInt((int) (25.0F / f) + 1) == 0) { + world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(i + 1)), 2); + } + } + } + + } + + public void grow(World worldIn, BlockPos pos, IBlockState state) { + int i = ((Integer) state.getValue(AGE)).intValue() + MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + if (i > 7) { + i = 7; + } + + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(i)), 2); + } + + protected static float getGrowthChance(Block blockIn, World worldIn, BlockPos pos) { + float f = 1.0F; + BlockPos blockpos = pos.down(); + + for (int i = -1; i <= 1; ++i) { + for (int j = -1; j <= 1; ++j) { + float f1 = 0.0F; + IBlockState iblockstate = worldIn.getBlockState(blockpos.add(i, 0, j)); + if (iblockstate.getBlock() == Blocks.farmland) { + f1 = 1.0F; + if (((Integer) iblockstate.getValue(BlockFarmland.MOISTURE)).intValue() > 0) { + f1 = 3.0F; + } + } + + if (i != 0 || j != 0) { + f1 /= 4.0F; + } + + f += f1; + } + } + + BlockPos blockpos1 = pos.north(); + BlockPos blockpos2 = pos.south(); + BlockPos blockpos3 = pos.west(); + BlockPos blockpos4 = pos.east(); + boolean flag = blockIn == worldIn.getBlockState(blockpos3).getBlock() + || blockIn == worldIn.getBlockState(blockpos4).getBlock(); + boolean flag1 = blockIn == worldIn.getBlockState(blockpos1).getBlock() + || blockIn == worldIn.getBlockState(blockpos2).getBlock(); + if (flag && flag1) { + f /= 2.0F; + } else { + boolean flag2 = blockIn == worldIn.getBlockState(blockpos3.north()).getBlock() + || blockIn == worldIn.getBlockState(blockpos4.north()).getBlock() + || blockIn == worldIn.getBlockState(blockpos4.south()).getBlock() + || blockIn == worldIn.getBlockState(blockpos3.south()).getBlock(); + if (flag2) { + f /= 2.0F; + } + } + + return f; + } + + public boolean canBlockStay(World world, BlockPos blockpos, IBlockState var3) { + return (world.getLight(blockpos) >= 8 || world.canSeeSky(blockpos)) + && this.canPlaceBlockOn(world.getBlockState(blockpos.down()).getBlock()); + } + + protected Item getSeed() { + return Items.wheat_seeds; + } + + protected Item getCrop() { + return Items.wheat; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, 0); + { + int j = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (j >= 7) { + int k = 3 + i; + + for (int l = 0; l < k; ++l) { + if (world.rand.nextInt(15) <= j) { + spawnAsEntity(world, blockpos, new ItemStack(this.getSeed(), 1, 0)); + } + } + } + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom var2, int var3) { + return ((Integer) iblockstate.getValue(AGE)).intValue() == 7 ? this.getCrop() : this.getSeed(); + } + + public Item getItem(World var1, BlockPos var2) { + return this.getSeed(); + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState iblockstate, boolean var4) { + return ((Integer) iblockstate.getValue(AGE)).intValue() < 7; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return true; + } + + public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState iblockstate) { + this.grow(world, blockpos, iblockstate); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AGE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDaylightDetector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDaylightDetector.java new file mode 100644 index 0000000..f3ff269 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDaylightDetector.java @@ -0,0 +1,192 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDaylightDetector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDaylightDetector extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDaylightDetector"); + } + + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + private final boolean inverted; + + public BlockDaylightDetector(boolean inverted) { + super(Material.wood); + this.inverted = inverted; + this.setDefaultState(this.blockState.getBaseState().withProperty(POWER, Integer.valueOf(0))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setHardness(0.2F); + this.setStepSound(soundTypeWood); + this.setUnlocalizedName("daylightDetector"); + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing var4) { + return ((Integer) iblockstate.getValue(POWER)).intValue(); + } + + public void updatePower(World worldIn, BlockPos pos) { + if (!worldIn.provider.getHasNoSky()) { + IBlockState iblockstate = worldIn.getBlockState(pos); + int i = worldIn.getLightFor(EnumSkyBlock.SKY, pos) - worldIn.getSkylightSubtracted(); + float f = worldIn.getCelestialAngleRadians(1.0F); + float f1 = f < 3.1415927F ? 0.0F : 6.2831855F; + f = f + (f1 - f) * 0.2F; + i = Math.round((float) i * MathHelper.cos(f)); + i = MathHelper.clamp_int(i, 0, 15); + if (this.inverted) { + i = 15 - i; + } + + if (((Integer) iblockstate.getValue(POWER)).intValue() != i) { + worldIn.setBlockState(pos, iblockstate.withProperty(POWER, Integer.valueOf(i)), 3); + } + + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing enumfacing, float f, float f1, float f2) { + if (entityplayer.isAllowEdit()) { + { + if (this.inverted) { + world.setBlockState(blockpos, + Blocks.daylight_detector.getDefaultState().withProperty(POWER, iblockstate.getValue(POWER)), + 4); + Blocks.daylight_detector.updatePower(world, blockpos); + } else { + world.setBlockState(blockpos, Blocks.daylight_detector_inverted.getDefaultState() + .withProperty(POWER, iblockstate.getValue(POWER)), 4); + Blocks.daylight_detector_inverted.updatePower(world, blockpos); + } + + return true; + } + } else { + return super.onBlockActivated(world, blockpos, iblockstate, entityplayer, enumfacing, f, f1, f2); + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.daylight_detector); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.daylight_detector); + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityDaylightDetector(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(POWER, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(POWER)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { POWER }); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs creativetabs, List list) { + if (!this.inverted) { + super.getSubBlocks(item, creativetabs, list); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDeadBush.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDeadBush.java new file mode 100644 index 0000000..de0635d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDeadBush.java @@ -0,0 +1,94 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDeadBush extends BlockBush { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDeadBush"); + } + + protected BlockDeadBush() { + super(Material.vine); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.woodColor; + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block block) { + return block == Blocks.sand || block == Blocks.hardened_clay || block == Blocks.stained_hardened_clay + || block == Blocks.dirt; + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World var1, BlockPos var2) { + return true; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(world, blockpos, new ItemStack(Blocks.deadbush, 1, 0)); + } else { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirectional.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirectional.java new file mode 100644 index 0000000..352d7e8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirectional.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockDirectional extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDirectional"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + protected BlockDirectional(Material materialIn) { + super(materialIn); + } + + protected BlockDirectional(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirt.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirt.java new file mode 100644 index 0000000..351f91f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirt.java @@ -0,0 +1,189 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDirt extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDirt"); + } + + public static PropertyEnum VARIANT; + public static final PropertyBool SNOWY = PropertyBool.create("snowy"); + + protected BlockDirt() { + super(Material.ground); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockDirt.DirtType.DIRT) + .withProperty(SNOWY, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockDirt.DirtType.class); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockDirt.DirtType) iblockstate.getValue(VARIANT)).func_181066_d(); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + if (iblockstate.getValue(VARIANT) == BlockDirt.DirtType.PODZOL) { + Block block = iblockaccess.getBlockState(blockpos.up()).getBlock(); + iblockstate = iblockstate.withProperty(SNOWY, + Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); + } + + return iblockstate; + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item var1, CreativeTabs var2, List list) { + list.add(new ItemStack(this, 1, BlockDirt.DirtType.DIRT.getMetadata())); + list.add(new ItemStack(this, 1, BlockDirt.DirtType.COARSE_DIRT.getMetadata())); + list.add(new ItemStack(this, 1, BlockDirt.DirtType.PODZOL.getMetadata())); + } + + public int getDamageValue(World world, BlockPos blockpos) { + IBlockState iblockstate = world.getBlockState(blockpos); + return iblockstate.getBlock() != this ? 0 : ((BlockDirt.DirtType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockDirt.DirtType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockDirt.DirtType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT, SNOWY }); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + BlockDirt.DirtType blockdirt$dirttype = (BlockDirt.DirtType) iblockstate.getValue(VARIANT); + if (blockdirt$dirttype == BlockDirt.DirtType.PODZOL) { + blockdirt$dirttype = BlockDirt.DirtType.DIRT; + } + + return blockdirt$dirttype.getMetadata(); + } + + public static enum DirtType implements IStringSerializable { + DIRT(0, "dirt", "default", MapColor.dirtColor), COARSE_DIRT(1, "coarse_dirt", "coarse", MapColor.dirtColor), + PODZOL(2, "podzol", MapColor.obsidianColor); + + private static final BlockDirt.DirtType[] METADATA_LOOKUP = new BlockDirt.DirtType[values().length]; + private final int metadata; + private final String name; + private final String unlocalizedName; + private final MapColor field_181067_h; + + private DirtType(int parInt2, String parString2, MapColor parMapColor) { + this(parInt2, parString2, parString2, parMapColor); + } + + private DirtType(int parInt2, String parString2, String parString3, MapColor parMapColor) { + this.metadata = parInt2; + this.name = parString2; + this.unlocalizedName = parString3; + this.field_181067_h = parMapColor; + } + + public int getMetadata() { + return this.metadata; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + public MapColor func_181066_d() { + return this.field_181067_h; + } + + public String toString() { + return this.name; + } + + public static BlockDirt.DirtType byMetadata(int metadata) { + if (metadata < 0 || metadata >= METADATA_LOOKUP.length) { + metadata = 0; + } + + return METADATA_LOOKUP[metadata]; + } + + public String getName() { + return this.name; + } + + static { + for (BlockDirt.DirtType blockdirt$dirttype : values()) { + METADATA_LOOKUP[blockdirt$dirttype.getMetadata()] = blockdirt$dirttype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDispenser.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDispenser.java new file mode 100644 index 0000000..80197c4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDispenser.java @@ -0,0 +1,286 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSourceImpl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBehaviorDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.PositionImpl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDropper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.RegistryDefaulted; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDispenser extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDispenser"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool TRIGGERED = PropertyBool.create("triggered"); + public static final RegistryDefaulted dispenseBehaviorRegistry = new RegistryDefaulted( + new BehaviorDefaultDispenseItem()); + protected EaglercraftRandom rand = new EaglercraftRandom(); + + protected BlockDispenser() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(TRIGGERED, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 4; + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + super.onBlockAdded(world, blockpos, iblockstate); + this.setDefaultDirection(world, blockpos, iblockstate); + } + + private void setDefaultDirection(World worldIn, BlockPos pos, IBlockState state) { + { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + boolean flag = worldIn.getBlockState(pos.north()).getBlock().isFullBlock(); + boolean flag1 = worldIn.getBlockState(pos.south()).getBlock().isFullBlock(); + if (enumfacing == EnumFacing.NORTH && flag && !flag1) { + enumfacing = EnumFacing.SOUTH; + } else if (enumfacing == EnumFacing.SOUTH && flag1 && !flag) { + enumfacing = EnumFacing.NORTH; + } else { + boolean flag2 = worldIn.getBlockState(pos.west()).getBlock().isFullBlock(); + boolean flag3 = worldIn.getBlockState(pos.east()).getBlock().isFullBlock(); + if (enumfacing == EnumFacing.WEST && flag2 && !flag3) { + enumfacing = EnumFacing.EAST; + } else if (enumfacing == EnumFacing.EAST && flag3 && !flag2) { + enumfacing = EnumFacing.WEST; + } + } + + worldIn.setBlockState(pos, + state.withProperty(FACING, enumfacing).withProperty(TRIGGERED, Boolean.valueOf(false)), 2); + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityDispenser) { + entityplayer.displayGUIChest((TileEntityDispenser) tileentity); + if (tileentity instanceof TileEntityDropper) { + entityplayer.triggerAchievement(StatList.field_181731_O); + } else { + entityplayer.triggerAchievement(StatList.field_181733_Q); + } + } + + return true; + } + } + + protected void dispense(World worldIn, BlockPos pos) { + BlockSourceImpl blocksourceimpl = new BlockSourceImpl(worldIn, pos); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser) blocksourceimpl.getBlockTileEntity(); + if (tileentitydispenser != null) { + int i = tileentitydispenser.getDispenseSlot(); + if (i < 0) { + worldIn.playAuxSFX(1001, pos, 0); + } else { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i); + IBehaviorDispenseItem ibehaviordispenseitem = this.getBehavior(itemstack); + if (ibehaviordispenseitem != IBehaviorDispenseItem.itemDispenseBehaviorProvider) { + ItemStack itemstack1 = ibehaviordispenseitem.dispense(blocksourceimpl, itemstack); + tileentitydispenser.setInventorySlotContents(i, itemstack1.stackSize <= 0 ? null : itemstack1); + } + + } + } + } + + protected IBehaviorDispenseItem getBehavior(ItemStack stack) { + return (IBehaviorDispenseItem) dispenseBehaviorRegistry.getObject(stack == null ? null : stack.getItem()); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + boolean flag = world.isBlockPowered(blockpos) || world.isBlockPowered(blockpos.up()); + boolean flag1 = ((Boolean) iblockstate.getValue(TRIGGERED)).booleanValue(); + if (flag && !flag1) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + world.setBlockState(blockpos, iblockstate.withProperty(TRIGGERED, Boolean.valueOf(true)), 4); + } else if (!flag && flag1) { + world.setBlockState(blockpos, iblockstate.withProperty(TRIGGERED, Boolean.valueOf(false)), 4); + } + + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + { + this.dispense(world, blockpos); + } + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityDispenser(); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing var3, float var4, float var5, + float var6, int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState() + .withProperty(FACING, BlockPistonBase.getFacingFromEntity(world, blockpos, entitylivingbase)) + .withProperty(TRIGGERED, Boolean.valueOf(false)); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack itemstack) { + world.setBlockState(blockpos, iblockstate.withProperty(FACING, + BlockPistonBase.getFacingFromEntity(world, blockpos, entitylivingbase)), 2); + if (itemstack.hasDisplayName()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityDispenser) { + ((TileEntityDispenser) tileentity).setCustomName(itemstack.getDisplayName()); + } + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityDispenser) { + InventoryHelper.dropInventoryItems(world, blockpos, (TileEntityDispenser) tileentity); + world.updateComparatorOutputLevel(blockpos, this); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + /**+ + * Get the position where the dispenser at the given Coordinates + * should dispense to. + */ + public static IPosition getDispensePosition(IBlockSource coords) { + EnumFacing enumfacing = getFacing(coords.getBlockMetadata()); + double d0 = coords.getX() + 0.7D * (double) enumfacing.getFrontOffsetX(); + double d1 = coords.getY() + 0.7D * (double) enumfacing.getFrontOffsetY(); + double d2 = coords.getZ() + 0.7D * (double) enumfacing.getFrontOffsetZ(); + return new PositionImpl(d0, d1, d2); + } + + /**+ + * Get the facing of a dispenser with the given metadata + */ + public static EnumFacing getFacing(int meta) { + return EnumFacing.getFront(meta & 7); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return Container.calcRedstone(world.getTileEntity(blockpos)); + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Possibly modify the given BlockState before rendering it on + * an Entity (Minecarts, Endermen, ...) + */ + public IBlockState getStateForEntityRender(IBlockState var1) { + return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, getFacing(i)).withProperty(TRIGGERED, + Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + if (((Boolean) iblockstate.getValue(TRIGGERED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, TRIGGERED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoor.java new file mode 100644 index 0000000..48a646c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoor.java @@ -0,0 +1,423 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDoor extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDoor"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool OPEN = PropertyBool.create("open"); + public static PropertyEnum HINGE; + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static PropertyEnum HALF; + + protected BlockDoor(Material materialIn) { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(OPEN, Boolean.valueOf(false)).withProperty(HINGE, BlockDoor.EnumHingePosition.LEFT) + .withProperty(POWERED, Boolean.valueOf(false)).withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER)); + } + + public static void bootstrapStates() { + HINGE = PropertyEnum.create("hinge", BlockDoor.EnumHingePosition.class); + HALF = PropertyEnum.create("half", BlockDoor.EnumDoorHalf.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal((this.getUnlocalizedName() + ".name").replaceAll("tile", "item")); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isPassable(IBlockAccess iblockaccess, BlockPos blockpos) { + return isOpen(combineMetadata(iblockaccess, blockpos)); + } + + public boolean isFullCube() { + return false; + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getSelectedBoundingBox(world, blockpos); + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + this.setBoundBasedOnMeta(combineMetadata(iblockaccess, blockpos)); + } + + private void setBoundBasedOnMeta(int combinedMeta) { + float f = 0.1875F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); + EnumFacing enumfacing = getFacing(combinedMeta); + boolean flag = isOpen(combinedMeta); + boolean flag1 = isHingeLeft(combinedMeta); + if (flag) { + if (enumfacing == EnumFacing.EAST) { + if (!flag1) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } else { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + } else if (enumfacing == EnumFacing.SOUTH) { + if (!flag1) { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } else if (enumfacing == EnumFacing.WEST) { + if (!flag1) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + } else if (enumfacing == EnumFacing.NORTH) { + if (!flag1) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } else { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + } else if (enumfacing == EnumFacing.EAST) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } else if (enumfacing == EnumFacing.SOUTH) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } else if (enumfacing == EnumFacing.WEST) { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else if (enumfacing == EnumFacing.NORTH) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (this.blockMaterial == Material.iron) { + return true; + } else { + BlockPos blockpos1 = iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? blockpos + : blockpos.down(); + IBlockState iblockstate1 = blockpos.equals(blockpos1) ? iblockstate : world.getBlockState(blockpos1); + if (iblockstate1.getBlock() != this) { + return false; + } else { + iblockstate = iblockstate1.cycleProperty(OPEN); + world.setBlockState(blockpos1, iblockstate, 2); + world.markBlockRangeForRenderUpdate(blockpos1, blockpos); + world.playAuxSFXAtEntity(entityplayer, + ((Boolean) iblockstate.getValue(OPEN)).booleanValue() ? 1003 : 1006, blockpos, 0); + return true; + } + } + } + + public void toggleDoor(World worldIn, BlockPos pos, boolean open) { + IBlockState iblockstate = worldIn.getBlockState(pos); + if (iblockstate.getBlock() == this) { + BlockPos blockpos = iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down(); + IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos); + if (iblockstate1.getBlock() == this && ((Boolean) iblockstate1.getValue(OPEN)).booleanValue() != open) { + worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, Boolean.valueOf(open)), 2); + worldIn.markBlockRangeForRenderUpdate(blockpos, pos); + worldIn.playAuxSFXAtEntity((EntityPlayer) null, open ? 1003 : 1006, pos, 0); + } + + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + if (iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER) { + BlockPos blockpos1 = blockpos.down(); + IBlockState iblockstate1 = world.getBlockState(blockpos1); + if (iblockstate1.getBlock() != this) { + world.setBlockToAir(blockpos); + } else if (block != this) { + this.onNeighborBlockChange(world, blockpos1, iblockstate1, block); + } + } else { + boolean flag1 = false; + BlockPos blockpos2 = blockpos.up(); + IBlockState iblockstate2 = world.getBlockState(blockpos2); + if (iblockstate2.getBlock() != this) { + world.setBlockToAir(blockpos); + flag1 = true; + } + + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down())) { + world.setBlockToAir(blockpos); + flag1 = true; + if (iblockstate2.getBlock() == this) { + world.setBlockToAir(blockpos2); + } + } + + if (flag1) { + { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + } + } else { + boolean flag = world.isBlockPowered(blockpos) || world.isBlockPowered(blockpos2); + if ((flag || block.canProvidePower()) && block != this + && flag != ((Boolean) iblockstate2.getValue(POWERED)).booleanValue()) { + world.setBlockState(blockpos2, iblockstate2.withProperty(POWERED, Boolean.valueOf(flag)), 2); + if (flag != ((Boolean) iblockstate.getValue(OPEN)).booleanValue()) { + world.setBlockState(blockpos, iblockstate.withProperty(OPEN, Boolean.valueOf(flag)), 2); + world.markBlockRangeForRenderUpdate(blockpos, blockpos); + world.playAuxSFXAtEntity((EntityPlayer) null, flag ? 1003 : 1006, blockpos, 0); + } + } + } + } + + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom var2, int var3) { + return iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getItem(); + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World world, BlockPos blockpos, Vec3 vec3, Vec3 vec31) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.collisionRayTrace(world, blockpos, vec3, vec31); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return blockpos.getY() >= 255 ? false + : World.doesBlockHaveSolidTopSurface(world, blockpos.down()) && super.canPlaceBlockAt(world, blockpos) + && super.canPlaceBlockAt(world, blockpos.up()); + } + + public int getMobilityFlag() { + return 1; + } + + public static int combineMetadata(IBlockAccess worldIn, BlockPos pos) { + IBlockState iblockstate = worldIn.getBlockState(pos); + int i = iblockstate.getBlock().getMetaFromState(iblockstate); + boolean flag = isTop(i); + IBlockState iblockstate1 = worldIn.getBlockState(pos.down()); + int j = iblockstate1.getBlock().getMetaFromState(iblockstate1); + int k = flag ? j : i; + IBlockState iblockstate2 = worldIn.getBlockState(pos.up()); + int l = iblockstate2.getBlock().getMetaFromState(iblockstate2); + int i1 = flag ? i : l; + boolean flag1 = (i1 & 1) != 0; + boolean flag2 = (i1 & 2) != 0; + return removeHalfBit(k) | (flag ? 8 : 0) | (flag1 ? 16 : 0) | (flag2 ? 32 : 0); + } + + public Item getItem(World var1, BlockPos var2) { + return this.getItem(); + } + + private Item getItem() { + return this == Blocks.iron_door ? Items.iron_door + : (this == Blocks.spruce_door ? Items.spruce_door + : (this == Blocks.birch_door ? Items.birch_door + : (this == Blocks.jungle_door ? Items.jungle_door + : (this == Blocks.acacia_door ? Items.acacia_door + : (this == Blocks.dark_oak_door ? Items.dark_oak_door + : Items.oak_door))))); + } + + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + BlockPos blockpos1 = blockpos.down(); + if (entityplayer.capabilities.isCreativeMode && iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER + && world.getBlockState(blockpos1).getBlock() == this) { + world.setBlockToAir(blockpos1); + } + + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + if (iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER) { + IBlockState iblockstate1 = iblockaccess.getBlockState(blockpos.up()); + if (iblockstate1.getBlock() == this) { + iblockstate = iblockstate.withProperty(HINGE, iblockstate1.getValue(HINGE)).withProperty(POWERED, + iblockstate1.getValue(POWERED)); + } + } else { + IBlockState iblockstate2 = iblockaccess.getBlockState(blockpos.down()); + if (iblockstate2.getBlock() == this) { + iblockstate = iblockstate.withProperty(FACING, iblockstate2.getValue(FACING)).withProperty(OPEN, + iblockstate2.getValue(OPEN)); + } + } + + return iblockstate; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return (i & 8) > 0 + ? this.getDefaultState().withProperty(HALF, BlockDoor.EnumDoorHalf.UPPER) + .withProperty(HINGE, + (i & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT) + .withProperty(POWERED, Boolean.valueOf((i & 2) > 0)) + : this.getDefaultState().withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER) + .withProperty(FACING, EnumFacing.getHorizontal(i & 3).rotateYCCW()) + .withProperty(OPEN, Boolean.valueOf((i & 4) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + if (iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER) { + i = i | 8; + if (iblockstate.getValue(HINGE) == BlockDoor.EnumHingePosition.RIGHT) { + i |= 1; + } + + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 2; + } + } else { + i = i | ((EnumFacing) iblockstate.getValue(FACING)).rotateY().getHorizontalIndex(); + if (((Boolean) iblockstate.getValue(OPEN)).booleanValue()) { + i |= 4; + } + } + + return i; + } + + protected static int removeHalfBit(int meta) { + return meta & 7; + } + + public static boolean isOpen(IBlockAccess worldIn, BlockPos pos) { + return isOpen(combineMetadata(worldIn, pos)); + } + + public static EnumFacing getFacing(IBlockAccess worldIn, BlockPos pos) { + return getFacing(combineMetadata(worldIn, pos)); + } + + public static EnumFacing getFacing(int combinedMeta) { + return EnumFacing.getHorizontal(combinedMeta & 3).rotateYCCW(); + } + + protected static boolean isOpen(int combinedMeta) { + return (combinedMeta & 4) != 0; + } + + protected static boolean isTop(int meta) { + return (meta & 8) != 0; + } + + protected static boolean isHingeLeft(int combinedMeta) { + return (combinedMeta & 16) != 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { HALF, FACING, OPEN, HINGE, POWERED }); + } + + public static enum EnumDoorHalf implements IStringSerializable { + UPPER, LOWER; + + public String toString() { + return this.getName(); + } + + public String getName() { + return this == UPPER ? "upper" : "lower"; + } + } + + public static enum EnumHingePosition implements IStringSerializable { + LEFT, RIGHT; + + public String toString() { + return this.getName(); + } + + public String getName() { + return this == LEFT ? "left" : "right"; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoublePlant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoublePlant.java new file mode 100644 index 0000000..81557b7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoublePlant.java @@ -0,0 +1,392 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeColorHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDoublePlant extends BlockBush implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDoublePlant"); + } + + public static PropertyEnum VARIANT; + public static PropertyEnum HALF; + public static final PropertyEnum field_181084_N = BlockDirectional.FACING; + + public BlockDoublePlant() { + super(Material.vine); + this.setDefaultState( + this.blockState.getBaseState().withProperty(VARIANT, BlockDoublePlant.EnumPlantType.SUNFLOWER) + .withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER) + .withProperty(field_181084_N, EnumFacing.NORTH)); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.setUnlocalizedName("doublePlant"); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockDoublePlant.EnumPlantType.class); + HALF = PropertyEnum.create("half", BlockDoublePlant.EnumBlockHalf.class); + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public BlockDoublePlant.EnumPlantType getVariant(IBlockAccess worldIn, BlockPos pos) { + IBlockState iblockstate = worldIn.getBlockState(pos); + if (iblockstate.getBlock() == this) { + iblockstate = this.getActualState(iblockstate, worldIn, pos); + return (BlockDoublePlant.EnumPlantType) iblockstate.getValue(VARIANT); + } else { + return BlockDoublePlant.EnumPlantType.FERN; + } + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) && world.isAirBlock(blockpos.up()); + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World world, BlockPos blockpos) { + IBlockState iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock() != this) { + return true; + } else { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) this + .getActualState(iblockstate, world, blockpos).getValue(VARIANT); + return blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.FERN + || blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS; + } + } + + protected void checkAndDropBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!this.canBlockStay(world, blockpos, iblockstate)) { + boolean flag = iblockstate.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER; + BlockPos blockpos1 = flag ? blockpos : blockpos.up(); + BlockPos blockpos2 = flag ? blockpos.down() : blockpos; + Object object = flag ? this : world.getBlockState(blockpos1).getBlock(); + Object object1 = flag ? world.getBlockState(blockpos2).getBlock() : this; + if (object == this) { + world.setBlockState(blockpos1, Blocks.air.getDefaultState(), 2); + } + + if (object1 == this) { + world.setBlockState(blockpos2, Blocks.air.getDefaultState(), 3); + if (!flag) { + this.dropBlockAsItem(world, blockpos2, iblockstate, 0); + } + } + + } + } + + public boolean canBlockStay(World world, BlockPos blockpos, IBlockState iblockstate) { + if (iblockstate.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + return world.getBlockState(blockpos.down()).getBlock() == this; + } else { + IBlockState iblockstate1 = world.getBlockState(blockpos.up()); + return iblockstate1.getBlock() == this && super.canBlockStay(world, blockpos, iblockstate1); + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom random, int var3) { + if (iblockstate.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + return null; + } else { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) iblockstate + .getValue(VARIANT); + return blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.FERN ? null + : (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS + ? (random.nextInt(8) == 0 ? Items.wheat_seeds : null) + : Item.getItemFromBlock(this)); + } + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return iblockstate.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.UPPER + && iblockstate.getValue(VARIANT) != BlockDoublePlant.EnumPlantType.GRASS + ? ((BlockDoublePlant.EnumPlantType) iblockstate.getValue(VARIANT)).getMeta() + : 0; + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = this.getVariant(iblockaccess, blockpos); + return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS + && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN ? 16777215 + : BiomeColorHelper.getGrassColorAtPos(iblockaccess, blockpos); + } + + public void placeAt(World worldIn, BlockPos lowerPos, BlockDoublePlant.EnumPlantType variant, int flags) { + worldIn.setBlockState(lowerPos, this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER) + .withProperty(VARIANT, variant), flags); + worldIn.setBlockState(lowerPos.up(), + this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState var3, EntityLivingBase var4, + ItemStack var5) { + world.setBlockState(blockpos.up(), + this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), 2); + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (entityplayer.getCurrentEquippedItem() == null + || entityplayer.getCurrentEquippedItem().getItem() != Items.shears + || iblockstate.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER + || !this.onHarvest(world, blockpos, iblockstate, entityplayer)) { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + } + + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + if (iblockstate.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + if (world.getBlockState(blockpos.down()).getBlock() == this) { + if (!entityplayer.capabilities.isCreativeMode) { + IBlockState iblockstate1 = world.getBlockState(blockpos.down()); + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) iblockstate1 + .getValue(VARIANT); + if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN + && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) { + world.destroyBlock(blockpos.down(), true); + } else { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + this.onHarvest(world, blockpos, iblockstate1, entityplayer); + world.setBlockToAir(blockpos.down()); + } else { + world.destroyBlock(blockpos.down(), true); + } + } + } else { + world.setBlockToAir(blockpos.down()); + } + } + } else if (entityplayer.capabilities.isCreativeMode && world.getBlockState(blockpos.up()).getBlock() == this) { + world.setBlockState(blockpos.up(), Blocks.air.getDefaultState(), 2); + } + + super.onBlockHarvested(world, blockpos, iblockstate, entityplayer); + } + + private boolean onHarvest(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) state + .getValue(VARIANT); + if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN + && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) { + return false; + } else { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS + ? BlockTallGrass.EnumType.GRASS + : BlockTallGrass.EnumType.FERN).getMeta(); + spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 2, i)); + return true; + } + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : BlockDoublePlant.EnumPlantType.values()) { + list.add(new ItemStack(item, 1, blockdoubleplant$enumplanttype.getMeta())); + } + + } + + public int getDamageValue(World world, BlockPos blockpos) { + return this.getVariant(world, blockpos).getMeta(); + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World world, BlockPos blockpos, IBlockState var3, boolean var4) { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = this.getVariant(world, blockpos); + return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS + && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return true; + } + + public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState var4) { + spawnAsEntity(world, blockpos, new ItemStack(this, 1, this.getVariant(world, blockpos).getMeta())); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return (i & 8) > 0 ? this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER) + : this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(VARIANT, + BlockDoublePlant.EnumPlantType.byMetadata(i & 7)); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + if (iblockstate.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + IBlockState iblockstate1 = iblockaccess.getBlockState(blockpos.down()); + if (iblockstate1.getBlock() == this) { + iblockstate = iblockstate.withProperty(VARIANT, iblockstate1.getValue(VARIANT)); + } + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return iblockstate.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER + ? 8 | ((EnumFacing) iblockstate.getValue(field_181084_N)).getHorizontalIndex() + : ((BlockDoublePlant.EnumPlantType) iblockstate.getValue(VARIANT)).getMeta(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { HALF, VARIANT, field_181084_N }); + } + + /**+ + * Get the OffsetType for this Block. Determines if the model is + * rendered slightly offset. + */ + public Block.EnumOffsetType getOffsetType() { + return Block.EnumOffsetType.XZ; + } + + public static enum EnumBlockHalf implements IStringSerializable { + UPPER, LOWER; + + public String toString() { + return this.getName(); + } + + public String getName() { + return this == UPPER ? "upper" : "lower"; + } + } + + public static enum EnumPlantType implements IStringSerializable { + SUNFLOWER(0, "sunflower"), SYRINGA(1, "syringa"), GRASS(2, "double_grass", "grass"), + FERN(3, "double_fern", "fern"), ROSE(4, "double_rose", "rose"), PAEONIA(5, "paeonia"); + + private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumPlantType(int meta, String name) { + this(meta, name, name); + } + + private EnumPlantType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMeta() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockDoublePlant.EnumPlantType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : values()) { + META_LOOKUP[blockdoubleplant$enumplanttype.getMeta()] = blockdoubleplant$enumplanttype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlab.java new file mode 100644 index 0000000..d06c7fd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlab.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDoubleStoneSlab extends BlockStoneSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDoubleStoneSlab"); + } + + public boolean isDouble() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlabNew.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlabNew.java new file mode 100644 index 0000000..fb35737 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlabNew.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlabNew; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDoubleStoneSlabNew extends BlockStoneSlabNew { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDoubleStoneSlabNew"); + } + + public boolean isDouble() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleWoodSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleWoodSlab.java new file mode 100644 index 0000000..9b5faef --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleWoodSlab.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWoodSlab; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDoubleWoodSlab extends BlockWoodSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDoubleWoodSlab"); + } + + public boolean isDouble() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDragonEgg.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDragonEgg.java new file mode 100644 index 0000000..b5498a6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDragonEgg.java @@ -0,0 +1,142 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFallingBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDragonEgg extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDragonEgg"); + } + + public BlockDragonEgg() { + super(Material.dragonEgg, MapColor.blackColor); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + this.checkFall(world, blockpos); + } + + private void checkFall(World worldIn, BlockPos pos) { + if (BlockFalling.canFallInto(worldIn, pos.down()) && pos.getY() >= 0) { + byte b0 = 32; + if (!BlockFalling.fallInstantly && worldIn.isAreaLoaded(pos.add(-b0, -b0, -b0), pos.add(b0, b0, b0))) { + worldIn.spawnEntityInWorld(new EntityFallingBlock(worldIn, (double) ((float) pos.getX() + 0.5F), + (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), this.getDefaultState())); + } else { + worldIn.setBlockToAir(pos); + + BlockPos blockpos; + for (blockpos = pos; BlockFalling.canFallInto(worldIn, blockpos) + && blockpos.getY() > 0; blockpos = blockpos.down()) { + ; + } + + if (blockpos.getY() > 0) { + worldIn.setBlockState(blockpos, this.getDefaultState(), 2); + } + } + + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer var4, + EnumFacing var5, float var6, float var7, float var8) { + this.teleport(world, blockpos); + return true; + } + + public void onBlockClicked(World world, BlockPos blockpos, EntityPlayer var3) { + this.teleport(world, blockpos); + } + + private void teleport(World worldIn, BlockPos pos) { + IBlockState iblockstate = worldIn.getBlockState(pos); + if (iblockstate.getBlock() == this) { + for (int i = 0; i < 1000; ++i) { + BlockPos blockpos = pos.add(worldIn.rand.nextInt(16) - worldIn.rand.nextInt(16), + worldIn.rand.nextInt(8) - worldIn.rand.nextInt(8), + worldIn.rand.nextInt(16) - worldIn.rand.nextInt(16)); + if (worldIn.getBlockState(blockpos).getBlock().blockMaterial == Material.air) { + worldIn.setBlockState(blockpos, iblockstate, 2); + worldIn.setBlockToAir(pos); + return; + } + } + + } + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 5; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess var1, BlockPos var2, EnumFacing var3) { + return true; + } + + public Item getItem(World var1, BlockPos var2) { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDropper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDropper.java new file mode 100644 index 0000000..af6970a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDropper.java @@ -0,0 +1,97 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSourceImpl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBehaviorDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDropper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDropper extends BlockDispenser { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDropper"); + } + + private final IBehaviorDispenseItem dropBehavior = new BehaviorDefaultDispenseItem(); + + protected IBehaviorDispenseItem getBehavior(ItemStack var1) { + return this.dropBehavior; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityDropper(); + } + + protected void dispense(World world, BlockPos blockpos) { + BlockSourceImpl blocksourceimpl = new BlockSourceImpl(world, blockpos); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser) blocksourceimpl.getBlockTileEntity(); + if (tileentitydispenser != null) { + int i = tileentitydispenser.getDispenseSlot(); + if (i < 0) { + world.playAuxSFX(1001, blockpos, 0); + } else { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i); + if (itemstack != null) { + EnumFacing enumfacing = (EnumFacing) world.getBlockState(blockpos).getValue(FACING); + BlockPos blockpos1 = blockpos.offset(enumfacing); + IInventory iinventory = TileEntityHopper.getInventoryAtPosition(world, (double) blockpos1.getX(), + (double) blockpos1.getY(), (double) blockpos1.getZ()); + ItemStack itemstack1; + if (iinventory == null) { + itemstack1 = this.dropBehavior.dispense(blocksourceimpl, itemstack); + if (itemstack1 != null && itemstack1.stackSize <= 0) { + itemstack1 = null; + } + } else { + itemstack1 = TileEntityHopper.putStackInInventoryAllSlots(iinventory, + itemstack.copy().splitStack(1), enumfacing.getOpposite()); + if (itemstack1 == null) { + itemstack1 = itemstack.copy(); + if (--itemstack1.stackSize <= 0) { + itemstack1 = null; + } + } else { + itemstack1 = itemstack.copy(); + } + } + + tileentitydispenser.setInventorySlotContents(i, itemstack1); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDynamicLiquid.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDynamicLiquid.java new file mode 100644 index 0000000..5ca3f52 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDynamicLiquid.java @@ -0,0 +1,262 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.EnumSet; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockDynamicLiquid extends BlockLiquid { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockDynamicLiquid"); + } + + int adjacentSourceBlocks; + + protected BlockDynamicLiquid(Material materialIn) { + super(materialIn); + } + + private void placeStaticBlock(World worldIn, BlockPos pos, IBlockState currentState) { + worldIn.setBlockState(pos, + getStaticBlock(this.blockMaterial).getDefaultState().withProperty(LEVEL, currentState.getValue(LEVEL)), + 2); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); + byte b0 = 1; + if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) { + b0 = 2; + } + + int j = this.tickRate(world); + if (i > 0) { + int k = -100; + this.adjacentSourceBlocks = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k); + } + + int l = k + b0; + if (l >= 8 || k < 0) { + l = -1; + } + + if (this.getLevel(world, blockpos.up()) >= 0) { + int i1 = this.getLevel(world, blockpos.up()); + if (i1 >= 8) { + l = i1; + } else { + l = i1 + 8; + } + } + + if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) { + IBlockState iblockstate2 = world.getBlockState(blockpos.down()); + if (iblockstate2.getBlock().getMaterial().isSolid()) { + l = 0; + } else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial + && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) { + l = 0; + } + } + + if (this.blockMaterial == Material.lava && i < 8 && l < 8 && l > i && random.nextInt(4) != 0) { + j *= 4; + } + + if (l == i) { + this.placeStaticBlock(world, blockpos, iblockstate); + } else { + i = l; + if (l < 0) { + world.setBlockToAir(blockpos); + } else { + iblockstate = iblockstate.withProperty(LEVEL, Integer.valueOf(l)); + world.setBlockState(blockpos, iblockstate, 2); + world.scheduleUpdate(blockpos, this, j); + world.notifyNeighborsOfStateChange(blockpos, this); + } + } + } else { + this.placeStaticBlock(world, blockpos, iblockstate); + } + + IBlockState iblockstate1 = world.getBlockState(blockpos.down()); + if (this.canFlowInto(world, blockpos.down(), iblockstate1)) { + if (this.blockMaterial == Material.lava + && world.getBlockState(blockpos.down()).getBlock().getMaterial() == Material.water) { + world.setBlockState(blockpos.down(), Blocks.stone.getDefaultState()); + this.triggerMixEffects(world, blockpos.down()); + return; + } + + if (i >= 8) { + this.tryFlowInto(world, blockpos.down(), iblockstate1, i); + } else { + this.tryFlowInto(world, blockpos.down(), iblockstate1, i + 8); + } + } else if (i >= 0 && (i == 0 || this.isBlocked(world, blockpos.down(), iblockstate1))) { + Set set = this.getPossibleFlowDirections(world, blockpos); + int j1 = i + b0; + if (i >= 8) { + j1 = 1; + } + + if (j1 >= 8) { + return; + } + + for (EnumFacing enumfacing1 : (Set) set) { + this.tryFlowInto(world, blockpos.offset(enumfacing1), world.getBlockState(blockpos.offset(enumfacing1)), + j1); + } + } + + } + + private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) { + if (this.canFlowInto(worldIn, pos, state)) { + if (state.getBlock() != Blocks.air) { + if (this.blockMaterial == Material.lava) { + this.triggerMixEffects(worldIn, pos); + } else { + state.getBlock().dropBlockAsItem(worldIn, pos, state, 0); + } + } + + worldIn.setBlockState(pos, this.getDefaultState().withProperty(LEVEL, Integer.valueOf(level)), 3); + } + + } + + private int func_176374_a(World worldIn, BlockPos pos, int distance, EnumFacing calculateFlowCost) { + int i = 1000; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (enumfacing != calculateFlowCost) { + BlockPos blockpos = pos.offset(enumfacing); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + if (!this.isBlocked(worldIn, blockpos, iblockstate) + && (iblockstate.getBlock().getMaterial() != this.blockMaterial + || ((Integer) iblockstate.getValue(LEVEL)).intValue() > 0)) { + if (!this.isBlocked(worldIn, blockpos.down(), iblockstate)) { + return distance; + } + + if (distance < 4) { + int j = this.func_176374_a(worldIn, blockpos, distance + 1, enumfacing.getOpposite()); + if (j < i) { + i = j; + } + } + } + } + } + + return i; + } + + /**+ + * This method returns a Set of EnumFacing + */ + private Set getPossibleFlowDirections(World worldIn, BlockPos pos) { + int i = 1000; + EnumSet enumset = EnumSet.noneOf(EnumFacing.class); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos = pos.offset(enumfacing); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + if (!this.isBlocked(worldIn, blockpos, iblockstate) + && (iblockstate.getBlock().getMaterial() != this.blockMaterial + || ((Integer) iblockstate.getValue(LEVEL)).intValue() > 0)) { + int j; + if (this.isBlocked(worldIn, blockpos.down(), worldIn.getBlockState(blockpos.down()))) { + j = this.func_176374_a(worldIn, blockpos, 1, enumfacing.getOpposite()); + } else { + j = 0; + } + + if (j < i) { + enumset.clear(); + } + + if (j <= i) { + enumset.add(enumfacing); + i = j; + } + } + } + + return enumset; + } + + private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state) { + Block block = worldIn.getBlockState(pos).getBlock(); + return !(block instanceof BlockDoor) && block != Blocks.standing_sign && block != Blocks.ladder + && block != Blocks.reeds + ? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) + : true; + } + + protected int checkAdjacentBlock(World worldIn, BlockPos pos, int currentMinLevel) { + int i = this.getLevel(worldIn, pos); + if (i < 0) { + return currentMinLevel; + } else { + if (i == 0) { + ++this.adjacentSourceBlocks; + } + + if (i >= 8) { + i = 0; + } + + return currentMinLevel >= 0 && i >= currentMinLevel ? currentMinLevel : i; + } + } + + private boolean canFlowInto(World worldIn, BlockPos pos, IBlockState state) { + Material material = state.getBlock().getMaterial(); + return material != this.blockMaterial && material != Material.lava && !this.isBlocked(worldIn, pos, state); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!this.checkForMixing(world, blockpos, iblockstate)) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnchantmentTable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnchantmentTable.java new file mode 100644 index 0000000..f6d4312 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnchantmentTable.java @@ -0,0 +1,140 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockEnchantmentTable extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockEnchantmentTable"); + } + + protected BlockEnchantmentTable() { + super(Material.rock, MapColor.redColor); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean isFullCube() { + return false; + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + super.randomDisplayTick(world, blockpos, iblockstate, random); + + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + if (i > -2 && i < 2 && j == -1) { + j = 2; + } + + if (random.nextInt(16) == 0) { + for (int k = 0; k <= 1; ++k) { + BlockPos blockpos1 = blockpos.add(i, k, j); + if (world.getBlockState(blockpos1).getBlock() == Blocks.bookshelf) { + if (!world.isAirBlock(blockpos.add(i / 2, 0, j / 2))) { + break; + } + + world.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, (double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + 2.0D, (double) blockpos.getZ() + 0.5D, + (double) ((float) i + random.nextFloat()) - 0.5D, + (double) ((float) k - random.nextFloat() - 1.0F), + (double) ((float) j + random.nextFloat()) - 0.5D, new int[0]); + } + } + } + } + } + + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityEnchantmentTable(); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityEnchantmentTable) { + entityplayer.displayGui((TileEntityEnchantmentTable) tileentity); + } + + return true; + } + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack itemstack) { + super.onBlockPlacedBy(world, blockpos, iblockstate, entitylivingbase, itemstack); + if (itemstack.hasDisplayName()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityEnchantmentTable) { + ((TileEntityEnchantmentTable) tileentity).setCustomName(itemstack.getDisplayName()); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortal.java new file mode 100644 index 0000000..2eba468 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortal.java @@ -0,0 +1,127 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEndPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockEndPortal extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockEndPortal"); + } + + protected BlockEndPortal(Material materialIn) { + super(materialIn); + this.setLightLevel(1.0F); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityEndPortal(); + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + float f = 0.0625F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return enumfacing == EnumFacing.DOWN ? super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing) : false; + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World var1, BlockPos var2, IBlockState var3, AxisAlignedBB var4, + List var5, Entity var6) { + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos var2, IBlockState var3, Entity entity) { + if (entity.ridingEntity == null && entity.riddenByEntity == null) { + entity.travelToDimension(1); + } + + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + double d0 = (double) ((float) blockpos.getX() + random.nextFloat()); + double d1 = (double) ((float) blockpos.getY() + 0.8F); + double d2 = (double) ((float) blockpos.getZ() + random.nextFloat()); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + public Item getItem(World var1, BlockPos var2) { + return null; + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.blackColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortalFrame.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortalFrame.java new file mode 100644 index 0000000..b58cfdf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortalFrame.java @@ -0,0 +1,138 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockEndPortalFrame extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockEndPortalFrame"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool EYE = PropertyBool.create("eye"); + + public BlockEndPortalFrame() { + super(Material.rock, MapColor.greenColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(EYE, + Boolean.valueOf(false))); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + if (((Boolean) world.getBlockState(blockpos).getValue(EYE)).booleanValue()) { + this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + this.setBlockBoundsForItemRender(); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()) + .withProperty(EYE, Boolean.valueOf(false)); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return ((Boolean) world.getBlockState(blockpos).getValue(EYE)).booleanValue() ? 15 : 0; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(EYE, Boolean.valueOf((i & 4) != 0)).withProperty(FACING, + EnumFacing.getHorizontal(i & 3)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + if (((Boolean) iblockstate.getValue(EYE)).booleanValue()) { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, EYE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnderChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnderChest.java new file mode 100644 index 0000000..32d8d76 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnderChest.java @@ -0,0 +1,182 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryEnderChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEnderChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockEnderChest extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockEnderChest"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + protected BlockEnderChest() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 2; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.obsidian); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 8; + } + + protected boolean canSilkHarvest() { + return true; + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack var5) { + world.setBlockState(blockpos, + iblockstate.withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()), 2); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + InventoryEnderChest inventoryenderchest = entityplayer.getInventoryEnderChest(); + TileEntity tileentity = world.getTileEntity(blockpos); + if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest) { + if (world.getBlockState(blockpos.up()).getBlock().isNormalCube()) { + return true; + } else { + inventoryenderchest.setChestTileEntity((TileEntityEnderChest) tileentity); + entityplayer.displayGUIChest(inventoryenderchest); + entityplayer.triggerAchievement(StatList.field_181738_V); + return true; + } + } else { + return true; + } + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityEnderChest(); + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + for (int i = 0; i < 3; ++i) { + int j = random.nextInt(2) * 2 - 1; + int k = random.nextInt(2) * 2 - 1; + double d0 = (double) blockpos.getX() + 0.5D + 0.25D * (double) j; + double d1 = (double) ((float) blockpos.getY() + random.nextFloat()); + double d2 = (double) blockpos.getZ() + 0.5D + 0.25D * (double) k; + double d3 = (double) (random.nextFloat() * (float) j); + double d4 = ((double) random.nextFloat() - 0.5D) * 0.125D; + double d5 = (double) (random.nextFloat() * (float) k); + world.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getFront(i); + if (enumfacing.getAxis() == EnumFacing.Axis.Y) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEventData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEventData.java new file mode 100644 index 0000000..e9014f8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEventData.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockEventData { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockEventData"); + } + + private BlockPos position; + private Block blockType; + private int eventID; + private int eventParameter; + + public BlockEventData(BlockPos pos, Block blockType, int eventId, int parInt1) { + this.position = pos; + this.eventID = eventId; + this.eventParameter = parInt1; + this.blockType = blockType; + } + + public BlockPos getPosition() { + return this.position; + } + + /**+ + * Get the Event ID (different for each BlockID) + */ + public int getEventID() { + return this.eventID; + } + + public int getEventParameter() { + return this.eventParameter; + } + + public Block getBlock() { + return this.blockType; + } + + public boolean equals(Object parObject) { + if (!(parObject instanceof BlockEventData)) { + return false; + } else { + BlockEventData blockeventdata = (BlockEventData) parObject; + return this.position.equals(blockeventdata.position) && this.eventID == blockeventdata.eventID + && this.eventParameter == blockeventdata.eventParameter + && this.blockType == blockeventdata.blockType; + } + } + + public String toString() { + return "TE(" + this.position + ")," + this.eventID + "," + this.eventParameter + "," + this.blockType; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFalling.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFalling.java new file mode 100644 index 0000000..a41b353 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFalling.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFallingBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFalling extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFalling"); + } + + public static boolean fallInstantly; + + public BlockFalling() { + super(Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public BlockFalling(Material materialIn) { + super(materialIn); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + { + this.checkFallable(world, blockpos); + } + } + + private void checkFallable(World worldIn, BlockPos pos) { + if (canFallInto(worldIn, pos.down()) && pos.getY() >= 0) { + byte b0 = 32; + if (!fallInstantly && worldIn.isAreaLoaded(pos.add(-b0, -b0, -b0), pos.add(b0, b0, b0))) { + EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldIn, (double) pos.getX() + 0.5D, + (double) pos.getY(), (double) pos.getZ() + 0.5D, worldIn.getBlockState(pos)); + this.onStartFalling(entityfallingblock); + worldIn.spawnEntityInWorld(entityfallingblock); + } else { + worldIn.setBlockToAir(pos); + + BlockPos blockpos; + for (blockpos = pos.down(); canFallInto(worldIn, blockpos) + && blockpos.getY() > 0; blockpos = blockpos.down()) { + ; + } + + if (blockpos.getY() > 0) { + worldIn.setBlockState(blockpos.up(), this.getDefaultState()); + } + } + + } + } + + protected void onStartFalling(EntityFallingBlock var1) { + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 2; + } + + public static boolean canFallInto(World worldIn, BlockPos pos) { + Block block = worldIn.getBlockState(pos).getBlock(); + Material material = block.blockMaterial; + return block == Blocks.fire || material == Material.air || material == Material.water + || material == Material.lava; + } + + public void onEndFalling(World var1, BlockPos var2) { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFarmland.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFarmland.java new file mode 100644 index 0000000..c4dd27f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFarmland.java @@ -0,0 +1,181 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCrops; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFarmland extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFarmland"); + } + + public static final PropertyInteger MOISTURE = PropertyInteger.create("moisture", 0, 7); + + protected BlockFarmland() { + super(Material.ground); + this.setDefaultState(this.blockState.getBaseState().withProperty(MOISTURE, Integer.valueOf(0))); + this.setTickRandomly(true); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); + this.setLightOpacity(255); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState var3) { + return new AxisAlignedBB((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ(), + (double) (blockpos.getX() + 1), (double) (blockpos.getY() + 1), (double) (blockpos.getZ() + 1)); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + int i = ((Integer) iblockstate.getValue(MOISTURE)).intValue(); + if (!this.hasWater(world, blockpos) && !world.canLightningStrike(blockpos.up())) { + if (i > 0) { + world.setBlockState(blockpos, iblockstate.withProperty(MOISTURE, Integer.valueOf(i - 1)), 2); + } else if (!this.hasCrops(world, blockpos)) { + world.setBlockState(blockpos, Blocks.dirt.getDefaultState()); + } + } else if (i < 7) { + world.setBlockState(blockpos, iblockstate.withProperty(MOISTURE, Integer.valueOf(7)), 2); + } + + } + + /**+ + * Block's chance to react to a living entity falling on it. + */ + public void onFallenUpon(World world, BlockPos blockpos, Entity entity, float f) { + if (entity instanceof EntityLivingBase) { + if (world.rand.nextFloat() < f - 0.5F) { + if (!(entity instanceof EntityPlayer) && !world.getGameRules().getBoolean("mobGriefing")) { + return; + } + + world.setBlockState(blockpos, Blocks.dirt.getDefaultState()); + } + + super.onFallenUpon(world, blockpos, entity, f); + } + } + + private boolean hasCrops(World worldIn, BlockPos pos) { + Block block = worldIn.getBlockState(pos.up()).getBlock(); + return block instanceof BlockCrops || block instanceof BlockStem; + } + + private boolean hasWater(World worldIn, BlockPos pos) { + for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(pos.add(-4, 0, -4), + pos.add(4, 1, 4))) { + if (worldIn.getBlockState(blockpos$mutableblockpos).getBlock().getMaterial() == Material.water) { + return true; + } + } + + return false; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + if (world.getBlockState(blockpos.up()).getBlock().getMaterial().isSolid()) { + world.setBlockState(blockpos, Blocks.dirt.getDefaultState()); + } + + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + switch (enumfacing) { + case UP: + return true; + case NORTH: + case SOUTH: + case WEST: + case EAST: + Block block = iblockaccess.getBlockState(blockpos).getBlock(); + return !block.isOpaqueCube() && block != Blocks.farmland; + default: + return super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom random, int i) { + return Blocks.dirt.getItemDropped( + Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT), random, i); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.dirt); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(MOISTURE, Integer.valueOf(i & 7)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(MOISTURE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { MOISTURE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFence.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFence.java new file mode 100644 index 0000000..3040fbc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFence.java @@ -0,0 +1,219 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFenceGate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemLead; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFence extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFence"); + } + + /**+ + * Whether this fence connects in the northern direction + */ + public static final PropertyBool NORTH = PropertyBool.create("north"); + /**+ + * Whether this fence connects in the eastern direction + */ + public static final PropertyBool EAST = PropertyBool.create("east"); + /**+ + * Whether this fence connects in the southern direction + */ + public static final PropertyBool SOUTH = PropertyBool.create("south"); + /**+ + * Whether this fence connects in the western direction + */ + public static final PropertyBool WEST = PropertyBool.create("west"); + + public BlockFence(Material materialIn) { + this(materialIn, materialIn.getMaterialMapColor()); + } + + public BlockFence(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, Boolean.valueOf(false)) + .withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)) + .withProperty(WEST, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + boolean flag = this.canConnectTo(world, blockpos.north()); + boolean flag1 = this.canConnectTo(world, blockpos.south()); + boolean flag2 = this.canConnectTo(world, blockpos.west()); + boolean flag3 = this.canConnectTo(world, blockpos.east()); + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.375F; + float f3 = 0.625F; + if (flag) { + f2 = 0.0F; + } + + if (flag1) { + f3 = 1.0F; + } + + if (flag || flag1) { + this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + f2 = 0.375F; + f3 = 0.625F; + if (flag2) { + f = 0.0F; + } + + if (flag3) { + f1 = 1.0F; + } + + if (flag2 || flag3 || !flag && !flag1) { + this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + if (flag) { + f2 = 0.0F; + } + + if (flag1) { + f3 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + boolean flag = this.canConnectTo(iblockaccess, blockpos.north()); + boolean flag1 = this.canConnectTo(iblockaccess, blockpos.south()); + boolean flag2 = this.canConnectTo(iblockaccess, blockpos.west()); + boolean flag3 = this.canConnectTo(iblockaccess, blockpos.east()); + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.375F; + float f3 = 0.625F; + if (flag) { + f2 = 0.0F; + } + + if (flag1) { + f3 = 1.0F; + } + + if (flag2) { + f = 0.0F; + } + + if (flag3) { + f1 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess var1, BlockPos var2) { + return false; + } + + public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) { + Block block = worldIn.getBlockState(pos).getBlock(); + return block == Blocks.barrier ? false + : ((!(block instanceof BlockFence) || block.blockMaterial != this.blockMaterial) + && !(block instanceof BlockFenceGate) + ? (block.blockMaterial.isOpaque() && block.isFullCube() + ? block.blockMaterial != Material.gourd + : false) + : true); + } + + public boolean shouldSideBeRendered(IBlockAccess var1, BlockPos var2, EnumFacing var3) { + return true; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + return ItemLead.attachToFence(entityplayer, world, blockpos); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState var1) { + return 0; + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate.withProperty(NORTH, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.north()))) + .withProperty(EAST, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.east()))) + .withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.south()))) + .withProperty(WEST, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.west()))); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { NORTH, EAST, WEST, SOUTH }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFenceGate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFenceGate.java new file mode 100644 index 0000000..14f327d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFenceGate.java @@ -0,0 +1,214 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFenceGate extends BlockDirectional { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFenceGate"); + } + + public static final PropertyBool OPEN = PropertyBool.create("open"); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyBool IN_WALL = PropertyBool.create("in_wall"); + + public BlockFenceGate(BlockPlanks.EnumType parEnumType) { + super(Material.wood, parEnumType.func_181070_c()); + this.setDefaultState(this.blockState.getBaseState().withProperty(OPEN, Boolean.valueOf(false)) + .withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + EnumFacing.Axis enumfacing$axis = ((EnumFacing) iblockstate.getValue(FACING)).getAxis(); + if (enumfacing$axis == EnumFacing.Axis.Z + && (iblockaccess.getBlockState(blockpos.west()).getBlock() == Blocks.cobblestone_wall + || iblockaccess.getBlockState(blockpos.east()).getBlock() == Blocks.cobblestone_wall) + || enumfacing$axis == EnumFacing.Axis.X && (iblockaccess.getBlockState(blockpos.north()) + .getBlock() == Blocks.cobblestone_wall + || iblockaccess.getBlockState(blockpos.south()).getBlock() == Blocks.cobblestone_wall)) { + iblockstate = iblockstate.withProperty(IN_WALL, Boolean.valueOf(true)); + } + + return iblockstate; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return world.getBlockState(blockpos.down()).getBlock().getMaterial().isSolid() + ? super.canPlaceBlockAt(world, blockpos) + : false; + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState iblockstate) { + if (((Boolean) iblockstate.getValue(OPEN)).booleanValue()) { + return null; + } else { + EnumFacing.Axis enumfacing$axis = ((EnumFacing) iblockstate.getValue(FACING)).getAxis(); + return enumfacing$axis == EnumFacing.Axis.Z + ? new AxisAlignedBB((double) blockpos.getX(), (double) blockpos.getY(), + (double) ((float) blockpos.getZ() + 0.375F), (double) (blockpos.getX() + 1), + (double) ((float) blockpos.getY() + 1.5F), (double) ((float) blockpos.getZ() + 0.625F)) + : new AxisAlignedBB((double) ((float) blockpos.getX() + 0.375F), (double) blockpos.getY(), + (double) blockpos.getZ(), (double) ((float) blockpos.getX() + 0.625F), + (double) ((float) blockpos.getY() + 1.5F), (double) (blockpos.getZ() + 1)); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + EnumFacing.Axis enumfacing$axis = ((EnumFacing) iblockaccess.getBlockState(blockpos).getValue(FACING)) + .getAxis(); + if (enumfacing$axis == EnumFacing.Axis.Z) { + this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F); + } else { + this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F); + } + + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess iblockaccess, BlockPos blockpos) { + return ((Boolean) iblockaccess.getBlockState(blockpos).getValue(OPEN)).booleanValue(); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing()) + .withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)) + .withProperty(IN_WALL, Boolean.valueOf(false)); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (((Boolean) iblockstate.getValue(OPEN)).booleanValue()) { + iblockstate = iblockstate.withProperty(OPEN, Boolean.valueOf(false)); + world.setBlockState(blockpos, iblockstate, 2); + } else { + EnumFacing enumfacing = EnumFacing.fromAngle((double) entityplayer.rotationYaw); + if (iblockstate.getValue(FACING) == enumfacing.getOpposite()) { + iblockstate = iblockstate.withProperty(FACING, enumfacing); + } + + iblockstate = iblockstate.withProperty(OPEN, Boolean.valueOf(true)); + world.setBlockState(blockpos, iblockstate, 2); + } + + world.playAuxSFXAtEntity(entityplayer, ((Boolean) iblockstate.getValue(OPEN)).booleanValue() ? 1003 : 1006, + blockpos, 0); + return true; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + { + boolean flag = world.isBlockPowered(blockpos); + if (flag || block.canProvidePower()) { + if (flag && !((Boolean) iblockstate.getValue(OPEN)).booleanValue() + && !((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + world.setBlockState(blockpos, iblockstate.withProperty(OPEN, Boolean.valueOf(true)) + .withProperty(POWERED, Boolean.valueOf(true)), 2); + world.playAuxSFXAtEntity((EntityPlayer) null, 1003, blockpos, 0); + } else if (!flag && ((Boolean) iblockstate.getValue(OPEN)).booleanValue() + && ((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + world.setBlockState(blockpos, iblockstate.withProperty(OPEN, Boolean.valueOf(false)) + .withProperty(POWERED, Boolean.valueOf(false)), 2); + world.playAuxSFXAtEntity((EntityPlayer) null, 1006, blockpos, 0); + } else if (flag != ((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + world.setBlockState(blockpos, iblockstate.withProperty(POWERED, Boolean.valueOf(flag)), 2); + } + } + } + } + + public boolean shouldSideBeRendered(IBlockAccess var1, BlockPos var2, EnumFacing var3) { + return true; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(i)) + .withProperty(OPEN, Boolean.valueOf((i & 4) != 0)).withProperty(POWERED, Boolean.valueOf((i & 8) != 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + if (((Boolean) iblockstate.getValue(OPEN)).booleanValue()) { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, OPEN, POWERED, IN_WALL }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFire.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFire.java new file mode 100644 index 0000000..bf16c7c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFire.java @@ -0,0 +1,463 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTNT; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProviderEnd; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFire extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFire"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + public static final PropertyBool FLIP = PropertyBool.create("flip"); + public static final PropertyBool ALT = PropertyBool.create("alt"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + public static final PropertyInteger UPPER = PropertyInteger.create("upper", 0, 2); + private final Map encouragements = Maps.newIdentityHashMap(); + private final Map flammabilities = Maps.newIdentityHashMap(); + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + if (!World.doesBlockHaveSolidTopSurface(iblockaccess, blockpos.down()) + && !Blocks.fire.canCatchFire(iblockaccess, blockpos.down())) { + boolean flag = (i + j + k & 1) == 1; + boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1; + int l = 0; + if (this.canCatchFire(iblockaccess, blockpos.up())) { + l = flag ? 1 : 2; + } + + return iblockstate.withProperty(NORTH, Boolean.valueOf(this.canCatchFire(iblockaccess, blockpos.north()))) + .withProperty(EAST, Boolean.valueOf(this.canCatchFire(iblockaccess, blockpos.east()))) + .withProperty(SOUTH, Boolean.valueOf(this.canCatchFire(iblockaccess, blockpos.south()))) + .withProperty(WEST, Boolean.valueOf(this.canCatchFire(iblockaccess, blockpos.west()))) + .withProperty(UPPER, Integer.valueOf(l)).withProperty(FLIP, Boolean.valueOf(flag1)) + .withProperty(ALT, Boolean.valueOf(flag)); + } else { + return this.getDefaultState(); + } + } + + protected BlockFire() { + super(Material.fire); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)) + .withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)) + .withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)) + .withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)) + .withProperty(UPPER, Integer.valueOf(0))); + this.setTickRandomly(true); + } + + public static void init() { + Blocks.fire.setFireInfo(Blocks.planks, 5, 20); + Blocks.fire.setFireInfo(Blocks.double_wooden_slab, 5, 20); + Blocks.fire.setFireInfo(Blocks.wooden_slab, 5, 20); + Blocks.fire.setFireInfo(Blocks.oak_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.spruce_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.birch_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.jungle_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.dark_oak_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.acacia_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.oak_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.spruce_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.birch_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.jungle_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.dark_oak_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.acacia_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.oak_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.birch_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.spruce_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.jungle_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.log, 5, 5); + Blocks.fire.setFireInfo(Blocks.log2, 5, 5); + Blocks.fire.setFireInfo(Blocks.leaves, 30, 60); + Blocks.fire.setFireInfo(Blocks.leaves2, 30, 60); + Blocks.fire.setFireInfo(Blocks.bookshelf, 30, 20); + Blocks.fire.setFireInfo(Blocks.tnt, 15, 100); + Blocks.fire.setFireInfo(Blocks.tallgrass, 60, 100); + Blocks.fire.setFireInfo(Blocks.double_plant, 60, 100); + Blocks.fire.setFireInfo(Blocks.yellow_flower, 60, 100); + Blocks.fire.setFireInfo(Blocks.red_flower, 60, 100); + Blocks.fire.setFireInfo(Blocks.deadbush, 60, 100); + Blocks.fire.setFireInfo(Blocks.wool, 30, 60); + Blocks.fire.setFireInfo(Blocks.vine, 15, 100); + Blocks.fire.setFireInfo(Blocks.coal_block, 5, 5); + Blocks.fire.setFireInfo(Blocks.hay_block, 60, 20); + Blocks.fire.setFireInfo(Blocks.carpet, 60, 20); + } + + public void setFireInfo(Block blockIn, int encouragement, int flammability) { + this.encouragements.put(blockIn, Integer.valueOf(encouragement)); + this.flammabilities.put(blockIn, Integer.valueOf(flammability)); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 30; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + if (world.getGameRules().getBoolean("doFireTick")) { + if (!this.canPlaceBlockAt(world, blockpos)) { + world.setBlockToAir(blockpos); + } + + Block block = world.getBlockState(blockpos.down()).getBlock(); + boolean flag = block == Blocks.netherrack; + if (world.provider instanceof WorldProviderEnd && block == Blocks.bedrock) { + flag = true; + } + + if (!flag && world.isRaining() && this.canDie(world, blockpos)) { + world.setBlockToAir(blockpos); + } else { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (i < 15) { + iblockstate = iblockstate.withProperty(AGE, Integer.valueOf(i + random.nextInt(3) / 2)); + world.setBlockState(blockpos, iblockstate, 4); + } + + world.scheduleUpdate(blockpos, this, this.tickRate(world) + random.nextInt(10)); + if (!flag) { + if (!this.canNeighborCatchFire(world, blockpos)) { + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down()) || i > 3) { + world.setBlockToAir(blockpos); + } + + return; + } + + if (!this.canCatchFire(world, blockpos.down()) && i == 15 && random.nextInt(4) == 0) { + world.setBlockToAir(blockpos); + return; + } + } + + boolean flag1 = world.isBlockinHighHumidity(blockpos); + byte b0 = 0; + if (flag1) { + b0 = -50; + } + + this.catchOnFire(world, blockpos.east(), 300 + b0, random, i); + this.catchOnFire(world, blockpos.west(), 300 + b0, random, i); + this.catchOnFire(world, blockpos.down(), 250 + b0, random, i); + this.catchOnFire(world, blockpos.up(), 250 + b0, random, i); + this.catchOnFire(world, blockpos.north(), 300 + b0, random, i); + this.catchOnFire(world, blockpos.south(), 300 + b0, random, i); + + for (int j = -1; j <= 1; ++j) { + for (int k = -1; k <= 1; ++k) { + for (int l = -1; l <= 4; ++l) { + if (j != 0 || l != 0 || k != 0) { + int i1 = 100; + if (l > 1) { + i1 += (l - 1) * 100; + } + + BlockPos blockpos1 = blockpos.add(j, l, k); + int j1 = this.getNeighborEncouragement(world, blockpos1); + if (j1 > 0) { + int k1 = (j1 + 40 + world.getDifficulty().getDifficultyId() * 7) / (i + 30); + if (flag1) { + k1 /= 2; + } + + if (k1 > 0 && random.nextInt(i1) <= k1 + && (!world.isRaining() || !this.canDie(world, blockpos1))) { + int l1 = i + random.nextInt(5) / 4; + if (l1 > 15) { + l1 = 15; + } + + world.setBlockState(blockpos1, + iblockstate.withProperty(AGE, Integer.valueOf(l1)), 3); + } + } + } + } + } + } + + } + } + } + + protected boolean canDie(World worldIn, BlockPos pos) { + return worldIn.canLightningStrike(pos) || worldIn.canLightningStrike(pos.west()) + || worldIn.canLightningStrike(pos.east()) || worldIn.canLightningStrike(pos.north()) + || worldIn.canLightningStrike(pos.south()); + } + + public boolean requiresUpdates() { + return false; + } + + private int getFlammability(Block blockIn) { + Integer integer = (Integer) this.flammabilities.get(blockIn); + return integer == null ? 0 : integer.intValue(); + } + + private int getEncouragement(Block blockIn) { + Integer integer = (Integer) this.encouragements.get(blockIn); + return integer == null ? 0 : integer.intValue(); + } + + private void catchOnFire(World worldIn, BlockPos pos, int chance, EaglercraftRandom random, int age) { + int i = this.getFlammability(worldIn.getBlockState(pos).getBlock()); + if (random.nextInt(chance) < i) { + IBlockState iblockstate = worldIn.getBlockState(pos); + if (random.nextInt(age + 10) < 5 && !worldIn.canLightningStrike(pos)) { + int j = age + random.nextInt(5) / 4; + if (j > 15) { + j = 15; + } + + worldIn.setBlockState(pos, this.getDefaultState().withProperty(AGE, Integer.valueOf(j)), 3); + } else { + worldIn.setBlockToAir(pos); + } + + if (iblockstate.getBlock() == Blocks.tnt) { + Blocks.tnt.onBlockDestroyedByPlayer(worldIn, pos, + iblockstate.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true))); + } + } + + } + + private boolean canNeighborCatchFire(World worldIn, BlockPos pos) { + for (EnumFacing enumfacing : EnumFacing.values()) { + if (this.canCatchFire(worldIn, pos.offset(enumfacing))) { + return true; + } + } + + return false; + } + + private int getNeighborEncouragement(World worldIn, BlockPos pos) { + if (!worldIn.isAirBlock(pos)) { + return 0; + } else { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) { + i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()), i); + } + + return i; + } + } + + /**+ + * Returns if this block is collidable (only used by Fire). + * Args: x, y, z + */ + public boolean isCollidable() { + return false; + } + + /**+ + * Checks if the block can be caught on fire + */ + public boolean canCatchFire(IBlockAccess worldIn, BlockPos pos) { + return this.getEncouragement(worldIn.getBlockState(pos).getBlock()) > 0; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return World.doesBlockHaveSolidTopSurface(world, blockpos.down()) || this.canNeighborCatchFire(world, blockpos); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down()) + && !this.canNeighborCatchFire(world, blockpos)) { + world.setBlockToAir(blockpos); + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + if (world.provider.getDimensionId() > 0 || !Blocks.portal.func_176548_d(world, blockpos)) { + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down()) + && !this.canNeighborCatchFire(world, blockpos)) { + world.setBlockToAir(blockpos); + } else { + world.scheduleUpdate(blockpos, this, this.tickRate(world) + world.rand.nextInt(10)); + } + } + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + if (random.nextInt(24) == 0) { + world.playSound((double) ((float) blockpos.getX() + 0.5F), (double) ((float) blockpos.getY() + 0.5F), + (double) ((float) blockpos.getZ() + 0.5F), "fire.fire", 1.0F + random.nextFloat(), + random.nextFloat() * 0.7F + 0.3F, false); + } + + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down()) + && !Blocks.fire.canCatchFire(world, blockpos.down())) { + if (Blocks.fire.canCatchFire(world, blockpos.west())) { + for (int j = 0; j < 2; ++j) { + double d3 = (double) blockpos.getX() + random.nextDouble() * 0.10000000149011612D; + double d8 = (double) blockpos.getY() + random.nextDouble(); + double d13 = (double) blockpos.getZ() + random.nextDouble(); + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d3, d8, d13, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(world, blockpos.east())) { + for (int k = 0; k < 2; ++k) { + double d4 = (double) (blockpos.getX() + 1) - random.nextDouble() * 0.10000000149011612D; + double d9 = (double) blockpos.getY() + random.nextDouble(); + double d14 = (double) blockpos.getZ() + random.nextDouble(); + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d4, d9, d14, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(world, blockpos.north())) { + for (int l = 0; l < 2; ++l) { + double d5 = (double) blockpos.getX() + random.nextDouble(); + double d10 = (double) blockpos.getY() + random.nextDouble(); + double d15 = (double) blockpos.getZ() + random.nextDouble() * 0.10000000149011612D; + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d5, d10, d15, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(world, blockpos.south())) { + for (int i1 = 0; i1 < 2; ++i1) { + double d6 = (double) blockpos.getX() + random.nextDouble(); + double d11 = (double) blockpos.getY() + random.nextDouble(); + double d16 = (double) (blockpos.getZ() + 1) - random.nextDouble() * 0.10000000149011612D; + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d6, d11, d16, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(world, blockpos.up())) { + for (int j1 = 0; j1 < 2; ++j1) { + double d7 = (double) blockpos.getX() + random.nextDouble(); + double d12 = (double) (blockpos.getY() + 1) - random.nextDouble() * 0.10000000149011612D; + double d17 = (double) blockpos.getZ() + random.nextDouble(); + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d7, d12, d17, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } else { + for (int i = 0; i < 3; ++i) { + double d0 = (double) blockpos.getX() + random.nextDouble(); + double d1 = (double) blockpos.getY() + random.nextDouble() * 0.5D + 0.5D; + double d2 = (double) blockpos.getZ() + random.nextDouble(); + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.tntColor; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlower.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlower.java new file mode 100644 index 0000000..aaa2783 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlower.java @@ -0,0 +1,209 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; + +import java.util.Collection; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockFlower extends BlockBush { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFlower"); + } + + protected PropertyEnum type; + + protected BlockFlower() { + this.setDefaultState(this.blockState.getBaseState().withProperty(this.getTypeProperty(), + this.getBlockType() == BlockFlower.EnumFlowerColor.RED ? BlockFlower.EnumFlowerType.POPPY + : BlockFlower.EnumFlowerType.DANDELION)); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockFlower.EnumFlowerType) iblockstate.getValue(this.getTypeProperty())).getMeta(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockFlower.EnumFlowerType blockflower$enumflowertype : BlockFlower.EnumFlowerType + .getTypes(this.getBlockType())) { + list.add(new ItemStack(item, 1, blockflower$enumflowertype.getMeta())); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(this.getTypeProperty(), + BlockFlower.EnumFlowerType.getType(this.getBlockType(), i)); + } + + public abstract BlockFlower.EnumFlowerColor getBlockType(); + + public IProperty getTypeProperty() { + if (this.type == null) { + this.type = PropertyEnum.create("type", BlockFlower.EnumFlowerType.class, + new Predicate() { + public boolean apply(BlockFlower.EnumFlowerType blockflower$enumflowertype) { + return blockflower$enumflowertype.getBlockType() == BlockFlower.this.getBlockType(); + } + }); + } + + return this.type; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockFlower.EnumFlowerType) iblockstate.getValue(this.getTypeProperty())).getMeta(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { this.getTypeProperty() }); + } + + /**+ + * Get the OffsetType for this Block. Determines if the model is + * rendered slightly offset. + */ + public Block.EnumOffsetType getOffsetType() { + return Block.EnumOffsetType.XZ; + } + + public static enum EnumFlowerColor { + YELLOW, RED; + + public BlockFlower getBlock() { + return this == YELLOW ? Blocks.yellow_flower : Blocks.red_flower; + } + } + + public static enum EnumFlowerType implements IStringSerializable { + DANDELION(BlockFlower.EnumFlowerColor.YELLOW, 0, "dandelion"), + POPPY(BlockFlower.EnumFlowerColor.RED, 0, "poppy"), + BLUE_ORCHID(BlockFlower.EnumFlowerColor.RED, 1, "blue_orchid", "blueOrchid"), + ALLIUM(BlockFlower.EnumFlowerColor.RED, 2, "allium"), + HOUSTONIA(BlockFlower.EnumFlowerColor.RED, 3, "houstonia"), + RED_TULIP(BlockFlower.EnumFlowerColor.RED, 4, "red_tulip", "tulipRed"), + ORANGE_TULIP(BlockFlower.EnumFlowerColor.RED, 5, "orange_tulip", "tulipOrange"), + WHITE_TULIP(BlockFlower.EnumFlowerColor.RED, 6, "white_tulip", "tulipWhite"), + PINK_TULIP(BlockFlower.EnumFlowerColor.RED, 7, "pink_tulip", "tulipPink"), + OXEYE_DAISY(BlockFlower.EnumFlowerColor.RED, 8, "oxeye_daisy", "oxeyeDaisy"); + + private static final BlockFlower.EnumFlowerType[][] TYPES_FOR_BLOCK = new BlockFlower.EnumFlowerType[BlockFlower.EnumFlowerColor + .values().length][]; + private final BlockFlower.EnumFlowerColor blockType; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumFlowerType(BlockFlower.EnumFlowerColor blockType, int meta, String name) { + this(blockType, meta, name, name); + } + + private EnumFlowerType(BlockFlower.EnumFlowerColor blockType, int meta, String name, String unlocalizedName) { + this.blockType = blockType; + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + /**+ + * Get the Type of this flower (Yellow/Red) + */ + public BlockFlower.EnumFlowerColor getBlockType() { + return this.blockType; + } + + public int getMeta() { + return this.meta; + } + + public static BlockFlower.EnumFlowerType getType(BlockFlower.EnumFlowerColor blockType, int meta) { + BlockFlower.EnumFlowerType[] ablockflower$enumflowertype = TYPES_FOR_BLOCK[blockType.ordinal()]; + if (meta < 0 || meta >= ablockflower$enumflowertype.length) { + meta = 0; + } + + return ablockflower$enumflowertype[meta]; + } + + public static BlockFlower.EnumFlowerType[] getTypes(BlockFlower.EnumFlowerColor flowerColor) { + return TYPES_FOR_BLOCK[flowerColor.ordinal()]; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (final BlockFlower.EnumFlowerColor blockflower$enumflowercolor : BlockFlower.EnumFlowerColor.values()) { + Collection collection = Collections2.filter(Lists.newArrayList(values()), + new Predicate() { + public boolean apply(BlockFlower.EnumFlowerType blockflower$enumflowertype) { + return blockflower$enumflowertype.getBlockType() == blockflower$enumflowercolor; + } + }); + TYPES_FOR_BLOCK[blockflower$enumflowercolor.ordinal()] = (BlockFlower.EnumFlowerType[]) collection + .toArray(new BlockFlower.EnumFlowerType[collection.size()]); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlowerPot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlowerPot.java new file mode 100644 index 0000000..b13db3f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlowerPot.java @@ -0,0 +1,424 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityFlowerPot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFlowerPot extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFlowerPot"); + } + + public static final PropertyInteger LEGACY_DATA = PropertyInteger.create("legacy_data", 0, 15); + public static PropertyEnum CONTENTS; + + public BlockFlowerPot() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(CONTENTS, BlockFlowerPot.EnumFlowerType.EMPTY) + .withProperty(LEGACY_DATA, Integer.valueOf(0))); + this.setBlockBoundsForItemRender(); + } + + public static void bootstrapStates() { + CONTENTS = PropertyEnum.create("contents", BlockFlowerPot.EnumFlowerType.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal("item.flowerPot.name"); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float f = 0.375F; + float f1 = f / 2.0F; + this.setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, f, 0.5F + f1); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + public boolean isFullCube() { + return false; + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int i) { + TileEntity tileentity = iblockaccess.getTileEntity(blockpos); + if (tileentity instanceof TileEntityFlowerPot) { + Item item = ((TileEntityFlowerPot) tileentity).getFlowerPotItem(); + if (item instanceof ItemBlock) { + return Block.getBlockFromItem(item).colorMultiplier(iblockaccess, blockpos, i); + } + } + + return 16777215; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() instanceof ItemBlock) { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(world, blockpos); + if (tileentityflowerpot == null) { + return false; + } else if (tileentityflowerpot.getFlowerPotItem() != null) { + return false; + } else { + Block block = Block.getBlockFromItem(itemstack.getItem()); + if (!this.canNotContain(block, itemstack.getMetadata())) { + return false; + } else { + tileentityflowerpot.setFlowerPotData(itemstack.getItem(), itemstack.getMetadata()); + tileentityflowerpot.markDirty(); + world.markBlockForUpdate(blockpos); + entityplayer.triggerAchievement(StatList.field_181736_T); + if (!entityplayer.capabilities.isCreativeMode && --itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + + return true; + } + } + } else { + return false; + } + } + + private boolean canNotContain(Block blockIn, int meta) { + return blockIn != Blocks.yellow_flower && blockIn != Blocks.red_flower && blockIn != Blocks.cactus + && blockIn != Blocks.brown_mushroom && blockIn != Blocks.red_mushroom && blockIn != Blocks.sapling + && blockIn != Blocks.deadbush + ? blockIn == Blocks.tallgrass && meta == BlockTallGrass.EnumType.FERN.getMeta() + : true; + } + + public Item getItem(World world, BlockPos blockpos) { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(world, blockpos); + return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null + ? tileentityflowerpot.getFlowerPotItem() + : Items.flower_pot; + } + + public int getDamageValue(World world, BlockPos blockpos) { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(world, blockpos); + return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null + ? tileentityflowerpot.getFlowerPotData() + : 0; + } + + /**+ + * Returns true only if block is flowerPot + */ + public boolean isFlowerPot() { + return true; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) && World.doesBlockHaveSolidTopSurface(world, blockpos.down()); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down())) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(world, blockpos); + if (tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null) { + spawnAsEntity(world, blockpos, + new ItemStack(tileentityflowerpot.getFlowerPotItem(), 1, tileentityflowerpot.getFlowerPotData())); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + super.onBlockHarvested(world, blockpos, iblockstate, entityplayer); + if (entityplayer.capabilities.isCreativeMode) { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(world, blockpos); + if (tileentityflowerpot != null) { + tileentityflowerpot.setFlowerPotData((Item) null, 0); + } + } + + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.flower_pot; + } + + private TileEntityFlowerPot getTileEntity(World worldIn, BlockPos pos) { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityFlowerPot ? (TileEntityFlowerPot) tileentity : null; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int i) { + Object object = null; + int j = 0; + switch (i) { + case 1: + object = Blocks.red_flower; + j = BlockFlower.EnumFlowerType.POPPY.getMeta(); + break; + case 2: + object = Blocks.yellow_flower; + break; + case 3: + object = Blocks.sapling; + j = BlockPlanks.EnumType.OAK.getMetadata(); + break; + case 4: + object = Blocks.sapling; + j = BlockPlanks.EnumType.SPRUCE.getMetadata(); + break; + case 5: + object = Blocks.sapling; + j = BlockPlanks.EnumType.BIRCH.getMetadata(); + break; + case 6: + object = Blocks.sapling; + j = BlockPlanks.EnumType.JUNGLE.getMetadata(); + break; + case 7: + object = Blocks.red_mushroom; + break; + case 8: + object = Blocks.brown_mushroom; + break; + case 9: + object = Blocks.cactus; + break; + case 10: + object = Blocks.deadbush; + break; + case 11: + object = Blocks.tallgrass; + j = BlockTallGrass.EnumType.FERN.getMeta(); + break; + case 12: + object = Blocks.sapling; + j = BlockPlanks.EnumType.ACACIA.getMetadata(); + break; + case 13: + object = Blocks.sapling; + j = BlockPlanks.EnumType.DARK_OAK.getMetadata(); + } + + return new TileEntityFlowerPot(Item.getItemFromBlock((Block) object), j); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { CONTENTS, LEGACY_DATA }); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(LEGACY_DATA)).intValue(); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + BlockFlowerPot.EnumFlowerType blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + TileEntity tileentity = iblockaccess.getTileEntity(blockpos); + if (tileentity instanceof TileEntityFlowerPot) { + TileEntityFlowerPot tileentityflowerpot = (TileEntityFlowerPot) tileentity; + Item item = tileentityflowerpot.getFlowerPotItem(); + if (item instanceof ItemBlock) { + int i = tileentityflowerpot.getFlowerPotData(); + Block block = Block.getBlockFromItem(item); + if (block == Blocks.sapling) { + switch (BlockPlanks.EnumType.byMetadata(i)) { + case OAK: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.OAK_SAPLING; + break; + case SPRUCE: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.SPRUCE_SAPLING; + break; + case BIRCH: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.BIRCH_SAPLING; + break; + case JUNGLE: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.JUNGLE_SAPLING; + break; + case ACACIA: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.ACACIA_SAPLING; + break; + case DARK_OAK: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DARK_OAK_SAPLING; + break; + default: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + } + } else if (block == Blocks.tallgrass) { + switch (i) { + case 0: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DEAD_BUSH; + break; + case 2: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.FERN; + break; + default: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + } + } else if (block == Blocks.yellow_flower) { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DANDELION; + } else if (block == Blocks.red_flower) { + switch (BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.RED, i)) { + case POPPY: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.POPPY; + break; + case BLUE_ORCHID: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.BLUE_ORCHID; + break; + case ALLIUM: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.ALLIUM; + break; + case HOUSTONIA: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.HOUSTONIA; + break; + case RED_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.RED_TULIP; + break; + case ORANGE_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.ORANGE_TULIP; + break; + case WHITE_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.WHITE_TULIP; + break; + case PINK_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.PINK_TULIP; + break; + case OXEYE_DAISY: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.OXEYE_DAISY; + break; + default: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + } + } else if (block == Blocks.red_mushroom) { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.MUSHROOM_RED; + } else if (block == Blocks.brown_mushroom) { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.MUSHROOM_BROWN; + } else if (block == Blocks.deadbush) { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DEAD_BUSH; + } else if (block == Blocks.cactus) { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.CACTUS; + } + } + } + + return iblockstate.withProperty(CONTENTS, blockflowerpot$enumflowertype); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + public static enum EnumFlowerType implements IStringSerializable { + EMPTY("empty"), POPPY("rose"), BLUE_ORCHID("blue_orchid"), ALLIUM("allium"), HOUSTONIA("houstonia"), + RED_TULIP("red_tulip"), ORANGE_TULIP("orange_tulip"), WHITE_TULIP("white_tulip"), PINK_TULIP("pink_tulip"), + OXEYE_DAISY("oxeye_daisy"), DANDELION("dandelion"), OAK_SAPLING("oak_sapling"), + SPRUCE_SAPLING("spruce_sapling"), BIRCH_SAPLING("birch_sapling"), JUNGLE_SAPLING("jungle_sapling"), + ACACIA_SAPLING("acacia_sapling"), DARK_OAK_SAPLING("dark_oak_sapling"), MUSHROOM_RED("mushroom_red"), + MUSHROOM_BROWN("mushroom_brown"), DEAD_BUSH("dead_bush"), FERN("fern"), CACTUS("cactus"); + + private final String name; + + private EnumFlowerType(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFurnace.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFurnace.java new file mode 100644 index 0000000..e21fa9e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFurnace.java @@ -0,0 +1,258 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockFurnace extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockFurnace"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + private final boolean isBurning; + private static boolean keepInventory; + + protected BlockFurnace(boolean isBurning) { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.isBurning = isBurning; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.furnace); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setDefaultFacing(world, blockpos, iblockstate); + } + + private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { + { + Block block = worldIn.getBlockState(pos.north()).getBlock(); + Block block1 = worldIn.getBlockState(pos.south()).getBlock(); + Block block2 = worldIn.getBlockState(pos.west()).getBlock(); + Block block3 = worldIn.getBlockState(pos.east()).getBlock(); + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock()) { + enumfacing = EnumFacing.SOUTH; + } else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock()) { + enumfacing = EnumFacing.NORTH; + } else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock()) { + enumfacing = EnumFacing.EAST; + } else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock()) { + enumfacing = EnumFacing.WEST; + } + + worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); + } + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + if (this.isBurning) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + double d0 = (double) blockpos.getX() + 0.5D; + double d1 = (double) blockpos.getY() + random.nextDouble() * 6.0D / 16.0D; + double d2 = (double) blockpos.getZ() + 0.5D; + double d3 = 0.52D; + double d4 = random.nextDouble() * 0.6D - 0.3D; + switch (enumfacing) { + case WEST: + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + break; + case EAST: + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + break; + case NORTH: + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); + break; + case SOUTH: + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); + } + + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityFurnace) { + entityplayer.displayGUIChest((TileEntityFurnace) tileentity); + entityplayer.triggerAchievement(StatList.field_181741_Y); + } + + return true; + } + } + + public static void setState(boolean active, World worldIn, BlockPos pos) { + IBlockState iblockstate = worldIn.getBlockState(pos); + TileEntity tileentity = worldIn.getTileEntity(pos); + keepInventory = true; + if (active) { + worldIn.setBlockState(pos, + Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + worldIn.setBlockState(pos, + Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + } else { + worldIn.setBlockState(pos, + Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + worldIn.setBlockState(pos, + Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + } + + keepInventory = false; + if (tileentity != null) { + tileentity.validate(); + worldIn.setTileEntity(pos, tileentity); + } + + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityFurnace(); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack itemstack) { + world.setBlockState(blockpos, + iblockstate.withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()), 2); + if (itemstack.hasDisplayName()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityFurnace) { + ((TileEntityFurnace) tileentity).setCustomInventoryName(itemstack.getDisplayName()); + } + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!keepInventory) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityFurnace) { + InventoryHelper.dropInventoryItems(world, blockpos, (TileEntityFurnace) tileentity); + world.updateComparatorOutputLevel(blockpos, this); + } + } + + super.breakBlock(world, blockpos, iblockstate); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return Container.calcRedstone(world.getTileEntity(blockpos)); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.furnace); + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Possibly modify the given BlockState before rendering it on + * an Entity (Minecarts, Endermen, ...) + */ + public IBlockState getStateForEntityRender(IBlockState var1) { + return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getFront(i); + if (enumfacing.getAxis() == EnumFacing.Axis.Y) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlass.java new file mode 100644 index 0000000..536ec65 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlass.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBreakable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockGlass extends BlockBreakable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockGlass"); + } + + public BlockGlass(Material materialIn, boolean ignoreSimilarity) { + super(materialIn, ignoreSimilarity); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + public boolean isFullCube() { + return false; + } + + protected boolean canSilkHarvest() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlowstone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlowstone.java new file mode 100644 index 0000000..59f15c6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlowstone.java @@ -0,0 +1,73 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockGlowstone extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockGlowstone"); + } + + public BlockGlowstone(Material materialIn) { + super(materialIn); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int i, EaglercraftRandom random) { + return MathHelper.clamp_int(this.quantityDropped(random) + random.nextInt(i + 1), 1, 4); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return 2 + random.nextInt(3); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.glowstone_dust; + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.sandColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGrass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGrass.java new file mode 100644 index 0000000..7b109b0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGrass.java @@ -0,0 +1,182 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeColorHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockGrass extends Block implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockGrass"); + } + + public static final PropertyBool SNOWY = PropertyBool.create("snowy"); + + protected BlockGrass() { + super(Material.grass); + this.setDefaultState(this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + Block block = iblockaccess.getBlockState(blockpos.up()).getBlock(); + return iblockstate.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); + } + + public int getBlockColor() { + return ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + + public int getRenderColor(IBlockState var1) { + return this.getBlockColor(); + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return BiomeColorHelper.getGrassColorAtPos(iblockaccess, blockpos); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + { + if (world.getLightFromNeighbors(blockpos.up()) < 4 + && world.getBlockState(blockpos.up()).getBlock().getLightOpacity() > 2) { + world.setBlockState(blockpos, Blocks.dirt.getDefaultState()); + } else { + if (world.getLightFromNeighbors(blockpos.up()) >= 9) { + for (int i = 0; i < 4; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, + random.nextInt(3) - 1); + Block block = world.getBlockState(blockpos1.up()).getBlock(); + IBlockState iblockstate = world.getBlockState(blockpos1); + if (iblockstate.getBlock() == Blocks.dirt + && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT + && world.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity() <= 2) { + world.setBlockState(blockpos1, Blocks.grass.getDefaultState()); + } + } + } + } + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom random, int i) { + return Blocks.dirt.getItemDropped( + Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT), random, i); + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4) { + return true; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return true; + } + + public void grow(World world, EaglercraftRandom random, BlockPos blockpos, IBlockState var4) { + BlockPos blockpos1 = blockpos.up(); + + for (int i = 0; i < 128; ++i) { + BlockPos blockpos2 = blockpos1; + int j = 0; + + while (true) { + if (j >= i / 16) { + if (world.getBlockState(blockpos2).getBlock().blockMaterial == Material.air) { + if (random.nextInt(8) == 0) { + BlockFlower.EnumFlowerType blockflower$enumflowertype = world + .getBiomeGenForCoords(blockpos2).pickRandomFlower(random, blockpos2); + BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock(); + IBlockState iblockstate = blockflower.getDefaultState() + .withProperty(blockflower.getTypeProperty(), blockflower$enumflowertype); + if (blockflower.canBlockStay(world, blockpos2, iblockstate)) { + world.setBlockState(blockpos2, iblockstate, 3); + } + } else { + IBlockState iblockstate1 = Blocks.tallgrass.getDefaultState() + .withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS); + if (Blocks.tallgrass.canBlockStay(world, blockpos2, iblockstate1)) { + world.setBlockState(blockpos2, iblockstate1, 3); + } + } + } + break; + } + + blockpos2 = blockpos2.add(random.nextInt(3) - 1, (random.nextInt(3) - 1) * random.nextInt(3) / 2, + random.nextInt(3) - 1); + if (world.getBlockState(blockpos2.down()).getBlock() != Blocks.grass + || world.getBlockState(blockpos2).getBlock().isNormalCube()) { + break; + } + + ++j; + } + } + + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState var1) { + return 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { SNOWY }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGravel.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGravel.java new file mode 100644 index 0000000..6ba7b90 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGravel.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockGravel extends BlockFalling { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockGravel"); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom random, int i) { + if (i > 3) { + i = 3; + } + + return random.nextInt(10 - i * 3) == 0 ? Items.flint : Item.getItemFromBlock(this); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.stoneColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlab.java new file mode 100644 index 0000000..5e604f3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlab.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHalfStoneSlab extends BlockStoneSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHalfStoneSlab"); + } + + public boolean isDouble() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlabNew.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlabNew.java new file mode 100644 index 0000000..d72584b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlabNew.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlabNew; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHalfStoneSlabNew extends BlockStoneSlabNew { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHalfStoneSlabNew"); + } + + public boolean isDouble() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfWoodSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfWoodSlab.java new file mode 100644 index 0000000..7483040 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfWoodSlab.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWoodSlab; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHalfWoodSlab extends BlockWoodSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHalfWoodSlab"); + } + + public boolean isDouble() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHardenedClay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHardenedClay.java new file mode 100644 index 0000000..6383d4f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHardenedClay.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHardenedClay extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHardenedClay"); + } + + public BlockHardenedClay() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.adobeColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHay.java new file mode 100644 index 0000000..85ae71e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHay.java @@ -0,0 +1,98 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRotatedPillar; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHay extends BlockRotatedPillar { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHay"); + } + + public BlockHay() { + super(Material.grass, MapColor.yellowColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.Y)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Y; + int j = i & 12; + if (j == 4) { + enumfacing$axis = EnumFacing.Axis.X; + } else if (j == 8) { + enumfacing$axis = EnumFacing.Axis.Z; + } + + return this.getDefaultState().withProperty(AXIS, enumfacing$axis); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis) iblockstate.getValue(AXIS); + if (enumfacing$axis == EnumFacing.Axis.X) { + i |= 4; + } else if (enumfacing$axis == EnumFacing.Axis.Z) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AXIS }); + } + + protected ItemStack createStackedBlock(IBlockState var1) { + return new ItemStack(Item.getItemFromBlock(this), 1, 0); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float f, float f1, float f2, + int i, EntityLivingBase entitylivingbase) { + return super.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, entitylivingbase).withProperty(AXIS, + enumfacing.getAxis()); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHopper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHopper.java new file mode 100644 index 0000000..b72d0d2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHopper.java @@ -0,0 +1,251 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHopper extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHopper"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() { + public boolean apply(EnumFacing enumfacing) { + return enumfacing != EnumFacing.UP; + } + }); + public static final PropertyBool ENABLED = PropertyBool.create("enabled"); + + public BlockHopper() { + super(Material.iron, MapColor.stoneColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.DOWN).withProperty(ENABLED, + Boolean.valueOf(true))); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + if (enumfacing1 == EnumFacing.UP) { + enumfacing1 = EnumFacing.DOWN; + } + + return this.getDefaultState().withProperty(FACING, enumfacing1).withProperty(ENABLED, Boolean.valueOf(true)); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityHopper(); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack itemstack) { + super.onBlockPlacedBy(world, blockpos, iblockstate, entitylivingbase, itemstack); + if (itemstack.hasDisplayName()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityHopper) { + ((TileEntityHopper) tileentity).setCustomName(itemstack.getDisplayName()); + } + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.updateState(world, blockpos, iblockstate); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityHopper) { + entityplayer.displayGUIChest((TileEntityHopper) tileentity); + entityplayer.triggerAchievement(StatList.field_181732_P); + } + + return true; + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.updateState(world, blockpos, iblockstate); + } + + private void updateState(World worldIn, BlockPos pos, IBlockState state) { + boolean flag = !worldIn.isBlockPowered(pos); + if (flag != ((Boolean) state.getValue(ENABLED)).booleanValue()) { + worldIn.setBlockState(pos, state.withProperty(ENABLED, Boolean.valueOf(flag)), 4); + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityHopper) { + InventoryHelper.dropInventoryItems(world, blockpos, (TileEntityHopper) tileentity); + world.updateComparatorOutputLevel(blockpos, this); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess var1, BlockPos var2, EnumFacing var3) { + return true; + } + + public static EnumFacing getFacing(int meta) { + return EnumFacing.getFront(meta & 7); + } + + /**+ + * Get's the hopper's active status from the 8-bit of the + * metadata. Note that the metadata stores whether the block is + * powered, so this returns true when that bit is 0. + */ + public static boolean isEnabled(int meta) { + return (meta & 8) != 8; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + return Container.calcRedstone(world.getTileEntity(blockpos)); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, getFacing(i)).withProperty(ENABLED, + Boolean.valueOf(isEnabled(i))); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + if (!((Boolean) iblockstate.getValue(ENABLED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, ENABLED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHugeMushroom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHugeMushroom.java new file mode 100644 index 0000000..55b61dc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHugeMushroom.java @@ -0,0 +1,164 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHugeMushroom extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockHugeMushroom"); + } + + public static PropertyEnum VARIANT; + private final Block smallBlock; + + public BlockHugeMushroom(Material parMaterial, MapColor parMapColor, Block parBlock) { + super(parMaterial, parMapColor); + this.setDefaultState( + this.blockState.getBaseState().withProperty(VARIANT, BlockHugeMushroom.EnumType.ALL_OUTSIDE)); + this.smallBlock = parBlock; + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockHugeMushroom.EnumType.class); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return Math.max(0, random.nextInt(10) - 7); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + switch ((BlockHugeMushroom.EnumType) iblockstate.getValue(VARIANT)) { + case ALL_STEM: + return MapColor.clothColor; + case ALL_INSIDE: + return MapColor.sandColor; + case STEM: + return MapColor.sandColor; + default: + return super.getMapColor(iblockstate); + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(this.smallBlock); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(this.smallBlock); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase var8) { + return this.getDefaultState(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockHugeMushroom.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockHugeMushroom.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + NORTH_WEST(1, "north_west"), NORTH(2, "north"), NORTH_EAST(3, "north_east"), WEST(4, "west"), + CENTER(5, "center"), EAST(6, "east"), SOUTH_WEST(7, "south_west"), SOUTH(8, "south"), + SOUTH_EAST(9, "south_east"), STEM(10, "stem"), ALL_INSIDE(0, "all_inside"), ALL_OUTSIDE(14, "all_outside"), + ALL_STEM(15, "all_stem"); + + private static final BlockHugeMushroom.EnumType[] META_LOOKUP = new BlockHugeMushroom.EnumType[16]; + private final int meta; + private final String name; + + private EnumType(int meta, String name) { + this.meta = meta; + this.name = name; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockHugeMushroom.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + BlockHugeMushroom.EnumType blockhugemushroom$enumtype = META_LOOKUP[meta]; + return blockhugemushroom$enumtype == null ? META_LOOKUP[0] : blockhugemushroom$enumtype; + } + + public String getName() { + return this.name; + } + + static { + for (BlockHugeMushroom.EnumType blockhugemushroom$enumtype : values()) { + META_LOOKUP[blockhugemushroom$enumtype.getMetadata()] = blockhugemushroom$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockIce.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockIce.java new file mode 100644 index 0000000..749c365 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockIce.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBreakable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockIce extends BlockBreakable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockIce"); + } + + public BlockIce() { + super(Material.ice, false); + this.slipperiness = 0.98F; + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity var5) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + entityplayer.addExhaustion(0.025F); + if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(entityplayer)) { + ItemStack itemstack = this.createStackedBlock(iblockstate); + if (itemstack != null) { + spawnAsEntity(world, blockpos, itemstack); + } + } else { + if (world.provider.doesWaterVaporize()) { + world.setBlockToAir(blockpos); + return; + } + + int i = EnchantmentHelper.getFortuneModifier(entityplayer); + this.dropBlockAsItem(world, blockpos, iblockstate, i); + Material material = world.getBlockState(blockpos.down()).getBlock().getMaterial(); + if (material.blocksMovement() || material.isLiquid()) { + world.setBlockState(blockpos, Blocks.flowing_water.getDefaultState()); + } + } + + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (world.getLightFor(EnumSkyBlock.BLOCK, blockpos) > 11 - this.getLightOpacity()) { + if (world.provider.doesWaterVaporize()) { + world.setBlockToAir(blockpos); + } else { + this.dropBlockAsItem(world, blockpos, world.getBlockState(blockpos), 0); + world.setBlockState(blockpos, Blocks.water.getDefaultState()); + } + } + } + + public int getMobilityFlag() { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockJukebox.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockJukebox.java new file mode 100644 index 0000000..f8bf038 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockJukebox.java @@ -0,0 +1,197 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockJukebox extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockJukebox"); + } + + public static final PropertyBool HAS_RECORD = PropertyBool.create("has_record"); + + protected BlockJukebox() { + super(Material.wood, MapColor.dirtColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_RECORD, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer var4, + EnumFacing var5, float var6, float var7, float var8) { + if (((Boolean) iblockstate.getValue(HAS_RECORD)).booleanValue()) { + this.dropRecord(world, blockpos, iblockstate); + iblockstate = iblockstate.withProperty(HAS_RECORD, Boolean.valueOf(false)); + world.setBlockState(blockpos, iblockstate, 2); + return true; + } else { + return false; + } + } + + public void insertRecord(World worldIn, BlockPos pos, IBlockState state, ItemStack recordStack) { + { + TileEntity tileentity = worldIn.getTileEntity(pos); + if (tileentity instanceof BlockJukebox.TileEntityJukebox) { + ((BlockJukebox.TileEntityJukebox) tileentity) + .setRecord(new ItemStack(recordStack.getItem(), 1, recordStack.getMetadata())); + worldIn.setBlockState(pos, state.withProperty(HAS_RECORD, Boolean.valueOf(true)), 2); + } + } + } + + private void dropRecord(World worldIn, BlockPos pos, IBlockState state) { + { + TileEntity tileentity = worldIn.getTileEntity(pos); + if (tileentity instanceof BlockJukebox.TileEntityJukebox) { + BlockJukebox.TileEntityJukebox blockjukebox$tileentityjukebox = (BlockJukebox.TileEntityJukebox) tileentity; + ItemStack itemstack = blockjukebox$tileentityjukebox.getRecord(); + if (itemstack != null) { + worldIn.playAuxSFX(1005, pos, 0); + worldIn.playRecord(pos, (String) null); + blockjukebox$tileentityjukebox.setRecord((ItemStack) null); + float f = 0.7F; + double d0 = (double) (worldIn.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d1 = (double) (worldIn.rand.nextFloat() * f) + (double) (1.0F - f) * 0.2D + 0.6D; + double d2 = (double) (worldIn.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + ItemStack itemstack1 = itemstack.copy(); + EntityItem entityitem = new EntityItem(worldIn, (double) pos.getX() + d0, (double) pos.getY() + d1, + (double) pos.getZ() + d2, itemstack1); + entityitem.setDefaultPickupDelay(); + worldIn.spawnEntityInWorld(entityitem); + } + } + } + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + this.dropRecord(world, blockpos, iblockstate); + super.breakBlock(world, blockpos, iblockstate); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int var5) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, 0); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new BlockJukebox.TileEntityJukebox(); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof BlockJukebox.TileEntityJukebox) { + ItemStack itemstack = ((BlockJukebox.TileEntityJukebox) tileentity).getRecord(); + if (itemstack != null) { + return Item.getIdFromItem(itemstack.getItem()) + 1 - Item.getIdFromItem(Items.record_13); + } + } + + return 0; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(HAS_RECORD, Boolean.valueOf(i > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Boolean) iblockstate.getValue(HAS_RECORD)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { HAS_RECORD }); + } + + public static class TileEntityJukebox extends TileEntity { + private ItemStack record; + + public void readFromNBT(NBTTagCompound compound) { + super.readFromNBT(compound); + if (compound.hasKey("RecordItem", 10)) { + this.setRecord(ItemStack.loadItemStackFromNBT(compound.getCompoundTag("RecordItem"))); + } else if (compound.getInteger("Record") > 0) { + this.setRecord(new ItemStack(Item.getItemById(compound.getInteger("Record")), 1, 0)); + } + + } + + public void writeToNBT(NBTTagCompound compound) { + super.writeToNBT(compound); + if (this.getRecord() != null) { + compound.setTag("RecordItem", this.getRecord().writeToNBT(new NBTTagCompound())); + } + + } + + public ItemStack getRecord() { + return this.record; + } + + public void setRecord(ItemStack recordStack) { + this.record = recordStack; + this.markDirty(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLadder.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLadder.java new file mode 100644 index 0000000..84789ca --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLadder.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockLadder extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLadder"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + protected BlockLadder() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getSelectedBoundingBox(world, blockpos); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + if (iblockstate.getBlock() == this) { + float f = 0.125F; + switch ((EnumFacing) iblockstate.getValue(FACING)) { + case NORTH: + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + break; + case SOUTH: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + break; + case WEST: + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case EAST: + default: + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + + } + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return world.getBlockState(blockpos.west()).getBlock().isNormalCube() ? true + : (world.getBlockState(blockpos.east()).getBlock().isNormalCube() ? true + : (world.getBlockState(blockpos.north()).getBlock().isNormalCube() ? true + : world.getBlockState(blockpos.south()).getBlock().isNormalCube())); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + if (enumfacing.getAxis().isHorizontal() && this.canBlockStay(world, blockpos, enumfacing)) { + return this.getDefaultState().withProperty(FACING, enumfacing); + } else { + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + if (this.canBlockStay(world, blockpos, enumfacing1)) { + return this.getDefaultState().withProperty(FACING, enumfacing1); + } + } + + return this.getDefaultState(); + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (!this.canBlockStay(world, blockpos, enumfacing)) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + } + + protected boolean canBlockStay(World worldIn, BlockPos pos, EnumFacing facing) { + return worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock().isNormalCube(); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getFront(i); + if (enumfacing.getAxis() == EnumFacing.Axis.Y) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeaves.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeaves.java new file mode 100644 index 0000000..aaa7bc0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeaves.java @@ -0,0 +1,278 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeavesBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerFoliage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeColorHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockLeaves extends BlockLeavesBase { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLeaves"); + } + + public static final PropertyBool DECAYABLE = PropertyBool.create("decayable"); + public static final PropertyBool CHECK_DECAY = PropertyBool.create("check_decay"); + int[] surroundings; + protected int iconIndex; + protected boolean isTransparent; + + public BlockLeaves() { + super(Material.leaves, false); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setHardness(0.2F); + this.setLightOpacity(1); + this.setStepSound(soundTypeGrass); + } + + public int getBlockColor() { + return ColorizerFoliage.getFoliageColor(0.5D, 1.0D); + } + + public int getRenderColor(IBlockState var1) { + return ColorizerFoliage.getFoliageColorBasic(); + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return BiomeColorHelper.getFoliageColorAtPos(iblockaccess, blockpos); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { + byte b0 = 1; + int i = b0 + 1; + int j = blockpos.getX(); + int k = blockpos.getY(); + int l = blockpos.getZ(); + if (world.isAreaLoaded(new BlockPos(j - i, k - i, l - i), new BlockPos(j + i, k + i, l + i))) { + for (int i1 = -b0; i1 <= b0; ++i1) { + for (int j1 = -b0; j1 <= b0; ++j1) { + for (int k1 = -b0; k1 <= b0; ++k1) { + BlockPos blockpos1 = blockpos.add(i1, j1, k1); + IBlockState iblockstate = world.getBlockState(blockpos1); + if (iblockstate.getBlock().getMaterial() == Material.leaves + && !((Boolean) iblockstate.getValue(CHECK_DECAY)).booleanValue()) { + world.setBlockState(blockpos1, iblockstate.withProperty(CHECK_DECAY, Boolean.valueOf(true)), + 4); + } + } + } + } + } + + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + { + if (((Boolean) iblockstate.getValue(CHECK_DECAY)).booleanValue() + && ((Boolean) iblockstate.getValue(DECAYABLE)).booleanValue()) { + byte b0 = 4; + int i = b0 + 1; + int j = blockpos.getX(); + int k = blockpos.getY(); + int l = blockpos.getZ(); + byte b1 = 32; + int i1 = b1 * b1; + int j1 = b1 / 2; + if (this.surroundings == null) { + this.surroundings = new int[b1 * b1 * b1]; + } + + if (world.isAreaLoaded(new BlockPos(j - i, k - i, l - i), new BlockPos(j + i, k + i, l + i))) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = -b0; k1 <= b0; ++k1) { + for (int l1 = -b0; l1 <= b0; ++l1) { + for (int i2 = -b0; i2 <= b0; ++i2) { + Block block = world + .getBlockState(blockpos$mutableblockpos.func_181079_c(j + k1, k + l1, l + i2)) + .getBlock(); + if (block != Blocks.log && block != Blocks.log2) { + if (block.getMaterial() == Material.leaves) { + this.surroundings[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -2; + } else { + this.surroundings[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -1; + } + } else { + this.surroundings[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = 0; + } + } + } + } + + for (int k2 = 1; k2 <= 4; ++k2) { + for (int l2 = -b0; l2 <= b0; ++l2) { + for (int i3 = -b0; i3 <= b0; ++i3) { + for (int j3 = -b0; j3 <= b0; ++j3) { + if (this.surroundings[(l2 + j1) * i1 + (i3 + j1) * b1 + j3 + j1] == k2 - 1) { + if (this.surroundings[(l2 + j1 - 1) * i1 + (i3 + j1) * b1 + j3 + j1] == -2) { + this.surroundings[(l2 + j1 - 1) * i1 + (i3 + j1) * b1 + j3 + j1] = k2; + } + + if (this.surroundings[(l2 + j1 + 1) * i1 + (i3 + j1) * b1 + j3 + j1] == -2) { + this.surroundings[(l2 + j1 + 1) * i1 + (i3 + j1) * b1 + j3 + j1] = k2; + } + + if (this.surroundings[(l2 + j1) * i1 + (i3 + j1 - 1) * b1 + j3 + j1] == -2) { + this.surroundings[(l2 + j1) * i1 + (i3 + j1 - 1) * b1 + j3 + j1] = k2; + } + + if (this.surroundings[(l2 + j1) * i1 + (i3 + j1 + 1) * b1 + j3 + j1] == -2) { + this.surroundings[(l2 + j1) * i1 + (i3 + j1 + 1) * b1 + j3 + j1] = k2; + } + + if (this.surroundings[(l2 + j1) * i1 + (i3 + j1) * b1 + (j3 + j1 - 1)] == -2) { + this.surroundings[(l2 + j1) * i1 + (i3 + j1) * b1 + (j3 + j1 - 1)] = k2; + } + + if (this.surroundings[(l2 + j1) * i1 + (i3 + j1) * b1 + j3 + j1 + 1] == -2) { + this.surroundings[(l2 + j1) * i1 + (i3 + j1) * b1 + j3 + j1 + 1] = k2; + } + } + } + } + } + } + } + + int j2 = this.surroundings[j1 * i1 + j1 * b1 + j1]; + if (j2 >= 0) { + world.setBlockState(blockpos, iblockstate.withProperty(CHECK_DECAY, Boolean.valueOf(false)), 4); + } else { + this.destroy(world, blockpos); + } + } + } + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + if (world.canLightningStrike(blockpos.up()) && !World.doesBlockHaveSolidTopSurface(world, blockpos.down()) + && random.nextInt(15) == 1) { + double d0 = (double) ((float) blockpos.getX() + random.nextFloat()); + double d1 = (double) blockpos.getY() - 0.05D; + double d2 = (double) ((float) blockpos.getZ() + random.nextFloat()); + world.spawnParticle(EnumParticleTypes.DRIP_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + } + + private void destroy(World worldIn, BlockPos pos) { + this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); + worldIn.setBlockToAir(pos); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return random.nextInt(20) == 0 ? 1 : 0; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.sapling); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float var4, int i) { + { + int j = this.getSaplingDropChance(iblockstate); + if (i > 0) { + j -= 2 << i; + if (j < 10) { + j = 10; + } + } + + if (world.rand.nextInt(j) == 0) { + Item item = this.getItemDropped(iblockstate, world.rand, i); + spawnAsEntity(world, blockpos, new ItemStack(item, 1, this.damageDropped(iblockstate))); + } + + j = 200; + if (i > 0) { + j -= 10 << i; + if (j < 40) { + j = 40; + } + } + + this.dropApple(world, blockpos, iblockstate, j); + } + } + + protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) { + } + + protected int getSaplingDropChance(IBlockState state) { + return 20; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return !this.fancyGraphics; + } + + /**+ + * Pass true to draw this block using fancy graphics, or false + * for fast graphics. + */ + public void setGraphicsLevel(boolean fancy) { + this.isTransparent = fancy; + this.fancyGraphics = fancy; + this.iconIndex = fancy ? 0 : 1; + } + + public EnumWorldBlockLayer getBlockLayer() { + return this.isTransparent ? EnumWorldBlockLayer.CUTOUT_MIPPED : EnumWorldBlockLayer.SOLID; + } + + public boolean isVisuallyOpaque() { + return false; + } + + public abstract BlockPlanks.EnumType getWoodType(int var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeavesBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeavesBase.java new file mode 100644 index 0000000..72b209e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeavesBase.java @@ -0,0 +1,56 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockLeavesBase extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLeavesBase"); + } + + protected boolean fancyGraphics; + + protected BlockLeavesBase(Material materialIn, boolean fancyGraphics) { + super(materialIn); + this.fancyGraphics = fancyGraphics; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return !this.fancyGraphics && iblockaccess.getBlockState(blockpos).getBlock() == this ? false + : super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLever.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLever.java new file mode 100644 index 0000000..413c163 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLever.java @@ -0,0 +1,345 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockButton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockLever extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLever"); + } + + public static PropertyEnum FACING; + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + protected BlockLever() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, BlockLever.EnumOrientation.NORTH) + .withProperty(POWERED, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public static void bootstrapStates() { + FACING = PropertyEnum.create("facing", BlockLever.EnumOrientation.class); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing) { + return func_181090_a(world, blockpos, enumfacing.getOpposite()); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + for (EnumFacing enumfacing : EnumFacing.values()) { + if (func_181090_a(world, blockpos, enumfacing)) { + return true; + } + } + + return false; + } + + protected static boolean func_181090_a(World parWorld, BlockPos parBlockPos, EnumFacing parEnumFacing) { + return BlockButton.func_181088_a(parWorld, parBlockPos, parEnumFacing); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase entitylivingbase) { + IBlockState iblockstate = this.getDefaultState().withProperty(POWERED, Boolean.valueOf(false)); + if (func_181090_a(world, blockpos, enumfacing.getOpposite())) { + return iblockstate.withProperty(FACING, + BlockLever.EnumOrientation.forFacings(enumfacing, entitylivingbase.getHorizontalFacing())); + } else { + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + if (enumfacing1 != enumfacing && func_181090_a(world, blockpos, enumfacing1.getOpposite())) { + return iblockstate.withProperty(FACING, + BlockLever.EnumOrientation.forFacings(enumfacing1, entitylivingbase.getHorizontalFacing())); + } + } + + if (World.doesBlockHaveSolidTopSurface(world, blockpos.down())) { + return iblockstate.withProperty(FACING, + BlockLever.EnumOrientation.forFacings(EnumFacing.UP, entitylivingbase.getHorizontalFacing())); + } else { + return iblockstate; + } + } + } + + public static int getMetadataForFacing(EnumFacing facing) { + switch (facing) { + case DOWN: + return 0; + case UP: + return 5; + case NORTH: + return 4; + case SOUTH: + return 3; + case WEST: + return 2; + case EAST: + return 1; + default: + return -1; + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (this.func_181091_e(world, blockpos, iblockstate) && !func_181090_a(world, blockpos, + ((BlockLever.EnumOrientation) iblockstate.getValue(FACING)).getFacing().getOpposite())) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + } + + private boolean func_181091_e(World parWorld, BlockPos parBlockPos, IBlockState parIBlockState) { + if (this.canPlaceBlockAt(parWorld, parBlockPos)) { + return true; + } else { + this.dropBlockAsItem(parWorld, parBlockPos, parIBlockState, 0); + parWorld.setBlockToAir(parBlockPos); + return false; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + float f = 0.1875F; + switch ((BlockLever.EnumOrientation) iblockaccess.getBlockState(blockpos).getValue(FACING)) { + case EAST: + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + break; + case WEST: + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + break; + case SOUTH: + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + break; + case NORTH: + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + break; + case UP_Z: + case UP_X: + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + break; + case DOWN_X: + case DOWN_Z: + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.4F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + } + + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer var4, + EnumFacing var5, float var6, float var7, float var8) { + { + iblockstate = iblockstate.cycleProperty(POWERED); + world.setBlockState(blockpos, iblockstate, 3); + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "random.click", 0.3F, + ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 0.6F : 0.5F); + world.notifyNeighborsOfStateChange(blockpos, this); + EnumFacing enumfacing = ((BlockLever.EnumOrientation) iblockstate.getValue(FACING)).getFacing(); + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing.getOpposite()), this); + return true; + } + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + world.notifyNeighborsOfStateChange(blockpos, this); + EnumFacing enumfacing = ((BlockLever.EnumOrientation) iblockstate.getValue(FACING)).getFacing(); + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing.getOpposite()), this); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing var4) { + return ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing enumfacing) { + return !((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 0 + : (((BlockLever.EnumOrientation) iblockstate.getValue(FACING)).getFacing() == enumfacing ? 15 : 0); + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, BlockLever.EnumOrientation.byMetadata(i & 7)) + .withProperty(POWERED, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockLever.EnumOrientation) iblockstate.getValue(FACING)).getMetadata(); + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, POWERED }); + } + + public static enum EnumOrientation implements IStringSerializable { + DOWN_X(0, "down_x", EnumFacing.DOWN), EAST(1, "east", EnumFacing.EAST), WEST(2, "west", EnumFacing.WEST), + SOUTH(3, "south", EnumFacing.SOUTH), NORTH(4, "north", EnumFacing.NORTH), UP_Z(5, "up_z", EnumFacing.UP), + UP_X(6, "up_x", EnumFacing.UP), DOWN_Z(7, "down_z", EnumFacing.DOWN); + + private static final BlockLever.EnumOrientation[] META_LOOKUP = new BlockLever.EnumOrientation[values().length]; + private final int meta; + private final String name; + private final EnumFacing facing; + + private EnumOrientation(int meta, String name, EnumFacing facing) { + this.meta = meta; + this.name = name; + this.facing = facing; + } + + public int getMetadata() { + return this.meta; + } + + public EnumFacing getFacing() { + return this.facing; + } + + public String toString() { + return this.name; + } + + public static BlockLever.EnumOrientation byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public static BlockLever.EnumOrientation forFacings(EnumFacing clickedSide, EnumFacing entityFacing) { + switch (clickedSide) { + case DOWN: + switch (entityFacing.getAxis()) { + case X: + return DOWN_X; + case Z: + return DOWN_Z; + default: + throw new IllegalArgumentException( + "Invalid entityFacing " + entityFacing + " for facing " + clickedSide); + } + case UP: + switch (entityFacing.getAxis()) { + case X: + return UP_X; + case Z: + return UP_Z; + default: + throw new IllegalArgumentException( + "Invalid entityFacing " + entityFacing + " for facing " + clickedSide); + } + case NORTH: + return NORTH; + case SOUTH: + return SOUTH; + case WEST: + return WEST; + case EAST: + return EAST; + default: + throw new IllegalArgumentException("Invalid facing: " + clickedSide); + } + } + + public String getName() { + return this.name; + } + + static { + for (BlockLever.EnumOrientation blocklever$enumorientation : values()) { + META_LOOKUP[blocklever$enumorientation.getMetadata()] = blocklever$enumorientation; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLilyPad.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLilyPad.java new file mode 100644 index 0000000..cd6b51e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLilyPad.java @@ -0,0 +1,106 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockLilyPad extends BlockBush { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLilyPad"); + } + + protected BlockLilyPad() { + float f = 0.5F; + float f1 = 0.015625F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + if (entity == null || !(entity instanceof EntityBoat)) { + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState var3) { + return new AxisAlignedBB((double) blockpos.getX() + this.minX, (double) blockpos.getY() + this.minY, + (double) blockpos.getZ() + this.minZ, (double) blockpos.getX() + this.maxX, + (double) blockpos.getY() + this.maxY, (double) blockpos.getZ() + this.maxZ); + } + + public int getBlockColor() { + return 7455580; + } + + public int getRenderColor(IBlockState var1) { + return 7455580; + } + + public int colorMultiplier(IBlockAccess var1, BlockPos var2, int var3) { + return 2129968; + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block block) { + return block == Blocks.water; + } + + public boolean canBlockStay(World world, BlockPos blockpos, IBlockState var3) { + if (blockpos.getY() >= 0 && blockpos.getY() < 256) { + IBlockState iblockstate = world.getBlockState(blockpos.down()); + return iblockstate.getBlock().getMaterial() == Material.water + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0; + } else { + return false; + } + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState var1) { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLiquid.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLiquid.java new file mode 100644 index 0000000..ff7f6c8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLiquid.java @@ -0,0 +1,382 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDynamicLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStaticLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeColorHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockLiquid extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLiquid"); + } + + public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 15); + + protected BlockLiquid(Material materialIn) { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(LEVEL, Integer.valueOf(0))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setTickRandomly(true); + } + + public boolean isPassable(IBlockAccess var1, BlockPos var2) { + return this.blockMaterial != Material.lava; + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return this.blockMaterial == Material.water ? BiomeColorHelper.getWaterColorAtPos(iblockaccess, blockpos) + : 16777215; + } + + /**+ + * Returns the percentage of the liquid block that is air, based + * on the given flow decay of the liquid + */ + public static float getLiquidHeightPercent(int meta) { + if (meta >= 8) { + meta = 0; + } + + return (float) (meta + 1) / 9.0F; + } + + protected int getLevel(IBlockAccess worldIn, BlockPos pos) { + return worldIn.getBlockState(pos).getBlock().getMaterial() == this.blockMaterial + ? ((Integer) worldIn.getBlockState(pos).getValue(LEVEL)).intValue() + : -1; + } + + protected int getEffectiveFlowDecay(IBlockAccess worldIn, BlockPos pos) { + int i = this.getLevel(worldIn, pos); + return i >= 8 ? 0 : i; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean canCollideCheck(IBlockState iblockstate, boolean flag) { + return flag && ((Integer) iblockstate.getValue(LEVEL)).intValue() == 0; + } + + /**+ + * Whether this Block is solid on the given Side + */ + public boolean isBlockSolid(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + Material material = iblockaccess.getBlockState(blockpos).getBlock().getMaterial(); + return material == this.blockMaterial ? false + : (enumfacing == EnumFacing.UP ? true + : (material == Material.ice ? false : super.isBlockSolid(iblockaccess, blockpos, enumfacing))); + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return iblockaccess.getBlockState(blockpos).getBlock().getMaterial() == this.blockMaterial ? false + : (enumfacing == EnumFacing.UP ? true : super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing)); + } + + public boolean func_176364_g(IBlockAccess blockAccess, BlockPos pos) { + for (int i = -1; i <= 1; ++i) { + for (int j = -1; j <= 1; ++j) { + IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j)); + Block block = iblockstate.getBlock(); + Material material = block.getMaterial(); + if (material != this.blockMaterial && !block.isFullBlock()) { + return true; + } + } + } + + return false; + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 1; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + protected Vec3 getFlowVector(IBlockAccess worldIn, BlockPos pos) { + Vec3 vec3 = new Vec3(0.0D, 0.0D, 0.0D); + int i = this.getEffectiveFlowDecay(worldIn, pos); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos = pos.offset(enumfacing); + int j = this.getEffectiveFlowDecay(worldIn, blockpos); + if (j < 0) { + if (!worldIn.getBlockState(blockpos).getBlock().getMaterial().blocksMovement()) { + j = this.getEffectiveFlowDecay(worldIn, blockpos.down()); + if (j >= 0) { + int k = j - (i - 8); + vec3 = vec3.addVector((double) ((blockpos.getX() - pos.getX()) * k), + (double) ((blockpos.getY() - pos.getY()) * k), + (double) ((blockpos.getZ() - pos.getZ()) * k)); + } + } + } else if (j >= 0) { + int l = j - i; + vec3 = vec3.addVector((double) ((blockpos.getX() - pos.getX()) * l), + (double) ((blockpos.getY() - pos.getY()) * l), (double) ((blockpos.getZ() - pos.getZ()) * l)); + } + } + + if (((Integer) worldIn.getBlockState(pos).getValue(LEVEL)).intValue() >= 8) { + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos1 = pos.offset(enumfacing1); + if (this.isBlockSolid(worldIn, blockpos1, enumfacing1) + || this.isBlockSolid(worldIn, blockpos1.up(), enumfacing1)) { + vec3 = vec3.normalize().addVector(0.0D, -6.0D, 0.0D); + break; + } + } + } + + return vec3.normalize(); + } + + public Vec3 modifyAcceleration(World world, BlockPos blockpos, Entity var3, Vec3 vec3) { + return vec3.add(this.getFlowVector(world, blockpos)); + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World world) { + return this.blockMaterial == Material.water ? 5 + : (this.blockMaterial == Material.lava ? (world.provider.getHasNoSky() ? 10 : 30) : 0); + } + + public int getMixedBrightnessForBlock(IBlockAccess iblockaccess, BlockPos blockpos) { + int i = iblockaccess.getCombinedLight(blockpos, 0); + int j = iblockaccess.getCombinedLight(blockpos.up(), 0); + int k = i & 255; + int l = j & 255; + int i1 = i >> 16 & 255; + int j1 = j >> 16 & 255; + return (k > l ? k : l) | (i1 > j1 ? i1 : j1) << 16; + } + + public EnumWorldBlockLayer getBlockLayer() { + return this.blockMaterial == Material.water ? EnumWorldBlockLayer.TRANSLUCENT : EnumWorldBlockLayer.SOLID; + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + double d0 = (double) blockpos.getX(); + double d1 = (double) blockpos.getY(); + double d2 = (double) blockpos.getZ(); + if (this.blockMaterial == Material.water) { + int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); + if (i > 0 && i < 8) { + if (random.nextInt(64) == 0) { + world.playSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, "liquid.water", random.nextFloat() * 0.25F + 0.75F, + random.nextFloat() * 1.0F + 0.5F, false); + } + } else if (random.nextInt(10) == 0) { + world.spawnParticle(EnumParticleTypes.SUSPENDED, d0 + (double) random.nextFloat(), + d1 + (double) random.nextFloat(), d2 + (double) random.nextFloat(), 0.0D, 0.0D, 0.0D, + new int[0]); + } + } + + if (this.blockMaterial == Material.lava + && world.getBlockState(blockpos.up()).getBlock().getMaterial() == Material.air + && !world.getBlockState(blockpos.up()).getBlock().isOpaqueCube()) { + if (random.nextInt(100) == 0) { + double d8 = d0 + (double) random.nextFloat(); + double d4 = d1 + this.maxY; + double d6 = d2 + (double) random.nextFloat(); + world.spawnParticle(EnumParticleTypes.LAVA, d8, d4, d6, 0.0D, 0.0D, 0.0D, new int[0]); + world.playSound(d8, d4, d6, "liquid.lavapop", 0.2F + random.nextFloat() * 0.2F, + 0.9F + random.nextFloat() * 0.15F, false); + } + + if (random.nextInt(200) == 0) { + world.playSound(d0, d1, d2, "liquid.lava", 0.2F + random.nextFloat() * 0.2F, + 0.9F + random.nextFloat() * 0.15F, false); + } + } + + if (random.nextInt(10) == 0 && World.doesBlockHaveSolidTopSurface(world, blockpos.down())) { + Material material = world.getBlockState(blockpos.down(2)).getBlock().getMaterial(); + if (!material.blocksMovement() && !material.isLiquid()) { + double d3 = d0 + (double) random.nextFloat(); + double d5 = d1 - 1.05D; + double d7 = d2 + (double) random.nextFloat(); + if (this.blockMaterial == Material.water) { + world.spawnParticle(EnumParticleTypes.DRIP_WATER, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]); + } else { + world.spawnParticle(EnumParticleTypes.DRIP_LAVA, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + } + + public static double getFlowDirection(IBlockAccess worldIn, BlockPos pos, Material materialIn) { + Vec3 vec3 = getFlowingBlock(materialIn).getFlowVector(worldIn, pos); + return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D + : MathHelper.func_181159_b(vec3.zCoord, vec3.xCoord) - 1.5707963267948966D; + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.checkForMixing(world, blockpos, iblockstate); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.checkForMixing(world, blockpos, iblockstate); + } + + public boolean checkForMixing(World worldIn, BlockPos pos, IBlockState state) { + if (this.blockMaterial == Material.lava) { + boolean flag = false; + + for (EnumFacing enumfacing : EnumFacing.values()) { + if (enumfacing != EnumFacing.DOWN + && worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial() == Material.water) { + flag = true; + break; + } + } + + if (flag) { + Integer integer = (Integer) state.getValue(LEVEL); + if (integer.intValue() == 0) { + worldIn.setBlockState(pos, Blocks.obsidian.getDefaultState()); + this.triggerMixEffects(worldIn, pos); + return true; + } + + if (integer.intValue() <= 4) { + worldIn.setBlockState(pos, Blocks.cobblestone.getDefaultState()); + this.triggerMixEffects(worldIn, pos); + return true; + } + } + } + + return false; + } + + protected void triggerMixEffects(World worldIn, BlockPos pos) { + double d0 = (double) pos.getX(); + double d1 = (double) pos.getY(); + double d2 = (double) pos.getZ(); + worldIn.playSoundEffect(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, "random.fizz", 0.5F, + 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + + for (int i = 0; i < 8; ++i) { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d0 + Math.random(), d1 + 1.2D, d2 + Math.random(), + 0.0D, 0.0D, 0.0D, new int[0]); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(LEVEL)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { LEVEL }); + } + + public static BlockDynamicLiquid getFlowingBlock(Material materialIn) { + if (materialIn == Material.water) { + return Blocks.flowing_water; + } else if (materialIn == Material.lava) { + return Blocks.flowing_lava; + } else { + throw new IllegalArgumentException("Invalid material"); + } + } + + public static BlockStaticLiquid getStaticBlock(Material materialIn) { + if (materialIn == Material.water) { + return Blocks.water; + } else if (materialIn == Material.lava) { + return Blocks.lava; + } else { + throw new IllegalArgumentException("Invalid material"); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLog.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLog.java new file mode 100644 index 0000000..2d0fda3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLog.java @@ -0,0 +1,112 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRotatedPillar; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockLog extends BlockRotatedPillar { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockLog"); + } + + public static PropertyEnum LOG_AXIS; + + public BlockLog() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + this.setHardness(2.0F); + this.setStepSound(soundTypeWood); + } + + public static void bootstrapStates() { + LOG_AXIS = PropertyEnum.create("axis", BlockLog.EnumAxis.class); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { + byte b0 = 4; + int i = b0 + 1; + if (world.isAreaLoaded(blockpos.add(-i, -i, -i), blockpos.add(i, i, i))) { + for (BlockPos blockpos1 : BlockPos.getAllInBox(blockpos.add(-b0, -b0, -b0), blockpos.add(b0, b0, b0))) { + IBlockState iblockstate = world.getBlockState(blockpos1); + if (iblockstate.getBlock().getMaterial() == Material.leaves + && !((Boolean) iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue()) { + world.setBlockState(blockpos1, + iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4); + } + } + + } + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float f, float f1, float f2, + int i, EntityLivingBase entitylivingbase) { + return super.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, entitylivingbase).withProperty(LOG_AXIS, + BlockLog.EnumAxis.fromFacingAxis(enumfacing.getAxis())); + } + + public static enum EnumAxis implements IStringSerializable { + X("x"), Y("y"), Z("z"), NONE("none"); + + private final String name; + + private EnumAxis(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public static BlockLog.EnumAxis fromFacingAxis(EnumFacing.Axis axis) { + switch (axis) { + case X: + return X; + case Y: + return Y; + case Z: + return Z; + default: + return NONE; + } + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMelon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMelon.java new file mode 100644 index 0000000..4c68f03 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMelon.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockMelon extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockMelon"); + } + + protected BlockMelon() { + super(Material.gourd, MapColor.limeColor); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.melon; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return 3 + random.nextInt(5); + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int i, EaglercraftRandom random) { + return Math.min(9, this.quantityDropped(random) + random.nextInt(1 + i)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMobSpawner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMobSpawner.java new file mode 100644 index 0000000..5dde644 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMobSpawner.java @@ -0,0 +1,100 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockMobSpawner extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockMobSpawner"); + } + + protected BlockMobSpawner() { + super(Material.rock); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityMobSpawner(); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); + int j = 15 + world.rand.nextInt(15) + world.rand.nextInt(15); + this.dropXpOnBlockBreak(world, blockpos, j); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + public Item getItem(World var1, BlockPos var2) { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMushroom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMushroom.java new file mode 100644 index 0000000..17a5c4e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMushroom.java @@ -0,0 +1,135 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenBigMushroom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockMushroom extends BlockBush implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockMushroom"); + } + + protected BlockMushroom() { + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setTickRandomly(true); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + if (random.nextInt(25) == 0) { + int i = 5; + boolean flag = true; + + for (BlockPos blockpos1 : BlockPos.getAllInBoxMutable(blockpos.add(-4, -1, -4), blockpos.add(4, 1, 4))) { + if (world.getBlockState(blockpos1).getBlock() == this) { + --i; + if (i <= 0) { + return; + } + } + } + + BlockPos blockpos2 = blockpos.add(random.nextInt(3) - 1, random.nextInt(2) - random.nextInt(2), + random.nextInt(3) - 1); + + for (int j = 0; j < 4; ++j) { + if (world.isAirBlock(blockpos2) && this.canBlockStay(world, blockpos2, this.getDefaultState())) { + blockpos = blockpos2; + } + + blockpos2 = blockpos.add(random.nextInt(3) - 1, random.nextInt(2) - random.nextInt(2), + random.nextInt(3) - 1); + } + + if (world.isAirBlock(blockpos2) && this.canBlockStay(world, blockpos2, this.getDefaultState())) { + world.setBlockState(blockpos2, this.getDefaultState(), 2); + } + } + + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return super.canPlaceBlockAt(world, blockpos) && this.canBlockStay(world, blockpos, this.getDefaultState()); + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block block) { + return block.isFullBlock(); + } + + public boolean canBlockStay(World world, BlockPos blockpos, IBlockState var3) { + if (blockpos.getY() >= 0 && blockpos.getY() < 256) { + IBlockState iblockstate = world.getBlockState(blockpos.down()); + return iblockstate.getBlock() == Blocks.mycelium ? true + : (iblockstate.getBlock() == Blocks.dirt + && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true + : world.getLight(blockpos) < 13 && this.canPlaceBlockOn(iblockstate.getBlock())); + } else { + return false; + } + } + + public boolean generateBigMushroom(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { + worldIn.setBlockToAir(pos); + WorldGenBigMushroom worldgenbigmushroom = null; + if (this == Blocks.brown_mushroom) { + worldgenbigmushroom = new WorldGenBigMushroom(Blocks.brown_mushroom_block); + } else if (this == Blocks.red_mushroom) { + worldgenbigmushroom = new WorldGenBigMushroom(Blocks.red_mushroom_block); + } + + if (worldgenbigmushroom != null && worldgenbigmushroom.generate(worldIn, rand, pos)) { + return true; + } else { + worldIn.setBlockState(pos, state, 3); + return false; + } + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4) { + return true; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom random, BlockPos var3, IBlockState var4) { + return (double) random.nextFloat() < 0.4D; + } + + public void grow(World world, EaglercraftRandom random, BlockPos blockpos, IBlockState iblockstate) { + this.generateBigMushroom(world, blockpos, iblockstate, random); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMycelium.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMycelium.java new file mode 100644 index 0000000..b8fdcbe --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMycelium.java @@ -0,0 +1,119 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockMycelium extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockMycelium"); + } + + public static final PropertyBool SNOWY = PropertyBool.create("snowy"); + + protected BlockMycelium() { + super(Material.grass, MapColor.purpleColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + Block block = iblockaccess.getBlockState(blockpos.up()).getBlock(); + return iblockstate.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + { + if (world.getLightFromNeighbors(blockpos.up()) < 4 + && world.getBlockState(blockpos.up()).getBlock().getLightOpacity() > 2) { + world.setBlockState(blockpos, + Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); + } else { + if (world.getLightFromNeighbors(blockpos.up()) >= 9) { + for (int i = 0; i < 4; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, + random.nextInt(3) - 1); + IBlockState iblockstate = world.getBlockState(blockpos1); + Block block = world.getBlockState(blockpos1.up()).getBlock(); + if (iblockstate.getBlock() == Blocks.dirt + && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT + && world.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity() <= 2) { + world.setBlockState(blockpos1, this.getDefaultState()); + } + } + } + } + } + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + super.randomDisplayTick(world, blockpos, iblockstate, random); + if (random.nextInt(10) == 0) { + world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double) ((float) blockpos.getX() + random.nextFloat()), + (double) ((float) blockpos.getY() + 1.1F), (double) ((float) blockpos.getZ() + random.nextFloat()), + 0.0D, 0.0D, 0.0D, new int[0]); + } + + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom random, int i) { + return Blocks.dirt.getItemDropped( + Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT), random, i); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState var1) { + return 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { SNOWY }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherBrick.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherBrick.java new file mode 100644 index 0000000..e843305 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherBrick.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockNetherBrick extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockNetherBrick"); + } + + public BlockNetherBrick() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.netherrackColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherWart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherWart.java new file mode 100644 index 0000000..6339ecb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherWart.java @@ -0,0 +1,134 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockNetherWart extends BlockBush { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockNetherWart"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 3); + + protected BlockNetherWart() { + super(Material.plants, MapColor.redColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs) null); + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block block) { + return block == Blocks.soul_sand; + } + + public boolean canBlockStay(World world, BlockPos blockpos, IBlockState var3) { + return this.canPlaceBlockOn(world.getBlockState(blockpos.down()).getBlock()); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (i < 3 && random.nextInt(10) == 0) { + iblockstate = iblockstate.withProperty(AGE, Integer.valueOf(i + 1)); + world.setBlockState(blockpos, iblockstate, 2); + } + + super.updateTick(world, blockpos, iblockstate, random); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float var4, int i) { + { + int j = 1; + if (((Integer) iblockstate.getValue(AGE)).intValue() >= 3) { + j = 2 + world.rand.nextInt(3); + if (i > 0) { + j += world.rand.nextInt(i + 1); + } + } + + for (int k = 0; k < j; ++k) { + spawnAsEntity(world, blockpos, new ItemStack(Items.nether_wart)); + } + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.nether_wart; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AGE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherrack.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherrack.java new file mode 100644 index 0000000..59729a8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherrack.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockNetherrack extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockNetherrack"); + } + + public BlockNetherrack() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.netherrackColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLeaf.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLeaf.java new file mode 100644 index 0000000..36234ef --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLeaf.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockNewLeaf extends BlockLeaves { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockNewLeaf"); + } + + public static PropertyEnum VARIANT; + + public BlockNewLeaf() { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.ACACIA) + .withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() { + public boolean apply(BlockPlanks.EnumType blockplanks$enumtype) { + return blockplanks$enumtype.getMetadata() >= 4; + } + }); + } + + protected void dropApple(World world, BlockPos blockpos, IBlockState iblockstate, int i) { + if (iblockstate.getValue(VARIANT) == BlockPlanks.EnumType.DARK_OAK && world.rand.nextInt(i) == 0) { + spawnAsEntity(world, blockpos, new ItemStack(Items.apple, 1, 0)); + } + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + public int getDamageValue(World world, BlockPos blockpos) { + IBlockState iblockstate = world.getBlockState(blockpos); + return iblockstate.getBlock().getMetaFromState(iblockstate) & 3; + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, 0)); + list.add(new ItemStack(item, 1, 1)); + } + + protected ItemStack createStackedBlock(IBlockState iblockstate) { + return new ItemStack(Item.getItemFromBlock(this), 1, + ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata() - 4); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, this.getWoodType(i)) + .withProperty(DECAYABLE, Boolean.valueOf((i & 4) == 0)) + .withProperty(CHECK_DECAY, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata() - 4; + if (!((Boolean) iblockstate.getValue(DECAYABLE)).booleanValue()) { + i |= 4; + } + + if (((Boolean) iblockstate.getValue(CHECK_DECAY)).booleanValue()) { + i |= 8; + } + + return i; + } + + public BlockPlanks.EnumType getWoodType(int i) { + return BlockPlanks.EnumType.byMetadata((i & 3) + 4); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT, CHECK_DECAY, DECAYABLE }); + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(world, blockpos, new ItemStack(Item.getItemFromBlock(this), 1, + ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata() - 4)); + } else { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLog.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLog.java new file mode 100644 index 0000000..cba0505 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLog.java @@ -0,0 +1,151 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockNewLog extends BlockLog { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockNewLog"); + } + + public static PropertyEnum VARIANT; + + public BlockNewLog() { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.ACACIA) + .withProperty(LOG_AXIS, BlockLog.EnumAxis.Y)); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() { + public boolean apply(BlockPlanks.EnumType blockplanks$enumtype) { + return blockplanks$enumtype.getMetadata() >= 4; + } + }); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType) iblockstate.getValue(VARIANT); + switch ((BlockLog.EnumAxis) iblockstate.getValue(LOG_AXIS)) { + case X: + case Z: + case NONE: + default: + switch (blockplanks$enumtype) { + case ACACIA: + default: + return MapColor.stoneColor; + case DARK_OAK: + return BlockPlanks.EnumType.DARK_OAK.func_181070_c(); + } + case Y: + return blockplanks$enumtype.func_181070_c(); + } + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4)); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, + BlockPlanks.EnumType.byMetadata((i & 3) + 4)); + switch (i & 12) { + case 0: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y); + break; + case 4: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X); + break; + case 8: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z); + break; + default: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata() - 4; + switch ((BlockLog.EnumAxis) iblockstate.getValue(LOG_AXIS)) { + case X: + i |= 4; + break; + case Z: + i |= 8; + break; + case NONE: + i |= 12; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT, LOG_AXIS }); + } + + protected ItemStack createStackedBlock(IBlockState iblockstate) { + return new ItemStack(Item.getItemFromBlock(this), 1, + ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata() - 4); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata() - 4; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNote.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNote.java new file mode 100644 index 0000000..8b40671 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNote.java @@ -0,0 +1,135 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityNote; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockNote extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockNote"); + } + + private static final List INSTRUMENTS = Lists + .newArrayList(new String[] { "harp", "bd", "snare", "hat", "bassattack" }); + + public BlockNote() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + boolean flag = world.isBlockPowered(blockpos); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityNote) { + TileEntityNote tileentitynote = (TileEntityNote) tileentity; + if (tileentitynote.previousRedstoneState != flag) { + if (flag) { + tileentitynote.triggerNote(world, blockpos); + } + + tileentitynote.previousRedstoneState = flag; + } + } + + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityNote) { + TileEntityNote tileentitynote = (TileEntityNote) tileentity; + tileentitynote.changePitch(); + tileentitynote.triggerNote(world, blockpos); + entityplayer.triggerAchievement(StatList.field_181735_S); + } + + return true; + } + } + + public void onBlockClicked(World world, BlockPos blockpos, EntityPlayer entityplayer) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityNote) { + ((TileEntityNote) tileentity).triggerNote(world, blockpos); + entityplayer.triggerAchievement(StatList.field_181734_R); + } + } + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityNote(); + } + + private String getInstrument(int id) { + if (id < 0 || id >= INSTRUMENTS.size()) { + id = 0; + } + + return (String) INSTRUMENTS.get(id); + } + + /**+ + * Called on both Client and Server when World#addBlockEvent is + * called + */ + public boolean onBlockEventReceived(World world, BlockPos blockpos, IBlockState var3, int i, int j) { + float f = (float) Math.pow(2.0D, (double) (j - 12) / 12.0D); + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "note." + this.getInstrument(i), 3.0F, f); + world.spawnParticle(EnumParticleTypes.NOTE, (double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 1.2D, + (double) blockpos.getZ() + 0.5D, (double) j / 24.0D, 0.0D, 0.0D, new int[0]); + return true; + } + + /**+ + * The type of render function called. 3 for standard block + * models, 2 for TESR's, 1 for liquids, -1 is no render + */ + public int getRenderType() { + return 3; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockObsidian.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockObsidian.java new file mode 100644 index 0000000..a734615 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockObsidian.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockObsidian extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockObsidian"); + } + + public BlockObsidian() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.obsidian); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.blackColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLeaf.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLeaf.java new file mode 100644 index 0000000..2f7a3d1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLeaf.java @@ -0,0 +1,177 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerFoliage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockOldLeaf extends BlockLeaves { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockOldLeaf"); + } + + public static PropertyEnum VARIANT; + + public BlockOldLeaf() { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK) + .withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() { + public boolean apply(BlockPlanks.EnumType blockplanks$enumtype) { + return blockplanks$enumtype.getMetadata() < 4; + } + }); + } + + public int getRenderColor(IBlockState iblockstate) { + if (iblockstate.getBlock() != this) { + return super.getRenderColor(iblockstate); + } else { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType) iblockstate.getValue(VARIANT); + return blockplanks$enumtype == BlockPlanks.EnumType.SPRUCE ? ColorizerFoliage.getFoliageColorPine() + : (blockplanks$enumtype == BlockPlanks.EnumType.BIRCH ? ColorizerFoliage.getFoliageColorBirch() + : super.getRenderColor(iblockstate)); + } + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int i) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + if (iblockstate.getBlock() == this) { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType) iblockstate.getValue(VARIANT); + if (blockplanks$enumtype == BlockPlanks.EnumType.SPRUCE) { + return ColorizerFoliage.getFoliageColorPine(); + } + + if (blockplanks$enumtype == BlockPlanks.EnumType.BIRCH) { + return ColorizerFoliage.getFoliageColorBirch(); + } + } + + return super.colorMultiplier(iblockaccess, blockpos, i); + } + + protected void dropApple(World world, BlockPos blockpos, IBlockState iblockstate, int i) { + if (iblockstate.getValue(VARIANT) == BlockPlanks.EnumType.OAK && world.rand.nextInt(i) == 0) { + spawnAsEntity(world, blockpos, new ItemStack(Items.apple, 1, 0)); + } + + } + + protected int getSaplingDropChance(IBlockState iblockstate) { + return iblockstate.getValue(VARIANT) == BlockPlanks.EnumType.JUNGLE ? 40 + : super.getSaplingDropChance(iblockstate); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.OAK.getMetadata())); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.BIRCH.getMetadata())); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())); + } + + protected ItemStack createStackedBlock(IBlockState iblockstate) { + return new ItemStack(Item.getItemFromBlock(this), 1, + ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata()); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, this.getWoodType(i)) + .withProperty(DECAYABLE, Boolean.valueOf((i & 4) == 0)) + .withProperty(CHECK_DECAY, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + if (!((Boolean) iblockstate.getValue(DECAYABLE)).booleanValue()) { + i |= 4; + } + + if (((Boolean) iblockstate.getValue(CHECK_DECAY)).booleanValue()) { + i |= 8; + } + + return i; + } + + public BlockPlanks.EnumType getWoodType(int i) { + return BlockPlanks.EnumType.byMetadata((i & 3) % 4); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT, CHECK_DECAY, DECAYABLE }); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(world, blockpos, new ItemStack(Item.getItemFromBlock(this), 1, + ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata())); + } else { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLog.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLog.java new file mode 100644 index 0000000..862c1bf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLog.java @@ -0,0 +1,157 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockOldLog extends BlockLog { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockOldLog"); + } + + public static PropertyEnum VARIANT; + + public BlockOldLog() { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK) + .withProperty(LOG_AXIS, BlockLog.EnumAxis.Y)); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() { + public boolean apply(BlockPlanks.EnumType blockplanks$enumtype) { + return blockplanks$enumtype.getMetadata() < 4; + } + }); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType) iblockstate.getValue(VARIANT); + switch ((BlockLog.EnumAxis) iblockstate.getValue(LOG_AXIS)) { + case X: + case Z: + case NONE: + default: + switch (blockplanks$enumtype) { + case OAK: + default: + return BlockPlanks.EnumType.SPRUCE.func_181070_c(); + case SPRUCE: + return BlockPlanks.EnumType.DARK_OAK.func_181070_c(); + case BIRCH: + return MapColor.quartzColor; + case JUNGLE: + return BlockPlanks.EnumType.SPRUCE.func_181070_c(); + } + case Y: + return blockplanks$enumtype.func_181070_c(); + } + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.OAK.getMetadata())); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.BIRCH.getMetadata())); + list.add(new ItemStack(item, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, + BlockPlanks.EnumType.byMetadata((i & 3) % 4)); + switch (i & 12) { + case 0: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y); + break; + case 4: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X); + break; + case 8: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z); + break; + default: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + switch ((BlockLog.EnumAxis) iblockstate.getValue(LOG_AXIS)) { + case X: + i |= 4; + break; + case Z: + i |= 8; + break; + case NONE: + i |= 12; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT, LOG_AXIS }); + } + + protected ItemStack createStackedBlock(IBlockState iblockstate) { + return new ItemStack(Item.getItemFromBlock(this), 1, + ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata()); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOre.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOre.java new file mode 100644 index 0000000..80f231f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOre.java @@ -0,0 +1,126 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockOre extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockOre"); + } + + public BlockOre() { + this(Material.rock.getMaterialMapColor()); + } + + public BlockOre(MapColor parMapColor) { + super(Material.rock, parMapColor); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return this == Blocks.coal_ore ? Items.coal + : (this == Blocks.diamond_ore ? Items.diamond + : (this == Blocks.lapis_ore ? Items.dye + : (this == Blocks.emerald_ore ? Items.emerald + : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this))))); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return this == Blocks.lapis_ore ? 4 + random.nextInt(5) : 1; + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int i, EaglercraftRandom random) { + if (i > 0 && Item.getItemFromBlock(this) != this + .getItemDropped((IBlockState) this.getBlockState().getValidStates().iterator().next(), random, i)) { + int j = random.nextInt(i + 2) - 1; + if (j < 0) { + j = 0; + } + + return this.quantityDropped(random) * (j + 1); + } else { + return this.quantityDropped(random); + } + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); + if (this.getItemDropped(iblockstate, world.rand, i) != Item.getItemFromBlock(this)) { + int j = 0; + if (this == Blocks.coal_ore) { + j = MathHelper.getRandomIntegerInRange(world.rand, 0, 2); + } else if (this == Blocks.diamond_ore) { + j = MathHelper.getRandomIntegerInRange(world.rand, 3, 7); + } else if (this == Blocks.emerald_ore) { + j = MathHelper.getRandomIntegerInRange(world.rand, 3, 7); + } else if (this == Blocks.lapis_ore) { + j = MathHelper.getRandomIntegerInRange(world.rand, 2, 5); + } else if (this == Blocks.quartz_ore) { + j = MathHelper.getRandomIntegerInRange(world.rand, 2, 5); + } + + this.dropXpOnBlockBreak(world, blockpos, j); + } + + } + + public int getDamageValue(World var1, BlockPos var2) { + return 0; + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState var1) { + return this == Blocks.lapis_ore ? EnumDyeColor.BLUE.getDyeDamage() : 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPackedIce.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPackedIce.java new file mode 100644 index 0000000..1ad7f55 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPackedIce.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPackedIce extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPackedIce"); + } + + public BlockPackedIce() { + super(Material.packedIce); + this.slipperiness = 0.98F; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPane.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPane.java new file mode 100644 index 0000000..2c06ba2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPane.java @@ -0,0 +1,211 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPane extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPane"); + } + + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + private final boolean canDrop; + + protected BlockPane(Material materialIn, boolean canDrop) { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, Boolean.valueOf(false)) + .withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)) + .withProperty(WEST, Boolean.valueOf(false))); + this.canDrop = canDrop; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate + .withProperty(NORTH, + Boolean.valueOf( + this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.north()).getBlock()))) + .withProperty(SOUTH, + Boolean.valueOf( + this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.south()).getBlock()))) + .withProperty(WEST, + Boolean.valueOf( + this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.west()).getBlock()))) + .withProperty(EAST, Boolean + .valueOf(this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.east()).getBlock()))); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom random, int i) { + return !this.canDrop ? null : super.getItemDropped(iblockstate, random, i); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return iblockaccess.getBlockState(blockpos).getBlock() == this ? false + : super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + boolean flag = this.canPaneConnectToBlock(world.getBlockState(blockpos.north()).getBlock()); + boolean flag1 = this.canPaneConnectToBlock(world.getBlockState(blockpos.south()).getBlock()); + boolean flag2 = this.canPaneConnectToBlock(world.getBlockState(blockpos.west()).getBlock()); + boolean flag3 = this.canPaneConnectToBlock(world.getBlockState(blockpos.east()).getBlock()); + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { + if (flag2) { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } else if (flag3) { + this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) { + if (flag) { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } else if (flag1) { + this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + } else { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + float f = 0.4375F; + float f1 = 0.5625F; + float f2 = 0.4375F; + float f3 = 0.5625F; + boolean flag = this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.north()).getBlock()); + boolean flag1 = this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.south()).getBlock()); + boolean flag2 = this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.west()).getBlock()); + boolean flag3 = this.canPaneConnectToBlock(iblockaccess.getBlockState(blockpos.east()).getBlock()); + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { + if (flag2) { + f = 0.0F; + } else if (flag3) { + f1 = 1.0F; + } + } else { + f = 0.0F; + f1 = 1.0F; + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) { + if (flag) { + f2 = 0.0F; + } else if (flag1) { + f3 = 1.0F; + } + } else { + f2 = 0.0F; + f3 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + public final boolean canPaneConnectToBlock(Block blockIn) { + return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass + || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane; + } + + protected boolean canSilkHarvest() { + return true; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState var1) { + return 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { NORTH, EAST, WEST, SOUTH }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonBase.java new file mode 100644 index 0000000..e0168a7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonBase.java @@ -0,0 +1,445 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonExtension; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonMoving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.ITileEntityProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockPistonStructureHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityPiston; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPistonBase extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPistonBase"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool EXTENDED = PropertyBool.create("extended"); + private final boolean isSticky; + + public BlockPistonBase(boolean isSticky) { + super(Material.piston); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(EXTENDED, Boolean.valueOf(false))); + this.isSticky = isSticky; + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, + EntityLivingBase entitylivingbase, ItemStack var5) { + world.setBlockState(blockpos, + iblockstate.withProperty(FACING, getFacingFromEntity(world, blockpos, entitylivingbase)), 2); + this.checkForMove(world, blockpos, iblockstate); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.checkForMove(world, blockpos, iblockstate); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + if (world.getTileEntity(blockpos) == null) { + this.checkForMove(world, blockpos, iblockstate); + } + + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing var3, float var4, float var5, + float var6, int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, blockpos, entitylivingbase)) + .withProperty(EXTENDED, Boolean.valueOf(false)); + } + + private void checkForMove(World worldIn, BlockPos pos, IBlockState state) { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + boolean flag = this.shouldBeExtended(worldIn, pos, enumfacing); + if (flag && !((Boolean) state.getValue(EXTENDED)).booleanValue()) { + if ((new BlockPistonStructureHelper(worldIn, pos, enumfacing, true)).canMove()) { + worldIn.addBlockEvent(pos, this, 0, enumfacing.getIndex()); + } + } else if (!flag && ((Boolean) state.getValue(EXTENDED)).booleanValue()) { + worldIn.setBlockState(pos, state.withProperty(EXTENDED, Boolean.valueOf(false)), 2); + worldIn.addBlockEvent(pos, this, 1, enumfacing.getIndex()); + } + + } + + private boolean shouldBeExtended(World worldIn, BlockPos pos, EnumFacing facing) { + for (EnumFacing enumfacing : EnumFacing.values()) { + if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) { + return true; + } + } + + if (worldIn.isSidePowered(pos, EnumFacing.DOWN)) { + return true; + } else { + BlockPos blockpos = pos.up(); + + for (EnumFacing enumfacing1 : EnumFacing.values()) { + if (enumfacing1 != EnumFacing.DOWN + && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1)) { + return true; + } + } + + return false; + } + } + + /**+ + * Called on both Client and Server when World#addBlockEvent is + * called + */ + public boolean onBlockEventReceived(World world, BlockPos blockpos, IBlockState iblockstate, int i, int j) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + { + boolean flag = this.shouldBeExtended(world, blockpos, enumfacing); + if (flag && i == 1) { + world.setBlockState(blockpos, iblockstate.withProperty(EXTENDED, Boolean.valueOf(true)), 2); + return false; + } + + if (!flag && i == 0) { + return false; + } + } + + if (i == 0) { + if (!this.doMove(world, blockpos, enumfacing, true)) { + return false; + } + + world.setBlockState(blockpos, iblockstate.withProperty(EXTENDED, Boolean.valueOf(true)), 2); + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "tile.piston.out", 0.5F, world.rand.nextFloat() * 0.25F + 0.6F); + } else if (i == 1) { + TileEntity tileentity1 = world.getTileEntity(blockpos.offset(enumfacing)); + if (tileentity1 instanceof TileEntityPiston) { + ((TileEntityPiston) tileentity1).clearPistonTileEntity(); + } + + world.setBlockState(blockpos, + Blocks.piston_extension.getDefaultState().withProperty(BlockPistonMoving.FACING, enumfacing) + .withProperty(BlockPistonMoving.TYPE, + this.isSticky ? BlockPistonExtension.EnumPistonType.STICKY + : BlockPistonExtension.EnumPistonType.DEFAULT), + 3); + world.setTileEntity(blockpos, + BlockPistonMoving.newTileEntity(this.getStateFromMeta(j), enumfacing, false, true)); + if (this.isSticky) { + BlockPos blockpos1 = blockpos.add(enumfacing.getFrontOffsetX() * 2, enumfacing.getFrontOffsetY() * 2, + enumfacing.getFrontOffsetZ() * 2); + Block block = world.getBlockState(blockpos1).getBlock(); + boolean flag1 = false; + if (block == Blocks.piston_extension) { + TileEntity tileentity = world.getTileEntity(blockpos1); + if (tileentity instanceof TileEntityPiston) { + TileEntityPiston tileentitypiston = (TileEntityPiston) tileentity; + if (tileentitypiston.getFacing() == enumfacing && tileentitypiston.isExtending()) { + tileentitypiston.clearPistonTileEntity(); + flag1 = true; + } + } + } + + if (!flag1 && block.getMaterial() != Material.air + && canPush(block, world, blockpos1, enumfacing.getOpposite(), false) + && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) { + this.doMove(world, blockpos, enumfacing, false); + } + } else { + world.setBlockToAir(blockpos.offset(enumfacing)); + } + + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "tile.piston.in", 0.5F, world.rand.nextFloat() * 0.15F + 0.6F); + } + + return true; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + if (iblockstate.getBlock() == this && ((Boolean) iblockstate.getValue(EXTENDED)).booleanValue()) { + float f = 0.25F; + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (enumfacing != null) { + switch (enumfacing) { + case DOWN: + this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case UP: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + break; + case NORTH: + this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); + break; + case SOUTH: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F); + break; + case WEST: + this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case EAST: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F); + } + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + public boolean isFullCube() { + return false; + } + + public static EnumFacing getFacing(int meta) { + int i = meta & 7; + return i > 5 ? null : EnumFacing.getFront(i); + } + + public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) { + if (MathHelper.abs((float) entityIn.posX - (float) clickedBlock.getX()) < 2.0F + && MathHelper.abs((float) entityIn.posZ - (float) clickedBlock.getZ()) < 2.0F) { + double d0 = entityIn.posY + (double) entityIn.getEyeHeight(); + if (d0 - (double) clickedBlock.getY() > 2.0D) { + return EnumFacing.UP; + } + + if ((double) clickedBlock.getY() - d0 > 0.0D) { + return EnumFacing.DOWN; + } + } + + return entityIn.getHorizontalFacing().getOpposite(); + } + + public static boolean canPush(Block blockIn, World worldIn, BlockPos pos, EnumFacing direction, + boolean allowDestroy) { + if (blockIn == Blocks.obsidian) { + return false; + } else if (!worldIn.getWorldBorder().contains(pos)) { + return false; + } else if (pos.getY() >= 0 && (direction != EnumFacing.DOWN || pos.getY() != 0)) { + if (pos.getY() <= worldIn.getHeight() - 1 + && (direction != EnumFacing.UP || pos.getY() != worldIn.getHeight() - 1)) { + if (blockIn != Blocks.piston && blockIn != Blocks.sticky_piston) { + if (blockIn.getBlockHardness(worldIn, pos) == -1.0F) { + return false; + } + + if (blockIn.getMobilityFlag() == 2) { + return false; + } + + if (blockIn.getMobilityFlag() == 1) { + if (!allowDestroy) { + return false; + } + + return true; + } + } else if (((Boolean) worldIn.getBlockState(pos).getValue(EXTENDED)).booleanValue()) { + return false; + } + + return !(blockIn instanceof ITileEntityProvider); + } else { + return false; + } + } else { + return false; + } + } + + private boolean doMove(World worldIn, BlockPos pos, EnumFacing direction, boolean extending) { + if (!extending) { + worldIn.setBlockToAir(pos.offset(direction)); + } + + BlockPistonStructureHelper blockpistonstructurehelper = new BlockPistonStructureHelper(worldIn, pos, direction, + extending); + List list = blockpistonstructurehelper.getBlocksToMove(); + List list1 = blockpistonstructurehelper.getBlocksToDestroy(); + if (!blockpistonstructurehelper.canMove()) { + return false; + } else { + int i = list.size() + list1.size(); + Block[] ablock = new Block[i]; + EnumFacing enumfacing = extending ? direction : direction.getOpposite(); + + for (int j = list1.size() - 1; j >= 0; --j) { + BlockPos blockpos = (BlockPos) list1.get(j); + Block block = worldIn.getBlockState(blockpos).getBlock(); + block.dropBlockAsItem(worldIn, blockpos, worldIn.getBlockState(blockpos), 0); + worldIn.setBlockToAir(blockpos); + --i; + ablock[i] = block; + } + + for (int k = list.size() - 1; k >= 0; --k) { + BlockPos blockpos2 = (BlockPos) list.get(k); + IBlockState iblockstate = worldIn.getBlockState(blockpos2); + Block block1 = iblockstate.getBlock(); + block1.getMetaFromState(iblockstate); + worldIn.setBlockToAir(blockpos2); + blockpos2 = blockpos2.offset(enumfacing); + worldIn.setBlockState(blockpos2, + Blocks.piston_extension.getDefaultState().withProperty(FACING, direction), 4); + worldIn.setTileEntity(blockpos2, + BlockPistonMoving.newTileEntity(iblockstate, direction, extending, false)); + --i; + ablock[i] = block1; + } + + BlockPos blockpos1 = pos.offset(direction); + if (extending) { + BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = this.isSticky + ? BlockPistonExtension.EnumPistonType.STICKY + : BlockPistonExtension.EnumPistonType.DEFAULT; + IBlockState iblockstate1 = Blocks.piston_head.getDefaultState() + .withProperty(BlockPistonExtension.FACING, direction) + .withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype); + IBlockState iblockstate2 = Blocks.piston_extension.getDefaultState() + .withProperty(BlockPistonMoving.FACING, direction) + .withProperty(BlockPistonMoving.TYPE, this.isSticky ? BlockPistonExtension.EnumPistonType.STICKY + : BlockPistonExtension.EnumPistonType.DEFAULT); + worldIn.setBlockState(blockpos1, iblockstate2, 4); + worldIn.setTileEntity(blockpos1, BlockPistonMoving.newTileEntity(iblockstate1, direction, true, false)); + } + + for (int l = list1.size() - 1; l >= 0; --l) { + worldIn.notifyNeighborsOfStateChange((BlockPos) list1.get(l), ablock[i++]); + } + + for (int i1 = list.size() - 1; i1 >= 0; --i1) { + worldIn.notifyNeighborsOfStateChange((BlockPos) list.get(i1), ablock[i++]); + } + + if (extending) { + worldIn.notifyNeighborsOfStateChange(blockpos1, Blocks.piston_head); + worldIn.notifyNeighborsOfStateChange(pos, this); + } + + return true; + } + } + + /**+ + * Possibly modify the given BlockState before rendering it on + * an Entity (Minecarts, Endermen, ...) + */ + public IBlockState getStateForEntityRender(IBlockState var1) { + return this.getDefaultState().withProperty(FACING, EnumFacing.UP); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, getFacing(i)).withProperty(EXTENDED, + Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + if (((Boolean) iblockstate.getValue(EXTENDED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, EXTENDED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonExtension.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonExtension.java new file mode 100644 index 0000000..b0ecaad --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonExtension.java @@ -0,0 +1,273 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPistonExtension extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPistonExtension"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static PropertyEnum TYPE; + public static final PropertyBool SHORT = PropertyBool.create("short"); + + public BlockPistonExtension() { + super(Material.piston); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(TYPE, BlockPistonExtension.EnumPistonType.DEFAULT) + .withProperty(SHORT, Boolean.valueOf(false))); + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + } + + public static void bootstrapStates() { + TYPE = PropertyEnum.create("type", + BlockPistonExtension.EnumPistonType.class); + } + + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + if (entityplayer.capabilities.isCreativeMode) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (enumfacing != null) { + BlockPos blockpos1 = blockpos.offset(enumfacing.getOpposite()); + Block block = world.getBlockState(blockpos1).getBlock(); + if (block == Blocks.piston || block == Blocks.sticky_piston) { + world.setBlockToAir(blockpos1); + } + } + } + + super.onBlockHarvested(world, blockpos, iblockstate, entityplayer); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + super.breakBlock(world, blockpos, iblockstate); + EnumFacing enumfacing = ((EnumFacing) iblockstate.getValue(FACING)).getOpposite(); + blockpos = blockpos.offset(enumfacing); + IBlockState iblockstate1 = world.getBlockState(blockpos); + if ((iblockstate1.getBlock() == Blocks.piston || iblockstate1.getBlock() == Blocks.sticky_piston) + && ((Boolean) iblockstate1.getValue(BlockPistonBase.EXTENDED)).booleanValue()) { + iblockstate1.getBlock().dropBlockAsItem(world, blockpos, iblockstate1, 0); + world.setBlockToAir(blockpos); + } + + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean canPlaceBlockAt(World var1, BlockPos var2) { + return false; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World var1, BlockPos var2, EnumFacing var3) { + return false; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.applyHeadBounds(iblockstate); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.applyCoreBounds(iblockstate); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + private void applyCoreBounds(IBlockState state) { + float f = 0.25F; + float f1 = 0.375F; + float f2 = 0.625F; + float f3 = 0.25F; + float f4 = 0.75F; + switch ((EnumFacing) state.getValue(FACING)) { + case DOWN: + this.setBlockBounds(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F); + break; + case UP: + this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F); + break; + case NORTH: + this.setBlockBounds(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F); + break; + case SOUTH: + this.setBlockBounds(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F); + break; + case WEST: + this.setBlockBounds(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F); + break; + case EAST: + this.setBlockBounds(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F); + } + + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + this.applyHeadBounds(iblockaccess.getBlockState(blockpos)); + } + + public void applyHeadBounds(IBlockState state) { + float f = 0.25F; + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + if (enumfacing != null) { + switch (enumfacing) { + case DOWN: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); + break; + case UP: + this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case NORTH: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); + break; + case SOUTH: + this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); + break; + case WEST: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); + break; + case EAST: + this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + BlockPos blockpos1 = blockpos.offset(enumfacing.getOpposite()); + IBlockState iblockstate1 = world.getBlockState(blockpos1); + if (iblockstate1.getBlock() != Blocks.piston && iblockstate1.getBlock() != Blocks.sticky_piston) { + world.setBlockToAir(blockpos); + } else { + iblockstate1.getBlock().onNeighborBlockChange(world, blockpos1, iblockstate1, block); + } + + } + + public boolean shouldSideBeRendered(IBlockAccess var1, BlockPos var2, EnumFacing var3) { + return true; + } + + public static EnumFacing getFacing(int meta) { + int i = meta & 7; + return i > 5 ? null : EnumFacing.getFront(i); + } + + public Item getItem(World world, BlockPos blockpos) { + return world.getBlockState(blockpos).getValue(TYPE) == BlockPistonExtension.EnumPistonType.STICKY + ? Item.getItemFromBlock(Blocks.sticky_piston) + : Item.getItemFromBlock(Blocks.piston); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, getFacing(i)).withProperty(TYPE, + (i & 8) > 0 ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + if (iblockstate.getValue(TYPE) == BlockPistonExtension.EnumPistonType.STICKY) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, TYPE, SHORT }); + } + + public static enum EnumPistonType implements IStringSerializable { + DEFAULT("normal"), STICKY("sticky"); + + private final String VARIANT; + + private EnumPistonType(String name) { + this.VARIANT = name; + } + + public String toString() { + return this.VARIANT; + } + + public String getName() { + return this.VARIANT; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonMoving.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonMoving.java new file mode 100644 index 0000000..5530fcf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonMoving.java @@ -0,0 +1,290 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonExtension; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityPiston; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPistonMoving extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPistonMoving"); + } + + public static final PropertyDirection FACING = BlockPistonExtension.FACING; + public static PropertyEnum TYPE; + + public BlockPistonMoving() { + super(Material.piston); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(TYPE, + BlockPistonExtension.EnumPistonType.DEFAULT)); + this.setHardness(-1.0F); + } + + public static void bootstrapStates() { + TYPE = BlockPistonExtension.TYPE; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return null; + } + + public static TileEntity newTileEntity(IBlockState state, EnumFacing facing, boolean extending, + boolean renderHead) { + return new TileEntityPiston(state, facing, extending, renderHead); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityPiston) { + ((TileEntityPiston) tileentity).clearPistonTileEntity(); + } else { + super.breakBlock(world, blockpos, iblockstate); + } + + } + + public boolean canPlaceBlockAt(World var1, BlockPos var2) { + return false; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World var1, BlockPos var2, EnumFacing var3) { + return false; + } + + /**+ + * Called when a player destroys this Block + */ + public void onBlockDestroyedByPlayer(World world, BlockPos blockpos, IBlockState iblockstate) { + BlockPos blockpos1 = blockpos.offset(((EnumFacing) iblockstate.getValue(FACING)).getOpposite()); + IBlockState iblockstate1 = world.getBlockState(blockpos1); + if (iblockstate1.getBlock() instanceof BlockPistonBase + && ((Boolean) iblockstate1.getValue(BlockPistonBase.EXTENDED)).booleanValue()) { + world.setBlockToAir(blockpos1); + } + + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer var4, + EnumFacing var5, float var6, float var7, float var8) { + if (world.getTileEntity(blockpos) == null) { + world.setBlockToAir(blockpos); + return true; + } else { + return false; + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState var3, float var4, int var5) { + { + TileEntityPiston tileentitypiston = this.getTileEntity(world, blockpos); + if (tileentitypiston != null) { + IBlockState iblockstate = tileentitypiston.getPistonState(); + iblockstate.getBlock().dropBlockAsItem(world, blockpos, iblockstate, 0); + } + } + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World var1, BlockPos var2, Vec3 var3, Vec3 var4) { + return null; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + world.getTileEntity(blockpos); + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState var3) { + TileEntityPiston tileentitypiston = this.getTileEntity(world, blockpos); + if (tileentitypiston == null) { + return null; + } else { + float f = tileentitypiston.getProgress(0.0F); + if (tileentitypiston.isExtending()) { + f = 1.0F - f; + } + + return this.getBoundingBox(world, blockpos, tileentitypiston.getPistonState(), f, + tileentitypiston.getFacing()); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + TileEntityPiston tileentitypiston = this.getTileEntity(iblockaccess, blockpos); + if (tileentitypiston != null) { + IBlockState iblockstate = tileentitypiston.getPistonState(); + Block block = iblockstate.getBlock(); + if (block == this || block.getMaterial() == Material.air) { + return; + } + + float f = tileentitypiston.getProgress(0.0F); + if (tileentitypiston.isExtending()) { + f = 1.0F - f; + } + + block.setBlockBoundsBasedOnState(iblockaccess, blockpos); + if (block == Blocks.piston || block == Blocks.sticky_piston) { + f = 0.0F; + } + + EnumFacing enumfacing = tileentitypiston.getFacing(); + this.minX = block.getBlockBoundsMinX() - (double) ((float) enumfacing.getFrontOffsetX() * f); + this.minY = block.getBlockBoundsMinY() - (double) ((float) enumfacing.getFrontOffsetY() * f); + this.minZ = block.getBlockBoundsMinZ() - (double) ((float) enumfacing.getFrontOffsetZ() * f); + this.maxX = block.getBlockBoundsMaxX() - (double) ((float) enumfacing.getFrontOffsetX() * f); + this.maxY = block.getBlockBoundsMaxY() - (double) ((float) enumfacing.getFrontOffsetY() * f); + this.maxZ = block.getBlockBoundsMaxZ() - (double) ((float) enumfacing.getFrontOffsetZ() * f); + } + + } + + public AxisAlignedBB getBoundingBox(World worldIn, BlockPos pos, IBlockState extendingBlock, float progress, + EnumFacing direction) { + if (extendingBlock.getBlock() != this && extendingBlock.getBlock().getMaterial() != Material.air) { + AxisAlignedBB axisalignedbb = extendingBlock.getBlock().getCollisionBoundingBox(worldIn, pos, + extendingBlock); + if (axisalignedbb == null) { + return null; + } else { + double d0 = axisalignedbb.minX; + double d1 = axisalignedbb.minY; + double d2 = axisalignedbb.minZ; + double d3 = axisalignedbb.maxX; + double d4 = axisalignedbb.maxY; + double d5 = axisalignedbb.maxZ; + if (direction.getFrontOffsetX() < 0) { + d0 -= (double) ((float) direction.getFrontOffsetX() * progress); + } else { + d3 -= (double) ((float) direction.getFrontOffsetX() * progress); + } + + if (direction.getFrontOffsetY() < 0) { + d1 -= (double) ((float) direction.getFrontOffsetY() * progress); + } else { + d4 -= (double) ((float) direction.getFrontOffsetY() * progress); + } + + if (direction.getFrontOffsetZ() < 0) { + d2 -= (double) ((float) direction.getFrontOffsetZ() * progress); + } else { + d5 -= (double) ((float) direction.getFrontOffsetZ() * progress); + } + + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + } else { + return null; + } + } + + private TileEntityPiston getTileEntity(IBlockAccess worldIn, BlockPos pos) { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityPiston ? (TileEntityPiston) tileentity : null; + } + + public Item getItem(World var1, BlockPos var2) { + return null; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, BlockPistonExtension.getFacing(i)).withProperty(TYPE, + (i & 8) > 0 ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + if (iblockstate.getValue(TYPE) == BlockPistonExtension.EnumPistonType.STICKY) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, TYPE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPlanks.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPlanks.java new file mode 100644 index 0000000..e4222f3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPlanks.java @@ -0,0 +1,159 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPlanks extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPlanks"); + } + + public static PropertyEnum VARIANT; + + public BlockPlanks() { + super(Material.wood); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) { + list.add(new ItemStack(item, 1, blockplanks$enumtype.getMetadata())); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata(i)); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).func_181070_c(); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + OAK(0, "oak", MapColor.woodColor), SPRUCE(1, "spruce", MapColor.obsidianColor), + BIRCH(2, "birch", MapColor.sandColor), JUNGLE(3, "jungle", MapColor.dirtColor), + ACACIA(4, "acacia", MapColor.adobeColor), DARK_OAK(5, "dark_oak", "big_oak", MapColor.brownColor); + + private static final BlockPlanks.EnumType[] META_LOOKUP = new BlockPlanks.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + private final MapColor field_181071_k; + + private EnumType(int parInt2, String parString2, MapColor parMapColor) { + this(parInt2, parString2, parString2, parMapColor); + } + + private EnumType(int parInt2, String parString2, String parString3, MapColor parMapColor) { + this.meta = parInt2; + this.name = parString2; + this.unlocalizedName = parString3; + this.field_181071_k = parMapColor; + } + + public int getMetadata() { + return this.meta; + } + + public MapColor func_181070_c() { + return this.field_181071_k; + } + + public String toString() { + return this.name; + } + + public static BlockPlanks.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockPlanks.EnumType blockplanks$enumtype : values()) { + META_LOOKUP[blockplanks$enumtype.getMetadata()] = blockplanks$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPortal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPortal.java new file mode 100644 index 0000000..d034946 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPortal.java @@ -0,0 +1,439 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.cache.EaglerLoadingCache; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBreakable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockWorldState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMonsterPlacer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPortal extends BlockBreakable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPortal"); + } + + public static final PropertyEnum AXIS = PropertyEnum.create("axis", EnumFacing.Axis.class, + new EnumFacing.Axis[] { EnumFacing.Axis.X, EnumFacing.Axis.Z }); + + public BlockPortal() { + super(Material.portal, false); + this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.X)); + this.setTickRandomly(true); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + super.updateTick(world, blockpos, iblockstate, random); + if (world.provider.isSurfaceWorld() && world.getGameRules().getBoolean("doMobSpawning") + && random.nextInt(2000) < world.getDifficulty().getDifficultyId()) { + int i = blockpos.getY(); + + BlockPos blockpos1; + for (blockpos1 = blockpos; !World.doesBlockHaveSolidTopSurface(world, blockpos1) + && blockpos1.getY() > 0; blockpos1 = blockpos1.down()) { + ; + } + + if (i > 0 && !world.getBlockState(blockpos1.up()).getBlock().isNormalCube()) { + Entity entity = ItemMonsterPlacer.spawnCreature(world, 57, (double) blockpos1.getX() + 0.5D, + (double) blockpos1.getY() + 1.1D, (double) blockpos1.getZ() + 0.5D); + if (entity != null) { + entity.timeUntilPortal = entity.getPortalCooldown(); + } + } + } + + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis) iblockaccess.getBlockState(blockpos).getValue(AXIS); + float f = 0.125F; + float f1 = 0.125F; + if (enumfacing$axis == EnumFacing.Axis.X) { + f = 0.5F; + } + + if (enumfacing$axis == EnumFacing.Axis.Z) { + f1 = 0.5F; + } + + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); + } + + public static int getMetaForAxis(EnumFacing.Axis axis) { + return axis == EnumFacing.Axis.X ? 1 : (axis == EnumFacing.Axis.Z ? 2 : 0); + } + + public boolean isFullCube() { + return false; + } + + public boolean func_176548_d(World worldIn, BlockPos parBlockPos) { + BlockPortal.Size blockportal$size = new BlockPortal.Size(worldIn, parBlockPos, EnumFacing.Axis.X); + if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0) { + blockportal$size.func_150859_c(); + return true; + } else { + BlockPortal.Size blockportal$size1 = new BlockPortal.Size(worldIn, parBlockPos, EnumFacing.Axis.Z); + if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0) { + blockportal$size1.func_150859_c(); + return true; + } else { + return false; + } + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis) iblockstate.getValue(AXIS); + if (enumfacing$axis == EnumFacing.Axis.X) { + BlockPortal.Size blockportal$size = new BlockPortal.Size(world, blockpos, EnumFacing.Axis.X); + if (!blockportal$size.func_150860_b() || blockportal$size.field_150864_e < blockportal$size.field_150868_h + * blockportal$size.field_150862_g) { + world.setBlockState(blockpos, Blocks.air.getDefaultState()); + } + } else if (enumfacing$axis == EnumFacing.Axis.Z) { + BlockPortal.Size blockportal$size1 = new BlockPortal.Size(world, blockpos, EnumFacing.Axis.Z); + if (!blockportal$size1.func_150860_b() + || blockportal$size1.field_150864_e < blockportal$size1.field_150868_h + * blockportal$size1.field_150862_g) { + world.setBlockState(blockpos, Blocks.air.getDefaultState()); + } + } + + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + EnumFacing.Axis enumfacing$axis = null; + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + if (iblockaccess.getBlockState(blockpos).getBlock() == this) { + enumfacing$axis = (EnumFacing.Axis) iblockstate.getValue(AXIS); + if (enumfacing$axis == null) { + return false; + } + + if (enumfacing$axis == EnumFacing.Axis.Z && enumfacing != EnumFacing.EAST + && enumfacing != EnumFacing.WEST) { + return false; + } + + if (enumfacing$axis == EnumFacing.Axis.X && enumfacing != EnumFacing.SOUTH + && enumfacing != EnumFacing.NORTH) { + return false; + } + } + + boolean flag = iblockaccess.getBlockState(blockpos.west()).getBlock() == this + && iblockaccess.getBlockState(blockpos.west(2)).getBlock() != this; + boolean flag1 = iblockaccess.getBlockState(blockpos.east()).getBlock() == this + && iblockaccess.getBlockState(blockpos.east(2)).getBlock() != this; + boolean flag2 = iblockaccess.getBlockState(blockpos.north()).getBlock() == this + && iblockaccess.getBlockState(blockpos.north(2)).getBlock() != this; + boolean flag3 = iblockaccess.getBlockState(blockpos.south()).getBlock() == this + && iblockaccess.getBlockState(blockpos.south(2)).getBlock() != this; + boolean flag4 = flag || flag1 || enumfacing$axis == EnumFacing.Axis.X; + boolean flag5 = flag2 || flag3 || enumfacing$axis == EnumFacing.Axis.Z; + return flag4 && enumfacing == EnumFacing.WEST ? true + : (flag4 && enumfacing == EnumFacing.EAST ? true + : (flag5 && enumfacing == EnumFacing.NORTH ? true : flag5 && enumfacing == EnumFacing.SOUTH)); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World var1, BlockPos blockpos, IBlockState var3, Entity entity) { + if (entity.ridingEntity == null && entity.riddenByEntity == null) { + entity.func_181015_d(blockpos); + } + + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + if (random.nextInt(100) == 0) { + world.playSound((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "portal.portal", 0.5F, random.nextFloat() * 0.4F + 0.8F, false); + } + + for (int i = 0; i < 4; ++i) { + double d0 = (double) ((float) blockpos.getX() + random.nextFloat()); + double d1 = (double) ((float) blockpos.getY() + random.nextFloat()); + double d2 = (double) ((float) blockpos.getZ() + random.nextFloat()); + double d3 = ((double) random.nextFloat() - 0.5D) * 0.5D; + double d4 = ((double) random.nextFloat() - 0.5D) * 0.5D; + double d5 = ((double) random.nextFloat() - 0.5D) * 0.5D; + int j = random.nextInt(2) * 2 - 1; + if (world.getBlockState(blockpos.west()).getBlock() != this + && world.getBlockState(blockpos.east()).getBlock() != this) { + d0 = (double) blockpos.getX() + 0.5D + 0.25D * (double) j; + d3 = (double) (random.nextFloat() * 2.0F * (float) j); + } else { + d2 = (double) blockpos.getZ() + 0.5D + 0.25D * (double) j; + d5 = (double) (random.nextFloat() * 2.0F * (float) j); + } + + world.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + } + + public Item getItem(World var1, BlockPos var2) { + return null; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AXIS, (i & 3) == 2 ? EnumFacing.Axis.Z : EnumFacing.Axis.X); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return getMetaForAxis((EnumFacing.Axis) iblockstate.getValue(AXIS)); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AXIS }); + } + + public BlockPattern.PatternHelper func_181089_f(World parWorld, BlockPos parBlockPos) { + EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Z; + BlockPortal.Size blockportal$size = new BlockPortal.Size(parWorld, parBlockPos, EnumFacing.Axis.X); + EaglerLoadingCache loadingcache = BlockPattern.func_181627_a(parWorld, true); + if (!blockportal$size.func_150860_b()) { + enumfacing$axis = EnumFacing.Axis.X; + blockportal$size = new BlockPortal.Size(parWorld, parBlockPos, EnumFacing.Axis.Z); + } + + if (!blockportal$size.func_150860_b()) { + return new BlockPattern.PatternHelper(parBlockPos, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1); + } else { + int[] aint = new int[EnumFacing.AxisDirection.values().length]; + EnumFacing enumfacing = blockportal$size.field_150866_c.rotateYCCW(); + BlockPos blockpos = blockportal$size.field_150861_f.up(blockportal$size.func_181100_a() - 1); + + for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values()) { + BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper( + enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos + : blockpos.offset(blockportal$size.field_150866_c, + blockportal$size.func_181101_b() - 1), + EnumFacing.func_181076_a(enumfacing$axisdirection, enumfacing$axis), EnumFacing.UP, + loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1); + + for (int i = 0; i < blockportal$size.func_181101_b(); ++i) { + for (int j = 0; j < blockportal$size.func_181100_a(); ++j) { + BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, 1); + if (blockworldstate.getBlockState() != null + && blockworldstate.getBlockState().getBlock().getMaterial() != Material.air) { + ++aint[enumfacing$axisdirection.ordinal()]; + } + } + } + } + + EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE; + + for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values()) { + if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()]) { + enumfacing$axisdirection1 = enumfacing$axisdirection2; + } + } + + return new BlockPattern.PatternHelper( + enumfacing.getAxisDirection() == enumfacing$axisdirection1 ? blockpos + : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), + EnumFacing.func_181076_a(enumfacing$axisdirection1, enumfacing$axis), EnumFacing.UP, loadingcache, + blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1); + } + } + + public static class Size { + private final World world; + private final EnumFacing.Axis axis; + private final EnumFacing field_150866_c; + private final EnumFacing field_150863_d; + private int field_150864_e = 0; + private BlockPos field_150861_f; + private int field_150862_g; + private int field_150868_h; + + public Size(World worldIn, BlockPos parBlockPos, EnumFacing.Axis parAxis) { + this.world = worldIn; + this.axis = parAxis; + if (parAxis == EnumFacing.Axis.X) { + this.field_150863_d = EnumFacing.EAST; + this.field_150866_c = EnumFacing.WEST; + } else { + this.field_150863_d = EnumFacing.NORTH; + this.field_150866_c = EnumFacing.SOUTH; + } + + for (BlockPos blockpos = parBlockPos; parBlockPos.getY() > blockpos.getY() - 21 && parBlockPos.getY() > 0 + && this.func_150857_a( + worldIn.getBlockState(parBlockPos.down()).getBlock()); parBlockPos = parBlockPos.down()) { + ; + } + + int i = this.func_180120_a(parBlockPos, this.field_150863_d) - 1; + if (i >= 0) { + this.field_150861_f = parBlockPos.offset(this.field_150863_d, i); + this.field_150868_h = this.func_180120_a(this.field_150861_f, this.field_150866_c); + if (this.field_150868_h < 2 || this.field_150868_h > 21) { + this.field_150861_f = null; + this.field_150868_h = 0; + } + } + + if (this.field_150861_f != null) { + this.field_150862_g = this.func_150858_a(); + } + + } + + protected int func_180120_a(BlockPos parBlockPos, EnumFacing parEnumFacing) { + int i; + for (i = 0; i < 22; ++i) { + BlockPos blockpos = parBlockPos.offset(parEnumFacing, i); + if (!this.func_150857_a(this.world.getBlockState(blockpos).getBlock()) + || this.world.getBlockState(blockpos.down()).getBlock() != Blocks.obsidian) { + break; + } + } + + Block block = this.world.getBlockState(parBlockPos.offset(parEnumFacing, i)).getBlock(); + return block == Blocks.obsidian ? i : 0; + } + + public int func_181100_a() { + return this.field_150862_g; + } + + public int func_181101_b() { + return this.field_150868_h; + } + + protected int func_150858_a() { + label24: for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g) { + for (int i = 0; i < this.field_150868_h; ++i) { + BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g); + Block block = this.world.getBlockState(blockpos).getBlock(); + if (!this.func_150857_a(block)) { + break label24; + } + + if (block == Blocks.portal) { + ++this.field_150864_e; + } + + if (i == 0) { + block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock(); + if (block != Blocks.obsidian) { + break label24; + } + } else if (i == this.field_150868_h - 1) { + block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock(); + if (block != Blocks.obsidian) { + break label24; + } + } + } + } + + for (int j = 0; j < this.field_150868_h; ++j) { + if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)) + .getBlock() != Blocks.obsidian) { + this.field_150862_g = 0; + break; + } + } + + if (this.field_150862_g <= 21 && this.field_150862_g >= 3) { + return this.field_150862_g; + } else { + this.field_150861_f = null; + this.field_150868_h = 0; + this.field_150862_g = 0; + return 0; + } + } + + protected boolean func_150857_a(Block parBlock) { + return parBlock.blockMaterial == Material.air || parBlock == Blocks.fire || parBlock == Blocks.portal; + } + + public boolean func_150860_b() { + return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 + && this.field_150862_g >= 3 && this.field_150862_g <= 21; + } + + public void func_150859_c() { + for (int i = 0; i < this.field_150868_h; ++i) { + BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i); + + for (int j = 0; j < this.field_150862_g; ++j) { + this.world.setBlockState(blockpos.up(j), + Blocks.portal.getDefaultState().withProperty(BlockPortal.AXIS, this.axis), 2); + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPotato.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPotato.java new file mode 100644 index 0000000..437860f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPotato.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCrops; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPotato extends BlockCrops { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPotato"); + } + + protected Item getSeed() { + return Items.potato; + } + + protected Item getCrop() { + return Items.potato; + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); + { + if (((Integer) iblockstate.getValue(AGE)).intValue() >= 7 && world.rand.nextInt(50) == 0) { + spawnAsEntity(world, blockpos, new ItemStack(Items.poisonous_potato)); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlate.java new file mode 100644 index 0000000..a0002e5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlate.java @@ -0,0 +1,107 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBasePressurePlate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPressurePlate extends BlockBasePressurePlate { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPressurePlate"); + } + + public static final PropertyBool POWERED = PropertyBool.create("powered"); + private final BlockPressurePlate.Sensitivity sensitivity; + + protected BlockPressurePlate(Material materialIn, BlockPressurePlate.Sensitivity sensitivityIn) { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false))); + this.sensitivity = sensitivityIn; + } + + protected int getRedstoneStrength(IBlockState iblockstate) { + return ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + protected IBlockState setRedstoneStrength(IBlockState iblockstate, int i) { + return iblockstate.withProperty(POWERED, Boolean.valueOf(i > 0)); + } + + protected int computeRedstoneStrength(World world, BlockPos blockpos) { + AxisAlignedBB axisalignedbb = this.getSensitiveAABB(blockpos); + List list; + switch (this.sensitivity) { + case EVERYTHING: + list = world.getEntitiesWithinAABBExcludingEntity((Entity) null, axisalignedbb); + break; + case MOBS: + list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + break; + default: + return 0; + } + + if (!list.isEmpty()) { + for (Entity entity : (List) list) { + if (!entity.doesEntityNotTriggerPressurePlate()) { + return 15; + } + } + } + + return 0; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(POWERED, Boolean.valueOf(i == 1)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { POWERED }); + } + + public static enum Sensitivity { + EVERYTHING, MOBS; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlateWeighted.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlateWeighted.java new file mode 100644 index 0000000..e178b39 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlateWeighted.java @@ -0,0 +1,99 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBasePressurePlate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPressurePlateWeighted extends BlockBasePressurePlate { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPressurePlateWeighted"); + } + + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + private final int field_150068_a; + + protected BlockPressurePlateWeighted(Material parMaterial, int parInt1) { + this(parMaterial, parInt1, parMaterial.getMaterialMapColor()); + } + + protected BlockPressurePlateWeighted(Material parMaterial, int parInt1, MapColor parMapColor) { + super(parMaterial, parMapColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWER, Integer.valueOf(0))); + this.field_150068_a = parInt1; + } + + protected int computeRedstoneStrength(World world, BlockPos blockpos) { + int i = Math.min(world.getEntitiesWithinAABB(Entity.class, this.getSensitiveAABB(blockpos)).size(), + this.field_150068_a); + if (i > 0) { + float f = (float) Math.min(this.field_150068_a, i) / (float) this.field_150068_a; + return MathHelper.ceiling_float_int(f * 15.0F); + } else { + return 0; + } + } + + protected int getRedstoneStrength(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(POWER)).intValue(); + } + + protected IBlockState setRedstoneStrength(IBlockState iblockstate, int i) { + return iblockstate.withProperty(POWER, Integer.valueOf(i)); + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 10; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(POWER, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(POWER)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { POWER }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPrismarine.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPrismarine.java new file mode 100644 index 0000000..a244cfa --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPrismarine.java @@ -0,0 +1,160 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPrismarine extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPrismarine"); + } + + public static PropertyEnum VARIANT; + public static final int ROUGH_META = BlockPrismarine.EnumType.ROUGH.getMetadata(); + public static final int BRICKS_META = BlockPrismarine.EnumType.BRICKS.getMetadata(); + public static final int DARK_META = BlockPrismarine.EnumType.DARK.getMetadata(); + + public BlockPrismarine() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPrismarine.EnumType.ROUGH)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPrismarine.EnumType.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal( + this.getUnlocalizedName() + "." + BlockPrismarine.EnumType.ROUGH.getUnlocalizedName() + ".name"); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return iblockstate.getValue(VARIANT) == BlockPrismarine.EnumType.ROUGH ? MapColor.cyanColor + : MapColor.diamondColor; + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPrismarine.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockPrismarine.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockPrismarine.EnumType.byMetadata(i)); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, ROUGH_META)); + list.add(new ItemStack(item, 1, BRICKS_META)); + list.add(new ItemStack(item, 1, DARK_META)); + } + + public static enum EnumType implements IStringSerializable { + ROUGH(0, "prismarine", "rough"), BRICKS(1, "prismarine_bricks", "bricks"), DARK(2, "dark_prismarine", "dark"); + + private static final BlockPrismarine.EnumType[] META_LOOKUP = new BlockPrismarine.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockPrismarine.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockPrismarine.EnumType blockprismarine$enumtype : values()) { + META_LOOKUP[blockprismarine$enumtype.getMetadata()] = blockprismarine$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPumpkin.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPumpkin.java new file mode 100644 index 0000000..bc867c0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPumpkin.java @@ -0,0 +1,207 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockWorldState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockStateHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.FactoryBlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySnowman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPumpkin extends BlockDirectional { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockPumpkin"); + } + + private BlockPattern snowmanBasePattern; + private BlockPattern snowmanPattern; + private BlockPattern golemBasePattern; + private BlockPattern golemPattern; + private static final Predicate field_181085_Q = new Predicate() { + public boolean apply(IBlockState iblockstate) { + return iblockstate != null + && (iblockstate.getBlock() == Blocks.pumpkin || iblockstate.getBlock() == Blocks.lit_pumpkin); + } + }; + + protected BlockPumpkin() { + super(Material.gourd, MapColor.adobeColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + super.onBlockAdded(world, blockpos, iblockstate); + this.trySpawnGolem(world, blockpos); + } + + public boolean canDispenserPlace(World worldIn, BlockPos pos) { + return this.getSnowmanBasePattern().match(worldIn, pos) != null + || this.getGolemBasePattern().match(worldIn, pos) != null; + } + + private void trySpawnGolem(World worldIn, BlockPos pos) { + BlockPattern.PatternHelper blockpattern$patternhelper; + if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null) { + for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i) { + BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0); + worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2); + } + + EntitySnowman entitysnowman = new EntitySnowman(worldIn); + BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos(); + entitysnowman.setLocationAndAngles((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.05D, + (double) blockpos1.getZ() + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entitysnowman); + + for (int j = 0; j < 120; ++j) { + worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, + (double) blockpos1.getX() + worldIn.rand.nextDouble(), + (double) blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, + (double) blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); + } + + for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1) { + BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0); + worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air); + } + } else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null) { + for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k) { + for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l) { + worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), + Blocks.air.getDefaultState(), 2); + } + } + + BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos(); + EntityIronGolem entityirongolem = new EntityIronGolem(worldIn); + entityirongolem.setPlayerCreated(true); + entityirongolem.setLocationAndAngles((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.05D, + (double) blockpos.getZ() + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entityirongolem); + + for (int j1 = 0; j1 < 120; ++j1) { + worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double) blockpos.getX() + worldIn.rand.nextDouble(), + (double) blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, + (double) blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); + } + + for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1) { + for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1) { + BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0); + worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air); + } + } + } + + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return world.getBlockState(blockpos).getBlock().blockMaterial.isReplaceable() + && World.doesBlockHaveSolidTopSurface(world, blockpos.down()); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } + + protected BlockPattern getSnowmanBasePattern() { + if (this.snowmanBasePattern == null) { + this.snowmanBasePattern = FactoryBlockPattern.start().aisle(new String[] { " ", "#", "#" }) + .where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.snow))).build(); + } + + return this.snowmanBasePattern; + } + + protected BlockPattern getSnowmanPattern() { + if (this.snowmanPattern == null) { + this.snowmanPattern = FactoryBlockPattern.start().aisle(new String[] { "^", "#", "#" }) + .where('^', BlockWorldState.hasState(field_181085_Q)) + .where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.snow))).build(); + } + + return this.snowmanPattern; + } + + protected BlockPattern getGolemBasePattern() { + if (this.golemBasePattern == null) { + this.golemBasePattern = FactoryBlockPattern.start().aisle(new String[] { "~ ~", "###", "~#~" }) + .where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.iron_block))) + .where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.golemBasePattern; + } + + protected BlockPattern getGolemPattern() { + if (this.golemPattern == null) { + this.golemPattern = FactoryBlockPattern.start().aisle(new String[] { "~^~", "###", "~#~" }) + .where('^', BlockWorldState.hasState(field_181085_Q)) + .where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.iron_block))) + .where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.golemPattern; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockQuartz.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockQuartz.java new file mode 100644 index 0000000..ddbe5de --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockQuartz.java @@ -0,0 +1,180 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockQuartz extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockQuartz"); + } + + public static PropertyEnum VARIANT; + + public BlockQuartz() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockQuartz.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockQuartz.EnumType.class); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing enumfacing, float var4, float var5, + float var6, int i, EntityLivingBase var8) { + if (i == BlockQuartz.EnumType.LINES_Y.getMetadata()) { + switch (enumfacing.getAxis()) { + case Z: + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.LINES_Z); + case X: + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.LINES_X); + case Y: + default: + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.LINES_Y); + } + } else { + return i == BlockQuartz.EnumType.CHISELED.getMetadata() + ? this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.CHISELED) + : this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.DEFAULT); + } + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + BlockQuartz.EnumType blockquartz$enumtype = (BlockQuartz.EnumType) iblockstate.getValue(VARIANT); + return blockquartz$enumtype != BlockQuartz.EnumType.LINES_X + && blockquartz$enumtype != BlockQuartz.EnumType.LINES_Z ? blockquartz$enumtype.getMetadata() + : BlockQuartz.EnumType.LINES_Y.getMetadata(); + } + + protected ItemStack createStackedBlock(IBlockState iblockstate) { + BlockQuartz.EnumType blockquartz$enumtype = (BlockQuartz.EnumType) iblockstate.getValue(VARIANT); + return blockquartz$enumtype != BlockQuartz.EnumType.LINES_X + && blockquartz$enumtype != BlockQuartz.EnumType.LINES_Z ? super.createStackedBlock(iblockstate) + : new ItemStack(Item.getItemFromBlock(this), 1, BlockQuartz.EnumType.LINES_Y.getMetadata()); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())); + list.add(new ItemStack(item, 1, BlockQuartz.EnumType.CHISELED.getMetadata())); + list.add(new ItemStack(item, 1, BlockQuartz.EnumType.LINES_Y.getMetadata())); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.quartzColor; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockQuartz.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + DEFAULT(0, "default", "default"), CHISELED(1, "chiseled", "chiseled"), LINES_Y(2, "lines_y", "lines"), + LINES_X(3, "lines_x", "lines"), LINES_Z(4, "lines_z", "lines"); + + private static final BlockQuartz.EnumType[] META_LOOKUP = new BlockQuartz.EnumType[values().length]; + private final int meta; + private final String field_176805_h; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.field_176805_h = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.unlocalizedName; + } + + public static BlockQuartz.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.field_176805_h; + } + + static { + for (BlockQuartz.EnumType blockquartz$enumtype : values()) { + META_LOOKUP[blockquartz$enumtype.getMetadata()] = blockquartz$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRail.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRail.java new file mode 100644 index 0000000..fb00222 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRail.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRail extends BlockRailBase { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRail"); + } + + public static PropertyEnum SHAPE; + + protected BlockRail() { + super(false); + this.setDefaultState( + this.blockState.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); + } + + public static void bootstrapStates() { + SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class); + } + + protected void onNeighborChangedInternal(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + if (block.canProvidePower() + && (new BlockRailBase.Rail(world, blockpos, iblockstate)).countAdjacentRails() == 3) { + this.func_176564_a(world, blockpos, iblockstate, false); + } + + } + + public IProperty getShapeProperty() { + return SHAPE; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockRailBase.EnumRailDirection) iblockstate.getValue(SHAPE)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { SHAPE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailBase.java new file mode 100644 index 0000000..5532c8d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailBase.java @@ -0,0 +1,571 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.collect.Lists; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockRailBase extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRailBase"); + } + + protected final boolean isPowered; + + public static boolean isRailBlock(World worldIn, BlockPos pos) { + return isRailBlock(worldIn.getBlockState(pos)); + } + + public static boolean isRailBlock(IBlockState state) { + Block block = state.getBlock(); + return block == Blocks.rail || block == Blocks.golden_rail || block == Blocks.detector_rail + || block == Blocks.activator_rail; + } + + protected BlockRailBase(boolean isPowered) { + super(Material.circuits); + this.isPowered = isPowered; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setCreativeTab(CreativeTabs.tabTransport); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.collisionRayTrace(worldIn, pos, start, end); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this + ? (BlockRailBase.EnumRailDirection) iblockstate.getValue(this.getShapeProperty()) + : null; + if (blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending()) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + } + + public boolean isFullCube() { + return false; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return World.doesBlockHaveSolidTopSurface(world, blockpos.down()); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { + { + state = this.func_176564_a(worldIn, pos, state, true); + if (this.isPowered) { + this.onNeighborBlockChange(worldIn, pos, state, this); + } + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) iblockstate + .getValue(this.getShapeProperty()); + boolean flag = false; + if (!World.doesBlockHaveSolidTopSurface(world, blockpos.down())) { + flag = true; + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST + && !World.doesBlockHaveSolidTopSurface(world, blockpos.east())) { + flag = true; + } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST + && !World.doesBlockHaveSolidTopSurface(world, blockpos.west())) { + flag = true; + } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH + && !World.doesBlockHaveSolidTopSurface(world, blockpos.north())) { + flag = true; + } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH + && !World.doesBlockHaveSolidTopSurface(world, blockpos.south())) { + flag = true; + } + + if (flag) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } else { + this.onNeighborChangedInternal(world, blockpos, iblockstate, block); + } + } + } + + protected void onNeighborChangedInternal(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { + } + + protected IBlockState func_176564_a(World worldIn, BlockPos parBlockPos, IBlockState parIBlockState, + boolean parFlag) { + return (new BlockRailBase.Rail(worldIn, parBlockPos, parIBlockState)) + .func_180364_a(worldIn.isBlockPowered(parBlockPos), parFlag).getBlockState(); + } + + public int getMobilityFlag() { + return 0; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + super.breakBlock(world, blockpos, iblockstate); + if (((BlockRailBase.EnumRailDirection) iblockstate.getValue(this.getShapeProperty())).isAscending()) { + world.notifyNeighborsOfStateChange(blockpos.up(), this); + } + + if (this.isPowered) { + world.notifyNeighborsOfStateChange(blockpos, this); + world.notifyNeighborsOfStateChange(blockpos.down(), this); + } + + } + + public abstract IProperty getShapeProperty(); + + public static enum EnumRailDirection implements IStringSerializable { + NORTH_SOUTH(0, "north_south"), EAST_WEST(1, "east_west"), ASCENDING_EAST(2, "ascending_east"), + ASCENDING_WEST(3, "ascending_west"), ASCENDING_NORTH(4, "ascending_north"), + ASCENDING_SOUTH(5, "ascending_south"), SOUTH_EAST(6, "south_east"), SOUTH_WEST(7, "south_west"), + NORTH_WEST(8, "north_west"), NORTH_EAST(9, "north_east"); + + private static final BlockRailBase.EnumRailDirection[] META_LOOKUP = new BlockRailBase.EnumRailDirection[values().length]; + private final int meta; + private final String name; + + private EnumRailDirection(int meta, String name) { + this.meta = meta; + this.name = name; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public boolean isAscending() { + return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH + || this == ASCENDING_WEST; + } + + public static BlockRailBase.EnumRailDirection byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + static { + for (BlockRailBase.EnumRailDirection blockrailbase$enumraildirection : values()) { + META_LOOKUP[blockrailbase$enumraildirection.getMetadata()] = blockrailbase$enumraildirection; + } + + } + } + + public class Rail { + private final World world; + private final BlockPos pos; + private final BlockRailBase block; + private IBlockState state; + private final boolean isPowered; + private final List field_150657_g = Lists.newArrayList(); + + public Rail(World worldIn, BlockPos pos, IBlockState state) { + this.world = worldIn; + this.pos = pos; + this.state = state; + this.block = (BlockRailBase) state.getBlock(); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) state + .getValue(BlockRailBase.this.getShapeProperty()); + this.isPowered = this.block.isPowered; + this.func_180360_a(blockrailbase$enumraildirection); + } + + private void func_180360_a(BlockRailBase.EnumRailDirection parEnumRailDirection) { + this.field_150657_g.clear(); + switch (parEnumRailDirection) { + case NORTH_SOUTH: + this.field_150657_g.add(this.pos.north()); + this.field_150657_g.add(this.pos.south()); + break; + case EAST_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.east()); + break; + case ASCENDING_EAST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.east().up()); + break; + case ASCENDING_WEST: + this.field_150657_g.add(this.pos.west().up()); + this.field_150657_g.add(this.pos.east()); + break; + case ASCENDING_NORTH: + this.field_150657_g.add(this.pos.north().up()); + this.field_150657_g.add(this.pos.south()); + break; + case ASCENDING_SOUTH: + this.field_150657_g.add(this.pos.north()); + this.field_150657_g.add(this.pos.south().up()); + break; + case SOUTH_EAST: + this.field_150657_g.add(this.pos.east()); + this.field_150657_g.add(this.pos.south()); + break; + case SOUTH_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.south()); + break; + case NORTH_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.north()); + break; + case NORTH_EAST: + this.field_150657_g.add(this.pos.east()); + this.field_150657_g.add(this.pos.north()); + } + + } + + private void func_150651_b() { + for (int i = 0; i < this.field_150657_g.size(); ++i) { + BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos) this.field_150657_g.get(i)); + if (blockrailbase$rail != null && blockrailbase$rail.func_150653_a(this)) { + this.field_150657_g.set(i, blockrailbase$rail.pos); + } else { + this.field_150657_g.remove(i--); + } + } + + } + + private boolean hasRailAt(BlockPos pos) { + return BlockRailBase.isRailBlock(this.world, pos) || BlockRailBase.isRailBlock(this.world, pos.up()) + || BlockRailBase.isRailBlock(this.world, pos.down()); + } + + private BlockRailBase.Rail findRailAt(BlockPos pos) { + IBlockState iblockstate = this.world.getBlockState(pos); + if (BlockRailBase.isRailBlock(iblockstate)) { + return BlockRailBase.this.new Rail(this.world, pos, iblockstate); + } else { + BlockPos blockpos = pos.up(); + iblockstate = this.world.getBlockState(blockpos); + if (BlockRailBase.isRailBlock(iblockstate)) { + return BlockRailBase.this.new Rail(this.world, blockpos, iblockstate); + } else { + blockpos = pos.down(); + iblockstate = this.world.getBlockState(blockpos); + return BlockRailBase.isRailBlock(iblockstate) + ? BlockRailBase.this.new Rail(this.world, blockpos, iblockstate) + : null; + } + } + } + + private boolean func_150653_a(BlockRailBase.Rail parRail) { + return this.func_180363_c(parRail.pos); + } + + private boolean func_180363_c(BlockPos parBlockPos) { + for (int i = 0; i < this.field_150657_g.size(); ++i) { + BlockPos blockpos = (BlockPos) this.field_150657_g.get(i); + if (blockpos.getX() == parBlockPos.getX() && blockpos.getZ() == parBlockPos.getZ()) { + return true; + } + } + + return false; + } + + protected int countAdjacentRails() { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (this.hasRailAt(this.pos.offset(enumfacing))) { + ++i; + } + } + + return i; + } + + private boolean func_150649_b(BlockRailBase.Rail rail) { + return this.func_150653_a(rail) || this.field_150657_g.size() != 2; + } + + private void func_150645_c(BlockRailBase.Rail parRail) { + this.field_150657_g.add(parRail.pos); + BlockPos blockpos = this.pos.north(); + BlockPos blockpos1 = this.pos.south(); + BlockPos blockpos2 = this.pos.west(); + BlockPos blockpos3 = this.pos.east(); + boolean flag = this.func_180363_c(blockpos); + boolean flag1 = this.func_180363_c(blockpos1); + boolean flag2 = this.func_180363_c(blockpos2); + boolean flag3 = this.func_180363_c(blockpos3); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null; + if (flag || flag1) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + if (flag2 || flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + } + + if (!this.isPowered) { + if (flag1 && flag3 && !flag && !flag2) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + + if (flag1 && flag2 && !flag && !flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag && flag2 && !flag1 && !flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + + if (flag && flag3 && !flag1 && !flag2) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) { + if (BlockRailBase.isRailBlock(this.world, blockpos.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos1.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH; + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) { + if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos2.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST; + } + } + + if (blockrailbase$enumraildirection == null) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection); + this.world.setBlockState(this.pos, this.state, 3); + } + + private boolean func_180361_d(BlockPos parBlockPos) { + BlockRailBase.Rail blockrailbase$rail = this.findRailAt(parBlockPos); + if (blockrailbase$rail == null) { + return false; + } else { + blockrailbase$rail.func_150651_b(); + return blockrailbase$rail.func_150649_b(this); + } + } + + public BlockRailBase.Rail func_180364_a(boolean parFlag, boolean parFlag2) { + BlockPos blockpos = this.pos.north(); + BlockPos blockpos1 = this.pos.south(); + BlockPos blockpos2 = this.pos.west(); + BlockPos blockpos3 = this.pos.east(); + boolean flag = this.func_180361_d(blockpos); + boolean flag1 = this.func_180361_d(blockpos1); + boolean flag2 = this.func_180361_d(blockpos2); + boolean flag3 = this.func_180361_d(blockpos3); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null; + if ((flag || flag1) && !flag2 && !flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + if ((flag2 || flag3) && !flag && !flag1) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + } + + if (!this.isPowered) { + if (flag1 && flag3 && !flag && !flag2) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + + if (flag1 && flag2 && !flag && !flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag && flag2 && !flag1 && !flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + + if (flag && flag3 && !flag1 && !flag2) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + } + + if (blockrailbase$enumraildirection == null) { + if (flag || flag1) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + if (flag2 || flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + } + + if (!this.isPowered) { + if (parFlag) { + if (flag1 && flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + + if (flag2 && flag1) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag3 && flag) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + + if (flag && flag2) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + } else { + if (flag && flag2) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + + if (flag3 && flag) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + + if (flag2 && flag1) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag1 && flag3) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + } + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) { + if (BlockRailBase.isRailBlock(this.world, blockpos.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos1.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH; + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) { + if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos2.up())) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST; + } + } + + if (blockrailbase$enumraildirection == null) { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + this.func_180360_a(blockrailbase$enumraildirection); + this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection); + if (parFlag2 || this.world.getBlockState(this.pos) != this.state) { + this.world.setBlockState(this.pos, this.state, 3); + + for (int i = 0; i < this.field_150657_g.size(); ++i) { + BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos) this.field_150657_g.get(i)); + if (blockrailbase$rail != null) { + blockrailbase$rail.func_150651_b(); + if (blockrailbase$rail.func_150649_b(this)) { + blockrailbase$rail.func_150645_c(this); + } + } + } + } + + return this; + } + + public IBlockState getBlockState() { + return this.state; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailDetector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailDetector.java new file mode 100644 index 0000000..7414d0a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailDetector.java @@ -0,0 +1,218 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityMinecartCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRailDetector extends BlockRailBase { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRailDetector"); + } + + public static PropertyEnum SHAPE; + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + public BlockRailDetector() { + super(true); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false)) + .withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); + this.setTickRandomly(true); + } + + public static void bootstrapStates() { + SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class, + new Predicate() { + public boolean apply(BlockRailBase.EnumRailDirection blockrailbase$enumraildirection) { + return blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_EAST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_WEST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.SOUTH_EAST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + }); + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 20; + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState iblockstate, Entity var4) { + { + if (!((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + this.updatePoweredState(world, blockpos, iblockstate); + } + } + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + this.updatePoweredState(world, blockpos, iblockstate); + } + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing var4) { + return ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing enumfacing) { + return !((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 0 : (enumfacing == EnumFacing.UP ? 15 : 0); + } + + private void updatePoweredState(World worldIn, BlockPos pos, IBlockState state) { + boolean flag = ((Boolean) state.getValue(POWERED)).booleanValue(); + boolean flag1 = false; + List list = this.findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[0]); + if (!list.isEmpty()) { + flag1 = true; + } + + if (flag1 && !flag) { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + + if (!flag1 && flag) { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 3); + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + + if (flag1) { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + worldIn.updateComparatorOutputLevel(pos, this); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + super.onBlockAdded(world, blockpos, iblockstate); + this.updatePoweredState(world, blockpos, iblockstate); + } + + public IProperty getShapeProperty() { + return SHAPE; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World world, BlockPos blockpos) { + if (((Boolean) world.getBlockState(blockpos).getValue(POWERED)).booleanValue()) { + List list = this.findMinecarts(world, blockpos, EntityMinecartCommandBlock.class, new Predicate[0]); + if (!list.isEmpty()) { + return ((EntityMinecartCommandBlock) list.get(0)).getCommandBlockLogic().getSuccessCount(); + } + + List list1 = this.findMinecarts(world, blockpos, EntityMinecart.class, + new Predicate[] { EntitySelectors.selectInventories }); + if (!list1.isEmpty()) { + return Container.calcRedstoneFromInventory((IInventory) list1.get(0)); + } + } + + return 0; + } + + protected List findMinecarts(World worldIn, BlockPos pos, Class clazz, + Predicate... filter) { + AxisAlignedBB axisalignedbb = this.getDectectionBox(pos); + return filter.length != 1 ? worldIn.getEntitiesWithinAABB(clazz, axisalignedbb) + : worldIn.getEntitiesWithinAABB(clazz, axisalignedbb, filter[0]); + } + + private AxisAlignedBB getDectectionBox(BlockPos pos) { + float f = 0.2F; + return new AxisAlignedBB((double) ((float) pos.getX() + 0.2F), (double) pos.getY(), + (double) ((float) pos.getZ() + 0.2F), (double) ((float) (pos.getX() + 1) - 0.2F), + (double) ((float) (pos.getY() + 1) - 0.2F), (double) ((float) (pos.getZ() + 1) - 0.2F)); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(i & 7)) + .withProperty(POWERED, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockRailBase.EnumRailDirection) iblockstate.getValue(SHAPE)).getMetadata(); + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { SHAPE, POWERED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailPowered.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailPowered.java new file mode 100644 index 0000000..3c96887 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailPowered.java @@ -0,0 +1,209 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRailPowered extends BlockRailBase { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRailPowered"); + } + + public static PropertyEnum SHAPE; + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + protected BlockRailPowered() { + super(true); + this.setDefaultState( + this.blockState.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH) + .withProperty(POWERED, Boolean.valueOf(false))); + } + + public static void bootstrapStates() { + SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class, + new Predicate() { + public boolean apply(BlockRailBase.EnumRailDirection blockrailbase$enumraildirection) { + return blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_EAST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_WEST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.SOUTH_EAST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + }); + } + + protected boolean func_176566_a(World worldIn, BlockPos pos, IBlockState state, boolean parFlag, int parInt1) { + if (parInt1 >= 8) { + return false; + } else { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + boolean flag = true; + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) state + .getValue(SHAPE); + switch (blockrailbase$enumraildirection) { + case NORTH_SOUTH: + if (parFlag) { + ++k; + } else { + --k; + } + break; + case EAST_WEST: + if (parFlag) { + --i; + } else { + ++i; + } + break; + case ASCENDING_EAST: + if (parFlag) { + --i; + } else { + ++i; + ++j; + flag = false; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + break; + case ASCENDING_WEST: + if (parFlag) { + --i; + ++j; + flag = false; + } else { + ++i; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + break; + case ASCENDING_NORTH: + if (parFlag) { + ++k; + } else { + --k; + ++j; + flag = false; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + break; + case ASCENDING_SOUTH: + if (parFlag) { + ++k; + ++j; + flag = false; + } else { + --k; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + return this.func_176567_a(worldIn, new BlockPos(i, j, k), parFlag, parInt1, blockrailbase$enumraildirection) + ? true + : flag && this.func_176567_a(worldIn, new BlockPos(i, j - 1, k), parFlag, parInt1, + blockrailbase$enumraildirection); + } + } + + protected boolean func_176567_a(World worldIn, BlockPos distance, boolean parFlag, int parInt1, + BlockRailBase.EnumRailDirection parEnumRailDirection) { + IBlockState iblockstate = worldIn.getBlockState(distance); + if (iblockstate.getBlock() != this) { + return false; + } else { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) iblockstate + .getValue(SHAPE); + return parEnumRailDirection != BlockRailBase.EnumRailDirection.EAST_WEST + || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_SOUTH + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_NORTH + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_SOUTH + ? (parEnumRailDirection != BlockRailBase.EnumRailDirection.NORTH_SOUTH + || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.EAST_WEST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_EAST + && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_WEST + ? (((Boolean) iblockstate.getValue(POWERED)).booleanValue() + ? (worldIn.isBlockPowered(distance) ? true + : this.func_176566_a(worldIn, distance, + iblockstate, parFlag, parInt1 + 1)) + : false) + : false) + : false; + } + } + + protected void onNeighborChangedInternal(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + boolean flag = ((Boolean) iblockstate.getValue(POWERED)).booleanValue(); + boolean flag1 = world.isBlockPowered(blockpos) || this.func_176566_a(world, blockpos, iblockstate, true, 0) + || this.func_176566_a(world, blockpos, iblockstate, false, 0); + if (flag1 != flag) { + world.setBlockState(blockpos, iblockstate.withProperty(POWERED, Boolean.valueOf(flag1)), 3); + world.notifyNeighborsOfStateChange(blockpos.down(), this); + if (((BlockRailBase.EnumRailDirection) iblockstate.getValue(SHAPE)).isAscending()) { + world.notifyNeighborsOfStateChange(blockpos.up(), this); + } + } + + } + + public IProperty getShapeProperty() { + return SHAPE; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(i & 7)) + .withProperty(POWERED, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockRailBase.EnumRailDirection) iblockstate.getValue(SHAPE)).getMetadata(); + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { SHAPE, POWERED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedFlower.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedFlower.java new file mode 100644 index 0000000..6eb2af9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedFlower.java @@ -0,0 +1,39 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedFlower extends BlockFlower { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedFlower"); + } + + /**+ + * Get the Type of this flower (Yellow/Red) + */ + public BlockFlower.EnumFlowerColor getBlockType() { + return BlockFlower.EnumFlowerColor.RED; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedSandstone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedSandstone.java new file mode 100644 index 0000000..6bd970f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedSandstone.java @@ -0,0 +1,141 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedSandstone extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedSandstone"); + } + + public static PropertyEnum TYPE; + + public BlockRedSandstone() { + super(Material.rock, BlockSand.EnumType.RED_SAND.getMapColor()); + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockRedSandstone.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + TYPE = PropertyEnum.create("type", BlockRedSandstone.EnumType.class); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockRedSandstone.EnumType) iblockstate.getValue(TYPE)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockRedSandstone.EnumType blockredsandstone$enumtype : BlockRedSandstone.EnumType.values()) { + list.add(new ItemStack(item, 1, blockredsandstone$enumtype.getMetadata())); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(TYPE, BlockRedSandstone.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockRedSandstone.EnumType) iblockstate.getValue(TYPE)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { TYPE }); + } + + public static enum EnumType implements IStringSerializable { + DEFAULT(0, "red_sandstone", "default"), CHISELED(1, "chiseled_red_sandstone", "chiseled"), + SMOOTH(2, "smooth_red_sandstone", "smooth"); + + private static final BlockRedSandstone.EnumType[] META_LOOKUP = new BlockRedSandstone.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockRedSandstone.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockRedSandstone.EnumType blockredsandstone$enumtype : values()) { + META_LOOKUP[blockredsandstone$enumtype.getMetadata()] = blockredsandstone$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneComparator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneComparator.java new file mode 100644 index 0000000..bfa2851 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneComparator.java @@ -0,0 +1,330 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneDiode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.ITileEntityProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneComparator"); + } + + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static PropertyEnum MODE; + + public BlockRedstoneComparator(boolean powered) { + super(powered); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(POWERED, Boolean.valueOf(false)) + .withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE)); + this.isBlockContainer = true; + } + + public static void bootstrapStates() { + MODE = PropertyEnum.create("mode", BlockRedstoneComparator.Mode.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal("item.comparator.name"); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.comparator; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.comparator; + } + + protected int getDelay(IBlockState state) { + return 2; + } + + protected IBlockState getPoweredState(IBlockState unpoweredState) { + Boolean obool = (Boolean) unpoweredState.getValue(POWERED); + BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode) unpoweredState + .getValue(MODE); + EnumFacing enumfacing = (EnumFacing) unpoweredState.getValue(FACING); + return Blocks.powered_comparator.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, obool) + .withProperty(MODE, blockredstonecomparator$mode); + } + + protected IBlockState getUnpoweredState(IBlockState poweredState) { + Boolean obool = (Boolean) poweredState.getValue(POWERED); + BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode) poweredState + .getValue(MODE); + EnumFacing enumfacing = (EnumFacing) poweredState.getValue(FACING); + return Blocks.unpowered_comparator.getDefaultState().withProperty(FACING, enumfacing) + .withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode); + } + + protected boolean isPowered(IBlockState state) { + return this.isRepeaterPowered || ((Boolean) state.getValue(POWERED)).booleanValue(); + } + + protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state) { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityComparator ? ((TileEntityComparator) tileentity).getOutputSignal() : 0; + } + + private int calculateOutput(World worldIn, BlockPos pos, IBlockState state) { + return state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT + ? Math.max(this.calculateInputStrength(worldIn, pos, state) - this.getPowerOnSides(worldIn, pos, state), + 0) + : this.calculateInputStrength(worldIn, pos, state); + } + + protected boolean shouldBePowered(World worldIn, BlockPos pos, IBlockState state) { + int i = this.calculateInputStrength(worldIn, pos, state); + if (i >= 15) { + return true; + } else if (i == 0) { + return false; + } else { + int j = this.getPowerOnSides(worldIn, pos, state); + return j == 0 ? true : i >= j; + } + } + + protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state) { + int i = super.calculateInputStrength(worldIn, pos, state); + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing); + Block block = worldIn.getBlockState(blockpos).getBlock(); + if (block.hasComparatorInputOverride()) { + i = block.getComparatorInputOverride(worldIn, blockpos); + } else if (i < 15 && block.isNormalCube()) { + blockpos = blockpos.offset(enumfacing); + block = worldIn.getBlockState(blockpos).getBlock(); + if (block.hasComparatorInputOverride()) { + i = block.getComparatorInputOverride(worldIn, blockpos); + } else if (block.getMaterial() == Material.air) { + EntityItemFrame entityitemframe = this.findItemFrame(worldIn, enumfacing, blockpos); + if (entityitemframe != null) { + i = entityitemframe.func_174866_q(); + } + } + } + + return i; + } + + private EntityItemFrame findItemFrame(World worldIn, final EnumFacing facing, BlockPos pos) { + List list = worldIn.getEntitiesWithinAABB(EntityItemFrame.class, + new AxisAlignedBB((double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), + (double) (pos.getX() + 1), (double) (pos.getY() + 1), (double) (pos.getZ() + 1)), + new Predicate() { + public boolean apply(Entity entity) { + return entity != null && entity.getHorizontalFacing() == facing; + } + }); + return list.size() == 1 ? (EntityItemFrame) list.get(0) : null; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (!entityplayer.capabilities.allowEdit) { + return false; + } else { + iblockstate = iblockstate.cycleProperty(MODE); + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "random.click", 0.3F, + iblockstate.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? 0.55F : 0.5F); + world.setBlockState(blockpos, iblockstate, 2); + this.onStateChange(world, blockpos, iblockstate); + return true; + } + } + + protected void updateState(World worldIn, BlockPos pos, IBlockState state) { + if (!worldIn.isBlockTickPending(pos, this)) { + int i = this.calculateOutput(worldIn, pos, state); + TileEntity tileentity = worldIn.getTileEntity(pos); + int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator) tileentity).getOutputSignal() + : 0; + if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state)) { + if (this.isFacingTowardsRepeater(worldIn, pos, state)) { + worldIn.updateBlockTick(pos, this, 2, -1); + } else { + worldIn.updateBlockTick(pos, this, 2, 0); + } + } + + } + } + + private void onStateChange(World worldIn, BlockPos pos, IBlockState state) { + int i = this.calculateOutput(worldIn, pos, state); + TileEntity tileentity = worldIn.getTileEntity(pos); + int j = 0; + if (tileentity instanceof TileEntityComparator) { + TileEntityComparator tileentitycomparator = (TileEntityComparator) tileentity; + j = tileentitycomparator.getOutputSignal(); + tileentitycomparator.setOutputSignal(i); + } + + if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE) { + boolean flag1 = this.shouldBePowered(worldIn, pos, state); + boolean flag = this.isPowered(state); + if (flag && !flag1) { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2); + } else if (!flag && flag1) { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2); + } + + this.notifyNeighbors(worldIn, pos, state); + } + + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + if (this.isRepeaterPowered) { + world.setBlockState(blockpos, + this.getUnpoweredState(iblockstate).withProperty(POWERED, Boolean.valueOf(true)), 4); + } + + this.onStateChange(world, blockpos, iblockstate); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + super.onBlockAdded(world, blockpos, iblockstate); + world.setTileEntity(blockpos, this.createNewTileEntity(world, 0)); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + super.breakBlock(world, blockpos, iblockstate); + world.removeTileEntity(blockpos); + this.notifyNeighbors(world, blockpos, iblockstate); + } + + /**+ + * Called on both Client and Server when World#addBlockEvent is + * called + */ + public boolean onBlockEventReceived(World world, BlockPos blockpos, IBlockState iblockstate, int i, int j) { + super.onBlockEventReceived(world, blockpos, iblockstate, i, j); + TileEntity tileentity = world.getTileEntity(blockpos); + return tileentity == null ? false : tileentity.receiveClientEvent(i, j); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityComparator(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(i)) + .withProperty(POWERED, Boolean.valueOf((i & 8) > 0)).withProperty(MODE, + (i & 4) > 0 ? BlockRedstoneComparator.Mode.SUBTRACT : BlockRedstoneComparator.Mode.COMPARE); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + if (iblockstate.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT) { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, MODE, POWERED }); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()) + .withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE); + } + + public static enum Mode implements IStringSerializable { + COMPARE("compare"), SUBTRACT("subtract"); + + private final String name; + + private Mode(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneDiode.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneDiode.java new file mode 100644 index 0000000..8ebd730 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneDiode.java @@ -0,0 +1,289 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneWire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockRedstoneDiode extends BlockDirectional { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneDiode"); + } + + protected final boolean isRepeaterPowered; + + protected BlockRedstoneDiode(boolean powered) { + super(Material.circuits); + this.isRepeaterPowered = powered; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + public boolean isFullCube() { + return false; + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return World.doesBlockHaveSolidTopSurface(world, blockpos.down()) ? super.canPlaceBlockAt(world, blockpos) + : false; + } + + public boolean canBlockStay(World worldIn, BlockPos pos) { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + if (!this.isLocked(world, blockpos, iblockstate)) { + boolean flag = this.shouldBePowered(world, blockpos, iblockstate); + if (this.isRepeaterPowered && !flag) { + world.setBlockState(blockpos, this.getUnpoweredState(iblockstate), 2); + } else if (!this.isRepeaterPowered) { + world.setBlockState(blockpos, this.getPoweredState(iblockstate), 2); + if (!flag) { + world.updateBlockTick(blockpos, this.getPoweredState(iblockstate).getBlock(), + this.getTickDelay(iblockstate), -1); + } + } + + } + } + + public boolean shouldSideBeRendered(IBlockAccess var1, BlockPos var2, EnumFacing enumfacing) { + return enumfacing.getAxis() != EnumFacing.Axis.Y; + } + + protected boolean isPowered(IBlockState var1) { + return this.isRepeaterPowered; + } + + public int getStrongPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate, + EnumFacing enumfacing) { + return this.getWeakPower(iblockaccess, blockpos, iblockstate, enumfacing); + } + + public int getWeakPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate, + EnumFacing enumfacing) { + return !this.isPowered(iblockstate) ? 0 + : (iblockstate.getValue(FACING) == enumfacing + ? this.getActiveSignal(iblockaccess, blockpos, iblockstate) + : 0); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (this.canBlockStay(world, blockpos)) { + this.updateState(world, blockpos, iblockstate); + } else { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + + for (EnumFacing enumfacing : EnumFacing.values()) { + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this); + } + + } + } + + protected void updateState(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!this.isLocked(world, blockpos, iblockstate)) { + boolean flag = this.shouldBePowered(world, blockpos, iblockstate); + if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) + && !world.isBlockTickPending(blockpos, this)) { + byte b0 = -1; + if (this.isFacingTowardsRepeater(world, blockpos, iblockstate)) { + b0 = -3; + } else if (this.isRepeaterPowered) { + b0 = -2; + } + + world.updateBlockTick(blockpos, this, this.getDelay(iblockstate), b0); + } + + } + } + + public boolean isLocked(IBlockAccess worldIn, BlockPos pos, IBlockState state) { + return false; + } + + protected boolean shouldBePowered(World world, BlockPos blockpos, IBlockState iblockstate) { + return this.calculateInputStrength(world, blockpos, iblockstate) > 0; + } + + protected int calculateInputStrength(World world, BlockPos blockpos, IBlockState iblockstate) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + BlockPos blockpos1 = blockpos.offset(enumfacing); + int i = world.getRedstonePower(blockpos1, enumfacing); + if (i >= 15) { + return i; + } else { + IBlockState iblockstate1 = world.getBlockState(blockpos1); + return Math.max(i, + iblockstate1.getBlock() == Blocks.redstone_wire + ? ((Integer) iblockstate1.getValue(BlockRedstoneWire.POWER)).intValue() + : 0); + } + } + + protected int getPowerOnSides(IBlockAccess worldIn, BlockPos pos, IBlockState state) { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + EnumFacing enumfacing1 = enumfacing.rotateY(); + EnumFacing enumfacing2 = enumfacing.rotateYCCW(); + return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), + this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2)); + } + + protected int getPowerOnSide(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + return this.canPowerSide(block) + ? (block == Blocks.redstone_wire ? ((Integer) iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() + : worldIn.getStrongPower(pos, side)) + : 0; + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing().getOpposite()); + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, EntityLivingBase var4, + ItemStack var5) { + if (this.shouldBePowered(world, blockpos, iblockstate)) { + world.scheduleUpdate(blockpos, this, 1); + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.notifyNeighbors(world, blockpos, iblockstate); + } + + protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state) { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing.getOpposite()); + worldIn.notifyBlockOfStateChange(blockpos, this); + worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing); + } + + /**+ + * Called when a player destroys this Block + */ + public void onBlockDestroyedByPlayer(World world, BlockPos blockpos, IBlockState iblockstate) { + if (this.isRepeaterPowered) { + for (EnumFacing enumfacing : EnumFacing.values()) { + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this); + } + } + + super.onBlockDestroyedByPlayer(world, blockpos, iblockstate); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + protected boolean canPowerSide(Block blockIn) { + return blockIn.canProvidePower(); + } + + protected int getActiveSignal(IBlockAccess var1, BlockPos var2, IBlockState var3) { + return 15; + } + + public static boolean isRedstoneRepeaterBlockID(Block blockIn) { + return Blocks.unpowered_repeater.isAssociated(blockIn) || Blocks.unpowered_comparator.isAssociated(blockIn); + } + + public boolean isAssociated(Block other) { + return other == this.getPoweredState(this.getDefaultState()).getBlock() + || other == this.getUnpoweredState(this.getDefaultState()).getBlock(); + } + + public boolean isFacingTowardsRepeater(World worldIn, BlockPos pos, IBlockState state) { + EnumFacing enumfacing = ((EnumFacing) state.getValue(FACING)).getOpposite(); + BlockPos blockpos = pos.offset(enumfacing); + return isRedstoneRepeaterBlockID(worldIn.getBlockState(blockpos).getBlock()) + ? worldIn.getBlockState(blockpos).getValue(FACING) != enumfacing + : false; + } + + protected int getTickDelay(IBlockState state) { + return this.getDelay(state); + } + + protected abstract int getDelay(IBlockState var1); + + protected abstract IBlockState getPoweredState(IBlockState var1); + + protected abstract IBlockState getUnpoweredState(IBlockState var1); + + public boolean isAssociatedBlock(Block block) { + return this.isAssociated(block); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneLight.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneLight.java new file mode 100644 index 0000000..76bd7e3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneLight.java @@ -0,0 +1,97 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedstoneLight extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneLight"); + } + + private final boolean isOn; + + public BlockRedstoneLight(boolean isOn) { + super(Material.redstoneLight); + this.isOn = isOn; + if (isOn) { + this.setLightLevel(1.0F); + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + { + if (this.isOn && !world.isBlockPowered(blockpos)) { + world.setBlockState(blockpos, Blocks.redstone_lamp.getDefaultState(), 2); + } else if (!this.isOn && world.isBlockPowered(blockpos)) { + world.setBlockState(blockpos, Blocks.lit_redstone_lamp.getDefaultState(), 2); + } + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + { + if (this.isOn && !world.isBlockPowered(blockpos)) { + world.scheduleUpdate(blockpos, this, 4); + } else if (!this.isOn && world.isBlockPowered(blockpos)) { + world.setBlockState(blockpos, Blocks.lit_redstone_lamp.getDefaultState(), 2); + } + } + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + { + if (this.isOn && !world.isBlockPowered(blockpos)) { + world.setBlockState(blockpos, Blocks.redstone_lamp.getDefaultState(), 2); + } + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + protected ItemStack createStackedBlock(IBlockState var1) { + return new ItemStack(Blocks.redstone_lamp); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneOre.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneOre.java new file mode 100644 index 0000000..6f471b5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneOre.java @@ -0,0 +1,182 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedstoneOre extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneOre"); + } + + private final boolean isOn; + + public BlockRedstoneOre(boolean isOn) { + super(Material.rock); + if (isOn) { + this.setTickRandomly(true); + } + + this.isOn = isOn; + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 30; + } + + public void onBlockClicked(World world, BlockPos blockpos, EntityPlayer entityplayer) { + this.activate(world, blockpos); + super.onBlockClicked(world, blockpos, entityplayer); + } + + /**+ + * Triggered whenever an entity collides with this block (enters + * into the block) + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, Entity entity) { + this.activate(world, blockpos); + super.onEntityCollidedWithBlock(world, blockpos, entity); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing enumfacing, float f, float f1, float f2) { + this.activate(world, blockpos); + return super.onBlockActivated(world, blockpos, iblockstate, entityplayer, enumfacing, f, f1, f2); + } + + private void activate(World worldIn, BlockPos pos) { + this.spawnParticles(worldIn, pos); + if (this == Blocks.redstone_ore) { + worldIn.setBlockState(pos, Blocks.lit_redstone_ore.getDefaultState()); + } + + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (this == Blocks.lit_redstone_ore) { + world.setBlockState(blockpos, Blocks.redstone_ore.getDefaultState()); + } + + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.redstone; + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int i, EaglercraftRandom random) { + return this.quantityDropped(random) + random.nextInt(i + 1); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return 4 + random.nextInt(2); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); + if (this.getItemDropped(iblockstate, world.rand, i) != Item.getItemFromBlock(this)) { + int j = 1 + world.rand.nextInt(5); + this.dropXpOnBlockBreak(world, blockpos, j); + } + + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (this.isOn) { + this.spawnParticles(world, blockpos); + } + + } + + private void spawnParticles(World worldIn, BlockPos pos) { + EaglercraftRandom random = worldIn.rand; + double d0 = 0.0625D; + + for (int i = 0; i < 6; ++i) { + double d1 = (double) ((float) pos.getX() + random.nextFloat()); + double d2 = (double) ((float) pos.getY() + random.nextFloat()); + double d3 = (double) ((float) pos.getZ() + random.nextFloat()); + if (i == 0 && !worldIn.getBlockState(pos.up()).getBlock().isOpaqueCube()) { + d2 = (double) pos.getY() + d0 + 1.0D; + } + + if (i == 1 && !worldIn.getBlockState(pos.down()).getBlock().isOpaqueCube()) { + d2 = (double) pos.getY() - d0; + } + + if (i == 2 && !worldIn.getBlockState(pos.south()).getBlock().isOpaqueCube()) { + d3 = (double) pos.getZ() + d0 + 1.0D; + } + + if (i == 3 && !worldIn.getBlockState(pos.north()).getBlock().isOpaqueCube()) { + d3 = (double) pos.getZ() - d0; + } + + if (i == 4 && !worldIn.getBlockState(pos.east()).getBlock().isOpaqueCube()) { + d1 = (double) pos.getX() + d0 + 1.0D; + } + + if (i == 5 && !worldIn.getBlockState(pos.west()).getBlock().isOpaqueCube()) { + d1 = (double) pos.getX() - d0; + } + + if (d1 < (double) pos.getX() || d1 > (double) (pos.getX() + 1) || d2 < 0.0D + || d2 > (double) (pos.getY() + 1) || d3 < (double) pos.getZ() || d3 > (double) (pos.getZ() + 1)) { + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, d1, d2, d3, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + } + + protected ItemStack createStackedBlock(IBlockState var1) { + return new ItemStack(Blocks.redstone_ore); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneRepeater.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneRepeater.java new file mode 100644 index 0000000..8dac133 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneRepeater.java @@ -0,0 +1,169 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneDiode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedstoneRepeater extends BlockRedstoneDiode { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneRepeater"); + } + + public static final PropertyBool LOCKED = PropertyBool.create("locked"); + public static final PropertyInteger DELAY = PropertyInteger.create("delay", 1, 4); + + protected BlockRedstoneRepeater(boolean powered) { + super(powered); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(DELAY, Integer.valueOf(1)).withProperty(LOCKED, Boolean.valueOf(false))); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal("item.diode.name"); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate.withProperty(LOCKED, Boolean.valueOf(this.isLocked(iblockaccess, blockpos, iblockstate))); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (!entityplayer.capabilities.allowEdit) { + return false; + } else { + world.setBlockState(blockpos, iblockstate.cycleProperty(DELAY), 3); + return true; + } + } + + protected int getDelay(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(DELAY)).intValue() * 2; + } + + protected IBlockState getPoweredState(IBlockState iblockstate) { + Integer integer = (Integer) iblockstate.getValue(DELAY); + Boolean obool = (Boolean) iblockstate.getValue(LOCKED); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + return Blocks.powered_repeater.getDefaultState().withProperty(FACING, enumfacing).withProperty(DELAY, integer) + .withProperty(LOCKED, obool); + } + + protected IBlockState getUnpoweredState(IBlockState iblockstate) { + Integer integer = (Integer) iblockstate.getValue(DELAY); + Boolean obool = (Boolean) iblockstate.getValue(LOCKED); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + return Blocks.unpowered_repeater.getDefaultState().withProperty(FACING, enumfacing).withProperty(DELAY, integer) + .withProperty(LOCKED, obool); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.repeater; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.repeater; + } + + public boolean isLocked(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate) { + return this.getPowerOnSides(iblockaccess, blockpos, iblockstate) > 0; + } + + protected boolean canPowerSide(Block block) { + return isRedstoneRepeaterBlockID(block); + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + if (this.isRepeaterPowered) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + double d0 = (double) ((float) blockpos.getX() + 0.5F) + (double) (random.nextFloat() - 0.5F) * 0.2D; + double d1 = (double) ((float) blockpos.getY() + 0.4F) + (double) (random.nextFloat() - 0.5F) * 0.2D; + double d2 = (double) ((float) blockpos.getZ() + 0.5F) + (double) (random.nextFloat() - 0.5F) * 0.2D; + float f = -5.0F; + if (random.nextBoolean()) { + f = (float) (((Integer) iblockstate.getValue(DELAY)).intValue() * 2 - 1); + } + + f = f / 16.0F; + double d3 = (double) (f * (float) enumfacing.getFrontOffsetX()); + double d4 = (double) (f * (float) enumfacing.getFrontOffsetZ()); + world.spawnParticle(EnumParticleTypes.REDSTONE, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + super.breakBlock(world, blockpos, iblockstate); + this.notifyNeighbors(world, blockpos, iblockstate); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(i)) + .withProperty(LOCKED, Boolean.valueOf(false)).withProperty(DELAY, Integer.valueOf(1 + (i >> 2))); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + i = i | ((Integer) iblockstate.getValue(DELAY)).intValue() - 1 << 2; + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, DELAY, LOCKED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneTorch.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneTorch.java new file mode 100644 index 0000000..230fccc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneTorch.java @@ -0,0 +1,225 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTorch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedstoneTorch extends BlockTorch { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneTorch"); + } + + private static Map> toggles = Maps.newHashMap(); + private final boolean isOn; + + private boolean isBurnedOut(World worldIn, BlockPos pos, boolean turnOff) { + if (!toggles.containsKey(worldIn)) { + toggles.put(worldIn, Lists.newArrayList()); + } + + List list = (List) toggles.get(worldIn); + if (turnOff) { + list.add(new BlockRedstoneTorch.Toggle(pos, worldIn.getTotalWorldTime())); + } + + int i = 0; + + for (int j = 0; j < list.size(); ++j) { + BlockRedstoneTorch.Toggle blockredstonetorch$toggle = (BlockRedstoneTorch.Toggle) list.get(j); + if (blockredstonetorch$toggle.pos.equals(pos)) { + ++i; + if (i >= 8) { + return true; + } + } + } + + return false; + } + + protected BlockRedstoneTorch(boolean isOn) { + this.isOn = isOn; + this.setTickRandomly(true); + this.setCreativeTab((CreativeTabs) null); + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World var1) { + return 2; + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + if (this.isOn) { + for (EnumFacing enumfacing : EnumFacing.values()) { + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this); + } + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { + if (this.isOn) { + for (EnumFacing enumfacing : EnumFacing.values()) { + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this); + } + } + + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing enumfacing) { + return this.isOn && iblockstate.getValue(FACING) != enumfacing ? 15 : 0; + } + + private boolean shouldBeOff(World worldIn, BlockPos pos, IBlockState state) { + EnumFacing enumfacing = ((EnumFacing) state.getValue(FACING)).getOpposite(); + return worldIn.isSidePowered(pos.offset(enumfacing), enumfacing); + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + boolean flag = this.shouldBeOff(world, blockpos, iblockstate); + List list = (List) toggles.get(world); + + while (list != null && !list.isEmpty() + && world.getTotalWorldTime() - ((BlockRedstoneTorch.Toggle) list.get(0)).time > 60L) { + list.remove(0); + } + + if (this.isOn) { + if (flag) { + world.setBlockState(blockpos, Blocks.unlit_redstone_torch.getDefaultState().withProperty(FACING, + iblockstate.getValue(FACING)), 3); + if (this.isBurnedOut(world, blockpos, true)) { + world.playSoundEffect((double) ((float) blockpos.getX() + 0.5F), + (double) ((float) blockpos.getY() + 0.5F), (double) ((float) blockpos.getZ() + 0.5F), + "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + + for (int i = 0; i < 5; ++i) { + double d0 = (double) blockpos.getX() + random.nextDouble() * 0.6D + 0.2D; + double d1 = (double) blockpos.getY() + random.nextDouble() * 0.6D + 0.2D; + double d2 = (double) blockpos.getZ() + random.nextDouble() * 0.6D + 0.2D; + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + world.scheduleUpdate(blockpos, world.getBlockState(blockpos).getBlock(), 160); + } + } + } else if (!flag && !this.isBurnedOut(world, blockpos, false)) { + world.setBlockState(blockpos, + Blocks.redstone_torch.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + } + + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!this.onNeighborChangeInternal(world, blockpos, iblockstate)) { + if (this.isOn == this.shouldBeOff(world, blockpos, iblockstate)) { + world.scheduleUpdate(blockpos, this, this.tickRate(world)); + } + + } + } + + public int getStrongPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate, + EnumFacing enumfacing) { + return enumfacing == EnumFacing.DOWN ? this.getWeakPower(iblockaccess, blockpos, iblockstate, enumfacing) : 0; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + if (this.isOn) { + double d0 = (double) blockpos.getX() + 0.5D + (random.nextDouble() - 0.5D) * 0.2D; + double d1 = (double) blockpos.getY() + 0.7D + (random.nextDouble() - 0.5D) * 0.2D; + double d2 = (double) blockpos.getZ() + 0.5D + (random.nextDouble() - 0.5D) * 0.2D; + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (enumfacing.getAxis().isHorizontal()) { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + double d3 = 0.27D; + d0 += 0.27D * (double) enumfacing1.getFrontOffsetX(); + d1 += 0.22D; + d2 += 0.27D * (double) enumfacing1.getFrontOffsetZ(); + } + + world.spawnParticle(EnumParticleTypes.REDSTONE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + public boolean isAssociatedBlock(Block block) { + return block == Blocks.unlit_redstone_torch || block == Blocks.redstone_torch; + } + + static class Toggle { + BlockPos pos; + long time; + + public Toggle(BlockPos pos, long time) { + this.pos = pos; + this.time = time; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneWire.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneWire.java new file mode 100644 index 0000000..9c8636b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneWire.java @@ -0,0 +1,468 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.EnumSet; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneDiode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneRepeater; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockRedstoneWire extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRedstoneWire"); + } + + public static PropertyEnum NORTH; + public static PropertyEnum EAST; + public static PropertyEnum SOUTH; + public static PropertyEnum WEST; + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + private boolean canProvidePower = true; + /**+ + * List of blocks to update with redstone. + */ + private final Set blocksNeedingUpdate = Sets.newHashSet(); + + public BlockRedstoneWire() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState() + .withProperty(NORTH, BlockRedstoneWire.EnumAttachPosition.NONE) + .withProperty(EAST, BlockRedstoneWire.EnumAttachPosition.NONE) + .withProperty(SOUTH, BlockRedstoneWire.EnumAttachPosition.NONE) + .withProperty(WEST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(POWER, Integer.valueOf(0))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + } + + public static void bootstrapStates() { + NORTH = PropertyEnum.create("north", + BlockRedstoneWire.EnumAttachPosition.class); + EAST = PropertyEnum.create("east", + BlockRedstoneWire.EnumAttachPosition.class); + SOUTH = PropertyEnum.create("south", + BlockRedstoneWire.EnumAttachPosition.class); + WEST = PropertyEnum.create("west", + BlockRedstoneWire.EnumAttachPosition.class); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + iblockstate = iblockstate.withProperty(WEST, this.getAttachPosition(iblockaccess, blockpos, EnumFacing.WEST)); + iblockstate = iblockstate.withProperty(EAST, this.getAttachPosition(iblockaccess, blockpos, EnumFacing.EAST)); + iblockstate = iblockstate.withProperty(NORTH, this.getAttachPosition(iblockaccess, blockpos, EnumFacing.NORTH)); + iblockstate = iblockstate.withProperty(SOUTH, this.getAttachPosition(iblockaccess, blockpos, EnumFacing.SOUTH)); + return iblockstate; + } + + private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, + EnumFacing direction) { + BlockPos blockpos = pos.offset(direction); + Block block = worldIn.getBlockState(pos.offset(direction)).getBlock(); + if (!canConnectTo(worldIn.getBlockState(blockpos), direction) + && (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down())))) { + Block block1 = worldIn.getBlockState(pos.up()).getBlock(); + return !block1.isBlockNormalCube() && block.isBlockNormalCube() + && canConnectUpwardsTo(worldIn.getBlockState(blockpos.up())) + ? BlockRedstoneWire.EnumAttachPosition.UP + : BlockRedstoneWire.EnumAttachPosition.NONE; + } else { + return BlockRedstoneWire.EnumAttachPosition.SIDE; + } + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int i) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + return iblockstate.getBlock() != this ? super.colorMultiplier(iblockaccess, blockpos, i) + : this.colorMultiplier(((Integer) iblockstate.getValue(POWER)).intValue()); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return World.doesBlockHaveSolidTopSurface(world, blockpos.down()) + || world.getBlockState(blockpos.down()).getBlock() == Blocks.glowstone; + } + + private IBlockState updateSurroundingRedstone(World worldIn, BlockPos pos, IBlockState state) { + state = this.calculateCurrentChanges(worldIn, pos, pos, state); + ArrayList arraylist = Lists.newArrayList(this.blocksNeedingUpdate); + this.blocksNeedingUpdate.clear(); + + for (BlockPos blockpos : (ArrayList) arraylist) { + worldIn.notifyNeighborsOfStateChange(blockpos, this); + } + + return state; + } + + private IBlockState calculateCurrentChanges(World worldIn, BlockPos pos1, BlockPos pos2, IBlockState state) { + IBlockState iblockstate = state; + int i = ((Integer) state.getValue(POWER)).intValue(); + int j = 0; + j = this.getMaxCurrentStrength(worldIn, pos2, j); + this.canProvidePower = false; + int k = worldIn.isBlockIndirectlyGettingPowered(pos1); + this.canProvidePower = true; + if (k > 0 && k > j - 1) { + j = k; + } + + int l = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos = pos1.offset(enumfacing); + boolean flag = blockpos.getX() != pos2.getX() || blockpos.getZ() != pos2.getZ(); + if (flag) { + l = this.getMaxCurrentStrength(worldIn, blockpos, l); + } + + if (worldIn.getBlockState(blockpos).getBlock().isNormalCube() + && !worldIn.getBlockState(pos1.up()).getBlock().isNormalCube()) { + if (flag && pos1.getY() >= pos2.getY()) { + l = this.getMaxCurrentStrength(worldIn, blockpos.up(), l); + } + } else if (!worldIn.getBlockState(blockpos).getBlock().isNormalCube() && flag + && pos1.getY() <= pos2.getY()) { + l = this.getMaxCurrentStrength(worldIn, blockpos.down(), l); + } + } + + if (l > j) { + j = l - 1; + } else if (j > 0) { + --j; + } else { + j = 0; + } + + if (k > j - 1) { + j = k; + } + + if (i != j) { + state = state.withProperty(POWER, Integer.valueOf(j)); + if (worldIn.getBlockState(pos1) == iblockstate) { + worldIn.setBlockState(pos1, state, 2); + } + + this.blocksNeedingUpdate.add(pos1); + + for (EnumFacing enumfacing1 : EnumFacing.values()) { + this.blocksNeedingUpdate.add(pos1.offset(enumfacing1)); + } + } + + return state; + } + + /**+ + * Calls World.notifyNeighborsOfStateChange() for all + * neighboring blocks, but only if the given block is a redstone + * wire. + */ + private void notifyWireNeighborsOfStateChange(World worldIn, BlockPos pos) { + if (worldIn.getBlockState(pos).getBlock() == this) { + worldIn.notifyNeighborsOfStateChange(pos, this); + + for (EnumFacing enumfacing : EnumFacing.values()) { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + + } + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + { + this.updateSurroundingRedstone(world, blockpos, iblockstate); + + for (EnumFacing enumfacing : EnumFacing.Plane.VERTICAL) { + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this); + } + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + this.notifyWireNeighborsOfStateChange(world, blockpos.offset(enumfacing1)); + } + + for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos1 = blockpos.offset(enumfacing2); + if (world.getBlockState(blockpos1).getBlock().isNormalCube()) { + this.notifyWireNeighborsOfStateChange(world, blockpos1.up()); + } else { + this.notifyWireNeighborsOfStateChange(world, blockpos1.down()); + } + } + } + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + super.breakBlock(world, blockpos, iblockstate); + { + for (EnumFacing enumfacing : EnumFacing.values()) { + world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this); + } + + this.updateSurroundingRedstone(world, blockpos, iblockstate); + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + this.notifyWireNeighborsOfStateChange(world, blockpos.offset(enumfacing1)); + } + + for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos1 = blockpos.offset(enumfacing2); + if (world.getBlockState(blockpos1).getBlock().isNormalCube()) { + this.notifyWireNeighborsOfStateChange(world, blockpos1.up()); + } else { + this.notifyWireNeighborsOfStateChange(world, blockpos1.down()); + } + } + } + } + + private int getMaxCurrentStrength(World worldIn, BlockPos pos, int strength) { + if (worldIn.getBlockState(pos).getBlock() != this) { + return strength; + } else { + int i = ((Integer) worldIn.getBlockState(pos).getValue(POWER)).intValue(); + return i > strength ? i : strength; + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (this.canPlaceBlockAt(world, blockpos)) { + this.updateSurroundingRedstone(world, blockpos, iblockstate); + } else { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.redstone; + } + + public int getStrongPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate, + EnumFacing enumfacing) { + return !this.canProvidePower ? 0 : this.getWeakPower(iblockaccess, blockpos, iblockstate, enumfacing); + } + + public int getWeakPower(IBlockAccess iblockaccess, BlockPos blockpos, IBlockState iblockstate, + EnumFacing enumfacing) { + if (!this.canProvidePower) { + return 0; + } else { + int i = ((Integer) iblockstate.getValue(POWER)).intValue(); + if (i == 0) { + return 0; + } else if (enumfacing == EnumFacing.UP) { + return i; + } else { + EnumSet enumset = EnumSet.noneOf(EnumFacing.class); + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + if (this.func_176339_d(iblockaccess, blockpos, enumfacing1)) { + enumset.add(enumfacing1); + } + } + + if (enumfacing.getAxis().isHorizontal() && enumset.isEmpty()) { + return i; + } else if (enumset.contains(enumfacing) && !enumset.contains(enumfacing.rotateYCCW()) + && !enumset.contains(enumfacing.rotateY())) { + return i; + } else { + return 0; + } + } + } + } + + private boolean func_176339_d(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { + BlockPos blockpos = pos.offset(side); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + boolean flag = block.isNormalCube(); + boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); + return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true + : (canConnectTo(iblockstate, side) ? true + : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side + ? true + : !flag && canConnectUpwardsTo(worldIn, blockpos.down()))); + } + + protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) { + return canConnectUpwardsTo(worldIn.getBlockState(pos)); + } + + protected static boolean canConnectUpwardsTo(IBlockState state) { + return canConnectTo(state, (EnumFacing) null); + } + + protected static boolean canConnectTo(IBlockState blockState, EnumFacing side) { + Block block = blockState.getBlock(); + if (block == Blocks.redstone_wire) { + return true; + } else if (Blocks.unpowered_repeater.isAssociated(block)) { + EnumFacing enumfacing = (EnumFacing) blockState.getValue(BlockRedstoneRepeater.FACING); + return enumfacing == side || enumfacing.getOpposite() == side; + } else { + return block.canProvidePower() && side != null; + } + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return this.canProvidePower; + } + + private int colorMultiplier(int powerLevel) { + float f = (float) powerLevel / 15.0F; + float f1 = f * 0.6F + 0.4F; + if (powerLevel == 0) { + f1 = 0.3F; + } + + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + if (f2 < 0.0F) { + f2 = 0.0F; + } + + if (f3 < 0.0F) { + f3 = 0.0F; + } + + int i = MathHelper.clamp_int((int) (f1 * 255.0F), 0, 255); + int j = MathHelper.clamp_int((int) (f2 * 255.0F), 0, 255); + int k = MathHelper.clamp_int((int) (f3 * 255.0F), 0, 255); + return -16777216 | i << 16 | j << 8 | k; + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + int i = ((Integer) iblockstate.getValue(POWER)).intValue(); + if (i != 0) { + double d0 = (double) blockpos.getX() + 0.5D + ((double) random.nextFloat() - 0.5D) * 0.2D; + double d1 = (double) ((float) blockpos.getY() + 0.0625F); + double d2 = (double) blockpos.getZ() + 0.5D + ((double) random.nextFloat() - 0.5D) * 0.2D; + float f = (float) i / 15.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = Math.max(0.0F, f * f * 0.7F - 0.5F); + float f3 = Math.max(0.0F, f * f * 0.6F - 0.7F); + world.spawnParticle(EnumParticleTypes.REDSTONE, d0, d1, d2, (double) f1, (double) f2, (double) f3, + new int[0]); + } + } + + public Item getItem(World var1, BlockPos var2) { + return Items.redstone; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(POWER, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(POWER)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { NORTH, EAST, SOUTH, WEST, POWER }); + } + + static enum EnumAttachPosition implements IStringSerializable { + UP("up"), SIDE("side"), NONE("none"); + + private final String name; + + private EnumAttachPosition(String name) { + this.name = name; + } + + public String toString() { + return this.getName(); + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockReed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockReed.java new file mode 100644 index 0000000..6780e15 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockReed.java @@ -0,0 +1,172 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockReed extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockReed"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + + protected BlockReed() { + super(Material.plants); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + float f = 0.375F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + this.setTickRandomly(true); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + if (world.getBlockState(blockpos.down()).getBlock() == Blocks.reeds + || this.checkForDrop(world, blockpos, iblockstate)) { + if (world.isAirBlock(blockpos.up())) { + int i; + for (i = 1; world.getBlockState(blockpos.down(i)).getBlock() == this; ++i) { + ; + } + + if (i < 3) { + int j = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (j == 15) { + world.setBlockState(blockpos.up(), this.getDefaultState()); + world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(0)), 4); + } else { + world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(j + 1)), 4); + } + } + } + + } + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + Block block = world.getBlockState(blockpos.down()).getBlock(); + if (block == this) { + return true; + } else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand) { + return false; + } else { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (world.getBlockState(blockpos.offset(enumfacing).down()).getBlock() + .getMaterial() == Material.water) { + return true; + } + } + + return false; + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.checkForDrop(world, blockpos, iblockstate); + } + + protected final boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (this.canBlockStay(worldIn, pos)) { + return true; + } else { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + } + + public boolean canBlockStay(World worldIn, BlockPos pos) { + return this.canPlaceBlockAt(worldIn, pos); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.reeds; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.reeds; + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return iblockaccess.getBiomeGenForCoords(blockpos).getGrassColorAtPos(blockpos); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AGE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRotatedPillar.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRotatedPillar.java new file mode 100644 index 0000000..bd08648 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRotatedPillar.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockRotatedPillar extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockRotatedPillar"); + } + + public static final PropertyEnum AXIS = PropertyEnum.create("axis", + EnumFacing.Axis.class); + + protected BlockRotatedPillar(Material materialIn) { + super(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockRotatedPillar(Material parMaterial, MapColor parMapColor) { + super(parMaterial, parMapColor); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSand.java new file mode 100644 index 0000000..bade65f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSand.java @@ -0,0 +1,153 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSand extends BlockFalling { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSand"); + } + + public static PropertyEnum VARIANT; + + public BlockSand() { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSand.EnumType.SAND)); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockSand.EnumType.class); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockSand.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockSand.EnumType blocksand$enumtype : BlockSand.EnumType.values()) { + list.add(new ItemStack(item, 1, blocksand$enumtype.getMetadata())); + } + + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockSand.EnumType) iblockstate.getValue(VARIANT)).getMapColor(); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockSand.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockSand.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + SAND(0, "sand", "default", MapColor.sandColor), RED_SAND(1, "red_sand", "red", MapColor.adobeColor); + + private static final BlockSand.EnumType[] META_LOOKUP = new BlockSand.EnumType[values().length]; + private final int meta; + private final String name; + private final MapColor mapColor; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName, MapColor mapColor) { + this.meta = meta; + this.name = name; + this.mapColor = mapColor; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor() { + return this.mapColor; + } + + public static BlockSand.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockSand.EnumType blocksand$enumtype : values()) { + META_LOOKUP[blocksand$enumtype.getMetadata()] = blocksand$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSandStone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSandStone.java new file mode 100644 index 0000000..b451737 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSandStone.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSandStone extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSandStone"); + } + + public static PropertyEnum TYPE; + + public BlockSandStone() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockSandStone.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + TYPE = PropertyEnum.create("type", BlockSandStone.EnumType.class); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockSandStone.EnumType) iblockstate.getValue(TYPE)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockSandStone.EnumType blocksandstone$enumtype : BlockSandStone.EnumType.values()) { + list.add(new ItemStack(item, 1, blocksandstone$enumtype.getMetadata())); + } + + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.sandColor; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(TYPE, BlockSandStone.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockSandStone.EnumType) iblockstate.getValue(TYPE)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { TYPE }); + } + + public static enum EnumType implements IStringSerializable { + DEFAULT(0, "sandstone", "default"), CHISELED(1, "chiseled_sandstone", "chiseled"), + SMOOTH(2, "smooth_sandstone", "smooth"); + + private static final BlockSandStone.EnumType[] META_LOOKUP = new BlockSandStone.EnumType[values().length]; + private final int metadata; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) { + this.metadata = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.metadata; + } + + public String toString() { + return this.name; + } + + public static BlockSandStone.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockSandStone.EnumType blocksandstone$enumtype : values()) { + META_LOOKUP[blocksandstone$enumtype.getMetadata()] = blocksandstone$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSapling.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSapling.java new file mode 100644 index 0000000..8fc92d7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSapling.java @@ -0,0 +1,269 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenBigTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenForest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenSavannaTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTrees; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSapling extends BlockBush implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSapling"); + } + + public static PropertyEnum TYPE; + public static final PropertyInteger STAGE = PropertyInteger.create("stage", 0, 1); + + protected BlockSapling() { + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockPlanks.EnumType.OAK) + .withProperty(STAGE, Integer.valueOf(0))); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public static void bootstrapStates() { + TYPE = PropertyEnum.create("type", BlockPlanks.EnumType.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal( + this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name"); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + { + super.updateTick(world, blockpos, iblockstate, random); + if (world.getLightFromNeighbors(blockpos.up()) >= 9 && random.nextInt(7) == 0) { + this.grow(world, blockpos, iblockstate, random); + } + } + } + + public void grow(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { + if (((Integer) state.getValue(STAGE)).intValue() == 0) { + worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4); + } else { + this.generateTree(worldIn, pos, state, rand); + } + + } + + public void generateTree(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { + Object object = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); + int i = 0; + int j = 0; + boolean flag = false; + switch ((BlockPlanks.EnumType) state.getValue(TYPE)) { + case SPRUCE: + label114: for (i = 0; i >= -1; --i) { + for (j = 0; j >= -1; --j) { + if (this.func_181624_a(worldIn, pos, i, j, BlockPlanks.EnumType.SPRUCE)) { + object = new WorldGenMegaPineTree(false, rand.nextBoolean()); + flag = true; + break label114; + } + } + } + + if (!flag) { + j = 0; + i = 0; + object = new WorldGenTaiga2(true); + } + break; + case BIRCH: + object = new WorldGenForest(true, false); + break; + case JUNGLE: + IBlockState iblockstate = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.JUNGLE); + IBlockState iblockstate1 = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + label269: for (i = 0; i >= -1; --i) { + for (j = 0; j >= -1; --j) { + if (this.func_181624_a(worldIn, pos, i, j, BlockPlanks.EnumType.JUNGLE)) { + object = new WorldGenMegaJungle(true, 10, 20, iblockstate, iblockstate1); + flag = true; + break label269; + } + } + } + + if (!flag) { + j = 0; + i = 0; + object = new WorldGenTrees(true, 4 + rand.nextInt(7), iblockstate, iblockstate1, false); + } + break; + case ACACIA: + object = new WorldGenSavannaTree(true); + break; + case DARK_OAK: + label390: for (i = 0; i >= -1; --i) { + for (j = 0; j >= -1; --j) { + if (this.func_181624_a(worldIn, pos, i, j, BlockPlanks.EnumType.DARK_OAK)) { + object = new WorldGenCanopyTree(true); + flag = true; + break label390; + } + } + } + + if (!flag) { + return; + } + case OAK: + } + + IBlockState iblockstate2 = Blocks.air.getDefaultState(); + if (flag) { + worldIn.setBlockState(pos.add(i, 0, j), iblockstate2, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j), iblockstate2, 4); + worldIn.setBlockState(pos.add(i, 0, j + 1), iblockstate2, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j + 1), iblockstate2, 4); + } else { + worldIn.setBlockState(pos, iblockstate2, 4); + } + + if (!((WorldGenerator) object).generate(worldIn, rand, pos.add(i, 0, j))) { + if (flag) { + worldIn.setBlockState(pos.add(i, 0, j), state, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j), state, 4); + worldIn.setBlockState(pos.add(i, 0, j + 1), state, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j + 1), state, 4); + } else { + worldIn.setBlockState(pos, state, 4); + } + } + + } + + private boolean func_181624_a(World parWorld, BlockPos parBlockPos, int parInt1, int parInt2, + BlockPlanks.EnumType parEnumType) { + return this.isTypeAt(parWorld, parBlockPos.add(parInt1, 0, parInt2), parEnumType) + && this.isTypeAt(parWorld, parBlockPos.add(parInt1 + 1, 0, parInt2), parEnumType) + && this.isTypeAt(parWorld, parBlockPos.add(parInt1, 0, parInt2 + 1), parEnumType) + && this.isTypeAt(parWorld, parBlockPos.add(parInt1 + 1, 0, parInt2 + 1), parEnumType); + } + + /**+ + * Check whether the given BlockPos has a Sapling of the given + * type + */ + public boolean isTypeAt(World worldIn, BlockPos pos, BlockPlanks.EnumType type) { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock() == this && iblockstate.getValue(TYPE) == type; + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(TYPE)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) { + list.add(new ItemStack(item, 1, blockplanks$enumtype.getMetadata())); + } + + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4) { + return true; + } + + public boolean canUseBonemeal(World world, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return (double) world.rand.nextFloat() < 0.45D; + } + + public void grow(World world, EaglercraftRandom random, BlockPos blockpos, IBlockState iblockstate) { + this.grow(world, blockpos, iblockstate, random); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(TYPE, BlockPlanks.EnumType.byMetadata(i & 7)).withProperty(STAGE, + Integer.valueOf((i & 8) >> 3)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockPlanks.EnumType) iblockstate.getValue(TYPE)).getMetadata(); + i = i | ((Integer) iblockstate.getValue(STAGE)).intValue() << 3; + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { TYPE, STAGE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSeaLantern.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSeaLantern.java new file mode 100644 index 0000000..ccdb688 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSeaLantern.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSeaLantern extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSeaLantern"); + } + + public BlockSeaLantern(Material materialIn) { + super(materialIn); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) { + return 2 + random.nextInt(2); + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int i, EaglercraftRandom random) { + return MathHelper.clamp_int(this.quantityDropped(random) + random.nextInt(i + 1), 1, 5); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.prismarine_crystals; + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return MapColor.quartzColor; + } + + protected boolean canSilkHarvest() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSign.java new file mode 100644 index 0000000..80ee208 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSign.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSign extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSign"); + } + + protected BlockSign() { + super(Material.wood); + float f = 0.25F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getSelectedBoundingBox(world, blockpos); + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess var1, BlockPos var2) { + return true; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean func_181623_g() { + return true; + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntitySign(); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.sign; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.sign; + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + TileEntity tileentity = world.getTileEntity(blockpos); + return tileentity instanceof TileEntitySign ? ((TileEntitySign) tileentity).executeCommand(entityplayer) + : false; + } + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return !this.func_181087_e(world, blockpos) && super.canPlaceBlockAt(world, blockpos); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSilverfish.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSilverfish.java new file mode 100644 index 0000000..b53d074 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSilverfish.java @@ -0,0 +1,235 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSilverfish extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSilverfish"); + } + + public static PropertyEnum VARIANT; + + public BlockSilverfish() { + super(Material.clay); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSilverfish.EnumType.STONE)); + this.setHardness(0.0F); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockSilverfish.EnumType.class); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public static boolean canContainSilverfish(IBlockState blockState) { + Block block = blockState.getBlock(); + return blockState == Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE) + || block == Blocks.cobblestone || block == Blocks.stonebrick; + } + + protected ItemStack createStackedBlock(IBlockState iblockstate) { + switch ((BlockSilverfish.EnumType) iblockstate.getValue(VARIANT)) { + case COBBLESTONE: + return new ItemStack(Blocks.cobblestone); + case STONEBRICK: + return new ItemStack(Blocks.stonebrick); + case MOSSY_STONEBRICK: + return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.MOSSY.getMetadata()); + case CRACKED_STONEBRICK: + return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CRACKED.getMetadata()); + case CHISELED_STONEBRICK: + return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CHISELED.getMetadata()); + default: + return new ItemStack(Blocks.stone); + } + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState var3, float var4, int var5) { + if (world.getGameRules().getBoolean("doTileDrops")) { + EntitySilverfish entitysilverfish = new EntitySilverfish(world); + entitysilverfish.setLocationAndAngles((double) blockpos.getX() + 0.5D, (double) blockpos.getY(), + (double) blockpos.getZ() + 0.5D, 0.0F, 0.0F); + world.spawnEntityInWorld(entitysilverfish); + entitysilverfish.spawnExplosionParticle(); + } + + } + + public int getDamageValue(World world, BlockPos blockpos) { + IBlockState iblockstate = world.getBlockState(blockpos); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockSilverfish.EnumType blocksilverfish$enumtype : BlockSilverfish.EnumType.values()) { + list.add(new ItemStack(item, 1, blocksilverfish$enumtype.getMetadata())); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockSilverfish.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockSilverfish.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + STONE(0, "stone") { + public IBlockState getModelBlock() { + return Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE); + } + }, + COBBLESTONE(1, "cobblestone", "cobble") { + public IBlockState getModelBlock() { + return Blocks.cobblestone.getDefaultState(); + } + }, + STONEBRICK(2, "stone_brick", "brick") { + public IBlockState getModelBlock() { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, + BlockStoneBrick.EnumType.DEFAULT); + } + }, + MOSSY_STONEBRICK(3, "mossy_brick", "mossybrick") { + public IBlockState getModelBlock() { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, + BlockStoneBrick.EnumType.MOSSY); + } + }, + CRACKED_STONEBRICK(4, "cracked_brick", "crackedbrick") { + public IBlockState getModelBlock() { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, + BlockStoneBrick.EnumType.CRACKED); + } + }, + CHISELED_STONEBRICK(5, "chiseled_brick", "chiseledbrick") { + public IBlockState getModelBlock() { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, + BlockStoneBrick.EnumType.CHISELED); + } + }; + + private static final BlockSilverfish.EnumType[] META_LOOKUP = new BlockSilverfish.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name) { + this(meta, name, name); + } + + private EnumType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockSilverfish.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + public abstract IBlockState getModelBlock(); + + public static BlockSilverfish.EnumType forModelBlock(IBlockState model) { + for (BlockSilverfish.EnumType blocksilverfish$enumtype : values()) { + if (model == blocksilverfish$enumtype.getModelBlock()) { + return blocksilverfish$enumtype; + } + } + + return STONE; + } + + static { + for (BlockSilverfish.EnumType blocksilverfish$enumtype : values()) { + META_LOOKUP[blocksilverfish$enumtype.getMetadata()] = blocksilverfish$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSkull.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSkull.java new file mode 100644 index 0000000..1d6eea4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSkull.java @@ -0,0 +1,306 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockWorldState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockStateHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.FactoryBlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityWither; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSkull extends BlockContainer { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSkull"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool NODROP = PropertyBool.create("nodrop"); + private static final Predicate IS_WITHER_SKELETON = new Predicate() { + public boolean apply(BlockWorldState blockworldstate) { + return blockworldstate.getBlockState() != null && blockworldstate.getBlockState().getBlock() == Blocks.skull + && blockworldstate.getTileEntity() instanceof TileEntitySkull + && ((TileEntitySkull) blockworldstate.getTileEntity()).getSkullType() == 1; + } + }; + private BlockPattern witherBasePattern; + private BlockPattern witherPattern; + + protected BlockSkull() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(NODROP, + Boolean.valueOf(false))); + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal("tile.skull.skeleton.name"); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + switch ((EnumFacing) iblockaccess.getBlockState(blockpos).getValue(FACING)) { + case UP: + default: + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + break; + case NORTH: + this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); + break; + case SOUTH: + this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); + break; + case WEST: + this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); + break; + case EAST: + this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); + } + + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing var3, float var4, float var5, float var6, + int var7, EntityLivingBase entitylivingbase) { + return this.getDefaultState().withProperty(FACING, entitylivingbase.getHorizontalFacing()).withProperty(NODROP, + Boolean.valueOf(false)); + } + + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntitySkull(); + } + + public Item getItem(World var1, BlockPos var2) { + return Items.skull; + } + + public int getDamageValue(World world, BlockPos blockpos) { + TileEntity tileentity = world.getTileEntity(blockpos); + return tileentity instanceof TileEntitySkull ? ((TileEntitySkull) tileentity).getSkullType() + : super.getDamageValue(world, blockpos); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World var1, BlockPos var2, IBlockState var3, float var4, int var5) { + } + + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + if (entityplayer.capabilities.isCreativeMode) { + iblockstate = iblockstate.withProperty(NODROP, Boolean.valueOf(true)); + world.setBlockState(blockpos, iblockstate, 4); + } + + super.onBlockHarvested(world, blockpos, iblockstate, entityplayer); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + { + if (!((Boolean) iblockstate.getValue(NODROP)).booleanValue()) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntitySkull) { + TileEntitySkull tileentityskull = (TileEntitySkull) tileentity; + ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(world, blockpos)); + if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) { + itemstack.setTagCompound(new NBTTagCompound()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTUtil.writeGameProfile(nbttagcompound, tileentityskull.getPlayerProfile()); + itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); + } + + spawnAsEntity(world, blockpos, itemstack); + } + } + + super.breakBlock(world, blockpos, iblockstate); + } + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.skull; + } + + public boolean canDispenserPlace(World worldIn, BlockPos pos, ItemStack stack) { + return stack.getMetadata() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL + && this.getWitherBasePattern().match(worldIn, pos) != null; + } + + public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te) { + if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL) { + BlockPattern blockpattern = this.getWitherPattern(); + BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos); + if (blockpattern$patternhelper != null) { + for (int i = 0; i < 3; ++i) { + BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0); + worldIn.setBlockState(blockworldstate.getPos(), + blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2); + } + + for (int j = 0; j < blockpattern.getPalmLength(); ++j) { + for (int k = 0; k < blockpattern.getThumbLength(); ++k) { + BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0); + worldIn.setBlockState(blockworldstate1.getPos(), Blocks.air.getDefaultState(), 2); + } + } + + BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos(); + EntityWither entitywither = new EntityWither(worldIn); + BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos(); + entitywither.setLocationAndAngles((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.55D, + (double) blockpos1.getZ() + 0.5D, + blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F); + entitywither.renderYawOffset = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X + ? 0.0F + : 90.0F; + entitywither.func_82206_m(); + + for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, + entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D))) { + entityplayer.triggerAchievement(AchievementList.spawnWither); + } + + worldIn.spawnEntityInWorld(entitywither); + + for (int l = 0; l < 120; ++l) { + worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, + (double) blockpos.getX() + worldIn.rand.nextDouble(), + (double) (blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, + (double) blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); + } + + for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1) { + for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1) { + BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0); + worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air); + } + } + + } + } + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(i & 7)).withProperty(NODROP, + Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + if (((Boolean) iblockstate.getValue(NODROP)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, NODROP }); + } + + protected BlockPattern getWitherBasePattern() { + if (this.witherBasePattern == null) { + this.witherBasePattern = FactoryBlockPattern.start().aisle(new String[] { " ", "###", "~#~" }) + .where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.soul_sand))) + .where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.witherBasePattern; + } + + protected BlockPattern getWitherPattern() { + if (this.witherPattern == null) { + this.witherPattern = FactoryBlockPattern.start().aisle(new String[] { "^^^", "###", "~#~" }) + .where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.soul_sand))) + .where('^', IS_WITHER_SKELETON) + .where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.witherPattern; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlab.java new file mode 100644 index 0000000..5c0eccb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlab.java @@ -0,0 +1,214 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockSlab extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSlab"); + } + + public static PropertyEnum HALF; + + public BlockSlab(Material materialIn) { + super(materialIn); + if (this.isDouble()) { + this.fullBlock = true; + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + this.setLightOpacity(255); + } + + public static void bootstrapStates() { + HALF = PropertyEnum.create("half", BlockSlab.EnumBlockHalf.class); + } + + protected boolean canSilkHarvest() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + if (this.isDouble()) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + if (iblockstate.getBlock() == this) { + if (iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + } + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + if (this.isDouble()) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBlockBoundsBasedOnState(world, blockpos); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return this.isDouble(); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float f, float f1, float f2, + int i, EntityLivingBase entitylivingbase) { + IBlockState iblockstate = super.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, entitylivingbase) + .withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + return this.isDouble() ? iblockstate + : (enumfacing != EnumFacing.DOWN && (enumfacing == EnumFacing.UP || (double) f1 <= 0.5D) ? iblockstate + : iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.TOP)); + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return this.isDouble() ? 2 : 1; + } + + public boolean isFullCube() { + return this.isDouble(); + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + if (this.isDouble()) { + return super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } else if (enumfacing != EnumFacing.UP && enumfacing != EnumFacing.DOWN + && !super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing)) { + return false; + } else { + BlockPos blockpos1 = blockpos.offset(enumfacing.getOpposite()); + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + IBlockState iblockstate1 = iblockaccess.getBlockState(blockpos1); + boolean flag = isSlab(iblockstate.getBlock()) && iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; + boolean flag1 = isSlab(iblockstate1.getBlock()) + && iblockstate1.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; + return flag1 + ? (enumfacing == EnumFacing.DOWN ? true + : (enumfacing == EnumFacing.UP + && super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing) ? true + : !isSlab(iblockstate.getBlock()) || !flag)) + : (enumfacing == EnumFacing.UP ? true + : (enumfacing == EnumFacing.DOWN + && super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing) ? true + : !isSlab(iblockstate.getBlock()) || flag)); + } + } + + protected static boolean isSlab(Block blockIn) { + return blockIn == Blocks.stone_slab || blockIn == Blocks.wooden_slab || blockIn == Blocks.stone_slab2; + } + + public abstract String getUnlocalizedName(int var1); + + public int getDamageValue(World world, BlockPos blockpos) { + return super.getDamageValue(world, blockpos) & 7; + } + + public abstract boolean isDouble(); + + public abstract IProperty getVariantProperty(); + + public abstract Object getVariant(ItemStack var1); + + public static enum EnumBlockHalf implements IStringSerializable { + TOP("top"), BOTTOM("bottom"); + + private final String name; + + private EnumBlockHalf(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance().getBoolean("clickToSit") + && entityplayer.getHeldItem() == null) { + EntityArrow arrow = new EntityArrow(world, blockpos.getX() + 0.5D, blockpos.getY(), blockpos.getZ() + 0.5D); + arrow.isChair = true; + world.spawnEntityInWorld(arrow); + entityplayer.mountEntity(arrow); + return true; + } + return super.onBlockActivated(world, blockpos, var3, entityplayer, var5, var6, var7, var8); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlime.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlime.java new file mode 100644 index 0000000..cca3064 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlime.java @@ -0,0 +1,88 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBreakable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSlime extends BlockBreakable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSlime"); + } + + public BlockSlime() { + super(Material.clay, false, MapColor.grassColor); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.slipperiness = 0.8F; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + /**+ + * Block's chance to react to a living entity falling on it. + */ + public void onFallenUpon(World world, BlockPos blockpos, Entity entity, float f) { + if (entity.isSneaking()) { + super.onFallenUpon(world, blockpos, entity, f); + } else { + entity.fall(f, 0.0F); + } + + } + + /**+ + * Called when an Entity lands on this Block. This method *must* + * update motionY because the entity will not do that on its own + */ + public void onLanded(World world, Entity entity) { + if (entity.isSneaking()) { + super.onLanded(world, entity); + } else if (entity.motionY < 0.0D) { + entity.motionY = -entity.motionY; + } + + } + + /**+ + * Triggered whenever an entity collides with this block (enters + * into the block) + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, Entity entity) { + if (Math.abs(entity.motionY) < 0.1D && !entity.isSneaking()) { + double d0 = 0.4D + Math.abs(entity.motionY) * 0.2D; + entity.motionX *= d0; + entity.motionZ *= d0; + } + + super.onEntityCollidedWithBlock(world, blockpos, entity); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnow.java new file mode 100644 index 0000000..0a6dae4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnow.java @@ -0,0 +1,189 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSnow extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSnow"); + } + + public static final PropertyInteger LAYERS = PropertyInteger.create("layers", 1, 8); + + protected BlockSnow() { + super(Material.snow); + this.setDefaultState(this.blockState.getBaseState().withProperty(LAYERS, Integer.valueOf(1))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBoundsForItemRender(); + } + + public boolean isPassable(IBlockAccess iblockaccess, BlockPos blockpos) { + return ((Integer) iblockaccess.getBlockState(blockpos).getValue(LAYERS)).intValue() < 5; + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState iblockstate) { + int i = ((Integer) iblockstate.getValue(LAYERS)).intValue() - 1; + float f = 0.125F; + return new AxisAlignedBB((double) blockpos.getX() + this.minX, (double) blockpos.getY() + this.minY, + (double) blockpos.getZ() + this.minZ, (double) blockpos.getX() + this.maxX, + (double) ((float) blockpos.getY() + (float) i * f), (double) blockpos.getZ() + this.maxZ); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.getBoundsForLayers(0); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + this.getBoundsForLayers(((Integer) iblockstate.getValue(LAYERS)).intValue()); + } + + protected void getBoundsForLayers(int parInt1) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, (float) parInt1 / 8.0F, 1.0F); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + IBlockState iblockstate = world.getBlockState(blockpos.down()); + Block block = iblockstate.getBlock(); + return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true + : (block == this && ((Integer) iblockstate.getValue(LAYERS)).intValue() >= 7 ? true + : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) + : false; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.checkAndDropBlock(world, blockpos, iblockstate); + } + + private boolean checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state) { + if (!this.canPlaceBlockAt(worldIn, pos)) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } else { + return true; + } + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity var5) { + spawnAsEntity(world, blockpos, + new ItemStack(Items.snowball, ((Integer) iblockstate.getValue(LAYERS)).intValue() + 1, 0)); + world.setBlockToAir(blockpos); + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.snowball; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (world.getLightFor(EnumSkyBlock.BLOCK, blockpos) > 11) { + this.dropBlockAsItem(world, blockpos, world.getBlockState(blockpos), 0); + world.setBlockToAir(blockpos); + } + + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return enumfacing == EnumFacing.UP ? true : super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(LAYERS, Integer.valueOf((i & 7) + 1)); + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World world, BlockPos blockpos) { + return ((Integer) world.getBlockState(blockpos).getValue(LAYERS)).intValue() == 1; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(LAYERS)).intValue() - 1; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { LAYERS }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnowBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnowBlock.java new file mode 100644 index 0000000..ad70958 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnowBlock.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSnowBlock extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSnowBlock"); + } + + protected BlockSnowBlock() { + super(Material.craftedSnow); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.snowball; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 4; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (world.getLightFor(EnumSkyBlock.BLOCK, blockpos) > 11) { + this.dropBlockAsItem(world, blockpos, world.getBlockState(blockpos), 0); + world.setBlockToAir(blockpos); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSoulSand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSoulSand.java new file mode 100644 index 0000000..9535f6a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSoulSand.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSoulSand extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSoulSand"); + } + + public BlockSoulSand() { + super(Material.sand, MapColor.brownColor); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos blockpos, IBlockState var3) { + float f = 0.125F; + return new AxisAlignedBB((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ(), + (double) (blockpos.getX() + 1), (double) ((float) (blockpos.getY() + 1) - f), + (double) (blockpos.getZ() + 1)); + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World var1, BlockPos var2, IBlockState var3, Entity entity) { + entity.motionX *= 0.4D; + entity.motionZ *= 0.4D; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSourceImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSourceImpl.java new file mode 100644 index 0000000..57f5c8f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSourceImpl.java @@ -0,0 +1,73 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSourceImpl implements IBlockSource { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSourceImpl"); + } + + private final World worldObj; + private final BlockPos pos; + + public BlockSourceImpl(World worldIn, BlockPos posIn) { + this.worldObj = worldIn; + this.pos = posIn; + } + + public World getWorld() { + return this.worldObj; + } + + public double getX() { + return (double) this.pos.getX() + 0.5D; + } + + public double getY() { + return (double) this.pos.getY() + 0.5D; + } + + public double getZ() { + return (double) this.pos.getZ() + 0.5D; + } + + public BlockPos getBlockPos() { + return this.pos; + } + + public int getBlockMetadata() { + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + public T getBlockTileEntity() { + return (T) this.worldObj.getTileEntity(this.pos); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSponge.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSponge.java new file mode 100644 index 0000000..f6505d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSponge.java @@ -0,0 +1,196 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Tuple; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockSponge extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockSponge"); + } + + public static final PropertyBool WET = PropertyBool.create("wet"); + + protected BlockSponge() { + super(Material.sponge); + this.setDefaultState(this.blockState.getBaseState().withProperty(WET, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".dry.name"); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((Boolean) iblockstate.getValue(WET)).booleanValue() ? 1 : 0; + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.tryAbsorb(world, blockpos, iblockstate); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + this.tryAbsorb(world, blockpos, iblockstate); + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + } + + protected void tryAbsorb(World worldIn, BlockPos pos, IBlockState state) { + if (!((Boolean) state.getValue(WET)).booleanValue() && this.absorb(worldIn, pos)) { + worldIn.setBlockState(pos, state.withProperty(WET, Boolean.valueOf(true)), 2); + worldIn.playAuxSFX(2001, pos, Block.getIdFromBlock(Blocks.water)); + } + + } + + private boolean absorb(World worldIn, BlockPos pos) { + LinkedList linkedlist = Lists.newLinkedList(); + ArrayList arraylist = Lists.newArrayList(); + linkedlist.add(new Tuple(pos, Integer.valueOf(0))); + int i = 0; + + while (!linkedlist.isEmpty()) { + Tuple tuple = (Tuple) linkedlist.poll(); + BlockPos blockpos = (BlockPos) tuple.getFirst(); + int j = ((Integer) tuple.getSecond()).intValue(); + + for (EnumFacing enumfacing : EnumFacing.values()) { + BlockPos blockpos1 = blockpos.offset(enumfacing); + if (worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.water) { + worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 2); + arraylist.add(blockpos1); + ++i; + if (j < 6) { + linkedlist.add(new Tuple(blockpos1, Integer.valueOf(j + 1))); + } + } + } + + if (i > 64) { + break; + } + } + + for (BlockPos blockpos2 : (ArrayList) arraylist) { + worldIn.notifyNeighborsOfStateChange(blockpos2, Blocks.air); + } + + return i > 0; + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, 0)); + list.add(new ItemStack(item, 1, 1)); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(WET, Boolean.valueOf((i & 1) == 1)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Boolean) iblockstate.getValue(WET)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { WET }); + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + if (((Boolean) iblockstate.getValue(WET)).booleanValue()) { + EnumFacing enumfacing = EnumFacing.random(random); + if (enumfacing != EnumFacing.UP + && !World.doesBlockHaveSolidTopSurface(world, blockpos.offset(enumfacing))) { + double d0 = (double) blockpos.getX(); + double d1 = (double) blockpos.getY(); + double d2 = (double) blockpos.getZ(); + if (enumfacing == EnumFacing.DOWN) { + d1 = d1 - 0.05D; + d0 += random.nextDouble(); + d2 += random.nextDouble(); + } else { + d1 = d1 + random.nextDouble() * 0.8D; + if (enumfacing.getAxis() == EnumFacing.Axis.X) { + d2 += random.nextDouble(); + if (enumfacing == EnumFacing.EAST) { + ++d0; + } else { + d0 += 0.05D; + } + } else { + d0 += random.nextDouble(); + if (enumfacing == EnumFacing.SOUTH) { + ++d2; + } else { + d2 += 0.05D; + } + } + } + + world.spawnParticle(EnumParticleTypes.DRIP_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlass.java new file mode 100644 index 0000000..6a36ae4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlass.java @@ -0,0 +1,130 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBreakable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStainedGlass extends BlockBreakable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStainedGlass"); + } + + public static final PropertyEnum COLOR = PropertyEnum.create("color", + EnumDyeColor.class); + + public BlockStainedGlass(Material materialIn) { + super(materialIn, false); + this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { + list.add(new ItemStack(item, 1, enumdyecolor.getMetadata())); + } + + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMapColor(); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + protected boolean canSilkHarvest() { + return true; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(i)); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + BlockBeacon.updateColorAsync(world, blockpos); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { + BlockBeacon.updateColorAsync(world, blockpos); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { COLOR }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlassPane.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlassPane.java new file mode 100644 index 0000000..f4a20de --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlassPane.java @@ -0,0 +1,116 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPane; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStainedGlassPane extends BlockPane { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStainedGlassPane"); + } + + public static final PropertyEnum COLOR = PropertyEnum.create("color", + EnumDyeColor.class); + + public BlockStainedGlassPane() { + super(Material.glass, false); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, Boolean.valueOf(false)) + .withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)) + .withProperty(WEST, Boolean.valueOf(false)).withProperty(COLOR, EnumDyeColor.WHITE)); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (int i = 0; i < EnumDyeColor.values().length; ++i) { + list.add(new ItemStack(item, 1, i)); + } + + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMapColor(); + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumDyeColor) iblockstate.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { NORTH, EAST, WEST, SOUTH, COLOR }); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + BlockBeacon.updateColorAsync(world, blockpos); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { + BlockBeacon.updateColorAsync(world, blockpos); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStairs.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStairs.java new file mode 100644 index 0000000..9b1e09f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStairs.java @@ -0,0 +1,713 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.Arrays; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStairs extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStairs"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static PropertyEnum HALF; + public static PropertyEnum SHAPE; + private static final int[][] field_150150_a = new int[][] { { 4, 5 }, { 5, 7 }, { 6, 7 }, { 4, 6 }, { 0, 1 }, + { 1, 3 }, { 2, 3 }, { 0, 2 } }; + private final Block modelBlock; + private final IBlockState modelState; + private boolean hasRaytraced; + private int rayTracePass; + + protected BlockStairs(IBlockState modelState) { + super(modelState.getBlock().blockMaterial); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(HALF, BlockStairs.EnumHalf.BOTTOM).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT)); + this.modelBlock = modelState.getBlock(); + this.modelState = modelState; + this.setHardness(this.modelBlock.blockHardness); + this.setResistance(this.modelBlock.blockResistance / 3.0F); + this.setStepSound(this.modelBlock.stepSound); + this.setLightOpacity(255); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + HALF = PropertyEnum.create("half", BlockStairs.EnumHalf.class); + SHAPE = PropertyEnum.create("shape", BlockStairs.EnumShape.class); + } + + public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { + if (this.hasRaytraced) { + this.setBlockBounds(0.5F * (float) (this.rayTracePass % 2), 0.5F * (float) (this.rayTracePass / 4 % 2), + 0.5F * (float) (this.rayTracePass / 2 % 2), 0.5F + 0.5F * (float) (this.rayTracePass % 2), + 0.5F + 0.5F * (float) (this.rayTracePass / 4 % 2), + 0.5F + 0.5F * (float) (this.rayTracePass / 2 % 2)); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Set the block bounds as the collision bounds for the stairs + * at the given position + */ + public void setBaseCollisionBounds(IBlockAccess worldIn, BlockPos pos) { + if (worldIn.getBlockState(pos).getValue(HALF) == BlockStairs.EnumHalf.TOP) { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + } + + /**+ + * Checks if a block is stairs + */ + public static boolean isBlockStairs(Block blockIn) { + return blockIn instanceof BlockStairs; + } + + /**+ + * Check whether there is a stair block at the given position + * and it has the same properties as the given BlockState + */ + public static boolean isSameStair(IBlockAccess worldIn, BlockPos pos, IBlockState state) { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + /**+ + * Checks if a block is stairs + */ + return isBlockStairs(block) && iblockstate.getValue(HALF) == state.getValue(HALF) + && iblockstate.getValue(FACING) == state.getValue(FACING); + } + + public int func_176307_f(IBlockAccess blockAccess, BlockPos pos) { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf) iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + if (enumfacing == EnumFacing.EAST) { + IBlockState iblockstate1 = blockAccess.getBlockState(pos.east()); + Block block = iblockstate1.getBlock(); + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) { + EnumFacing enumfacing1 = (EnumFacing) iblockstate1.getValue(FACING); + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + return flag ? 1 : 2; + } + + if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + return flag ? 2 : 1; + } + } + } else if (enumfacing == EnumFacing.WEST) { + IBlockState iblockstate2 = blockAccess.getBlockState(pos.west()); + Block block1 = iblockstate2.getBlock(); + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) { + EnumFacing enumfacing2 = (EnumFacing) iblockstate2.getValue(FACING); + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + return flag ? 2 : 1; + } + + if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + return flag ? 1 : 2; + } + } + } else if (enumfacing == EnumFacing.SOUTH) { + IBlockState iblockstate3 = blockAccess.getBlockState(pos.south()); + Block block2 = iblockstate3.getBlock(); + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) { + EnumFacing enumfacing3 = (EnumFacing) iblockstate3.getValue(FACING); + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + return flag ? 2 : 1; + } + + if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + return flag ? 1 : 2; + } + } + } else if (enumfacing == EnumFacing.NORTH) { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.north()); + Block block3 = iblockstate4.getBlock(); + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) { + EnumFacing enumfacing4 = (EnumFacing) iblockstate4.getValue(FACING); + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + return flag ? 1 : 2; + } + + if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + return flag ? 2 : 1; + } + } + } + + return 0; + } + + public int func_176305_g(IBlockAccess blockAccess, BlockPos pos) { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf) iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + if (enumfacing == EnumFacing.EAST) { + IBlockState iblockstate1 = blockAccess.getBlockState(pos.west()); + Block block = iblockstate1.getBlock(); + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) { + EnumFacing enumfacing1 = (EnumFacing) iblockstate1.getValue(FACING); + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + return flag ? 1 : 2; + } + + if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + return flag ? 2 : 1; + } + } + } else if (enumfacing == EnumFacing.WEST) { + IBlockState iblockstate2 = blockAccess.getBlockState(pos.east()); + Block block1 = iblockstate2.getBlock(); + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) { + EnumFacing enumfacing2 = (EnumFacing) iblockstate2.getValue(FACING); + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + return flag ? 2 : 1; + } + + if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + return flag ? 1 : 2; + } + } + } else if (enumfacing == EnumFacing.SOUTH) { + IBlockState iblockstate3 = blockAccess.getBlockState(pos.north()); + Block block2 = iblockstate3.getBlock(); + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) { + EnumFacing enumfacing3 = (EnumFacing) iblockstate3.getValue(FACING); + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + return flag ? 2 : 1; + } + + if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + return flag ? 1 : 2; + } + } + } else if (enumfacing == EnumFacing.NORTH) { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.south()); + Block block3 = iblockstate4.getBlock(); + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) { + EnumFacing enumfacing4 = (EnumFacing) iblockstate4.getValue(FACING); + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + return flag ? 1 : 2; + } + + if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + return flag ? 2 : 1; + } + } + } + + return 0; + } + + public boolean func_176306_h(IBlockAccess blockAccess, BlockPos pos) { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf) iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + float f = 0.5F; + float f1 = 1.0F; + if (flag) { + f = 0.0F; + f1 = 0.5F; + } + + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.0F; + float f5 = 0.5F; + boolean flag1 = true; + if (enumfacing == EnumFacing.EAST) { + f2 = 0.5F; + f5 = 1.0F; + IBlockState iblockstate1 = blockAccess.getBlockState(pos.east()); + Block block = iblockstate1.getBlock(); + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) { + EnumFacing enumfacing1 = (EnumFacing) iblockstate1.getValue(FACING); + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + f5 = 0.5F; + flag1 = false; + } else if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + f4 = 0.5F; + flag1 = false; + } + } + } else if (enumfacing == EnumFacing.WEST) { + f3 = 0.5F; + f5 = 1.0F; + IBlockState iblockstate2 = blockAccess.getBlockState(pos.west()); + Block block1 = iblockstate2.getBlock(); + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) { + EnumFacing enumfacing2 = (EnumFacing) iblockstate2.getValue(FACING); + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + f5 = 0.5F; + flag1 = false; + } else if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + f4 = 0.5F; + flag1 = false; + } + } + } else if (enumfacing == EnumFacing.SOUTH) { + f4 = 0.5F; + f5 = 1.0F; + IBlockState iblockstate3 = blockAccess.getBlockState(pos.south()); + Block block2 = iblockstate3.getBlock(); + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) { + EnumFacing enumfacing3 = (EnumFacing) iblockstate3.getValue(FACING); + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + f3 = 0.5F; + flag1 = false; + } else if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + f2 = 0.5F; + flag1 = false; + } + } + } else if (enumfacing == EnumFacing.NORTH) { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.north()); + Block block3 = iblockstate4.getBlock(); + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) { + EnumFacing enumfacing4 = (EnumFacing) iblockstate4.getValue(FACING); + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + f3 = 0.5F; + flag1 = false; + } else if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + f2 = 0.5F; + flag1 = false; + } + } + } + + this.setBlockBounds(f2, f, f4, f3, f1, f5); + return flag1; + } + + public boolean func_176304_i(IBlockAccess blockAccess, BlockPos pos) { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf) iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + float f = 0.5F; + float f1 = 1.0F; + if (flag) { + f = 0.0F; + f1 = 0.5F; + } + + float f2 = 0.0F; + float f3 = 0.5F; + float f4 = 0.5F; + float f5 = 1.0F; + boolean flag1 = false; + if (enumfacing == EnumFacing.EAST) { + IBlockState iblockstate1 = blockAccess.getBlockState(pos.west()); + Block block = iblockstate1.getBlock(); + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) { + EnumFacing enumfacing1 = (EnumFacing) iblockstate1.getValue(FACING); + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + f4 = 0.0F; + f5 = 0.5F; + flag1 = true; + } else if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + f4 = 0.5F; + f5 = 1.0F; + flag1 = true; + } + } + } else if (enumfacing == EnumFacing.WEST) { + IBlockState iblockstate2 = blockAccess.getBlockState(pos.east()); + Block block1 = iblockstate2.getBlock(); + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) { + f2 = 0.5F; + f3 = 1.0F; + EnumFacing enumfacing2 = (EnumFacing) iblockstate2.getValue(FACING); + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) { + f4 = 0.0F; + f5 = 0.5F; + flag1 = true; + } else if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) { + f4 = 0.5F; + f5 = 1.0F; + flag1 = true; + } + } + } else if (enumfacing == EnumFacing.SOUTH) { + IBlockState iblockstate3 = blockAccess.getBlockState(pos.north()); + Block block2 = iblockstate3.getBlock(); + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) { + f4 = 0.0F; + f5 = 0.5F; + EnumFacing enumfacing3 = (EnumFacing) iblockstate3.getValue(FACING); + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + flag1 = true; + } else if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + f2 = 0.5F; + f3 = 1.0F; + flag1 = true; + } + } + } else if (enumfacing == EnumFacing.NORTH) { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.south()); + Block block3 = iblockstate4.getBlock(); + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) { + EnumFacing enumfacing4 = (EnumFacing) iblockstate4.getValue(FACING); + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) { + flag1 = true; + } else if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) { + f2 = 0.5F; + f3 = 1.0F; + flag1 = true; + } + } + } + + if (flag1) { + this.setBlockBounds(f2, f, f4, f3, f1, f5); + } + + return flag1; + } + + /**+ + * Add all collision boxes of this Block to the list that + * intersect with the given mask. + */ + public void addCollisionBoxesToList(World world, BlockPos blockpos, IBlockState iblockstate, + AxisAlignedBB axisalignedbb, List list, Entity entity) { + this.setBaseCollisionBounds(world, blockpos); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + boolean flag = this.func_176306_h(world, blockpos); + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + if (flag && this.func_176304_i(world, blockpos)) { + super.addCollisionBoxesToList(world, blockpos, iblockstate, axisalignedbb, list, entity); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + this.modelBlock.randomDisplayTick(world, blockpos, iblockstate, random); + } + + public void onBlockClicked(World world, BlockPos blockpos, EntityPlayer entityplayer) { + this.modelBlock.onBlockClicked(world, blockpos, entityplayer); + } + + /**+ + * Called when a player destroys this Block + */ + public void onBlockDestroyedByPlayer(World world, BlockPos blockpos, IBlockState iblockstate) { + this.modelBlock.onBlockDestroyedByPlayer(world, blockpos, iblockstate); + } + + public int getMixedBrightnessForBlock(IBlockAccess iblockaccess, BlockPos blockpos) { + return this.modelBlock.getMixedBrightnessForBlock(iblockaccess, blockpos); + } + + /**+ + * Returns how much this block can resist explosions from the + * passed in entity. + */ + public float getExplosionResistance(Entity entity) { + return this.modelBlock.getExplosionResistance(entity); + } + + public EnumWorldBlockLayer getBlockLayer() { + return this.modelBlock.getBlockLayer(); + } + + /**+ + * How many world ticks before ticking + */ + public int tickRate(World world) { + return this.modelBlock.tickRate(world); + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + return this.modelBlock.getSelectedBoundingBox(world, blockpos); + } + + public Vec3 modifyAcceleration(World world, BlockPos blockpos, Entity entity, Vec3 vec3) { + return this.modelBlock.modifyAcceleration(world, blockpos, entity, vec3); + } + + /**+ + * Returns if this block is collidable (only used by Fire). + * Args: x, y, z + */ + public boolean isCollidable() { + return this.modelBlock.isCollidable(); + } + + public boolean canCollideCheck(IBlockState iblockstate, boolean flag) { + return this.modelBlock.canCollideCheck(iblockstate, flag); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + return this.modelBlock.canPlaceBlockAt(world, blockpos); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + this.onNeighborBlockChange(world, blockpos, this.modelState, Blocks.air); + this.modelBlock.onBlockAdded(world, blockpos, this.modelState); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { + this.modelBlock.breakBlock(world, blockpos, this.modelState); + } + + /**+ + * Triggered whenever an entity collides with this block (enters + * into the block) + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, Entity entity) { + this.modelBlock.onEntityCollidedWithBlock(world, blockpos, entity); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + this.modelBlock.updateTick(world, blockpos, iblockstate, random); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance().getBoolean("clickToSit") + && entityplayer.getHeldItem() == null) { + EntityArrow arrow = new EntityArrow(world, blockpos.getX() + 0.5D, blockpos.getY(), blockpos.getZ() + 0.5D); + arrow.isChair = true; + world.spawnEntityInWorld(arrow); + entityplayer.mountEntity(arrow); + return true; + } + return this.modelBlock.onBlockActivated(world, blockpos, this.modelState, entityplayer, EnumFacing.DOWN, 0.0F, + 0.0F, 0.0F); + } + + /**+ + * Called when this Block is destroyed by an Explosion + */ + public void onBlockDestroyedByExplosion(World world, BlockPos blockpos, Explosion explosion) { + this.modelBlock.onBlockDestroyedByExplosion(world, blockpos, explosion); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState var1) { + return this.modelBlock.getMapColor(this.modelState); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float f, float f1, float f2, + int i, EntityLivingBase entitylivingbase) { + IBlockState iblockstate = super.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, entitylivingbase); + iblockstate = iblockstate.withProperty(FACING, entitylivingbase.getHorizontalFacing()).withProperty(SHAPE, + BlockStairs.EnumShape.STRAIGHT); + return enumfacing != EnumFacing.DOWN && (enumfacing == EnumFacing.UP || (double) f1 <= 0.5D) + ? iblockstate.withProperty(HALF, BlockStairs.EnumHalf.BOTTOM) + : iblockstate.withProperty(HALF, BlockStairs.EnumHalf.TOP); + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World world, BlockPos blockpos, Vec3 vec3, Vec3 vec31) { + MovingObjectPosition[] amovingobjectposition = new MovingObjectPosition[8]; + IBlockState iblockstate = world.getBlockState(blockpos); + int i = ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + boolean flag = iblockstate.getValue(HALF) == BlockStairs.EnumHalf.TOP; + int[] aint = field_150150_a[i + (flag ? 4 : 0)]; + this.hasRaytraced = true; + + for (int j = 0; j < 8; ++j) { + this.rayTracePass = j; + if (Arrays.binarySearch(aint, j) < 0) { + amovingobjectposition[j] = super.collisionRayTrace(world, blockpos, vec3, vec31); + } + } + + for (int k : aint) { + amovingobjectposition[k] = null; + } + + MovingObjectPosition movingobjectposition1 = null; + double d1 = 0.0D; + + for (MovingObjectPosition movingobjectposition : amovingobjectposition) { + if (movingobjectposition != null) { + double d0 = movingobjectposition.hitVec.squareDistanceTo(vec31); + if (d0 > d1) { + movingobjectposition1 = movingobjectposition; + d1 = d0; + } + } + } + + return movingobjectposition1; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState().withProperty(HALF, + (i & 4) > 0 ? BlockStairs.EnumHalf.TOP : BlockStairs.EnumHalf.BOTTOM); + iblockstate = iblockstate.withProperty(FACING, EnumFacing.getFront(5 - (i & 3))); + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + if (iblockstate.getValue(HALF) == BlockStairs.EnumHalf.TOP) { + i |= 4; + } + + i = i | 5 - ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + return i; + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + if (this.func_176306_h(iblockaccess, blockpos)) { + switch (this.func_176305_g(iblockaccess, blockpos)) { + case 0: + iblockstate = iblockstate.withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT); + break; + case 1: + iblockstate = iblockstate.withProperty(SHAPE, BlockStairs.EnumShape.INNER_RIGHT); + break; + case 2: + iblockstate = iblockstate.withProperty(SHAPE, BlockStairs.EnumShape.INNER_LEFT); + } + } else { + switch (this.func_176307_f(iblockaccess, blockpos)) { + case 0: + iblockstate = iblockstate.withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT); + break; + case 1: + iblockstate = iblockstate.withProperty(SHAPE, BlockStairs.EnumShape.OUTER_RIGHT); + break; + case 2: + iblockstate = iblockstate.withProperty(SHAPE, BlockStairs.EnumShape.OUTER_LEFT); + } + } + + return iblockstate; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, HALF, SHAPE }); + } + + public static enum EnumHalf implements IStringSerializable { + TOP("top"), BOTTOM("bottom"); + + private final String name; + + private EnumHalf(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } + + public static enum EnumShape implements IStringSerializable { + STRAIGHT("straight"), INNER_LEFT("inner_left"), INNER_RIGHT("inner_right"), OUTER_LEFT("outer_left"), + OUTER_RIGHT("outer_right"); + + private final String name; + + private EnumShape(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStandingSign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStandingSign.java new file mode 100644 index 0000000..bb5d5e9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStandingSign.java @@ -0,0 +1,75 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStandingSign extends BlockSign { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStandingSign"); + } + + public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15); + + public BlockStandingSign() { + this.setDefaultState(this.blockState.getBaseState().withProperty(ROTATION, Integer.valueOf(0))); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + if (!world.getBlockState(blockpos.down()).getBlock().getMaterial().isSolid()) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(ROTATION, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(ROTATION)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { ROTATION }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStaticLiquid.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStaticLiquid.java new file mode 100644 index 0000000..b4405ea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStaticLiquid.java @@ -0,0 +1,112 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDynamicLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStaticLiquid extends BlockLiquid { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStaticLiquid"); + } + + protected BlockStaticLiquid(Material materialIn) { + super(materialIn); + this.setTickRandomly(false); + if (materialIn == Material.lava) { + this.setTickRandomly(true); + } + + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!this.checkForMixing(world, blockpos, iblockstate)) { + this.updateLiquid(world, blockpos, iblockstate); + } + + } + + private void updateLiquid(World worldIn, BlockPos pos, IBlockState state) { + BlockDynamicLiquid blockdynamicliquid = getFlowingBlock(this.blockMaterial); + worldIn.setBlockState(pos, blockdynamicliquid.getDefaultState().withProperty(LEVEL, state.getValue(LEVEL)), 2); + worldIn.scheduleUpdate(pos, blockdynamicliquid, this.tickRate(worldIn)); + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + if (this.blockMaterial == Material.lava) { + if (world.getGameRules().getBoolean("doFireTick")) { + int i = random.nextInt(3); + if (i > 0) { + BlockPos blockpos1 = blockpos; + + for (int j = 0; j < i; ++j) { + blockpos1 = blockpos1.add(random.nextInt(3) - 1, 1, random.nextInt(3) - 1); + Block block = world.getBlockState(blockpos1).getBlock(); + if (block.blockMaterial == Material.air) { + if (this.isSurroundingBlockFlammable(world, blockpos1)) { + world.setBlockState(blockpos1, Blocks.fire.getDefaultState()); + return; + } + } else if (block.blockMaterial.blocksMovement()) { + return; + } + } + } else { + for (int k = 0; k < 3; ++k) { + BlockPos blockpos2 = blockpos.add(random.nextInt(3) - 1, 0, random.nextInt(3) - 1); + if (world.isAirBlock(blockpos2.up()) && this.getCanBlockBurn(world, blockpos2)) { + world.setBlockState(blockpos2.up(), Blocks.fire.getDefaultState()); + } + } + } + + } + } + } + + protected boolean isSurroundingBlockFlammable(World worldIn, BlockPos pos) { + for (EnumFacing enumfacing : EnumFacing.values()) { + if (this.getCanBlockBurn(worldIn, pos.offset(enumfacing))) { + return true; + } + } + + return false; + } + + private boolean getCanBlockBurn(World worldIn, BlockPos pos) { + return worldIn.getBlockState(pos).getBlock().getMaterial().getCanBurn(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStem.java new file mode 100644 index 0000000..eb8ed16 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStem.java @@ -0,0 +1,230 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCrops; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyInteger; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStem extends BlockBush implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStem"); + } + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7); + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() { + public boolean apply(EnumFacing enumfacing) { + return enumfacing != EnumFacing.DOWN; + } + }); + private final Block crop; + + protected BlockStem(Block crop) { + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FACING, + EnumFacing.UP)); + this.crop = crop; + this.setTickRandomly(true); + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs) null); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + iblockstate = iblockstate.withProperty(FACING, EnumFacing.UP); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (iblockaccess.getBlockState(blockpos.offset(enumfacing)).getBlock() == this.crop) { + iblockstate = iblockstate.withProperty(FACING, enumfacing); + break; + } + } + + return iblockstate; + } + + /**+ + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block block) { + return block == Blocks.farmland; + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + super.updateTick(world, blockpos, iblockstate, random); + if (world.getLightFromNeighbors(blockpos.up()) >= 9) { + float f = BlockCrops.getGrowthChance(this, world, blockpos); + if (random.nextInt((int) (25.0F / f) + 1) == 0) { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + if (i < 7) { + iblockstate = iblockstate.withProperty(AGE, Integer.valueOf(i + 1)); + world.setBlockState(blockpos, iblockstate, 2); + } else { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (world.getBlockState(blockpos.offset(enumfacing)).getBlock() == this.crop) { + return; + } + } + + blockpos = blockpos.offset(EnumFacing.Plane.HORIZONTAL.random(random)); + Block block = world.getBlockState(blockpos.down()).getBlock(); + if (world.getBlockState(blockpos).getBlock().blockMaterial == Material.air + && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass)) { + world.setBlockState(blockpos, this.crop.getDefaultState()); + } + } + } + + } + } + + public void growStem(World worldIn, BlockPos pos, IBlockState state) { + int i = ((Integer) state.getValue(AGE)).intValue() + MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(Math.min(7, i))), 2); + } + + public int getRenderColor(IBlockState iblockstate) { + if (iblockstate.getBlock() != this) { + return super.getRenderColor(iblockstate); + } else { + int i = ((Integer) iblockstate.getValue(AGE)).intValue(); + int j = i * 32; + int k = 255 - i * 8; + int l = i * 4; + return j << 16 | k << 8 | l; + } + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return this.getRenderColor(iblockaccess.getBlockState(blockpos)); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + this.maxY = (double) ((float) (((Integer) iblockaccess.getBlockState(blockpos).getValue(AGE)).intValue() * 2 + + 2) / 16.0F); + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, (float) this.maxY, 0.5F + f); + } + + /**+ + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); + { + Item item = this.getSeedItem(); + if (item != null) { + int j = ((Integer) iblockstate.getValue(AGE)).intValue(); + + for (int k = 0; k < 3; ++k) { + if (world.rand.nextInt(15) <= j) { + spawnAsEntity(world, blockpos, new ItemStack(item)); + } + } + + } + } + } + + protected Item getSeedItem() { + return this.crop == Blocks.pumpkin ? Items.pumpkin_seeds + : (this.crop == Blocks.melon_block ? Items.melon_seeds : null); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + public Item getItem(World var1, BlockPos var2) { + Item item = this.getSeedItem(); + return item != null ? item : null; + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState iblockstate, boolean var4) { + return ((Integer) iblockstate.getValue(AGE)).intValue() != 7; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return true; + } + + public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState iblockstate) { + this.growStem(world, blockpos, iblockstate); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Integer) iblockstate.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { AGE, FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStone.java new file mode 100644 index 0000000..cb41fc3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStone.java @@ -0,0 +1,182 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStone extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStone"); + } + + public static PropertyEnum VARIANT; + + public BlockStone() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockStone.EnumType.STONE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockStone.EnumType.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal( + this.getUnlocalizedName() + "." + BlockStone.EnumType.STONE.getUnlocalizedName() + ".name"); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockStone.EnumType) iblockstate.getValue(VARIANT)).func_181072_c(); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom var2, int var3) { + return iblockstate.getValue(VARIANT) == BlockStone.EnumType.STONE ? Item.getItemFromBlock(Blocks.cobblestone) + : Item.getItemFromBlock(Blocks.stone); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockStone.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockStone.EnumType blockstone$enumtype : BlockStone.EnumType.values()) { + list.add(new ItemStack(item, 1, blockstone$enumtype.getMetadata())); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockStone.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockStone.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + STONE(0, MapColor.stoneColor, "stone"), GRANITE(1, MapColor.dirtColor, "granite"), + GRANITE_SMOOTH(2, MapColor.dirtColor, "smooth_granite", "graniteSmooth"), + DIORITE(3, MapColor.quartzColor, "diorite"), + DIORITE_SMOOTH(4, MapColor.quartzColor, "smooth_diorite", "dioriteSmooth"), + ANDESITE(5, MapColor.stoneColor, "andesite"), + ANDESITE_SMOOTH(6, MapColor.stoneColor, "smooth_andesite", "andesiteSmooth"); + + private static final BlockStone.EnumType[] META_LOOKUP = new BlockStone.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + private final MapColor field_181073_l; + + private EnumType(int parInt2, MapColor parMapColor, String parString2) { + this(parInt2, parMapColor, parString2, parString2); + } + + private EnumType(int parInt2, MapColor parMapColor, String parString2, String parString3) { + this.meta = parInt2; + this.name = parString2; + this.unlocalizedName = parString3; + this.field_181073_l = parMapColor; + } + + public int getMetadata() { + return this.meta; + } + + public MapColor func_181072_c() { + return this.field_181073_l; + } + + public String toString() { + return this.name; + } + + public static BlockStone.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockStone.EnumType blockstone$enumtype : values()) { + META_LOOKUP[blockstone$enumtype.getMetadata()] = blockstone$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneBrick.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneBrick.java new file mode 100644 index 0000000..f63c5bd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneBrick.java @@ -0,0 +1,144 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStoneBrick extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStoneBrick"); + } + + public static PropertyEnum VARIANT; + public static final int DEFAULT_META = BlockStoneBrick.EnumType.DEFAULT.getMetadata(); + public static final int MOSSY_META = BlockStoneBrick.EnumType.MOSSY.getMetadata(); + public static final int CRACKED_META = BlockStoneBrick.EnumType.CRACKED.getMetadata(); + public static final int CHISELED_META = BlockStoneBrick.EnumType.CHISELED.getMetadata(); + + public BlockStoneBrick() { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockStoneBrick.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockStoneBrick.EnumType.class); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockStoneBrick.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockStoneBrick.EnumType blockstonebrick$enumtype : BlockStoneBrick.EnumType.values()) { + list.add(new ItemStack(item, 1, blockstonebrick$enumtype.getMetadata())); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockStoneBrick.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockStoneBrick.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + DEFAULT(0, "stonebrick", "default"), MOSSY(1, "mossy_stonebrick", "mossy"), + CRACKED(2, "cracked_stonebrick", "cracked"), CHISELED(3, "chiseled_stonebrick", "chiseled"); + + private static final BlockStoneBrick.EnumType[] META_LOOKUP = new BlockStoneBrick.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockStoneBrick.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockStoneBrick.EnumType blockstonebrick$enumtype : values()) { + META_LOOKUP[blockstonebrick$enumtype.getMetadata()] = blockstonebrick$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlab.java new file mode 100644 index 0000000..ab74d9c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlab.java @@ -0,0 +1,227 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockStoneSlab extends BlockSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStoneSlab"); + } + + public static final PropertyBool SEAMLESS = PropertyBool.create("seamless"); + public static PropertyEnum VARIANT; + + public BlockStoneSlab() { + super(Material.rock); + IBlockState iblockstate = this.blockState.getBaseState(); + if (this.isDouble()) { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false)); + } else { + iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + } + + this.setDefaultState(iblockstate.withProperty(VARIANT, BlockStoneSlab.EnumType.STONE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockStoneSlab.EnumType.class); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.stone_slab); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.stone_slab); + } + + /**+ + * Returns the slab block name with the type associated with it + */ + public String getUnlocalizedName(int i) { + return super.getUnlocalizedName() + "." + BlockStoneSlab.EnumType.byMetadata(i).getUnlocalizedName(); + } + + public IProperty getVariantProperty() { + return VARIANT; + } + + public Object getVariant(ItemStack itemstack) { + return BlockStoneSlab.EnumType.byMetadata(itemstack.getMetadata() & 7); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + if (item != Item.getItemFromBlock(Blocks.double_stone_slab)) { + for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values()) { + if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD) { + list.add(new ItemStack(item, 1, blockstoneslab$enumtype.getMetadata())); + } + } + + } + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, + BlockStoneSlab.EnumType.byMetadata(i & 7)); + if (this.isDouble()) { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf((i & 8) != 0)); + } else { + iblockstate = iblockstate.withProperty(HALF, + (i & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockStoneSlab.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + if (this.isDouble()) { + if (((Boolean) iblockstate.getValue(SEAMLESS)).booleanValue()) { + i |= 8; + } + } else if (iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return this.isDouble() ? new BlockState(this, new IProperty[] { SEAMLESS, VARIANT }) + : new BlockState(this, new IProperty[] { HALF, VARIANT }); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockStoneSlab.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockStoneSlab.EnumType) iblockstate.getValue(VARIANT)).func_181074_c(); + } + + public static enum EnumType implements IStringSerializable { + STONE(0, MapColor.stoneColor, "stone"), SAND(1, MapColor.sandColor, "sandstone", "sand"), + WOOD(2, MapColor.woodColor, "wood_old", "wood"), COBBLESTONE(3, MapColor.stoneColor, "cobblestone", "cobble"), + BRICK(4, MapColor.redColor, "brick"), SMOOTHBRICK(5, MapColor.stoneColor, "stone_brick", "smoothStoneBrick"), + NETHERBRICK(6, MapColor.netherrackColor, "nether_brick", "netherBrick"), + QUARTZ(7, MapColor.quartzColor, "quartz"); + + private static final BlockStoneSlab.EnumType[] META_LOOKUP = new BlockStoneSlab.EnumType[values().length]; + private final int meta; + private final MapColor field_181075_k; + private final String name; + private final String unlocalizedName; + + private EnumType(int parInt2, MapColor parMapColor, String parString2) { + this(parInt2, parMapColor, parString2, parString2); + } + + private EnumType(int parInt2, MapColor parMapColor, String parString2, String parString3) { + this.meta = parInt2; + this.field_181075_k = parMapColor; + this.name = parString2; + this.unlocalizedName = parString3; + } + + public int getMetadata() { + return this.meta; + } + + public MapColor func_181074_c() { + return this.field_181075_k; + } + + public String toString() { + return this.name; + } + + public static BlockStoneSlab.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + /**+ + * Returns the slab block name with the type associated with it + */ + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockStoneSlab.EnumType blockstoneslab$enumtype : values()) { + META_LOOKUP[blockstoneslab$enumtype.getMetadata()] = blockstoneslab$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlabNew.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlabNew.java new file mode 100644 index 0000000..b3480df --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlabNew.java @@ -0,0 +1,225 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockStoneSlabNew extends BlockSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockStoneSlabNew"); + } + + public static final PropertyBool SEAMLESS = PropertyBool.create("seamless"); + public static PropertyEnum VARIANT; + + public BlockStoneSlabNew() { + super(Material.rock); + IBlockState iblockstate = this.blockState.getBaseState(); + if (this.isDouble()) { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false)); + } else { + iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + } + + this.setDefaultState(iblockstate.withProperty(VARIANT, BlockStoneSlabNew.EnumType.RED_SANDSTONE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockStoneSlabNew.EnumType.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".red_sandstone.name"); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.stone_slab2); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.stone_slab2); + } + + /**+ + * Returns the slab block name with the type associated with it + */ + public String getUnlocalizedName(int i) { + return super.getUnlocalizedName() + "." + BlockStoneSlabNew.EnumType.byMetadata(i).getUnlocalizedName(); + } + + public IProperty getVariantProperty() { + return VARIANT; + } + + public Object getVariant(ItemStack itemstack) { + return BlockStoneSlabNew.EnumType.byMetadata(itemstack.getMetadata() & 7); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + if (item != Item.getItemFromBlock(Blocks.double_stone_slab2)) { + for (BlockStoneSlabNew.EnumType blockstoneslabnew$enumtype : BlockStoneSlabNew.EnumType.values()) { + list.add(new ItemStack(item, 1, blockstoneslabnew$enumtype.getMetadata())); + } + + } + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, + BlockStoneSlabNew.EnumType.byMetadata(i & 7)); + if (this.isDouble()) { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf((i & 8) != 0)); + } else { + iblockstate = iblockstate.withProperty(HALF, + (i & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockStoneSlabNew.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + if (this.isDouble()) { + if (((Boolean) iblockstate.getValue(SEAMLESS)).booleanValue()) { + i |= 8; + } + } else if (iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return this.isDouble() ? new BlockState(this, new IProperty[] { SEAMLESS, VARIANT }) + : new BlockState(this, new IProperty[] { HALF, VARIANT }); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockStoneSlabNew.EnumType) iblockstate.getValue(VARIANT)).func_181068_c(); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockStoneSlabNew.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + public static enum EnumType implements IStringSerializable { + RED_SANDSTONE(0, "red_sandstone", BlockSand.EnumType.RED_SAND.getMapColor()); + + private static final BlockStoneSlabNew.EnumType[] META_LOOKUP = new BlockStoneSlabNew.EnumType[values().length]; + private final int meta; + private final String name; + private final MapColor field_181069_e; + + private EnumType(int parInt2, String parString2, MapColor parMapColor) { + this.meta = parInt2; + this.name = parString2; + this.field_181069_e = parMapColor; + } + + public int getMetadata() { + return this.meta; + } + + public MapColor func_181068_c() { + return this.field_181069_e; + } + + public String toString() { + return this.name; + } + + public static BlockStoneSlabNew.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + /**+ + * Returns the slab block name with the type associated with it + */ + public String getUnlocalizedName() { + return this.name; + } + + static { + for (BlockStoneSlabNew.EnumType blockstoneslabnew$enumtype : values()) { + META_LOOKUP[blockstoneslabnew$enumtype.getMetadata()] = blockstoneslabnew$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTNT.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTNT.java new file mode 100644 index 0000000..1da2f92 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTNT.java @@ -0,0 +1,171 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityTNTPrimed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockTNT extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockTNT"); + } + + public static final PropertyBool EXPLODE = PropertyBool.create("explode"); + + public BlockTNT() { + super(Material.tnt); + this.setDefaultState(this.blockState.getBaseState().withProperty(EXPLODE, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + super.onBlockAdded(world, blockpos, iblockstate); + if (world.isBlockPowered(blockpos)) { + this.onBlockDestroyedByPlayer(world, blockpos, iblockstate.withProperty(EXPLODE, Boolean.valueOf(true))); + world.setBlockToAir(blockpos); + } + + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (world.isBlockPowered(blockpos)) { + this.onBlockDestroyedByPlayer(world, blockpos, iblockstate.withProperty(EXPLODE, Boolean.valueOf(true))); + world.setBlockToAir(blockpos); + } + + } + + /**+ + * Called when this Block is destroyed by an Explosion + */ + public void onBlockDestroyedByExplosion(World world, BlockPos blockpos, Explosion explosion) { + { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockpos.getX() + 0.5F), + (double) blockpos.getY(), (double) ((float) blockpos.getZ() + 0.5F), + explosion.getExplosivePlacedBy()); + entitytntprimed.fuse = world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8; + world.spawnEntityInWorld(entitytntprimed); + } + } + + /**+ + * Called when a player destroys this Block + */ + public void onBlockDestroyedByPlayer(World world, BlockPos blockpos, IBlockState iblockstate) { + this.explode(world, blockpos, iblockstate, (EntityLivingBase) null); + } + + public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) { + { + if (((Boolean) state.getValue(EXPLODE)).booleanValue()) { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double) ((float) pos.getX() + 0.5F), + (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter); + worldIn.spawnEntityInWorld(entitytntprimed); + worldIn.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); + } + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing enumfacing, float f, float f1, float f2) { + if (entityplayer.getCurrentEquippedItem() != null) { + Item item = entityplayer.getCurrentEquippedItem().getItem(); + if (item == Items.flint_and_steel || item == Items.fire_charge) { + this.explode(world, blockpos, iblockstate.withProperty(EXPLODE, Boolean.valueOf(true)), entityplayer); + world.setBlockToAir(blockpos); + if (item == Items.flint_and_steel) { + entityplayer.getCurrentEquippedItem().damageItem(1, entityplayer); + } else if (!entityplayer.capabilities.isCreativeMode) { + --entityplayer.getCurrentEquippedItem().stackSize; + } + + return true; + } + } + + return super.onBlockActivated(world, blockpos, iblockstate, entityplayer, enumfacing, f, f1, f2); + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState var3, Entity entity) { + if (entity instanceof EntityArrow) { + EntityArrow entityarrow = (EntityArrow) entity; + if (entityarrow.isBurning()) { + this.explode(world, blockpos, + world.getBlockState(blockpos).withProperty(EXPLODE, Boolean.valueOf(true)), + entityarrow.shootingEntity instanceof EntityLivingBase + ? (EntityLivingBase) entityarrow.shootingEntity + : null); + world.setBlockToAir(blockpos); + } + } + + } + + /**+ + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion var1) { + return false; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(EXPLODE, Boolean.valueOf((i & 1) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((Boolean) iblockstate.getValue(EXPLODE)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { EXPLODE }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTallGrass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTallGrass.java new file mode 100644 index 0000000..56e6407 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTallGrass.java @@ -0,0 +1,230 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockTallGrass extends BlockBush implements IGrowable { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockTallGrass"); + } + + public static PropertyEnum TYPE; + + protected BlockTallGrass() { + super(Material.vine); + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockTallGrass.EnumType.DEAD_BUSH)); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + public static void bootstrapStates() { + TYPE = PropertyEnum.create("type", BlockTallGrass.EnumType.class); + } + + public int getBlockColor() { + return ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + + public boolean canBlockStay(World world, BlockPos blockpos, IBlockState var3) { + return this.canPlaceBlockOn(world.getBlockState(blockpos.down()).getBlock()); + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World var1, BlockPos var2) { + return true; + } + + public int getRenderColor(IBlockState iblockstate) { + if (iblockstate.getBlock() != this) { + return super.getRenderColor(iblockstate); + } else { + BlockTallGrass.EnumType blocktallgrass$enumtype = (BlockTallGrass.EnumType) iblockstate.getValue(TYPE); + return blocktallgrass$enumtype == BlockTallGrass.EnumType.DEAD_BUSH ? 16777215 + : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return iblockaccess.getBiomeGenForCoords(blockpos).getGrassColorAtPos(blockpos); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom random, int var3) { + return random.nextInt(8) == 0 ? Items.wheat_seeds : null; + } + + /**+ + * Get the quantity dropped based on the given fortune level + */ + public int quantityDroppedWithBonus(int i, EaglercraftRandom random) { + return 1 + random.nextInt(i * 2 + 1); + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(world, blockpos, new ItemStack(Blocks.tallgrass, 1, + ((BlockTallGrass.EnumType) iblockstate.getValue(TYPE)).getMeta())); + } else { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + + } + + public int getDamageValue(World world, BlockPos blockpos) { + IBlockState iblockstate = world.getBlockState(blockpos); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (int i = 1; i < 3; ++i) { + list.add(new ItemStack(item, 1, i)); + } + + } + + /**+ + * Whether this IGrowable can grow + */ + public boolean canGrow(World var1, BlockPos var2, IBlockState iblockstate, boolean var4) { + return iblockstate.getValue(TYPE) != BlockTallGrass.EnumType.DEAD_BUSH; + } + + public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { + return true; + } + + public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState iblockstate) { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.GRASS; + if (iblockstate.getValue(TYPE) == BlockTallGrass.EnumType.FERN) { + blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.FERN; + } + + if (Blocks.double_plant.canPlaceBlockAt(world, blockpos)) { + Blocks.double_plant.placeAt(world, blockpos, blockdoubleplant$enumplanttype, 2); + } + + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(TYPE, BlockTallGrass.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockTallGrass.EnumType) iblockstate.getValue(TYPE)).getMeta(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { TYPE }); + } + + /**+ + * Get the OffsetType for this Block. Determines if the model is + * rendered slightly offset. + */ + public Block.EnumOffsetType getOffsetType() { + return Block.EnumOffsetType.XYZ; + } + + public static enum EnumType implements IStringSerializable { + DEAD_BUSH(0, "dead_bush"), GRASS(1, "tall_grass"), FERN(2, "fern"); + + private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[values().length]; + private final int meta; + private final String name; + + private EnumType(int meta, String name) { + this.meta = meta; + this.name = name; + } + + public int getMeta() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockTallGrass.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + static { + for (BlockTallGrass.EnumType blocktallgrass$enumtype : values()) { + META_LOOKUP[blocktallgrass$enumtype.getMeta()] = blocktallgrass$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTorch.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTorch.java new file mode 100644 index 0000000..8566f27 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTorch.java @@ -0,0 +1,278 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockTorch extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockTorch"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() { + public boolean apply(EnumFacing enumfacing) { + return enumfacing != EnumFacing.DOWN; + } + }); + + protected BlockTorch() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + private boolean canPlaceOn(World worldIn, BlockPos pos) { + if (World.doesBlockHaveSolidTopSurface(worldIn, pos)) { + return true; + } else { + Block block = worldIn.getBlockState(pos).getBlock(); + return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall + || block == Blocks.stained_glass; + } + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + for (EnumFacing enumfacing : FACING.getAllowedValues()) { + if (this.canPlaceAt(world, blockpos, enumfacing)) { + return true; + } + } + + return false; + } + + private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) { + BlockPos blockpos = pos.offset(facing.getOpposite()); + boolean flag = facing.getAxis().isHorizontal(); + return flag && worldIn.isBlockNormalCube(blockpos, true) + || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + if (this.canPlaceAt(world, blockpos, enumfacing)) { + return this.getDefaultState().withProperty(FACING, enumfacing); + } else { + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + if (world.isBlockNormalCube(blockpos.offset(enumfacing1.getOpposite()), true)) { + return this.getDefaultState().withProperty(FACING, enumfacing1); + } + } + + return this.getDefaultState(); + } + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + this.checkForDrop(world, blockpos, iblockstate); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + this.onNeighborChangeInternal(world, blockpos, iblockstate); + } + + protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state) { + if (!this.checkForDrop(worldIn, pos, state)) { + return true; + } else { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + EnumFacing.Axis enumfacing$axis = enumfacing.getAxis(); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + boolean flag = false; + if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true)) { + flag = true; + } else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1))) { + flag = true; + } + + if (flag) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return true; + } else { + return false; + } + } + } + + protected boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, (EnumFacing) state.getValue(FACING))) { + return true; + } else { + if (worldIn.getBlockState(pos).getBlock() == this) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + return false; + } + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World world, BlockPos blockpos, Vec3 vec3, Vec3 vec31) { + EnumFacing enumfacing = (EnumFacing) world.getBlockState(blockpos).getValue(FACING); + float f = 0.15F; + if (enumfacing == EnumFacing.EAST) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + } else if (enumfacing == EnumFacing.WEST) { + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + } else if (enumfacing == EnumFacing.SOUTH) { + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + } else if (enumfacing == EnumFacing.NORTH) { + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } else { + f = 0.1F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + } + + return super.collisionRayTrace(world, blockpos, vec3, vec31); + } + + public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + double d0 = (double) blockpos.getX() + 0.5D; + double d1 = (double) blockpos.getY() + 0.7D; + double d2 = (double) blockpos.getZ() + 0.5D; + double d3 = 0.22D; + double d4 = 0.27D; + if (enumfacing.getAxis().isHorizontal()) { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4 * (double) enumfacing1.getFrontOffsetX(), + d1 + d3, d2 + d4 * (double) enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4 * (double) enumfacing1.getFrontOffsetX(), d1 + d3, + d2 + d4 * (double) enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + } else { + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState(); + switch (i) { + case 1: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST); + break; + case 2: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST); + break; + case 3: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH); + break; + case 4: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH); + break; + case 5: + default: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.UP); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + switch ((EnumFacing) iblockstate.getValue(FACING)) { + case EAST: + i = i | 1; + break; + case WEST: + i = i | 2; + break; + case SOUTH: + i = i | 3; + break; + case NORTH: + i = i | 4; + break; + case DOWN: + case UP: + default: + i = i | 5; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTrapDoor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTrapDoor.java new file mode 100644 index 0000000..f164dc5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTrapDoor.java @@ -0,0 +1,296 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStairs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockTrapDoor extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockTrapDoor"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool OPEN = PropertyBool.create("open"); + public static PropertyEnum HALF; + + protected BlockTrapDoor(Material materialIn) { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(OPEN, Boolean.valueOf(false)).withProperty(HALF, BlockTrapDoor.DoorHalf.BOTTOM)); + float f = 0.5F; + float f1 = 1.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public static void bootstrapStates() { + HALF = PropertyEnum.create("half", BlockTrapDoor.DoorHalf.class); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess iblockaccess, BlockPos blockpos) { + return !((Boolean) iblockaccess.getBlockState(blockpos).getValue(OPEN)).booleanValue(); + } + + public AxisAlignedBB getSelectedBoundingBox(World world, BlockPos blockpos) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getSelectedBoundingBox(world, blockpos); + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + this.setBounds(iblockaccess.getBlockState(blockpos)); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float f = 0.1875F; + this.setBlockBounds(0.0F, 0.40625F, 0.0F, 1.0F, 0.59375F, 1.0F); + } + + public void setBounds(IBlockState state) { + if (state.getBlock() == this) { + boolean flag = state.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP; + Boolean obool = (Boolean) state.getValue(OPEN); + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + float f = 0.1875F; + if (flag) { + this.setBlockBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1875F, 1.0F); + } + + if (obool.booleanValue()) { + if (enumfacing == EnumFacing.NORTH) { + this.setBlockBounds(0.0F, 0.0F, 0.8125F, 1.0F, 1.0F, 1.0F); + } + + if (enumfacing == EnumFacing.SOUTH) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.1875F); + } + + if (enumfacing == EnumFacing.WEST) { + this.setBlockBounds(0.8125F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + if (enumfacing == EnumFacing.EAST) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.1875F, 1.0F, 1.0F); + } + } + + } + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (this.blockMaterial == Material.iron) { + return true; + } else { + iblockstate = iblockstate.cycleProperty(OPEN); + world.setBlockState(blockpos, iblockstate, 2); + world.playAuxSFXAtEntity(entityplayer, ((Boolean) iblockstate.getValue(OPEN)).booleanValue() ? 1003 : 1006, + blockpos, 0); + return true; + } + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + { + BlockPos blockpos1 = blockpos.offset(((EnumFacing) iblockstate.getValue(FACING)).getOpposite()); + if (!isValidSupportBlock(world.getBlockState(blockpos1).getBlock())) { + world.setBlockToAir(blockpos); + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + } else { + boolean flag = world.isBlockPowered(blockpos); + if (flag || block.canProvidePower()) { + boolean flag1 = ((Boolean) iblockstate.getValue(OPEN)).booleanValue(); + if (flag1 != flag) { + world.setBlockState(blockpos, iblockstate.withProperty(OPEN, Boolean.valueOf(flag)), 2); + world.playAuxSFXAtEntity((EntityPlayer) null, flag ? 1003 : 1006, blockpos, 0); + } + } + } + } + } + + /**+ + * Ray traces through the blocks collision from start vector to + * end vector returning a ray trace hit. + */ + public MovingObjectPosition collisionRayTrace(World world, BlockPos blockpos, Vec3 vec3, Vec3 vec31) { + this.setBlockBoundsBasedOnState(world, blockpos); + return super.collisionRayTrace(world, blockpos, vec3, vec31); + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing enumfacing, float var4, float f, float var6, + int var7, EntityLivingBase var8) { + IBlockState iblockstate = this.getDefaultState(); + if (enumfacing.getAxis().isHorizontal()) { + iblockstate = iblockstate.withProperty(FACING, enumfacing).withProperty(OPEN, Boolean.valueOf(false)); + iblockstate = iblockstate.withProperty(HALF, + f > 0.5F ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM); + } + + return iblockstate; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing) { + return !enumfacing.getAxis().isVertical() + && isValidSupportBlock(world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock()); + } + + protected static EnumFacing getFacing(int meta) { + switch (meta & 3) { + case 0: + return EnumFacing.NORTH; + case 1: + return EnumFacing.SOUTH; + case 2: + return EnumFacing.WEST; + case 3: + default: + return EnumFacing.EAST; + } + } + + protected static int getMetaForFacing(EnumFacing facing) { + switch (facing) { + case NORTH: + return 0; + case SOUTH: + return 1; + case WEST: + return 2; + case EAST: + default: + return 3; + } + } + + private static boolean isValidSupportBlock(Block blockIn) { + return blockIn.blockMaterial.isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glowstone + || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, getFacing(i)) + .withProperty(OPEN, Boolean.valueOf((i & 4) != 0)) + .withProperty(HALF, (i & 8) == 0 ? BlockTrapDoor.DoorHalf.BOTTOM : BlockTrapDoor.DoorHalf.TOP); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | getMetaForFacing((EnumFacing) iblockstate.getValue(FACING)); + if (((Boolean) iblockstate.getValue(OPEN)).booleanValue()) { + i |= 4; + } + + if (iblockstate.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, OPEN, HALF }); + } + + public static enum DoorHalf implements IStringSerializable { + TOP("top"), BOTTOM("bottom"); + + private final String name; + + private DoorHalf(String name) { + this.name = name; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWire.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWire.java new file mode 100644 index 0000000..5a7fd91 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWire.java @@ -0,0 +1,294 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWireHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockTripWire extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockTripWire"); + } + + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyBool SUSPENDED = PropertyBool.create("suspended"); + public static final PropertyBool ATTACHED = PropertyBool.create("attached"); + public static final PropertyBool DISARMED = PropertyBool.create("disarmed"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + + public BlockTripWire() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false)) + .withProperty(SUSPENDED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)) + .withProperty(DISARMED, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)) + .withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)) + .withProperty(WEST, Boolean.valueOf(false))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F); + this.setTickRandomly(true); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate + .withProperty(NORTH, + Boolean.valueOf(isConnectedTo(iblockaccess, blockpos, iblockstate, EnumFacing.NORTH))) + .withProperty(EAST, + Boolean.valueOf(isConnectedTo(iblockaccess, blockpos, iblockstate, EnumFacing.EAST))) + .withProperty(SOUTH, + Boolean.valueOf(isConnectedTo(iblockaccess, blockpos, iblockstate, EnumFacing.SOUTH))) + .withProperty(WEST, + Boolean.valueOf(isConnectedTo(iblockaccess, blockpos, iblockstate, EnumFacing.WEST))); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.string; + } + + public Item getItem(World var1, BlockPos var2) { + return Items.string; + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + boolean flag = ((Boolean) iblockstate.getValue(SUSPENDED)).booleanValue(); + boolean flag1 = !World.doesBlockHaveSolidTopSurface(world, blockpos.down()); + if (flag != flag1) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + IBlockState iblockstate = iblockaccess.getBlockState(blockpos); + boolean flag = ((Boolean) iblockstate.getValue(ATTACHED)).booleanValue(); + boolean flag1 = ((Boolean) iblockstate.getValue(SUSPENDED)).booleanValue(); + if (!flag1) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F); + } else if (!flag) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F); + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + iblockstate = iblockstate.withProperty(SUSPENDED, + Boolean.valueOf(!World.doesBlockHaveSolidTopSurface(world, blockpos.down()))); + world.setBlockState(blockpos, iblockstate, 3); + this.notifyHook(world, blockpos, iblockstate); + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + this.notifyHook(world, blockpos, iblockstate.withProperty(POWERED, Boolean.valueOf(true))); + } + + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + world.setBlockState(blockpos, iblockstate.withProperty(DISARMED, Boolean.valueOf(true)), 4); + } + } + + private void notifyHook(World worldIn, BlockPos pos, IBlockState state) { + for (EnumFacing enumfacing : new EnumFacing[] { EnumFacing.SOUTH, EnumFacing.WEST }) { + for (int i = 1; i < 42; ++i) { + BlockPos blockpos = pos.offset(enumfacing, i); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + if (iblockstate.getBlock() == Blocks.tripwire_hook) { + if (iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing.getOpposite()) { + Blocks.tripwire_hook.func_176260_a(worldIn, blockpos, iblockstate, false, true, i, state); + } + break; + } + + if (iblockstate.getBlock() != Blocks.tripwire) { + break; + } + } + } + + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState iblockstate, Entity var4) { + { + if (!((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + this.updateState(world, blockpos); + } + } + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + { + if (((Boolean) world.getBlockState(blockpos).getValue(POWERED)).booleanValue()) { + this.updateState(world, blockpos); + } + } + } + + private void updateState(World worldIn, BlockPos pos) { + IBlockState iblockstate = worldIn.getBlockState(pos); + boolean flag = ((Boolean) iblockstate.getValue(POWERED)).booleanValue(); + boolean flag1 = false; + List list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity) null, + new AxisAlignedBB((double) pos.getX() + this.minX, (double) pos.getY() + this.minY, + (double) pos.getZ() + this.minZ, (double) pos.getX() + this.maxX, + (double) pos.getY() + this.maxY, (double) pos.getZ() + this.maxZ)); + if (!list.isEmpty()) { + for (Entity entity : (List) list) { + if (!entity.doesEntityNotTriggerPressurePlate()) { + flag1 = true; + break; + } + } + } + + if (flag1 != flag) { + iblockstate = iblockstate.withProperty(POWERED, Boolean.valueOf(flag1)); + worldIn.setBlockState(pos, iblockstate, 3); + this.notifyHook(worldIn, pos, iblockstate); + } + + if (flag1) { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + } + + public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing direction) { + BlockPos blockpos = pos.offset(direction); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (block == Blocks.tripwire_hook) { + EnumFacing enumfacing = direction.getOpposite(); + return iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing; + } else if (block == Blocks.tripwire) { + boolean flag = ((Boolean) state.getValue(SUSPENDED)).booleanValue(); + boolean flag1 = ((Boolean) iblockstate.getValue(SUSPENDED)).booleanValue(); + return flag == flag1; + } else { + return false; + } + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(POWERED, Boolean.valueOf((i & 1) > 0)) + .withProperty(SUSPENDED, Boolean.valueOf((i & 2) > 0)) + .withProperty(ATTACHED, Boolean.valueOf((i & 4) > 0)) + .withProperty(DISARMED, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 1; + } + + if (((Boolean) iblockstate.getValue(SUSPENDED)).booleanValue()) { + i |= 2; + } + + if (((Boolean) iblockstate.getValue(ATTACHED)).booleanValue()) { + i |= 4; + } + + if (((Boolean) iblockstate.getValue(DISARMED)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, + new IProperty[] { POWERED, SUSPENDED, ATTACHED, DISARMED, NORTH, EAST, WEST, SOUTH }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWireHook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWireHook.java new file mode 100644 index 0000000..7f181ce --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWireHook.java @@ -0,0 +1,352 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import com.google.common.base.Objects; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockTripWireHook extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockTripWireHook"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyBool ATTACHED = PropertyBool.create("attached"); + public static final PropertyBool SUSPENDED = PropertyBool.create("suspended"); + + public BlockTripWireHook() { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) + .withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)) + .withProperty(SUSPENDED, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate.withProperty(SUSPENDED, + Boolean.valueOf(!World.doesBlockHaveSolidTopSurface(iblockaccess, blockpos.down()))); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing) { + return enumfacing.getAxis().isHorizontal() + && world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock().isNormalCube(); + } + + public boolean canPlaceBlockAt(World world, BlockPos blockpos) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (world.getBlockState(blockpos.offset(enumfacing)).getBlock().isNormalCube()) { + return true; + } + } + + return false; + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + IBlockState iblockstate = this.getDefaultState().withProperty(POWERED, Boolean.valueOf(false)) + .withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false)); + if (enumfacing.getAxis().isHorizontal()) { + iblockstate = iblockstate.withProperty(FACING, enumfacing); + } + + return iblockstate; + } + + /**+ + * Called by ItemBlocks after a block is set in the world, to + * allow post-place logic + */ + public void onBlockPlacedBy(World world, BlockPos blockpos, IBlockState iblockstate, EntityLivingBase var4, + ItemStack var5) { + this.func_176260_a(world, blockpos, iblockstate, false, false, -1, (IBlockState) null); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + if (block != this) { + if (this.checkForDrop(world, blockpos, iblockstate)) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (!world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock().isNormalCube()) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + } + + } + } + + public void func_176260_a(World worldIn, BlockPos pos, IBlockState hookState, boolean parFlag, boolean parFlag2, + int parInt1, IBlockState parIBlockState2) { + EnumFacing enumfacing = (EnumFacing) hookState.getValue(FACING); + boolean flag = ((Boolean) hookState.getValue(ATTACHED)).booleanValue(); + boolean flag1 = ((Boolean) hookState.getValue(POWERED)).booleanValue(); + boolean flag2 = !World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + boolean flag3 = !parFlag; + boolean flag4 = false; + int i = 0; + IBlockState[] aiblockstate = new IBlockState[42]; + + for (int j = 1; j < 42; ++j) { + BlockPos blockpos = pos.offset(enumfacing, j); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + if (iblockstate.getBlock() == Blocks.tripwire_hook) { + if (iblockstate.getValue(FACING) == enumfacing.getOpposite()) { + i = j; + } + break; + } + + if (iblockstate.getBlock() != Blocks.tripwire && j != parInt1) { + aiblockstate[j] = null; + flag3 = false; + } else { + if (j == parInt1) { + iblockstate = (IBlockState) Objects.firstNonNull(parIBlockState2, iblockstate); + } + + boolean flag5 = !((Boolean) iblockstate.getValue(BlockTripWire.DISARMED)).booleanValue(); + boolean flag6 = ((Boolean) iblockstate.getValue(BlockTripWire.POWERED)).booleanValue(); + boolean flag7 = ((Boolean) iblockstate.getValue(BlockTripWire.SUSPENDED)).booleanValue(); + flag3 &= flag7 == flag2; + flag4 |= flag5 && flag6; + aiblockstate[j] = iblockstate; + if (j == parInt1) { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + flag3 &= flag5; + } + } + } + + flag3 = flag3 & i > 1; + flag4 = flag4 & flag3; + IBlockState iblockstate1 = this.getDefaultState().withProperty(ATTACHED, Boolean.valueOf(flag3)) + .withProperty(POWERED, Boolean.valueOf(flag4)); + if (i > 0) { + BlockPos blockpos1 = pos.offset(enumfacing, i); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + worldIn.setBlockState(blockpos1, iblockstate1.withProperty(FACING, enumfacing1), 3); + this.func_176262_b(worldIn, blockpos1, enumfacing1); + this.func_180694_a(worldIn, blockpos1, flag3, flag4, flag, flag1); + } + + this.func_180694_a(worldIn, pos, flag3, flag4, flag, flag1); + if (!parFlag) { + worldIn.setBlockState(pos, iblockstate1.withProperty(FACING, enumfacing), 3); + if (parFlag2) { + this.func_176262_b(worldIn, pos, enumfacing); + } + } + + if (flag != flag3) { + for (int k = 1; k < i; ++k) { + BlockPos blockpos2 = pos.offset(enumfacing, k); + IBlockState iblockstate2 = aiblockstate[k]; + if (iblockstate2 != null && worldIn.getBlockState(blockpos2).getBlock() != Blocks.air) { + worldIn.setBlockState(blockpos2, iblockstate2.withProperty(ATTACHED, Boolean.valueOf(flag3)), 3); + } + } + } + + } + + /**+ + * Called randomly when setTickRandomly is set to true (used by + * e.g. crops to grow, etc.) + */ + public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + this.func_176260_a(world, blockpos, iblockstate, false, true, -1, (IBlockState) null); + } + + private void func_180694_a(World worldIn, BlockPos pos, boolean parFlag, boolean parFlag2, boolean parFlag3, + boolean parFlag4) { + if (parFlag2 && !parFlag4) { + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.1D, (double) pos.getZ() + 0.5D, + "random.click", 0.4F, 0.6F); + } else if (!parFlag2 && parFlag4) { + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.1D, (double) pos.getZ() + 0.5D, + "random.click", 0.4F, 0.5F); + } else if (parFlag && !parFlag3) { + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.1D, (double) pos.getZ() + 0.5D, + "random.click", 0.4F, 0.7F); + } else if (!parFlag && parFlag3) { + worldIn.playSoundEffect((double) pos.getX() + 0.5D, (double) pos.getY() + 0.1D, (double) pos.getZ() + 0.5D, + "random.bowhit", 0.4F, 1.2F / (worldIn.rand.nextFloat() * 0.2F + 0.9F)); + } + + } + + private void func_176262_b(World worldIn, BlockPos parBlockPos, EnumFacing parEnumFacing) { + worldIn.notifyNeighborsOfStateChange(parBlockPos, this); + worldIn.notifyNeighborsOfStateChange(parBlockPos.offset(parEnumFacing.getOpposite()), this); + } + + private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (!this.canPlaceBlockAt(worldIn, pos)) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } else { + return true; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + float f = 0.1875F; + switch ((EnumFacing) iblockaccess.getBlockState(blockpos).getValue(FACING)) { + case EAST: + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + break; + case WEST: + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + break; + case SOUTH: + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + break; + case NORTH: + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } + + } + + public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + boolean flag = ((Boolean) iblockstate.getValue(ATTACHED)).booleanValue(); + boolean flag1 = ((Boolean) iblockstate.getValue(POWERED)).booleanValue(); + if (flag || flag1) { + this.func_176260_a(world, blockpos, iblockstate, true, false, -1, (IBlockState) null); + } + + if (flag1) { + world.notifyNeighborsOfStateChange(blockpos, this); + world.notifyNeighborsOfStateChange( + blockpos.offset(((EnumFacing) iblockstate.getValue(FACING)).getOpposite()), this); + } + + super.breakBlock(world, blockpos, iblockstate); + } + + public int getWeakPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing var4) { + return ((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess var1, BlockPos var2, IBlockState iblockstate, EnumFacing enumfacing) { + return !((Boolean) iblockstate.getValue(POWERED)).booleanValue() ? 0 + : (iblockstate.getValue(FACING) == enumfacing ? 15 : 0); + } + + /**+ + * Can this block provide power. Only wire currently seems to + * have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(i & 3)) + .withProperty(POWERED, Boolean.valueOf((i & 8) > 0)) + .withProperty(ATTACHED, Boolean.valueOf((i & 4) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((EnumFacing) iblockstate.getValue(FACING)).getHorizontalIndex(); + if (((Boolean) iblockstate.getValue(POWERED)).booleanValue()) { + i |= 8; + } + + if (((Boolean) iblockstate.getValue(ATTACHED)).booleanValue()) { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING, POWERED, ATTACHED, SUSPENDED }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockVine.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockVine.java new file mode 100644 index 0000000..197cdb7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockVine.java @@ -0,0 +1,477 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerFoliage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockVine extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockVine"); + } + + public static final PropertyBool UP = PropertyBool.create("up"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + public static final PropertyBool[] ALL_FACES = new PropertyBool[] { UP, NORTH, SOUTH, WEST, EAST }; + + public BlockVine() { + super(Material.vine); + this.setDefaultState(this.blockState.getBaseState().withProperty(UP, Boolean.valueOf(false)) + .withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)) + .withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate.withProperty(UP, + Boolean.valueOf(iblockaccess.getBlockState(blockpos.up()).getBlock().isBlockNormalCube())); + } + + /**+ + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Whether this Block can be replaced directly by other blocks + * (true for e.g. tall grass) + */ + public boolean isReplaceable(World var1, BlockPos var2) { + return true; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + float f = 0.0625F; + float f1 = 1.0F; + float f2 = 1.0F; + float f3 = 1.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + boolean flag = false; + if (((Boolean) iblockaccess.getBlockState(blockpos).getValue(WEST)).booleanValue()) { + f4 = Math.max(f4, 0.0625F); + f1 = 0.0F; + f2 = 0.0F; + f5 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + flag = true; + } + + if (((Boolean) iblockaccess.getBlockState(blockpos).getValue(EAST)).booleanValue()) { + f1 = Math.min(f1, 0.9375F); + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + flag = true; + } + + if (((Boolean) iblockaccess.getBlockState(blockpos).getValue(NORTH)).booleanValue()) { + f6 = Math.max(f6, 0.0625F); + f3 = 0.0F; + f1 = 0.0F; + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + flag = true; + } + + if (((Boolean) iblockaccess.getBlockState(blockpos).getValue(SOUTH)).booleanValue()) { + f3 = Math.min(f3, 0.9375F); + f6 = 1.0F; + f1 = 0.0F; + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + flag = true; + } + + if (!flag && this.canPlaceOn(iblockaccess.getBlockState(blockpos.up()).getBlock())) { + f2 = Math.min(f2, 0.9375F); + f5 = 1.0F; + f1 = 0.0F; + f4 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + } + + this.setBlockBounds(f1, f2, f3, f4, f5, f6); + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + /**+ + * Check whether this Block can be placed on the given side + */ + public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing) { + switch (enumfacing) { + case UP: + return this.canPlaceOn(world.getBlockState(blockpos.up()).getBlock()); + case NORTH: + case SOUTH: + case EAST: + case WEST: + return this.canPlaceOn(world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock()); + default: + return false; + } + } + + private boolean canPlaceOn(Block blockIn) { + return blockIn.isFullCube() && blockIn.blockMaterial.blocksMovement(); + } + + private boolean recheckGrownSides(World worldIn, BlockPos pos, IBlockState state) { + IBlockState iblockstate = state; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + PropertyBool propertybool = getPropertyFor(enumfacing); + if (((Boolean) state.getValue(propertybool)).booleanValue() + && !this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing)).getBlock())) { + IBlockState iblockstate1 = worldIn.getBlockState(pos.up()); + if (iblockstate1.getBlock() != this + || !((Boolean) iblockstate1.getValue(propertybool)).booleanValue()) { + state = state.withProperty(propertybool, Boolean.valueOf(false)); + } + } + } + + if (getNumGrownFaces(state) == 0) { + return false; + } else { + if (iblockstate != state) { + worldIn.setBlockState(pos, state, 2); + } + + return true; + } + } + + public int getBlockColor() { + return ColorizerFoliage.getFoliageColorBasic(); + } + + public int getRenderColor(IBlockState var1) { + return ColorizerFoliage.getFoliageColorBasic(); + } + + public int colorMultiplier(IBlockAccess iblockaccess, BlockPos blockpos, int var3) { + return iblockaccess.getBiomeGenForCoords(blockpos).getFoliageColorAtPos(blockpos); + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!this.recheckGrownSides(world, blockpos, iblockstate)) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + } + + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + { + if (world.rand.nextInt(4) == 0) { + byte b0 = 4; + int i = 5; + boolean flag = false; + + label62: for (int j = -b0; j <= b0; ++j) { + for (int k = -b0; k <= b0; ++k) { + for (int l = -1; l <= 1; ++l) { + if (world.getBlockState(blockpos.add(j, l, k)).getBlock() == this) { + --i; + if (i <= 0) { + flag = true; + break label62; + } + } + } + } + } + + EnumFacing enumfacing1 = EnumFacing.random(random); + BlockPos blockpos2 = blockpos.up(); + if (enumfacing1 == EnumFacing.UP && blockpos.getY() < 255 && world.isAirBlock(blockpos2)) { + if (!flag) { + IBlockState iblockstate3 = iblockstate; + + for (EnumFacing enumfacing3 : EnumFacing.Plane.HORIZONTAL) { + if (random.nextBoolean() || !this + .canPlaceOn(world.getBlockState(blockpos2.offset(enumfacing3)).getBlock())) { + iblockstate3 = iblockstate3.withProperty(getPropertyFor(enumfacing3), + Boolean.valueOf(false)); + } + } + + if (((Boolean) iblockstate3.getValue(NORTH)).booleanValue() + || ((Boolean) iblockstate3.getValue(EAST)).booleanValue() + || ((Boolean) iblockstate3.getValue(SOUTH)).booleanValue() + || ((Boolean) iblockstate3.getValue(WEST)).booleanValue()) { + world.setBlockState(blockpos2, iblockstate3, 2); + } + + } + } else if (enumfacing1.getAxis().isHorizontal() + && !((Boolean) iblockstate.getValue(getPropertyFor(enumfacing1))).booleanValue()) { + if (!flag) { + BlockPos blockpos4 = blockpos.offset(enumfacing1); + Block block1 = world.getBlockState(blockpos4).getBlock(); + if (block1.blockMaterial == Material.air) { + EnumFacing enumfacing2 = enumfacing1.rotateY(); + EnumFacing enumfacing4 = enumfacing1.rotateYCCW(); + boolean flag1 = ((Boolean) iblockstate.getValue(getPropertyFor(enumfacing2))) + .booleanValue(); + boolean flag2 = ((Boolean) iblockstate.getValue(getPropertyFor(enumfacing4))) + .booleanValue(); + BlockPos blockpos5 = blockpos4.offset(enumfacing2); + BlockPos blockpos1 = blockpos4.offset(enumfacing4); + if (flag1 && this.canPlaceOn(world.getBlockState(blockpos5).getBlock())) { + world.setBlockState(blockpos4, this.getDefaultState() + .withProperty(getPropertyFor(enumfacing2), Boolean.valueOf(true)), 2); + } else if (flag2 && this.canPlaceOn(world.getBlockState(blockpos1).getBlock())) { + world.setBlockState(blockpos4, this.getDefaultState() + .withProperty(getPropertyFor(enumfacing4), Boolean.valueOf(true)), 2); + } else if (flag1 && world.isAirBlock(blockpos5) + && this.canPlaceOn(world.getBlockState(blockpos.offset(enumfacing2)).getBlock())) { + world.setBlockState(blockpos5, this.getDefaultState().withProperty( + getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2); + } else if (flag2 && world.isAirBlock(blockpos1) + && this.canPlaceOn(world.getBlockState(blockpos.offset(enumfacing4)).getBlock())) { + world.setBlockState(blockpos1, this.getDefaultState().withProperty( + getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2); + } else if (this.canPlaceOn(world.getBlockState(blockpos4.up()).getBlock())) { + world.setBlockState(blockpos4, this.getDefaultState(), 2); + } + } else if (block1.blockMaterial.isOpaque() && block1.isFullCube()) { + world.setBlockState(blockpos, + iblockstate.withProperty(getPropertyFor(enumfacing1), Boolean.valueOf(true)), 2); + } + + } + } else { + if (blockpos.getY() > 1) { + BlockPos blockpos3 = blockpos.down(); + IBlockState iblockstate1 = world.getBlockState(blockpos3); + Block block = iblockstate1.getBlock(); + if (block.blockMaterial == Material.air) { + IBlockState iblockstate2 = iblockstate; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (random.nextBoolean()) { + iblockstate2 = iblockstate2.withProperty(getPropertyFor(enumfacing), + Boolean.valueOf(false)); + } + } + + if (((Boolean) iblockstate2.getValue(NORTH)).booleanValue() + || ((Boolean) iblockstate2.getValue(EAST)).booleanValue() + || ((Boolean) iblockstate2.getValue(SOUTH)).booleanValue() + || ((Boolean) iblockstate2.getValue(WEST)).booleanValue()) { + world.setBlockState(blockpos3, iblockstate2, 2); + } + } else if (block == this) { + IBlockState iblockstate4 = iblockstate1; + + for (EnumFacing enumfacing5 : EnumFacing.Plane.HORIZONTAL) { + PropertyBool propertybool = getPropertyFor(enumfacing5); + if (random.nextBoolean() + && ((Boolean) iblockstate.getValue(propertybool)).booleanValue()) { + iblockstate4 = iblockstate4.withProperty(propertybool, Boolean.valueOf(true)); + } + } + + if (((Boolean) iblockstate4.getValue(NORTH)).booleanValue() + || ((Boolean) iblockstate4.getValue(EAST)).booleanValue() + || ((Boolean) iblockstate4.getValue(SOUTH)).booleanValue() + || ((Boolean) iblockstate4.getValue(WEST)).booleanValue()) { + world.setBlockState(blockpos3, iblockstate4, 2); + } + } + } + } + } + } + } + + /**+ + * Called by ItemBlocks just before a block is actually set in + * the world, to allow for adjustments to the IBlockstate + */ + public IBlockState onBlockPlaced(World var1, BlockPos var2, EnumFacing enumfacing, float var4, float var5, + float var6, int var7, EntityLivingBase var8) { + IBlockState iblockstate = this.getDefaultState().withProperty(UP, Boolean.valueOf(false)) + .withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)) + .withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)); + return enumfacing.getAxis().isHorizontal() + ? iblockstate.withProperty(getPropertyFor(enumfacing.getOpposite()), Boolean.valueOf(true)) + : iblockstate; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return null; + } + + /**+ + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom var1) { + return 0; + } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (entityplayer.getCurrentEquippedItem() != null + && entityplayer.getCurrentEquippedItem().getItem() == Items.shears) { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(world, blockpos, new ItemStack(Blocks.vine, 1, 0)); + } else { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(SOUTH, Boolean.valueOf((i & 1) > 0)) + .withProperty(WEST, Boolean.valueOf((i & 2) > 0)).withProperty(NORTH, Boolean.valueOf((i & 4) > 0)) + .withProperty(EAST, Boolean.valueOf((i & 8) > 0)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + if (((Boolean) iblockstate.getValue(SOUTH)).booleanValue()) { + i |= 1; + } + + if (((Boolean) iblockstate.getValue(WEST)).booleanValue()) { + i |= 2; + } + + if (((Boolean) iblockstate.getValue(NORTH)).booleanValue()) { + i |= 4; + } + + if (((Boolean) iblockstate.getValue(EAST)).booleanValue()) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { UP, NORTH, EAST, SOUTH, WEST }); + } + + public static PropertyBool getPropertyFor(EnumFacing side) { + switch (side) { + case UP: + return UP; + case NORTH: + return NORTH; + case SOUTH: + return SOUTH; + case EAST: + return EAST; + case WEST: + return WEST; + default: + throw new IllegalArgumentException(side + " is an invalid choice"); + } + } + + public static int getNumGrownFaces(IBlockState state) { + int i = 0; + + for (PropertyBool propertybool : ALL_FACES) { + if (((Boolean) state.getValue(propertybool)).booleanValue()) { + ++i; + } + } + + return i; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWall.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWall.java new file mode 100644 index 0000000..4e14033 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWall.java @@ -0,0 +1,255 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFenceGate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockWall extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockWall"); + } + + public static final PropertyBool UP = PropertyBool.create("up"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + public static PropertyEnum VARIANT; + + public BlockWall(Block modelBlock) { + super(modelBlock.blockMaterial); + this.setDefaultState(this.blockState.getBaseState().withProperty(UP, Boolean.valueOf(false)) + .withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)) + .withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)) + .withProperty(VARIANT, BlockWall.EnumType.NORMAL)); + this.setHardness(modelBlock.blockHardness); + this.setResistance(modelBlock.blockResistance / 3.0F); + this.setStepSound(modelBlock.stepSound); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockWall.EnumType.class); + } + + /**+ + * Gets the localized name of this block. Used for the + * statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal( + this.getUnlocalizedName() + "." + BlockWall.EnumType.NORMAL.getUnlocalizedName() + ".name"); + } + + public boolean isFullCube() { + return false; + } + + public boolean isPassable(IBlockAccess var1, BlockPos var2) { + return false; + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + boolean flag = this.canConnectTo(iblockaccess, blockpos.north()); + boolean flag1 = this.canConnectTo(iblockaccess, blockpos.south()); + boolean flag2 = this.canConnectTo(iblockaccess, blockpos.west()); + boolean flag3 = this.canConnectTo(iblockaccess, blockpos.east()); + float f = 0.25F; + float f1 = 0.75F; + float f2 = 0.25F; + float f3 = 0.75F; + float f4 = 1.0F; + if (flag) { + f2 = 0.0F; + } + + if (flag1) { + f3 = 1.0F; + } + + if (flag2) { + f = 0.0F; + } + + if (flag3) { + f1 = 1.0F; + } + + if (flag && flag1 && !flag2 && !flag3) { + f4 = 0.8125F; + f = 0.3125F; + f1 = 0.6875F; + } else if (!flag && !flag1 && flag2 && flag3) { + f4 = 0.8125F; + f2 = 0.3125F; + f3 = 0.6875F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, f4, f3); + } + + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState iblockstate) { + this.setBlockBoundsBasedOnState(world, blockpos); + this.maxY = 1.5D; + return super.getCollisionBoundingBox(world, blockpos, iblockstate); + } + + public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) { + Block block = worldIn.getBlockState(pos).getBlock(); + return block == Blocks.barrier ? false + : (block != this && !(block instanceof BlockFenceGate) + ? (block.blockMaterial.isOpaque() && block.isFullCube() ? block.blockMaterial != Material.gourd + : false) + : true); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + for (BlockWall.EnumType blockwall$enumtype : BlockWall.EnumType.values()) { + list.add(new ItemStack(item, 1, blockwall$enumtype.getMetadata())); + } + + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockWall.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { + return enumfacing == EnumFacing.DOWN ? super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing) : true; + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + return this.getDefaultState().withProperty(VARIANT, BlockWall.EnumType.byMetadata(i)); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((BlockWall.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } + + /**+ + * Get the actual Block state of this Block at the given + * position. This applies properties not visible in the + * metadata, such as fence connections. + */ + public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) { + return iblockstate.withProperty(UP, Boolean.valueOf(!iblockaccess.isAirBlock(blockpos.up()))) + .withProperty(NORTH, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.north()))) + .withProperty(EAST, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.east()))) + .withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.south()))) + .withProperty(WEST, Boolean.valueOf(this.canConnectTo(iblockaccess, blockpos.west()))); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { UP, NORTH, EAST, WEST, SOUTH, VARIANT }); + } + + public static enum EnumType implements IStringSerializable { + NORMAL(0, "cobblestone", "normal"), MOSSY(1, "mossy_cobblestone", "mossy"); + + private static final BlockWall.EnumType[] META_LOOKUP = new BlockWall.EnumType[values().length]; + private final int meta; + private final String name; + private String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() { + return this.meta; + } + + public String toString() { + return this.name; + } + + public static BlockWall.EnumType byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() { + return this.name; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + static { + for (BlockWall.EnumType blockwall$enumtype : values()) { + META_LOOKUP[blockwall$enumtype.getMetadata()] = blockwall$enumtype; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWallSign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWallSign.java new file mode 100644 index 0000000..236d42c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWallSign.java @@ -0,0 +1,107 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockWallSign extends BlockSign { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockWallSign"); + } + + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + public BlockWallSign() { + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + } + + public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, BlockPos blockpos) { + EnumFacing enumfacing = (EnumFacing) iblockaccess.getBlockState(blockpos).getValue(FACING); + float f = 0.28125F; + float f1 = 0.78125F; + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + switch (enumfacing) { + case NORTH: + this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F); + break; + case SOUTH: + this.setBlockBounds(f2, f, 0.0F, f3, f1, f4); + break; + case WEST: + this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3); + break; + case EAST: + this.setBlockBounds(0.0F, f, f2, f4, f1, f3); + } + + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (!world.getBlockState(blockpos.offset(enumfacing.getOpposite())).getBlock().getMaterial().isSolid()) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + world.setBlockToAir(blockpos); + } + + super.onNeighborBlockChange(world, blockpos, iblockstate, block); + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + EnumFacing enumfacing = EnumFacing.getFront(i); + if (enumfacing.getAxis() == EnumFacing.Axis.Y) { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + return ((EnumFacing) iblockstate.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() { + return new BlockState(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWeb.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWeb.java new file mode 100644 index 0000000..9ee7ab5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWeb.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumWorldBlockLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockWeb extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockWeb"); + } + + public BlockWeb() { + super(Material.web); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World var1, BlockPos var2, IBlockState var3, Entity entity) { + entity.setInWeb(); + } + + /**+ + * Used to determine ambient occlusion and culling when + * rebuilding chunks for render + */ + public boolean isOpaqueCube() { + return false; + } + + public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) { + return null; + } + + public boolean isFullCube() { + return false; + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Items.string; + } + + protected boolean canSilkHarvest() { + return true; + } + + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.CUTOUT; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWoodSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWoodSlab.java new file mode 100644 index 0000000..848dd2f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWoodSlab.java @@ -0,0 +1,151 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockWoodSlab extends BlockSlab { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockWoodSlab"); + } + + public static PropertyEnum VARIANT; + + public BlockWoodSlab() { + super(Material.wood); + IBlockState iblockstate = this.blockState.getBaseState(); + if (!this.isDouble()) { + iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + } + + this.setDefaultState(iblockstate.withProperty(VARIANT, BlockPlanks.EnumType.OAK)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public static void bootstrapStates() { + VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class); + } + + /**+ + * Get the MapColor for this Block and the given BlockState + */ + public MapColor getMapColor(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).func_181070_c(); + } + + /**+ + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { + return Item.getItemFromBlock(Blocks.wooden_slab); + } + + public Item getItem(World var1, BlockPos var2) { + return Item.getItemFromBlock(Blocks.wooden_slab); + } + + /**+ + * Returns the slab block name with the type associated with it + */ + public String getUnlocalizedName(int i) { + return super.getUnlocalizedName() + "." + BlockPlanks.EnumType.byMetadata(i).getUnlocalizedName(); + } + + public IProperty getVariantProperty() { + return VARIANT; + } + + public Object getVariant(ItemStack itemstack) { + return BlockPlanks.EnumType.byMetadata(itemstack.getMetadata() & 7); + } + + /**+ + * returns a list of blocks with the same ID, but different meta + * (eg: wood returns 4 blocks) + */ + public void getSubBlocks(Item item, CreativeTabs var2, List list) { + if (item != Item.getItemFromBlock(Blocks.double_wooden_slab)) { + for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) { + list.add(new ItemStack(item, 1, blockplanks$enumtype.getMetadata())); + } + + } + } + + /**+ + * Convert the given metadata into a BlockState for this Block + */ + public IBlockState getStateFromMeta(int i) { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata(i & 7)); + if (!this.isDouble()) { + iblockstate = iblockstate.withProperty(HALF, + (i & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP); + } + + return iblockstate; + } + + /**+ + * Convert the BlockState into the correct metadata value + */ + public int getMetaFromState(IBlockState iblockstate) { + int i = 0; + i = i | ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + if (!this.isDouble() && iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() { + return this.isDouble() ? new BlockState(this, new IProperty[] { VARIANT }) + : new BlockState(this, new IProperty[] { HALF, VARIANT }); + } + + /**+ + * Gets the metadata of the item this Block can drop. This + * method is called when the block gets destroyed. It returns + * the metadata of the dropped item based on the old metadata of + * the block. + */ + public int damageDropped(IBlockState iblockstate) { + return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWorkbench.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWorkbench.java new file mode 100644 index 0000000..863f51a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWorkbench.java @@ -0,0 +1,91 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerWorkbench; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockWorkbench extends Block { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockWorkbench"); + } + + protected BlockWorkbench() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + { + entityplayer.displayGui(new BlockWorkbench.InterfaceCraftingTable(world, blockpos)); + entityplayer.triggerAchievement(StatList.field_181742_Z); + return true; + } + } + + public static class InterfaceCraftingTable implements IInteractionObject { + private final World world; + private final BlockPos position; + + public InterfaceCraftingTable(World worldIn, BlockPos pos) { + this.world = worldIn; + this.position = pos; + } + + public String getName() { + return null; + } + + public boolean hasCustomName() { + return false; + } + + public IChatComponent getDisplayName() { + return new ChatComponentTranslation(Blocks.crafting_table.getUnlocalizedName() + ".name", new Object[0]); + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer var2) { + return new ContainerWorkbench(inventoryplayer, this.world, this.position); + } + + public String getGuiID() { + return "minecraft:crafting_table"; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockYellowFlower.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockYellowFlower.java new file mode 100644 index 0000000..db56cd4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockYellowFlower.java @@ -0,0 +1,39 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockYellowFlower extends BlockFlower { + + static { + __checkIntegratedContextValid("net/minecraft/block/BlockYellowFlower"); + } + + /**+ + * Get the Type of this flower (Yellow/Red) + */ + public BlockFlower.EnumFlowerColor getBlockType() { + return BlockFlower.EnumFlowerColor.YELLOW; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/IGrowable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/IGrowable.java new file mode 100644 index 0000000..7c14e45 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/IGrowable.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IGrowable { + /**+ + * Whether this IGrowable can grow + */ + boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4); + + boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4); + + void grow(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/ITileEntityProvider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/ITileEntityProvider.java new file mode 100644 index 0000000..839084d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/ITileEntityProvider.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ITileEntityProvider { + /**+ + * Returns a new instance of a block's tile entity class. Called + * on placing the block. + */ + TileEntity createNewTileEntity(World var1, int var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MapColor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MapColor.java new file mode 100644 index 0000000..27f1df1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MapColor.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapColor { + + static { + __checkIntegratedContextValid("net/minecraft/block/material/MapColor"); + } + + /**+ + * Holds all the 16 colors used on maps, very similar of a + * pallete system. + */ + public static final MapColor[] mapColorArray = new MapColor[64]; + public static final MapColor airColor = new MapColor(0, 0); + public static final MapColor grassColor = new MapColor(1, 8368696); + public static final MapColor sandColor = new MapColor(2, 16247203); + public static final MapColor clothColor = new MapColor(3, 13092807); + public static final MapColor tntColor = new MapColor(4, 16711680); + public static final MapColor iceColor = new MapColor(5, 10526975); + public static final MapColor ironColor = new MapColor(6, 10987431); + public static final MapColor foliageColor = new MapColor(7, 31744); + public static final MapColor snowColor = new MapColor(8, 16777215); + public static final MapColor clayColor = new MapColor(9, 10791096); + public static final MapColor dirtColor = new MapColor(10, 9923917); + public static final MapColor stoneColor = new MapColor(11, 7368816); + public static final MapColor waterColor = new MapColor(12, 4210943); + public static final MapColor woodColor = new MapColor(13, 9402184); + public static final MapColor quartzColor = new MapColor(14, 16776437); + public static final MapColor adobeColor = new MapColor(15, 14188339); + public static final MapColor magentaColor = new MapColor(16, 11685080); + public static final MapColor lightBlueColor = new MapColor(17, 6724056); + public static final MapColor yellowColor = new MapColor(18, 15066419); + public static final MapColor limeColor = new MapColor(19, 8375321); + public static final MapColor pinkColor = new MapColor(20, 15892389); + public static final MapColor grayColor = new MapColor(21, 5000268); + public static final MapColor silverColor = new MapColor(22, 10066329); + public static final MapColor cyanColor = new MapColor(23, 5013401); + public static final MapColor purpleColor = new MapColor(24, 8339378); + public static final MapColor blueColor = new MapColor(25, 3361970); + public static final MapColor brownColor = new MapColor(26, 6704179); + public static final MapColor greenColor = new MapColor(27, 6717235); + public static final MapColor redColor = new MapColor(28, 10040115); + public static final MapColor blackColor = new MapColor(29, 1644825); + public static final MapColor goldColor = new MapColor(30, 16445005); + public static final MapColor diamondColor = new MapColor(31, 6085589); + public static final MapColor lapisColor = new MapColor(32, 4882687); + public static final MapColor emeraldColor = new MapColor(33, '\ud93a'); + public static final MapColor obsidianColor = new MapColor(34, 8476209); + public static final MapColor netherrackColor = new MapColor(35, 7340544); + public final int colorValue; + public final int colorIndex; + + private MapColor(int index, int color) { + if (index >= 0 && index <= 63) { + this.colorIndex = index; + this.colorValue = color; + mapColorArray[index] = this; + } else { + throw new IndexOutOfBoundsException("Map colour ID must be between 0 and 63 (inclusive)"); + } + } + + public int func_151643_b(int parInt1) { + short short1 = 220; + if (parInt1 == 3) { + short1 = 135; + } + + if (parInt1 == 2) { + short1 = 255; + } + + if (parInt1 == 1) { + short1 = 220; + } + + if (parInt1 == 0) { + short1 = 180; + } + + int i = (this.colorValue >> 16 & 255) * short1 / 255; + int j = (this.colorValue >> 8 & 255) * short1 / 255; + int k = (this.colorValue & 255) * short1 / 255; + return -16777216 | i << 16 | j << 8 | k; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/Material.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/Material.java new file mode 100644 index 0000000..662991c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/Material.java @@ -0,0 +1,239 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MaterialLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MaterialLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MaterialPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MaterialTransparent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Material { + + static { + __checkIntegratedContextValid("net/minecraft/block/material/Material"); + } + + public static final Material air = new MaterialTransparent(MapColor.airColor); + public static final Material grass = new Material(MapColor.grassColor); + public static final Material ground = new Material(MapColor.dirtColor); + public static final Material wood = (new Material(MapColor.woodColor)).setBurning(); + public static final Material rock = (new Material(MapColor.stoneColor)).setRequiresTool(); + public static final Material iron = (new Material(MapColor.ironColor)).setRequiresTool(); + public static final Material anvil = (new Material(MapColor.ironColor)).setRequiresTool().setImmovableMobility(); + public static final Material water = (new MaterialLiquid(MapColor.waterColor)).setNoPushMobility(); + public static final Material lava = (new MaterialLiquid(MapColor.tntColor)).setNoPushMobility(); + public static final Material leaves = (new Material(MapColor.foliageColor)).setBurning().setTranslucent() + .setNoPushMobility(); + public static final Material plants = (new MaterialLogic(MapColor.foliageColor)).setNoPushMobility(); + public static final Material vine = (new MaterialLogic(MapColor.foliageColor)).setBurning().setNoPushMobility() + .setReplaceable(); + public static final Material sponge = new Material(MapColor.yellowColor); + public static final Material cloth = (new Material(MapColor.clothColor)).setBurning(); + public static final Material fire = (new MaterialTransparent(MapColor.airColor)).setNoPushMobility(); + public static final Material sand = new Material(MapColor.sandColor); + public static final Material circuits = (new MaterialLogic(MapColor.airColor)).setNoPushMobility(); + public static final Material carpet = (new MaterialLogic(MapColor.clothColor)).setBurning(); + public static final Material glass = (new Material(MapColor.airColor)).setTranslucent().setAdventureModeExempt(); + public static final Material redstoneLight = (new Material(MapColor.airColor)).setAdventureModeExempt(); + public static final Material tnt = (new Material(MapColor.tntColor)).setBurning().setTranslucent(); + public static final Material coral = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material ice = (new Material(MapColor.iceColor)).setTranslucent().setAdventureModeExempt(); + public static final Material packedIce = (new Material(MapColor.iceColor)).setAdventureModeExempt(); + public static final Material snow = (new MaterialLogic(MapColor.snowColor)).setReplaceable().setTranslucent() + .setRequiresTool().setNoPushMobility(); + /**+ + * The material for crafted snow. + */ + public static final Material craftedSnow = (new Material(MapColor.snowColor)).setRequiresTool(); + public static final Material cactus = (new Material(MapColor.foliageColor)).setTranslucent().setNoPushMobility(); + public static final Material clay = new Material(MapColor.clayColor); + public static final Material gourd = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material dragonEgg = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material portal = (new MaterialPortal(MapColor.airColor)).setImmovableMobility(); + public static final Material cake = (new Material(MapColor.airColor)).setNoPushMobility(); + public static final Material web = (new Material(MapColor.clothColor) { + /**+ + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } + }).setRequiresTool().setNoPushMobility(); + /**+ + * Pistons' material. + */ + public static final Material piston = (new Material(MapColor.stoneColor)).setImmovableMobility(); + public static final Material barrier = (new Material(MapColor.airColor)).setRequiresTool().setImmovableMobility(); + private boolean canBurn; + private boolean replaceable; + private boolean isTranslucent; + private final MapColor materialMapColor; + /**+ + * Determines if the material can be harvested without a tool + * (or with the wrong tool) + */ + private boolean requiresNoTool = true; + private int mobilityFlag; + private boolean isAdventureModeExempt; + + public Material(MapColor color) { + this.materialMapColor = color; + } + + /**+ + * Returns if blocks of these materials are liquids. + */ + public boolean isLiquid() { + return false; + } + + /**+ + * Returns true if the block is a considered solid. This is true + * by default. + */ + public boolean isSolid() { + return true; + } + + /**+ + * Will prevent grass from growing on dirt underneath and kill + * any grass below it if it returns true + */ + public boolean blocksLight() { + return true; + } + + /**+ + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return true; + } + + /**+ + * Marks the material as translucent + */ + private Material setTranslucent() { + this.isTranslucent = true; + return this; + } + + /**+ + * Makes blocks with this material require the correct tool to + * be harvested. + */ + protected Material setRequiresTool() { + this.requiresNoTool = false; + return this; + } + + /**+ + * Set the canBurn bool to True and return the current object. + */ + protected Material setBurning() { + this.canBurn = true; + return this; + } + + /**+ + * Returns if the block can burn or not. + */ + public boolean getCanBurn() { + return this.canBurn; + } + + /**+ + * Sets {@link #replaceable} to true. + */ + public Material setReplaceable() { + this.replaceable = true; + return this; + } + + /**+ + * Returns whether the material can be replaced by other blocks + * when placed - eg snow, vines and tall grass. + */ + public boolean isReplaceable() { + return this.replaceable; + } + + /**+ + * Indicate if the material is opaque + */ + public boolean isOpaque() { + return this.isTranslucent ? false : this.blocksMovement(); + } + + /**+ + * Returns true if the material can be harvested without a tool + * (or with the wrong tool) + */ + public boolean isToolNotRequired() { + return this.requiresNoTool; + } + + /**+ + * Returns the mobility information of the material, 0 = free, 1 + * = can't push but can move over, 2 = total immobility and stop + * pistons. + */ + public int getMaterialMobility() { + return this.mobilityFlag; + } + + /**+ + * This type of material can't be pushed, but pistons can move + * over it. + */ + protected Material setNoPushMobility() { + this.mobilityFlag = 1; + return this; + } + + /**+ + * This type of material can't be pushed, and pistons are + * blocked to move. + */ + protected Material setImmovableMobility() { + this.mobilityFlag = 2; + return this; + } + + /**+ + * @see #isAdventureModeExempt() + */ + protected Material setAdventureModeExempt() { + this.isAdventureModeExempt = true; + return this; + } + + /**+ + * Retrieves the color index of the block. This is is the same + * color used by vanilla maps to represent this block. + */ + public MapColor getMaterialMapColor() { + return this.materialMapColor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLiquid.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLiquid.java new file mode 100644 index 0000000..a3384de --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLiquid.java @@ -0,0 +1,61 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MaterialLiquid extends Material { + + static { + __checkIntegratedContextValid("net/minecraft/block/material/MaterialLiquid"); + } + + public MaterialLiquid(MapColor color) { + super(color); + this.setReplaceable(); + this.setNoPushMobility(); + } + + /**+ + * Returns if blocks of these materials are liquids. + */ + public boolean isLiquid() { + return true; + } + + /**+ + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } + + /**+ + * Returns true if the block is a considered solid. This is true + * by default. + */ + public boolean isSolid() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLogic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLogic.java new file mode 100644 index 0000000..1c62b7c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLogic.java @@ -0,0 +1,61 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MaterialLogic extends Material { + + static { + __checkIntegratedContextValid("net/minecraft/block/material/MaterialLogic"); + } + + public MaterialLogic(MapColor color) { + super(color); + this.setAdventureModeExempt(); + } + + /**+ + * Returns true if the block is a considered solid. This is true + * by default. + */ + public boolean isSolid() { + return false; + } + + /**+ + * Will prevent grass from growing on dirt underneath and kill + * any grass below it if it returns true + */ + public boolean blocksLight() { + return false; + } + + /**+ + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialPortal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialPortal.java new file mode 100644 index 0000000..29e3ed9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialPortal.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MaterialPortal extends Material { + + static { + __checkIntegratedContextValid("net/minecraft/block/material/MaterialPortal"); + } + + public MaterialPortal(MapColor color) { + super(color); + } + + /**+ + * Returns true if the block is a considered solid. This is true + * by default. + */ + public boolean isSolid() { + return false; + } + + /**+ + * Will prevent grass from growing on dirt underneath and kill + * any grass below it if it returns true + */ + public boolean blocksLight() { + return false; + } + + /**+ + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialTransparent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialTransparent.java new file mode 100644 index 0000000..b07f39a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialTransparent.java @@ -0,0 +1,61 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MaterialTransparent extends Material { + + static { + __checkIntegratedContextValid("net/minecraft/block/material/MaterialTransparent"); + } + + public MaterialTransparent(MapColor color) { + super(color); + this.setReplaceable(); + } + + /**+ + * Returns true if the block is a considered solid. This is true + * by default. + */ + public boolean isSolid() { + return false; + } + + /**+ + * Will prevent grass from growing on dirt underneath and kill + * any grass below it if it returns true + */ + public boolean blocksLight() { + return false; + } + + /**+ + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/IProperty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/IProperty.java new file mode 100644 index 0000000..8751718 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/IProperty.java @@ -0,0 +1,42 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties; + +import java.util.Collection; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IProperty> { + /**+ + * Get the name for the given value. + */ + String getName(); + + Collection getAllowedValues(); + + /**+ + * The class of the values of this property + */ + Class getValueClass(); + + /**+ + * Get the name for the given value. + */ + String getName(T var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyBool.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyBool.java new file mode 100644 index 0000000..14fc867 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyBool.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties; + +import com.google.common.collect.ImmutableSet; +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PropertyBool extends PropertyHelper { + + static { + __checkIntegratedContextValid("net/minecraft/block/properties/PropertyBool"); + } + + private final ImmutableSet allowedValues = ImmutableSet.of(Boolean.valueOf(true), Boolean.valueOf(false)); + + protected PropertyBool(String name) { + super(name, Boolean.class); + } + + public Collection getAllowedValues() { + return this.allowedValues; + } + + public static PropertyBool create(String name) { + return new PropertyBool(name); + } + + /**+ + * Get the name for the given value. + */ + public String getName(Boolean value) { + return value.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyDirection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyDirection.java new file mode 100644 index 0000000..acec076 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyDirection.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyEnum; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PropertyDirection extends PropertyEnum { + + static { + __checkIntegratedContextValid("net/minecraft/block/properties/PropertyDirection"); + } + + protected PropertyDirection(String name, Collection values) { + super(name, EnumFacing.class, values); + } + + /**+ + * Create a new PropertyDirection with the given name + */ + public static PropertyDirection create(String name) { + /**+ + * Create a new PropertyDirection with the given name + */ + return create(name, Predicates.alwaysTrue()); + } + + /**+ + * Create a new PropertyDirection with the given name + */ + public static PropertyDirection create(String name, Predicate filter) { + /**+ + * Create a new PropertyDirection with the given name + */ + return create(name, Collections2.filter(Lists.newArrayList(EnumFacing.values()), filter)); + } + + /**+ + * Create a new PropertyDirection with the given name + */ + public static PropertyDirection create(String name, Collection values) { + return new PropertyDirection(name, values); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyEnum.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyEnum.java new file mode 100644 index 0000000..4598e8a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyEnum.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Collections2; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PropertyEnum & IStringSerializable> extends PropertyHelper { + + static { + __checkIntegratedContextValid("net/minecraft/block/properties/PropertyEnum"); + } + + private final ImmutableSet allowedValues; + private final Map nameToValue = Maps.newHashMap(); + + protected PropertyEnum(String name, Class valueClass, Collection allowedValues) { + super(name, valueClass); + this.allowedValues = ImmutableSet.copyOf(allowedValues); + + for (T oenum : allowedValues) { + String s = ((IStringSerializable) oenum).getName(); + if (this.nameToValue.containsKey(s)) { + throw new IllegalArgumentException("Multiple values have the same name \'" + s + "\'"); + } + + this.nameToValue.put(s, oenum); + } + + } + + public Collection getAllowedValues() { + return this.allowedValues; + } + + /**+ + * Get the name for the given value. + */ + public String getName(T oenum) { + return ((IStringSerializable) oenum).getName(); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz) { + /**+ + * Create a new PropertyEnum with all Enum constants of the + * given class. + */ + return create(name, clazz, Predicates.alwaysTrue()); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz, + Predicate filter) { + /**+ + * Create a new PropertyEnum with all Enum constants of the + * given class. + */ + return create(name, clazz, Collections2.filter(Lists.newArrayList(clazz.getEnumConstants()), filter)); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz, + T... values) { + /**+ + * Create a new PropertyEnum with all Enum constants of the + * given class. + */ + return create(name, clazz, Lists.newArrayList(values)); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz, + Collection values) { + return new PropertyEnum(name, clazz, values); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyHelper.java new file mode 100644 index 0000000..861190f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyHelper.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties; + +import com.google.common.base.Objects; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class PropertyHelper> implements IProperty { + + static { + __checkIntegratedContextValid("net/minecraft/block/properties/PropertyHelper"); + } + + private final Class valueClass; + private final String name; + + protected PropertyHelper(String name, Class valueClass) { + this.valueClass = valueClass; + this.name = name; + } + + public String getName() { + return this.name; + } + + /**+ + * The class of the values of this property + */ + public Class getValueClass() { + return this.valueClass; + } + + public String toString() { + return Objects.toStringHelper(this).add("name", this.name).add("clazz", this.valueClass) + .add("values", this.getAllowedValues()).toString(); + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + PropertyHelper propertyhelper = (PropertyHelper) object; + return this.valueClass.equals(propertyhelper.valueClass) && this.name.equals(propertyhelper.name); + } else { + return false; + } + } + + public int hashCode() { + return 31 * this.valueClass.hashCode() + this.name.hashCode(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyInteger.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyInteger.java new file mode 100644 index 0000000..19222d0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyInteger.java @@ -0,0 +1,91 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.HashSet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PropertyInteger extends PropertyHelper { + + static { + __checkIntegratedContextValid("net/minecraft/block/properties/PropertyInteger"); + } + + private final ImmutableSet allowedValues; + + protected PropertyInteger(String name, int min, int max) { + super(name, Integer.class); + if (min < 0) { + throw new IllegalArgumentException("Min value of " + name + " must be 0 or greater"); + } else if (max <= min) { + throw new IllegalArgumentException("Max value of " + name + " must be greater than min (" + min + ")"); + } else { + HashSet hashset = Sets.newHashSet(); + + for (int i = min; i <= max; ++i) { + hashset.add(Integer.valueOf(i)); + } + + this.allowedValues = ImmutableSet.copyOf(hashset); + } + } + + public Collection getAllowedValues() { + return this.allowedValues; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + if (!super.equals(object)) { + return false; + } else { + PropertyInteger propertyinteger = (PropertyInteger) object; + return this.allowedValues.equals(propertyinteger.allowedValues); + } + } else { + return false; + } + } + + public int hashCode() { + int i = super.hashCode(); + i = 31 * i + this.allowedValues.hashCode(); + return i; + } + + public static PropertyInteger create(String name, int min, int max) { + return new PropertyInteger(name, min, max); + } + + /**+ + * Get the name for the given value. + */ + public String getName(Integer integer) { + return integer.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockPistonStructureHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockPistonStructureHelper.java new file mode 100644 index 0000000..67ab783 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockPistonStructureHelper.java @@ -0,0 +1,218 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPistonStructureHelper { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/BlockPistonStructureHelper"); + } + + private final World world; + private final BlockPos pistonPos; + private final BlockPos blockToMove; + private final EnumFacing moveDirection; + /**+ + * This is a List of all blocks that will be moved by + * the piston. + */ + private final List toMove = Lists.newArrayList(); + /**+ + * This is a List of blocks that will be destroyed + * when a piston attempts to move them. + */ + private final List toDestroy = Lists.newArrayList(); + + public BlockPistonStructureHelper(World worldIn, BlockPos posIn, EnumFacing pistonFacing, boolean extending) { + this.world = worldIn; + this.pistonPos = posIn; + if (extending) { + this.moveDirection = pistonFacing; + this.blockToMove = posIn.offset(pistonFacing); + } else { + this.moveDirection = pistonFacing.getOpposite(); + this.blockToMove = posIn.offset(pistonFacing, 2); + } + + } + + public boolean canMove() { + this.toMove.clear(); + this.toDestroy.clear(); + Block block = this.world.getBlockState(this.blockToMove).getBlock(); + if (!BlockPistonBase.canPush(block, this.world, this.blockToMove, this.moveDirection, false)) { + if (block.getMobilityFlag() != 1) { + return false; + } else { + this.toDestroy.add(this.blockToMove); + return true; + } + } else if (!this.func_177251_a(this.blockToMove)) { + return false; + } else { + for (int i = 0; i < this.toMove.size(); ++i) { + BlockPos blockpos = (BlockPos) this.toMove.get(i); + if (this.world.getBlockState(blockpos).getBlock() == Blocks.slime_block + && !this.func_177250_b(blockpos)) { + return false; + } + } + + return true; + } + } + + private boolean func_177251_a(BlockPos origin) { + Block block = this.world.getBlockState(origin).getBlock(); + if (block.getMaterial() == Material.air) { + return true; + } else if (!BlockPistonBase.canPush(block, this.world, origin, this.moveDirection, false)) { + return true; + } else if (origin.equals(this.pistonPos)) { + return true; + } else if (this.toMove.contains(origin)) { + return true; + } else { + int i = 1; + if (i + this.toMove.size() > 12) { + return false; + } else { + while (block == Blocks.slime_block) { + BlockPos blockpos = origin.offset(this.moveDirection.getOpposite(), i); + block = this.world.getBlockState(blockpos).getBlock(); + if (block.getMaterial() == Material.air + || !BlockPistonBase.canPush(block, this.world, blockpos, this.moveDirection, false) + || blockpos.equals(this.pistonPos)) { + break; + } + + ++i; + if (i + this.toMove.size() > 12) { + return false; + } + } + + int i1 = 0; + + for (int j = i - 1; j >= 0; --j) { + this.toMove.add(origin.offset(this.moveDirection.getOpposite(), j)); + ++i1; + } + + int j1 = 1; + + while (true) { + BlockPos blockpos1 = origin.offset(this.moveDirection, j1); + int k = this.toMove.indexOf(blockpos1); + if (k > -1) { + this.func_177255_a(i1, k); + + for (int l = 0; l <= k + i1; ++l) { + BlockPos blockpos2 = (BlockPos) this.toMove.get(l); + if (this.world.getBlockState(blockpos2).getBlock() == Blocks.slime_block + && !this.func_177250_b(blockpos2)) { + return false; + } + } + + return true; + } + + block = this.world.getBlockState(blockpos1).getBlock(); + if (block.getMaterial() == Material.air) { + return true; + } + + if (!BlockPistonBase.canPush(block, this.world, blockpos1, this.moveDirection, true) + || blockpos1.equals(this.pistonPos)) { + return false; + } + + if (block.getMobilityFlag() == 1) { + this.toDestroy.add(blockpos1); + return true; + } + + if (this.toMove.size() >= 12) { + return false; + } + + this.toMove.add(blockpos1); + ++i1; + ++j1; + } + } + } + } + + private void func_177255_a(int parInt1, int parInt2) { + ArrayList arraylist = Lists.newArrayList(); + ArrayList arraylist1 = Lists.newArrayList(); + ArrayList arraylist2 = Lists.newArrayList(); + arraylist.addAll(this.toMove.subList(0, parInt2)); + arraylist1.addAll(this.toMove.subList(this.toMove.size() - parInt1, this.toMove.size())); + arraylist2.addAll(this.toMove.subList(parInt2, this.toMove.size() - parInt1)); + this.toMove.clear(); + this.toMove.addAll(arraylist); + this.toMove.addAll(arraylist1); + this.toMove.addAll(arraylist2); + } + + private boolean func_177250_b(BlockPos parBlockPos) { + for (EnumFacing enumfacing : EnumFacing.values()) { + if (enumfacing.getAxis() != this.moveDirection.getAxis() + && !this.func_177251_a(parBlockPos.offset(enumfacing))) { + return false; + } + } + + return true; + } + + /**+ + * Returns a List of all the blocks that are being + * moved by the piston. + */ + public List getBlocksToMove() { + return this.toMove; + } + + /**+ + * Returns an List of all the blocks that are being + * destroyed by the piston. + */ + public List getBlocksToDestroy() { + return this.toDestroy; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockState.java new file mode 100644 index 0000000..3a6dcab --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockState.java @@ -0,0 +1,202 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.base.Objects; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableTable; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockStateBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Cartesian; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MapPopulator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockState { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/BlockState"); + } + + private static final Joiner COMMA_JOINER = Joiner.on(", "); + private static final Function GET_NAME_FUNC = new Function() { + public String apply(IProperty iproperty) { + return iproperty == null ? "" : iproperty.getName(); + } + }; + private final Block block; + private final ImmutableList properties; + private final ImmutableList validStates; + + public BlockState(Block blockIn, IProperty... properties) { + this.block = blockIn; + Arrays.sort(properties, new Comparator() { + public int compare(IProperty iproperty, IProperty iproperty1) { + return iproperty.getName().compareTo(iproperty1.getName()); + } + }); + this.properties = ImmutableList.copyOf(properties); + LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(); + ArrayList arraylist = Lists.newArrayList(); + + for (List list : Cartesian.cartesianProduct(this.getAllowedValues())) { + Map map = MapPopulator.createMap(this.properties, list); + BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(blockIn, + ImmutableMap.copyOf(map)); + linkedhashmap.put(map, blockstate$stateimplementation); + arraylist.add(blockstate$stateimplementation); + } + + for (BlockState.StateImplementation blockstate$stateimplementation1 : (ArrayList) arraylist) { + blockstate$stateimplementation1.buildPropertyValueTable(linkedhashmap); + } + + this.validStates = ImmutableList.copyOf(arraylist); + } + + public ImmutableList getValidStates() { + return this.validStates; + } + + private List> getAllowedValues() { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < this.properties.size(); ++i) { + arraylist.add(((IProperty) this.properties.get(i)).getAllowedValues()); + } + + return arraylist; + } + + public IBlockState getBaseState() { + return (IBlockState) this.validStates.get(0); + } + + public Block getBlock() { + return this.block; + } + + public Collection getProperties() { + return this.properties; + } + + public String toString() { + return Objects.toStringHelper(this).add("block", Block.blockRegistry.getNameForObject(this.block)) + .add("properties", Iterables.transform(this.properties, GET_NAME_FUNC)).toString(); + } + + static class StateImplementation extends BlockStateBase { + private final Block block; + private final ImmutableMap properties; + private ImmutableTable propertyValueTable; + + private StateImplementation(Block blockIn, ImmutableMap propertiesIn) { + this.block = blockIn; + this.properties = propertiesIn; + } + + public Collection getPropertyNames() { + return Collections.unmodifiableCollection(this.properties.keySet()); + } + + public > T getValue(IProperty iproperty) { + if (!this.properties.containsKey(iproperty)) { + throw new IllegalArgumentException( + "Cannot get property " + iproperty + " as it does not exist in " + this.block.getBlockState()); + } else { + return (T) ((Comparable) iproperty.getValueClass().cast(this.properties.get(iproperty))); + } + } + + public , V extends T> IBlockState withProperty(IProperty iproperty, V comparable) { + if (!this.properties.containsKey(iproperty)) { + throw new IllegalArgumentException( + "Cannot set property " + iproperty + " as it does not exist in " + this.block.getBlockState()); + } else if (!iproperty.getAllowedValues().contains(comparable)) { + throw new IllegalArgumentException( + "Cannot set property " + iproperty + " to " + comparable + " on block " + + Block.blockRegistry.getNameForObject(this.block) + ", it is not an allowed value"); + } else { + return (IBlockState) (this.properties.get(iproperty) == comparable ? this + : (IBlockState) this.propertyValueTable.get(iproperty, comparable)); + } + } + + public ImmutableMap getProperties() { + return this.properties; + } + + public Block getBlock() { + return this.block; + } + + public boolean equals(Object object) { + return this == object; + } + + public int hashCode() { + return this.properties.hashCode(); + } + + public void buildPropertyValueTable(Map, BlockState.StateImplementation> map) { + if (this.propertyValueTable != null) { + throw new IllegalStateException(); + } else { + HashBasedTable hashbasedtable = HashBasedTable.create(); + + for (IProperty iproperty : this.properties.keySet()) { + for (Comparable comparable : (Collection) iproperty.getAllowedValues()) { + if (comparable != this.properties.get(iproperty)) { + hashbasedtable.put(iproperty, comparable, + map.get(this.getPropertiesWithValue(iproperty, comparable))); + } + } + } + + this.propertyValueTable = ImmutableTable.copyOf(hashbasedtable); + } + } + + private Map getPropertiesWithValue(IProperty property, Comparable value) { + HashMap hashmap = Maps.newHashMap(this.properties); + hashmap.put(property, value); + return hashmap; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockStateBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockStateBase.java new file mode 100644 index 0000000..f1fb09c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockStateBase.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockStateBase implements IBlockState { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/BlockStateBase"); + } + + private static final Joiner COMMA_JOINER = Joiner.on(','); + private static final Function, String> MAP_ENTRY_TO_STRING = new Function, String>() { + public String apply(Entry entry) { + if (entry == null) { + return ""; + } else { + IProperty iproperty = (IProperty) entry.getKey(); + return iproperty.getName() + "=" + iproperty.getName((Comparable) entry.getValue()); + } + } + }; + + private int blockId = -1; + private int blockStateId = -1; + private int metadata = -1; + + public int getBlockId() { + if (this.blockId < 0) { + this.blockId = Block.getIdFromBlock(this.getBlock()); + } + + return this.blockId; + } + + public int getBlockStateId() { + if (this.blockStateId < 0) { + this.blockStateId = Block.getStateId(this); + } + + return this.blockStateId; + } + + public int getMetadata() { + if (this.metadata < 0) { + this.metadata = this.getBlock().getMetaFromState(this); + } + + return this.metadata; + } + + public > IBlockState cycleProperty(IProperty property) { + return this.withProperty(property, cyclePropertyValue(property.getAllowedValues(), this.getValue(property))); + } + + protected static T cyclePropertyValue(Collection values, T currentValue) { + Iterator iterator = values.iterator(); + + while (iterator.hasNext()) { + if (iterator.next().equals(currentValue)) { + if (iterator.hasNext()) { + return (T) iterator.next(); + } + + return (T) values.iterator().next(); + } + } + + return (T) iterator.next(); + } + + public String toString() { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append(Block.blockRegistry.getNameForObject(this.getBlock())); + if (!this.getProperties().isEmpty()) { + stringbuilder.append("["); + COMMA_JOINER.appendTo(stringbuilder, + Iterables.transform(this.getProperties().entrySet(), MAP_ENTRY_TO_STRING)); + stringbuilder.append("]"); + } + + return stringbuilder.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockWorldState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockWorldState.java new file mode 100644 index 0000000..f7b6835 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockWorldState.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockWorldState { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/BlockWorldState"); + } + + private final World world; + private final BlockPos pos; + private final boolean field_181628_c; + private IBlockState state; + private TileEntity tileEntity; + private boolean tileEntityInitialized; + + public BlockWorldState(World parWorld, BlockPos parBlockPos, boolean parFlag) { + this.world = parWorld; + this.pos = parBlockPos; + this.field_181628_c = parFlag; + } + + public IBlockState getBlockState() { + if (this.state == null && (this.field_181628_c || this.world.isBlockLoaded(this.pos))) { + this.state = this.world.getBlockState(this.pos); + } + + return this.state; + } + + public TileEntity getTileEntity() { + if (this.tileEntity == null && !this.tileEntityInitialized) { + this.tileEntity = this.world.getTileEntity(this.pos); + this.tileEntityInitialized = true; + } + + return this.tileEntity; + } + + public BlockPos getPos() { + return this.pos; + } + + public static Predicate hasState(final Predicate parPredicate) { + return new Predicate() { + public boolean apply(BlockWorldState blockworldstate) { + return blockworldstate != null && parPredicate.apply(blockworldstate.getBlockState()); + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/IBlockState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/IBlockState.java new file mode 100644 index 0000000..fa65dad --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/IBlockState.java @@ -0,0 +1,43 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state; + +import com.google.common.collect.ImmutableMap; +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IBlockState { + /**+ + * Get the names of all properties defined for this BlockState + */ + Collection getPropertyNames(); + + > T getValue(IProperty var1); + + , V extends T> IBlockState withProperty(IProperty var1, V var2); + + > IBlockState cycleProperty(IProperty var1); + + ImmutableMap getProperties(); + + Block getBlock(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockHelper.java new file mode 100644 index 0000000..86512d8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockHelper.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockHelper implements Predicate { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/pattern/BlockHelper"); + } + + private final Block block; + + private BlockHelper(Block blockType) { + this.block = blockType; + } + + public static BlockHelper forBlock(Block blockType) { + return new BlockHelper(blockType); + } + + public boolean apply(IBlockState iblockstate) { + return iblockstate != null && iblockstate.getBlock() == this.block; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockPattern.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockPattern.java new file mode 100644 index 0000000..5192ee2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockPattern.java @@ -0,0 +1,213 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern; + +import com.google.common.base.Objects; +import com.google.common.base.Predicate; + +import net.lax1dude.eaglercraft.v1_8.cache.EaglerCacheProvider; +import net.lax1dude.eaglercraft.v1_8.cache.EaglerLoadingCache; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockWorldState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3i; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPattern { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/pattern/BlockPattern"); + } + + private final Predicate[][][] blockMatches; + private final int fingerLength; + private final int thumbLength; + private final int palmLength; + + public BlockPattern(Predicate[][][] predicatesIn) { + this.blockMatches = predicatesIn; + this.fingerLength = predicatesIn.length; + if (this.fingerLength > 0) { + this.thumbLength = predicatesIn[0].length; + if (this.thumbLength > 0) { + this.palmLength = predicatesIn[0][0].length; + } else { + this.palmLength = 0; + } + } else { + this.thumbLength = 0; + this.palmLength = 0; + } + + } + + public int getThumbLength() { + return this.thumbLength; + } + + public int getPalmLength() { + return this.palmLength; + } + + /**+ + * checks that the given pattern & rotation is at the block + * co-ordinates. + */ + private BlockPattern.PatternHelper checkPatternAt(BlockPos pos, EnumFacing finger, EnumFacing thumb, + EaglerLoadingCache lcache) { + for (int i = 0; i < this.palmLength; ++i) { + for (int j = 0; j < this.thumbLength; ++j) { + for (int k = 0; k < this.fingerLength; ++k) { + if (!this.blockMatches[k][j][i].apply(lcache.get(translateOffset(pos, finger, thumb, i, j, k)))) { + return null; + } + } + } + } + + return new BlockPattern.PatternHelper(pos, finger, thumb, lcache, this.palmLength, this.thumbLength, + this.fingerLength); + } + + /**+ + * Calculates whether the given world position matches the + * pattern. Warning, fairly heavy function. @return a + * BlockPattern.PatternHelper if found, null otherwise. + */ + public BlockPattern.PatternHelper match(World worldIn, BlockPos pos) { + EaglerLoadingCache loadingcache = func_181627_a(worldIn, false); + int i = Math.max(Math.max(this.palmLength, this.thumbLength), this.fingerLength); + + for (BlockPos blockpos : BlockPos.getAllInBox(pos, pos.add(i - 1, i - 1, i - 1))) { + for (EnumFacing enumfacing : EnumFacing.values()) { + for (EnumFacing enumfacing1 : EnumFacing.values()) { + if (enumfacing1 != enumfacing && enumfacing1 != enumfacing.getOpposite()) { + BlockPattern.PatternHelper blockpattern$patternhelper = this.checkPatternAt(blockpos, + enumfacing, enumfacing1, loadingcache); + if (blockpattern$patternhelper != null) { + return blockpattern$patternhelper; + } + } + } + } + } + + return null; + } + + public static EaglerLoadingCache func_181627_a(World parWorld, boolean parFlag) { + return new EaglerLoadingCache(new BlockPattern.CacheLoader(parWorld, parFlag)); + } + + /**+ + * Offsets the position of pos in the direction of finger and + * thumb facing by offset amounts, follows the right-hand rule + * for cross products (finger, thumb, palm) @return A new + * BlockPos offset in the facing directions + */ + protected static BlockPos translateOffset(BlockPos pos, EnumFacing finger, EnumFacing thumb, int palmOffset, + int thumbOffset, int fingerOffset) { + if (finger != thumb && finger != thumb.getOpposite()) { + Vec3i vec3i = new Vec3i(finger.getFrontOffsetX(), finger.getFrontOffsetY(), finger.getFrontOffsetZ()); + Vec3i vec3i1 = new Vec3i(thumb.getFrontOffsetX(), thumb.getFrontOffsetY(), thumb.getFrontOffsetZ()); + Vec3i vec3i2 = vec3i.crossProduct(vec3i1); + return pos.add(vec3i1.getX() * -thumbOffset + vec3i2.getX() * palmOffset + vec3i.getX() * fingerOffset, + vec3i1.getY() * -thumbOffset + vec3i2.getY() * palmOffset + vec3i.getY() * fingerOffset, + vec3i1.getZ() * -thumbOffset + vec3i2.getZ() * palmOffset + vec3i.getZ() * fingerOffset); + } else { + throw new IllegalArgumentException("Invalid forwards & up combination"); + } + } + + static class CacheLoader implements EaglerCacheProvider { + private final World world; + private final boolean field_181626_b; + + public CacheLoader(World parWorld, boolean parFlag) { + this.world = parWorld; + this.field_181626_b = parFlag; + } + + public BlockWorldState create(BlockPos parBlockPos) { + return new BlockWorldState(this.world, parBlockPos, this.field_181626_b); + } + + } + + public static class PatternHelper { + private final BlockPos pos; + private final EnumFacing finger; + private final EnumFacing thumb; + private final EaglerLoadingCache lcache; + private final int field_181120_e; + private final int field_181121_f; + private final int field_181122_g; + + public PatternHelper(BlockPos parBlockPos, EnumFacing parEnumFacing, EnumFacing parEnumFacing2, + EaglerLoadingCache parLoadingCache, int parInt1, int parInt2, int parInt3) { + this.pos = parBlockPos; + this.finger = parEnumFacing; + this.thumb = parEnumFacing2; + this.lcache = parLoadingCache; + this.field_181120_e = parInt1; + this.field_181121_f = parInt2; + this.field_181122_g = parInt3; + } + + public BlockPos func_181117_a() { + return this.pos; + } + + public EnumFacing getFinger() { + return this.finger; + } + + public EnumFacing getThumb() { + return this.thumb; + } + + public int func_181118_d() { + return this.field_181120_e; + } + + public int func_181119_e() { + return this.field_181121_f; + } + + /**+ + * Offsets the position of pos in the direction of finger and + * thumb facing by offset amounts, follows the right-hand rule + * for cross products (finger, thumb, palm) @return A new + * BlockPos offset in the facing directions + */ + public BlockWorldState translateOffset(int palmOffset, int thumbOffset, int fingerOffset) { + return (BlockWorldState) this.lcache.get(BlockPattern.translateOffset(this.pos, this.getFinger(), + this.getThumb(), palmOffset, thumbOffset, fingerOffset)); + } + + public String toString() { + return Objects.toStringHelper(this).add("up", this.thumb).add("forwards", this.finger) + .add("frontTopLeft", this.pos).toString(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockStateHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockStateHelper.java new file mode 100644 index 0000000..39ff941 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockStateHelper.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern; + +import com.google.common.base.Predicate; +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockStateHelper implements Predicate { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/pattern/BlockStateHelper"); + } + + private final BlockState blockstate; + private final Map propertyPredicates = Maps.newHashMap(); + + private BlockStateHelper(BlockState blockStateIn) { + this.blockstate = blockStateIn; + } + + public static BlockStateHelper forBlock(Block blockIn) { + return new BlockStateHelper(blockIn.getBlockState()); + } + + public boolean apply(IBlockState iblockstate) { + if (iblockstate != null && iblockstate.getBlock().equals(this.blockstate.getBlock())) { + for (Entry entry : this.propertyPredicates.entrySet()) { + Comparable comparable = iblockstate.getValue((IProperty) entry.getKey()); + if (!((Predicate) entry.getValue()).apply(comparable)) { + return false; + } + } + + return true; + } else { + return false; + } + } + + public > BlockStateHelper where(IProperty property, Predicate is) { + if (!this.blockstate.getProperties().contains(property)) { + throw new IllegalArgumentException(this.blockstate + " cannot support property " + property); + } else { + this.propertyPredicates.put(property, is); + return this; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/FactoryBlockPattern.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/FactoryBlockPattern.java new file mode 100644 index 0000000..5bf33fb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/FactoryBlockPattern.java @@ -0,0 +1,129 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern; + +import com.google.common.base.Joiner; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.BlockWorldState; +import org.apache.commons.lang3.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 FactoryBlockPattern { + + static { + __checkIntegratedContextValid("net/minecraft/block/state/pattern/FactoryBlockPattern"); + } + + private static final Joiner COMMA_JOIN = Joiner.on(","); + private final List depth = Lists.newArrayList(); + private final Map> symbolMap = Maps.newHashMap(); + private int aisleHeight; + private int rowWidth; + + private FactoryBlockPattern() { + this.symbolMap.put(Character.valueOf(' '), Predicates.alwaysTrue()); + } + + public FactoryBlockPattern aisle(String... aisle) { + if (!(aisle == null || aisle.length <= 0) && !StringUtils.isEmpty(aisle[0])) { + if (this.depth.isEmpty()) { + this.aisleHeight = aisle.length; + this.rowWidth = aisle[0].length(); + } + + if (aisle.length != this.aisleHeight) { + throw new IllegalArgumentException("Expected aisle with height of " + this.aisleHeight + + ", but was given one with a height of " + aisle.length + ")"); + } else { + for (String s : aisle) { + if (s.length() != this.rowWidth) { + throw new IllegalArgumentException( + "Not all rows in the given aisle are the correct width (expected " + this.rowWidth + + ", found one with " + s.length() + ")"); + } + + for (char c0 : s.toCharArray()) { + if (!this.symbolMap.containsKey(Character.valueOf(c0))) { + this.symbolMap.put(Character.valueOf(c0), null); + } + } + } + + this.depth.add(aisle); + return this; + } + } else { + throw new IllegalArgumentException("Empty pattern for aisle"); + } + } + + public static FactoryBlockPattern start() { + return new FactoryBlockPattern(); + } + + public FactoryBlockPattern where(char symbol, Predicate blockMatcher) { + this.symbolMap.put(Character.valueOf(symbol), blockMatcher); + return this; + } + + public BlockPattern build() { + return new BlockPattern(this.makePredicateArray()); + } + + private Predicate[][][] makePredicateArray() { + this.checkMissingPredicates(); + Predicate[][][] apredicate = new Predicate[this.depth.size()][this.aisleHeight][this.rowWidth]; + + for (int i = 0; i < this.depth.size(); ++i) { + for (int j = 0; j < this.aisleHeight; ++j) { + for (int k = 0; k < this.rowWidth; ++k) { + apredicate[i][j][k] = (Predicate) this.symbolMap + .get(Character.valueOf(((String[]) this.depth.get(i))[j].charAt(k))); + } + } + } + + return apredicate; + } + + private void checkMissingPredicates() { + ArrayList arraylist = Lists.newArrayList(); + + for (Entry entry : this.symbolMap.entrySet()) { + if (entry.getValue() == null) { + arraylist.add(entry.getKey()); + } + } + + if (!arraylist.isEmpty()) { + throw new IllegalStateException( + "Predicates for character(s) " + COMMA_JOIN.join(arraylist) + " are missing"); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBase.java new file mode 100644 index 0000000..91a7bb2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBase.java @@ -0,0 +1,668 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.base.Functions; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.primitives.Doubles; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.EntityNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.IAdminCommand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerSelector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class CommandBase implements ICommand { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandBase"); + } + + private static IAdminCommand theAdmin; + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 4; + } + + /**+ + * Gets a list of aliases for this command + */ + public List getCommandAliases() { + return Collections.emptyList(); + } + + /**+ + * Returns true if the given command sender is allowed to use + * this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender icommandsender) { + return icommandsender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] var2, BlockPos var3) { + return null; + } + + public static int parseInt(String input) throws NumberInvalidException { + try { + return Integer.parseInt(input); + } catch (NumberFormatException var2) { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] { input }); + } + } + + public static int parseInt(String input, int min) throws NumberInvalidException { + return parseInt(input, min, Integer.MAX_VALUE); + } + + public static int parseInt(String input, int min, int max) throws NumberInvalidException { + int i = parseInt(input); + if (i < min) { + throw new NumberInvalidException("commands.generic.num.tooSmall", + new Object[] { Integer.valueOf(i), Integer.valueOf(min) }); + } else if (i > max) { + throw new NumberInvalidException("commands.generic.num.tooBig", + new Object[] { Integer.valueOf(i), Integer.valueOf(max) }); + } else { + return i; + } + } + + public static long parseLong(String input) throws NumberInvalidException { + try { + return Long.parseLong(input); + } catch (NumberFormatException var2) { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] { input }); + } + } + + public static long parseLong(String input, long min, long max) throws NumberInvalidException { + long i = parseLong(input); + if (i < min) { + throw new NumberInvalidException("commands.generic.num.tooSmall", + new Object[] { Long.valueOf(i), Long.valueOf(min) }); + } else if (i > max) { + throw new NumberInvalidException("commands.generic.num.tooBig", + new Object[] { Long.valueOf(i), Long.valueOf(max) }); + } else { + return i; + } + } + + public static BlockPos parseBlockPos(ICommandSender sender, String[] args, int startIndex, boolean centerBlock) + throws NumberInvalidException { + BlockPos blockpos = sender.getPosition(); + return new BlockPos(parseDouble((double) blockpos.getX(), args[startIndex], -30000000, 30000000, centerBlock), + parseDouble((double) blockpos.getY(), args[startIndex + 1], 0, 256, false), + parseDouble((double) blockpos.getZ(), args[startIndex + 2], -30000000, 30000000, centerBlock)); + } + + public static double parseDouble(String input) throws NumberInvalidException { + try { + double d0 = Double.parseDouble(input); + if (!Doubles.isFinite(d0)) { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] { input }); + } else { + return d0; + } + } catch (NumberFormatException var3) { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] { input }); + } + } + + public static double parseDouble(String input, double min) throws NumberInvalidException { + return parseDouble(input, min, Double.MAX_VALUE); + } + + public static double parseDouble(String input, double min, double max) throws NumberInvalidException { + double d0 = parseDouble(input); + if (d0 < min) { + throw new NumberInvalidException("commands.generic.double.tooSmall", + new Object[] { Double.valueOf(d0), Double.valueOf(min) }); + } else if (d0 > max) { + throw new NumberInvalidException("commands.generic.double.tooBig", + new Object[] { Double.valueOf(d0), Double.valueOf(max) }); + } else { + return d0; + } + } + + public static boolean parseBoolean(String input) throws CommandException { + if (!input.equals("true") && !input.equals("1")) { + if (!input.equals("false") && !input.equals("0")) { + throw new CommandException("commands.generic.boolean.invalid", new Object[] { input }); + } else { + return false; + } + } else { + return true; + } + } + + /**+ + * Returns the given ICommandSender as a EntityPlayer or throw + * an exception. + */ + public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender sender) throws PlayerNotFoundException { + if (sender instanceof EntityPlayerMP) { + return (EntityPlayerMP) sender; + } else { + throw new PlayerNotFoundException("You must specify which player you wish to perform this action on.", + new Object[0]); + } + } + + public static EntityPlayerMP getPlayer(ICommandSender sender, String username) throws PlayerNotFoundException { + EntityPlayerMP entityplayermp = PlayerSelector.matchOnePlayer(sender, username); + if (entityplayermp == null) { + try { + entityplayermp = MinecraftServer.getServer().getConfigurationManager() + .getPlayerByUUID(EaglercraftUUID.fromString(username)); + } catch (IllegalArgumentException var4) { + ; + } + } + + if (entityplayermp == null) { + entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(username); + } + + if (entityplayermp == null) { + throw new PlayerNotFoundException(); + } else { + return entityplayermp; + } + } + + public static Entity func_175768_b(ICommandSender parICommandSender, String parString1) + throws EntityNotFoundException { + return getEntity(parICommandSender, parString1, Entity.class); + } + + public static T getEntity(ICommandSender commandSender, String parString1, + Class parClass1) throws EntityNotFoundException { + Object object = PlayerSelector.matchOneEntity(commandSender, parString1, parClass1); + MinecraftServer minecraftserver = MinecraftServer.getServer(); + if (object == null) { + object = minecraftserver.getConfigurationManager().getPlayerByUsername(parString1); + } + + if (object == null) { + try { + EaglercraftUUID uuid = EaglercraftUUID.fromString(parString1); + object = minecraftserver.getEntityFromUuid(uuid); + if (object == null) { + object = minecraftserver.getConfigurationManager().getPlayerByUUID(uuid); + } + } catch (IllegalArgumentException var6) { + throw new EntityNotFoundException("commands.generic.entity.invalidUuid", new Object[0]); + } + } + + if (object != null && parClass1.isAssignableFrom(object.getClass())) { + return (T) object; + } else { + throw new EntityNotFoundException(); + } + } + + public static List func_175763_c(ICommandSender parICommandSender, String parString1) + throws EntityNotFoundException { + return (List) (PlayerSelector.hasArguments(parString1) + ? PlayerSelector.matchEntities(parICommandSender, parString1, Entity.class) + : Lists.newArrayList(new Entity[] { func_175768_b(parICommandSender, parString1) })); + } + + public static String getPlayerName(ICommandSender sender, String query) throws PlayerNotFoundException { + try { + return getPlayer(sender, query).getName(); + } catch (PlayerNotFoundException playernotfoundexception) { + if (PlayerSelector.hasArguments(query)) { + throw playernotfoundexception; + } else { + return query; + } + } + } + + /**+ + * Attempts to retrieve an entity's name, first assuming that + * the entity is a player, and then exhausting all other + * possibilities. + */ + public static String getEntityName(ICommandSender parICommandSender, String parString1) + throws EntityNotFoundException { + try { + return getPlayer(parICommandSender, parString1).getName(); + } catch (PlayerNotFoundException var5) { + try { + return func_175768_b(parICommandSender, parString1).getUniqueID().toString(); + } catch (EntityNotFoundException entitynotfoundexception) { + if (PlayerSelector.hasArguments(parString1)) { + throw entitynotfoundexception; + } else { + return parString1; + } + } + } + } + + public static IChatComponent getChatComponentFromNthArg(ICommandSender sender, String[] args, int parInt1) + throws PlayerNotFoundException { + return getChatComponentFromNthArg(sender, args, parInt1, false); + } + + public static IChatComponent getChatComponentFromNthArg(ICommandSender sender, String[] args, int index, + boolean parFlag) throws PlayerNotFoundException { + ChatComponentText chatcomponenttext = new ChatComponentText(""); + + for (int i = index; i < args.length; ++i) { + if (i > index) { + chatcomponenttext.appendText(" "); + } + + Object object = new ChatComponentText(args[i]); + if (parFlag) { + IChatComponent ichatcomponent = PlayerSelector.matchEntitiesToChatComponent(sender, args[i]); + if (ichatcomponent == null) { + if (PlayerSelector.hasArguments(args[i])) { + throw new PlayerNotFoundException(); + } + } else { + object = ichatcomponent; + } + } + + chatcomponenttext.appendSibling((IChatComponent) object); + } + + return chatcomponenttext; + } + + /**+ + * Builds a string starting at startPos + */ + public static String buildString(String[] args, int startPos) { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = startPos; i < args.length; ++i) { + if (i > startPos) { + stringbuilder.append(" "); + } + + String s = args[i]; + stringbuilder.append(s); + } + + return stringbuilder.toString(); + } + + public static CommandBase.CoordinateArg parseCoordinate(double base, String centerBlock, boolean parFlag) + throws NumberInvalidException { + return parseCoordinate(base, centerBlock, -30000000, 30000000, parFlag); + } + + public static CommandBase.CoordinateArg parseCoordinate(double min, String max, int centerBlock, int parInt2, + boolean parFlag) throws NumberInvalidException { + boolean flag = max.startsWith("~"); + if (flag && Double.isNaN(min)) { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] { Double.valueOf(min) }); + } else { + double d0 = 0.0D; + if (!flag || max.length() > 1) { + boolean flag1 = max.contains("."); + if (flag) { + max = max.substring(1); + } + + d0 += parseDouble(max); + if (!flag1 && !flag && parFlag) { + d0 += 0.5D; + } + } + + if (centerBlock != 0 || parInt2 != 0) { + if (d0 < (double) centerBlock) { + throw new NumberInvalidException("commands.generic.double.tooSmall", + new Object[] { Double.valueOf(d0), Integer.valueOf(centerBlock) }); + } + + if (d0 > (double) parInt2) { + throw new NumberInvalidException("commands.generic.double.tooBig", + new Object[] { Double.valueOf(d0), Integer.valueOf(parInt2) }); + } + } + + return new CommandBase.CoordinateArg(d0 + (flag ? min : 0.0D), d0, flag); + } + } + + public static double parseDouble(double base, String input, boolean centerBlock) throws NumberInvalidException { + return parseDouble(base, input, -30000000, 30000000, centerBlock); + } + + public static double parseDouble(double base, String input, int min, int max, boolean centerBlock) + throws NumberInvalidException { + boolean flag = input.startsWith("~"); + if (flag && Double.isNaN(base)) { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] { Double.valueOf(base) }); + } else { + double d0 = flag ? base : 0.0D; + if (!flag || input.length() > 1) { + boolean flag1 = input.contains("."); + if (flag) { + input = input.substring(1); + } + + d0 += parseDouble(input); + if (!flag1 && !flag && centerBlock) { + d0 += 0.5D; + } + } + + if (min != 0 || max != 0) { + if (d0 < (double) min) { + throw new NumberInvalidException("commands.generic.double.tooSmall", + new Object[] { Double.valueOf(d0), Integer.valueOf(min) }); + } + + if (d0 > (double) max) { + throw new NumberInvalidException("commands.generic.double.tooBig", + new Object[] { Double.valueOf(d0), Integer.valueOf(max) }); + } + } + + return d0; + } + } + + /**+ + * Gets the Item specified by the given text string. First + * checks the item registry, then tries by parsing the string as + * an integer ID (deprecated). Warns the sender if we matched by + * parsing the ID. Throws if the item wasn't found. Returns the + * item if it was found. + */ + public static Item getItemByText(ICommandSender sender, String id) throws NumberInvalidException { + ResourceLocation resourcelocation = new ResourceLocation(id); + Item item = (Item) Item.itemRegistry.getObject(resourcelocation); + if (item == null) { + throw new NumberInvalidException("commands.give.item.notFound", new Object[] { resourcelocation }); + } else { + return item; + } + } + + /**+ + * Gets the Block specified by the given text string. First + * checks the block registry, then tries by parsing the string + * as an integer ID (deprecated). Warns the sender if we matched + * by parsing the ID. Throws if the block wasn't found. Returns + * the block if it was found. + */ + public static Block getBlockByText(ICommandSender sender, String id) throws NumberInvalidException { + ResourceLocation resourcelocation = new ResourceLocation(id); + if (!Block.blockRegistry.containsKey(resourcelocation)) { + throw new NumberInvalidException("commands.give.block.notFound", new Object[] { resourcelocation }); + } else { + Block block = (Block) Block.blockRegistry.getObject(resourcelocation); + if (block == null) { + throw new NumberInvalidException("commands.give.block.notFound", new Object[] { resourcelocation }); + } else { + return block; + } + } + } + + /**+ + * Creates a linguistic series joining the input objects + * together. Examples: 1) {} --> "", 2) {"Steve"} --> "Steve", + * 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", + * "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + public static String joinNiceString(Object[] elements) { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = 0; i < elements.length; ++i) { + String s = elements[i].toString(); + if (i > 0) { + if (i == elements.length - 1) { + stringbuilder.append(" and "); + } else { + stringbuilder.append(", "); + } + } + + stringbuilder.append(s); + } + + return stringbuilder.toString(); + } + + public static IChatComponent join(List components) { + ChatComponentText chatcomponenttext = new ChatComponentText(""); + + for (int i = 0; i < components.size(); ++i) { + if (i > 0) { + if (i == components.size() - 1) { + chatcomponenttext.appendText(" and "); + } else if (i > 0) { + chatcomponenttext.appendText(", "); + } + } + + chatcomponenttext.appendSibling((IChatComponent) components.get(i)); + } + + return chatcomponenttext; + } + + /**+ + * Creates a linguistic series joining together the elements of + * the given collection. Examples: 1) {} --> "", 2) {"Steve"} + * --> "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) + * {"Steve", "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + public static String joinNiceStringFromCollection(Collection strings) { + /**+ + * Creates a linguistic series joining the input objects + * together. Examples: 1) {} --> "", 2) {"Steve"} --> "Steve", + * 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", + * "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + return joinNiceString(strings.toArray(new String[strings.size()])); + } + + public static List func_175771_a(String[] parArrayOfString, int parInt1, BlockPos parBlockPos) { + if (parBlockPos == null) { + return null; + } else { + int i = parArrayOfString.length - 1; + String s; + if (i == parInt1) { + s = Integer.toString(parBlockPos.getX()); + } else if (i == parInt1 + 1) { + s = Integer.toString(parBlockPos.getY()); + } else { + if (i != parInt1 + 2) { + return null; + } + + s = Integer.toString(parBlockPos.getZ()); + } + + return Lists.newArrayList(new String[] { s }); + } + } + + public static List func_181043_b(String[] parArrayOfString, int parInt1, BlockPos parBlockPos) { + if (parBlockPos == null) { + return null; + } else { + int i = parArrayOfString.length - 1; + String s; + if (i == parInt1) { + s = Integer.toString(parBlockPos.getX()); + } else { + if (i != parInt1 + 1) { + return null; + } + + s = Integer.toString(parBlockPos.getZ()); + } + + return Lists.newArrayList(new String[] { s }); + } + } + + /**+ + * Returns true if the given substring is exactly equal to the + * start of the given string (case insensitive). + */ + public static boolean doesStringStartWith(String original, String region) { + return region.regionMatches(true, 0, original, 0, original.length()); + } + + /**+ + * Returns a List of strings (chosen from the given strings) + * which the last word in the given string array is a + * beginning-match for. (Tab completion). + */ + public static List getListOfStringsMatchingLastWord(String[] args, String... possibilities) { + /**+ + * Returns a List of strings (chosen from the given strings) + * which the last word in the given string array is a + * beginning-match for. (Tab completion). + */ + return getListOfStringsMatchingLastWord(args, (Collection) Arrays.asList(possibilities)); + } + + /**+ + * Returns a List of strings (chosen from the given strings) + * which the last word in the given string array is a + * beginning-match for. (Tab completion). + */ + public static List getListOfStringsMatchingLastWord(String[] parArrayOfString, + Collection parCollection) { + String s = parArrayOfString[parArrayOfString.length - 1]; + ArrayList arraylist = Lists.newArrayList(); + if (!parCollection.isEmpty()) { + for (String s1 : Iterables.transform(parCollection, Functions.toStringFunction())) { + if (doesStringStartWith(s, s1)) { + arraylist.add(s1); + } + } + + if (arraylist.isEmpty()) { + for (Object object : parCollection) { + if (object instanceof ResourceLocation + && doesStringStartWith(s, ((ResourceLocation) object).getResourcePath())) { + arraylist.add(String.valueOf(object)); + } + } + } + } + + return arraylist; + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int var2) { + return false; + } + + public static void notifyOperators(ICommandSender sender, ICommand command, String msgFormat, Object... msgParams) { + notifyOperators(sender, command, 0, msgFormat, msgParams); + } + + public static void notifyOperators(ICommandSender sender, ICommand command, int msgFormat, String msgParams, + Object... parArrayOfObject) { + if (theAdmin != null) { + theAdmin.notifyOperators(sender, command, msgFormat, msgParams, parArrayOfObject); + } + + } + + /**+ + * Sets the static IAdminCommander. + */ + public static void setAdminCommander(IAdminCommand command) { + theAdmin = command; + } + + public int compareTo(ICommand icommand) { + return this.getCommandName().compareTo(icommand.getCommandName()); + } + + public static class CoordinateArg { + private final double field_179633_a; + private final double field_179631_b; + private final boolean field_179632_c; + + protected CoordinateArg(double parDouble1, double parDouble2, boolean parFlag) { + this.field_179633_a = parDouble1; + this.field_179631_b = parDouble2; + this.field_179632_c = parFlag; + } + + public double func_179628_a() { + return this.field_179633_a; + } + + public double func_179629_b() { + return this.field_179631_b; + } + + public boolean func_179630_c() { + return this.field_179632_c; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBlockData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBlockData.java new file mode 100644 index 0000000..d04bfb8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBlockData.java @@ -0,0 +1,122 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandBlockData extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandBlockData"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "blockdata"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.blockdata.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 4) { + throw new WrongUsageException("commands.blockdata.usage", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, false); + World world = parICommandSender.getEntityWorld(); + if (!world.isBlockLoaded(blockpos)) { + throw new CommandException("commands.blockdata.outOfWorld", new Object[0]); + } else { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity == null) { + throw new CommandException("commands.blockdata.notValid", new Object[0]); + } else { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttagcompound.copy(); + + NBTTagCompound nbttagcompound2; + try { + nbttagcompound2 = JsonToNBT + .getTagFromJson(getChatComponentFromNthArg(parICommandSender, parArrayOfString, 3) + .getUnformattedText()); + } catch (NBTException nbtexception) { + throw new CommandException("commands.blockdata.tagError", + new Object[] { nbtexception.getMessage() }); + } + + nbttagcompound.merge(nbttagcompound2); + nbttagcompound.setInteger("x", blockpos.getX()); + nbttagcompound.setInteger("y", blockpos.getY()); + nbttagcompound.setInteger("z", blockpos.getZ()); + if (nbttagcompound.equals(nbttagcompound1)) { + throw new CommandException("commands.blockdata.failed", + new Object[] { nbttagcompound.toString() }); + } else { + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + world.markBlockForUpdate(blockpos); + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 1); + notifyOperators(parICommandSender, this, "commands.blockdata.success", + new Object[] { nbttagcompound.toString() }); + } + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 && astring.length <= 3 ? func_175771_a(astring, 0, blockpos) : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClearInventory.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClearInventory.java new file mode 100644 index 0000000..235d484 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClearInventory.java @@ -0,0 +1,128 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandClearInventory extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandClearInventory"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "clear"; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.clear.usage"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + EntityPlayerMP entityplayermp = parArrayOfString.length == 0 ? getCommandSenderAsPlayer(parICommandSender) + : getPlayer(parICommandSender, parArrayOfString[0]); + Item item = parArrayOfString.length >= 2 ? getItemByText(parICommandSender, parArrayOfString[1]) : null; + int i = parArrayOfString.length >= 3 ? parseInt(parArrayOfString[2], -1) : -1; + int j = parArrayOfString.length >= 4 ? parseInt(parArrayOfString[3], -1) : -1; + NBTTagCompound nbttagcompound = null; + if (parArrayOfString.length >= 5) { + try { + nbttagcompound = JsonToNBT.getTagFromJson(buildString(parArrayOfString, 4)); + } catch (NBTException nbtexception) { + throw new CommandException("commands.clear.tagError", new Object[] { nbtexception.getMessage() }); + } + } + + if (parArrayOfString.length >= 2 && item == null) { + throw new CommandException("commands.clear.failure", new Object[] { entityplayermp.getName() }); + } else { + int k = entityplayermp.inventory.clearMatchingItems(item, i, j, nbttagcompound); + entityplayermp.inventoryContainer.detectAndSendChanges(); + if (!entityplayermp.capabilities.isCreativeMode) { + entityplayermp.updateHeldItem(); + } + + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, k); + if (k == 0) { + throw new CommandException("commands.clear.failure", new Object[] { entityplayermp.getName() }); + } else { + if (j == 0) { + parICommandSender.addChatMessage(new ChatComponentTranslation("commands.clear.testing", + new Object[] { entityplayermp.getName(), Integer.valueOf(k) })); + } else { + notifyOperators(parICommandSender, this, "commands.clear.success", + new Object[] { entityplayermp.getName(), Integer.valueOf(k) }); + } + + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, this.func_147209_d()) + : (astring.length == 2 ? getListOfStringsMatchingLastWord(astring, Item.itemRegistry.getKeys()) : null); + } + + protected String[] func_147209_d() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClone.java new file mode 100644 index 0000000..10a15db --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClone.java @@ -0,0 +1,292 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.NextTickListEntry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandClone extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandClone"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "clone"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.clone.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 9) { + throw new WrongUsageException("commands.clone.usage", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, false); + BlockPos blockpos1 = parseBlockPos(parICommandSender, parArrayOfString, 3, false); + BlockPos blockpos2 = parseBlockPos(parICommandSender, parArrayOfString, 6, false); + StructureBoundingBox structureboundingbox = new StructureBoundingBox(blockpos, blockpos1); + StructureBoundingBox structureboundingbox1 = new StructureBoundingBox(blockpos2, + blockpos2.add(structureboundingbox.func_175896_b())); + int i = structureboundingbox.getXSize() * structureboundingbox.getYSize() * structureboundingbox.getZSize(); + if (i > '\u8000') { + throw new CommandException("commands.clone.tooManyBlocks", + new Object[] { Integer.valueOf(i), Integer.valueOf('\u8000') }); + } else { + boolean flag = false; + Block block = null; + int j = -1; + if ((parArrayOfString.length < 11 + || !parArrayOfString[10].equals("force") && !parArrayOfString[10].equals("move")) + && structureboundingbox.intersectsWith(structureboundingbox1)) { + throw new CommandException("commands.clone.noOverlap", new Object[0]); + } else { + if (parArrayOfString.length >= 11 && parArrayOfString[10].equals("move")) { + flag = true; + } + + if (structureboundingbox.minY >= 0 && structureboundingbox.maxY < 256 + && structureboundingbox1.minY >= 0 && structureboundingbox1.maxY < 256) { + World world = parICommandSender.getEntityWorld(); + if (world.isAreaLoaded(structureboundingbox) && world.isAreaLoaded(structureboundingbox1)) { + boolean flag1 = false; + if (parArrayOfString.length >= 10) { + if (parArrayOfString[9].equals("masked")) { + flag1 = true; + } else if (parArrayOfString[9].equals("filtered")) { + if (parArrayOfString.length < 12) { + throw new WrongUsageException("commands.clone.usage", new Object[0]); + } + + block = getBlockByText(parICommandSender, parArrayOfString[11]); + if (parArrayOfString.length >= 13) { + j = parseInt(parArrayOfString[12], 0, 15); + } + } + } + + ArrayList arraylist = Lists.newArrayList(); + ArrayList arraylist1 = Lists.newArrayList(); + ArrayList arraylist2 = Lists.newArrayList(); + LinkedList linkedlist = Lists.newLinkedList(); + BlockPos blockpos3 = new BlockPos(structureboundingbox1.minX - structureboundingbox.minX, + structureboundingbox1.minY - structureboundingbox.minY, + structureboundingbox1.minZ - structureboundingbox.minZ); + + for (int k = structureboundingbox.minZ; k <= structureboundingbox.maxZ; ++k) { + for (int l = structureboundingbox.minY; l <= structureboundingbox.maxY; ++l) { + for (int i1 = structureboundingbox.minX; i1 <= structureboundingbox.maxX; ++i1) { + BlockPos blockpos4 = new BlockPos(i1, l, k); + BlockPos blockpos5 = blockpos4.add(blockpos3); + IBlockState iblockstate = world.getBlockState(blockpos4); + if ((!flag1 || iblockstate.getBlock() != Blocks.air) && (block == null + || iblockstate.getBlock() == block && (j < 0 || iblockstate.getBlock() + .getMetaFromState(iblockstate) == j))) { + TileEntity tileentity = world.getTileEntity(blockpos4); + if (tileentity != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + arraylist1.add(new CommandClone.StaticCloneData(blockpos5, iblockstate, + nbttagcompound)); + linkedlist.addLast(blockpos4); + } else if (!iblockstate.getBlock().isFullBlock() + && !iblockstate.getBlock().isFullCube()) { + arraylist2.add(new CommandClone.StaticCloneData(blockpos5, iblockstate, + (NBTTagCompound) null)); + linkedlist.addFirst(blockpos4); + } else { + arraylist.add(new CommandClone.StaticCloneData(blockpos5, iblockstate, + (NBTTagCompound) null)); + linkedlist.addLast(blockpos4); + } + } + } + } + } + + if (flag) { + for (BlockPos blockpos6 : (LinkedList) linkedlist) { + TileEntity tileentity1 = world.getTileEntity(blockpos6); + if (tileentity1 instanceof IInventory) { + ((IInventory) tileentity1).clear(); + } + + world.setBlockState(blockpos6, Blocks.barrier.getDefaultState(), 2); + } + + for (BlockPos blockpos7 : (LinkedList) linkedlist) { + world.setBlockState(blockpos7, Blocks.air.getDefaultState(), 3); + } + } + + ArrayList arraylist3 = Lists.newArrayList(); + arraylist3.addAll(arraylist); + arraylist3.addAll(arraylist1); + arraylist3.addAll(arraylist2); + List list = Lists.reverse(arraylist3); + + for (CommandClone.StaticCloneData commandclone$staticclonedata : (List) list) { + TileEntity tileentity2 = world + .getTileEntity(commandclone$staticclonedata.field_179537_a); + if (tileentity2 instanceof IInventory) { + ((IInventory) tileentity2).clear(); + } + + world.setBlockState(commandclone$staticclonedata.field_179537_a, + Blocks.barrier.getDefaultState(), 2); + } + + i = 0; + + for (CommandClone.StaticCloneData commandclone$staticclonedata1 : (ArrayList) arraylist3) { + if (world.setBlockState(commandclone$staticclonedata1.field_179537_a, + commandclone$staticclonedata1.blockState, 2)) { + ++i; + } + } + + for (CommandClone.StaticCloneData commandclone$staticclonedata2 : (ArrayList) arraylist1) { + TileEntity tileentity3 = world + .getTileEntity(commandclone$staticclonedata2.field_179537_a); + if (commandclone$staticclonedata2.field_179536_c != null && tileentity3 != null) { + commandclone$staticclonedata2.field_179536_c.setInteger("x", + commandclone$staticclonedata2.field_179537_a.getX()); + commandclone$staticclonedata2.field_179536_c.setInteger("y", + commandclone$staticclonedata2.field_179537_a.getY()); + commandclone$staticclonedata2.field_179536_c.setInteger("z", + commandclone$staticclonedata2.field_179537_a.getZ()); + tileentity3.readFromNBT(commandclone$staticclonedata2.field_179536_c); + tileentity3.markDirty(); + } + + world.setBlockState(commandclone$staticclonedata2.field_179537_a, + commandclone$staticclonedata2.blockState, 2); + } + + for (CommandClone.StaticCloneData commandclone$staticclonedata3 : (List) list) { + world.notifyNeighborsRespectDebug(commandclone$staticclonedata3.field_179537_a, + commandclone$staticclonedata3.blockState.getBlock()); + } + + List list1 = world.func_175712_a(structureboundingbox, false); + if (list1 != null) { + for (NextTickListEntry nextticklistentry : (List) list1) { + if (structureboundingbox.isVecInside(nextticklistentry.position)) { + BlockPos blockpos8 = nextticklistentry.position.add(blockpos3); + world.scheduleBlockUpdate(blockpos8, nextticklistentry.getBlock(), + (int) (nextticklistentry.scheduledTime + - world.getWorldInfo().getWorldTotalTime()), + nextticklistentry.priority); + } + } + } + + if (i <= 0) { + throw new CommandException("commands.clone.failed", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, i); + notifyOperators(parICommandSender, this, "commands.clone.success", + new Object[] { Integer.valueOf(i) }); + } + } else { + throw new CommandException("commands.clone.outOfWorld", new Object[0]); + } + } else { + throw new CommandException("commands.clone.outOfWorld", new Object[0]); + } + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 + && astring.length <= 3 + ? func_175771_a(astring, 0, blockpos) + : (astring.length > 3 + && astring.length <= 6 + ? func_175771_a(astring, 3, blockpos) + : (astring.length > 6 && astring.length <= 9 + ? func_175771_a(astring, 6, blockpos) + : (astring.length == 10 + ? getListOfStringsMatchingLastWord(astring, + new String[] { "replace", "masked", "filtered" }) + : (astring.length == 11 + ? getListOfStringsMatchingLastWord(astring, + new String[] { "normal", "force", "move" }) + : (astring.length == 12 && "filtered".equals(astring[9]) + ? getListOfStringsMatchingLastWord(astring, + Block.blockRegistry.getKeys()) + : null))))); + } + + static class StaticCloneData { + public final BlockPos field_179537_a; + public final IBlockState blockState; + public final NBTTagCompound field_179536_c; + + public StaticCloneData(BlockPos parBlockPos, IBlockState parIBlockState, NBTTagCompound parNBTTagCompound) { + this.field_179537_a = parBlockPos; + this.blockState = parIBlockState; + this.field_179536_c = parNBTTagCompound; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandCompare.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandCompare.java new file mode 100644 index 0000000..d729644 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandCompare.java @@ -0,0 +1,165 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandCompare extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandCompare"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "testforblocks"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.compare.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 9) { + throw new WrongUsageException("commands.compare.usage", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, false); + BlockPos blockpos1 = parseBlockPos(parICommandSender, parArrayOfString, 3, false); + BlockPos blockpos2 = parseBlockPos(parICommandSender, parArrayOfString, 6, false); + StructureBoundingBox structureboundingbox = new StructureBoundingBox(blockpos, blockpos1); + StructureBoundingBox structureboundingbox1 = new StructureBoundingBox(blockpos2, + blockpos2.add(structureboundingbox.func_175896_b())); + int i = structureboundingbox.getXSize() * structureboundingbox.getYSize() * structureboundingbox.getZSize(); + if (i > 524288) { + throw new CommandException("commands.compare.tooManyBlocks", + new Object[] { Integer.valueOf(i), Integer.valueOf(524288) }); + } else if (structureboundingbox.minY >= 0 && structureboundingbox.maxY < 256 + && structureboundingbox1.minY >= 0 && structureboundingbox1.maxY < 256) { + World world = parICommandSender.getEntityWorld(); + if (world.isAreaLoaded(structureboundingbox) && world.isAreaLoaded(structureboundingbox1)) { + boolean flag = false; + if (parArrayOfString.length > 9 && parArrayOfString[9].equals("masked")) { + flag = true; + } + + i = 0; + BlockPos blockpos3 = new BlockPos(structureboundingbox1.minX - structureboundingbox.minX, + structureboundingbox1.minY - structureboundingbox.minY, + structureboundingbox1.minZ - structureboundingbox.minZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); + + for (int j = structureboundingbox.minZ; j <= structureboundingbox.maxZ; ++j) { + for (int k = structureboundingbox.minY; k <= structureboundingbox.maxY; ++k) { + for (int l = structureboundingbox.minX; l <= structureboundingbox.maxX; ++l) { + blockpos$mutableblockpos.func_181079_c(l, k, j); + blockpos$mutableblockpos1.func_181079_c(l + blockpos3.getX(), k + blockpos3.getY(), + j + blockpos3.getZ()); + boolean flag1 = false; + IBlockState iblockstate = world.getBlockState(blockpos$mutableblockpos); + if (!flag || iblockstate.getBlock() != Blocks.air) { + if (iblockstate == world.getBlockState(blockpos$mutableblockpos1)) { + TileEntity tileentity = world.getTileEntity(blockpos$mutableblockpos); + TileEntity tileentity1 = world.getTileEntity(blockpos$mutableblockpos1); + if (tileentity != null && tileentity1 != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("x"); + nbttagcompound.removeTag("y"); + nbttagcompound.removeTag("z"); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity1.writeToNBT(nbttagcompound1); + nbttagcompound1.removeTag("x"); + nbttagcompound1.removeTag("y"); + nbttagcompound1.removeTag("z"); + if (!nbttagcompound.equals(nbttagcompound1)) { + flag1 = true; + } + } else if (tileentity != null) { + flag1 = true; + } + } else { + flag1 = true; + } + + ++i; + if (flag1) { + throw new CommandException("commands.compare.failed", new Object[0]); + } + } + } + } + } + + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, i); + notifyOperators(parICommandSender, this, "commands.compare.success", + new Object[] { Integer.valueOf(i) }); + } else { + throw new CommandException("commands.compare.outOfWorld", new Object[0]); + } + } else { + throw new CommandException("commands.compare.outOfWorld", new Object[0]); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 && astring.length <= 3 ? func_175771_a(astring, 0, blockpos) + : (astring.length > 3 && astring.length <= 6 ? func_175771_a(astring, 3, blockpos) + : (astring.length > 6 && astring.length <= 9 ? func_175771_a(astring, 6, blockpos) + : (astring.length == 10 + ? getListOfStringsMatchingLastWord(astring, new String[] { "masked", "all" }) + : null))); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDefaultGameMode.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDefaultGameMode.java new file mode 100644 index 0000000..57a96d2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDefaultGameMode.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandGameMode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandDefaultGameMode extends CommandGameMode { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandDefaultGameMode"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "defaultgamemode"; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.defaultgamemode.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length <= 0) { + throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]); + } else { + WorldSettings.GameType worldsettings$gametype = this.getGameModeFromCommand(parICommandSender, + parArrayOfString[0]); + this.setGameType(worldsettings$gametype); + notifyOperators(parICommandSender, this, "commands.defaultgamemode.success", new Object[] { + new ChatComponentTranslation("gameMode." + worldsettings$gametype.getName(), new Object[0]) }); + } + } + + protected void setGameType(WorldSettings.GameType parGameType) { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + minecraftserver.setGameType(parGameType); + if (minecraftserver.getForceGamemode()) { + for (EntityPlayerMP entityplayermp : MinecraftServer.getServer().getConfigurationManager() + .func_181057_v()) { + entityplayermp.setGameType(parGameType); + entityplayermp.fallDistance = 0.0F; + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDifficulty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDifficulty.java new file mode 100644 index 0000000..77d6666 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDifficulty.java @@ -0,0 +1,97 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandDifficulty extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandDifficulty"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "difficulty"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.difficulty.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length <= 0) { + throw new WrongUsageException("commands.difficulty.usage", new Object[0]); + } else { + EnumDifficulty enumdifficulty = this.getDifficultyFromCommand(parArrayOfString[0]); + MinecraftServer.getServer().setDifficultyForAllWorlds(enumdifficulty); + notifyOperators(parICommandSender, this, "commands.difficulty.success", new Object[] { + new ChatComponentTranslation(enumdifficulty.getDifficultyResourceKey(), new Object[0]) }); + } + } + + protected EnumDifficulty getDifficultyFromCommand(String parString1) throws NumberInvalidException { + return !parString1.equalsIgnoreCase("peaceful") && !parString1.equalsIgnoreCase("p") + ? (!parString1.equalsIgnoreCase("easy") && !parString1.equalsIgnoreCase("e") + ? (!parString1.equalsIgnoreCase("normal") && !parString1.equalsIgnoreCase("n") + ? (!parString1.equalsIgnoreCase("hard") && !parString1.equalsIgnoreCase("h") + ? EnumDifficulty.getDifficultyEnum(parseInt(parString1, 0, 3)) + : EnumDifficulty.HARD) + : EnumDifficulty.NORMAL) + : EnumDifficulty.EASY) + : EnumDifficulty.PEACEFUL; + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, new String[] { "peaceful", "easy", "normal", "hard" }) + : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEffect.java new file mode 100644 index 0000000..7fb6141 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEffect.java @@ -0,0 +1,168 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandEffect extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandEffect"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "effect"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.effect.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.effect.usage", new Object[0]); + } else { + EntityLivingBase entitylivingbase = (EntityLivingBase) getEntity(parICommandSender, parArrayOfString[0], + EntityLivingBase.class); + if (parArrayOfString[1].equals("clear")) { + if (entitylivingbase.getActivePotionEffects().isEmpty()) { + throw new CommandException("commands.effect.failure.notActive.all", + new Object[] { entitylivingbase.getName() }); + } else { + entitylivingbase.clearActivePotions(); + notifyOperators(parICommandSender, this, "commands.effect.success.removed.all", + new Object[] { entitylivingbase.getName() }); + } + } else { + int i; + try { + i = parseInt(parArrayOfString[1], 1); + } catch (NumberInvalidException numberinvalidexception) { + Potion potion = Potion.getPotionFromResourceLocation(parArrayOfString[1]); + if (potion == null) { + throw numberinvalidexception; + } + + i = potion.id; + } + + int j = 600; + int l = 30; + int k = 0; + if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) { + Potion potion1 = Potion.potionTypes[i]; + if (parArrayOfString.length >= 3) { + l = parseInt(parArrayOfString[2], 0, 1000000); + if (potion1.isInstant()) { + j = l; + } else { + j = l * 20; + } + } else if (potion1.isInstant()) { + j = 1; + } + + if (parArrayOfString.length >= 4) { + k = parseInt(parArrayOfString[3], 0, 255); + } + + boolean flag = true; + if (parArrayOfString.length >= 5 && "true".equalsIgnoreCase(parArrayOfString[4])) { + flag = false; + } + + if (l > 0) { + PotionEffect potioneffect = new PotionEffect(i, j, k, false, flag); + entitylivingbase.addPotionEffect(potioneffect); + notifyOperators(parICommandSender, this, "commands.effect.success", + new Object[] { + new ChatComponentTranslation(potioneffect.getEffectName(), new Object[0]), + Integer.valueOf(i), Integer.valueOf(k), entitylivingbase.getName(), + Integer.valueOf(l) }); + } else if (entitylivingbase.isPotionActive(i)) { + entitylivingbase.removePotionEffect(i); + notifyOperators(parICommandSender, this, "commands.effect.success.removed", + new Object[] { new ChatComponentTranslation(potion1.getName(), new Object[0]), + entitylivingbase.getName() }); + } else { + throw new CommandException("commands.effect.failure.notActive", + new Object[] { new ChatComponentTranslation(potion1.getName(), new Object[0]), + entitylivingbase.getName() }); + } + } else { + throw new NumberInvalidException("commands.effect.notFound", new Object[] { Integer.valueOf(i) }); + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, this.getAllUsernames()) + : (astring.length == 2 ? getListOfStringsMatchingLastWord(astring, Potion.func_181168_c()) + : (astring.length == 5 + ? getListOfStringsMatchingLastWord(astring, new String[] { "true", "false" }) + : null)); + } + + protected String[] getAllUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEnchant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEnchant.java new file mode 100644 index 0000000..7181bd0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEnchant.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandEnchant extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandEnchant"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "enchant"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.enchant.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.enchant.usage", new Object[0]); + } else { + EntityPlayerMP entityplayermp = getPlayer(parICommandSender, parArrayOfString[0]); + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 0); + + int i; + try { + i = parseInt(parArrayOfString[1], 0); + } catch (NumberInvalidException numberinvalidexception) { + Enchantment enchantment = Enchantment.getEnchantmentByLocation(parArrayOfString[1]); + if (enchantment == null) { + throw numberinvalidexception; + } + + i = enchantment.effectId; + } + + int j = 1; + ItemStack itemstack = entityplayermp.getCurrentEquippedItem(); + if (itemstack == null) { + throw new CommandException("commands.enchant.noItem", new Object[0]); + } else { + Enchantment enchantment1 = Enchantment.getEnchantmentById(i); + if (enchantment1 == null) { + throw new NumberInvalidException("commands.enchant.notFound", new Object[] { Integer.valueOf(i) }); + } else if (!enchantment1.canApply(itemstack)) { + throw new CommandException("commands.enchant.cantEnchant", new Object[0]); + } else { + if (parArrayOfString.length >= 3) { + j = parseInt(parArrayOfString[2], enchantment1.getMinLevel(), enchantment1.getMaxLevel()); + } + + if (itemstack.hasTagCompound()) { + NBTTagList nbttaglist = itemstack.getEnchantmentTagList(); + if (nbttaglist != null) { + for (int k = 0; k < nbttaglist.tagCount(); ++k) { + short short1 = nbttaglist.getCompoundTagAt(k).getShort("id"); + if (Enchantment.getEnchantmentById(short1) != null) { + Enchantment enchantment2 = Enchantment.getEnchantmentById(short1); + if (!enchantment2.canApplyTogether(enchantment1)) { + throw new CommandException("commands.enchant.cantCombine", + new Object[] { enchantment1.getTranslatedName(j), + enchantment2.getTranslatedName( + nbttaglist.getCompoundTagAt(k).getShort("lvl")) }); + } + } + } + } + } + + itemstack.addEnchantment(enchantment1, j); + notifyOperators(parICommandSender, this, "commands.enchant.success", new Object[0]); + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 1); + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, this.getListOfPlayers()) + : (astring.length == 2 ? getListOfStringsMatchingLastWord(astring, Enchantment.func_181077_c()) : null); + } + + protected String[] getListOfPlayers() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) { + return index == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEntityData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEntityData.java new file mode 100644 index 0000000..d7ad7e3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEntityData.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandEntityData extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandEntityData"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "entitydata"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.entitydata.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.entitydata.usage", new Object[0]); + } else { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[0]); + if (entity instanceof EntityPlayer) { + throw new CommandException("commands.entitydata.noPlayers", new Object[] { entity.getDisplayName() }); + } else { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entity.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttagcompound.copy(); + + NBTTagCompound nbttagcompound2; + try { + nbttagcompound2 = JsonToNBT.getTagFromJson( + getChatComponentFromNthArg(parICommandSender, parArrayOfString, 1).getUnformattedText()); + } catch (NBTException nbtexception) { + throw new CommandException("commands.entitydata.tagError", + new Object[] { nbtexception.getMessage() }); + } + + nbttagcompound2.removeTag("UUIDMost"); + nbttagcompound2.removeTag("UUIDLeast"); + nbttagcompound.merge(nbttagcompound2); + if (nbttagcompound.equals(nbttagcompound1)) { + throw new CommandException("commands.entitydata.failed", + new Object[] { nbttagcompound.toString() }); + } else { + entity.readFromNBT(nbttagcompound); + notifyOperators(parICommandSender, this, "commands.entitydata.success", + new Object[] { nbttagcompound.toString() }); + } + } + } + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandException.java new file mode 100644 index 0000000..9e75c53 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandException.java @@ -0,0 +1,41 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandException extends Exception { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandException"); + } + + private final Object[] errorObjects; + + public CommandException(String message, Object... objects) { + super(message); + this.errorObjects = objects; + } + + public Object[] getErrorObjects() { + return this.errorObjects; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandExecuteAt.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandExecuteAt.java new file mode 100644 index 0000000..b3bb4e3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandExecuteAt.java @@ -0,0 +1,177 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandExecuteAt extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandExecuteAt"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "execute"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.execute.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(final ICommandSender parICommandSender, String[] parArrayOfString) + throws CommandException { + if (parArrayOfString.length < 5) { + throw new WrongUsageException("commands.execute.usage", new Object[0]); + } else { + final Entity entity = getEntity(parICommandSender, parArrayOfString[0], Entity.class); + final double d0 = parseDouble(entity.posX, parArrayOfString[1], false); + final double d1 = parseDouble(entity.posY, parArrayOfString[2], false); + final double d2 = parseDouble(entity.posZ, parArrayOfString[3], false); + final BlockPos blockpos = new BlockPos(d0, d1, d2); + byte b0 = 4; + if ("detect".equals(parArrayOfString[4]) && parArrayOfString.length > 10) { + World world = entity.getEntityWorld(); + double d3 = parseDouble(d0, parArrayOfString[5], false); + double d4 = parseDouble(d1, parArrayOfString[6], false); + double d5 = parseDouble(d2, parArrayOfString[7], false); + Block block = getBlockByText(parICommandSender, parArrayOfString[8]); + int j = parseInt(parArrayOfString[9], -1, 15); + BlockPos blockpos1 = new BlockPos(d3, d4, d5); + IBlockState iblockstate = world.getBlockState(blockpos1); + if (iblockstate.getBlock() != block + || j >= 0 && iblockstate.getBlock().getMetaFromState(iblockstate) != j) { + throw new CommandException("commands.execute.failed", new Object[] { "detect", entity.getName() }); + } + + b0 = 10; + } + + String s = buildString(parArrayOfString, b0); + ICommandSender icommandsender = new ICommandSender() { + public String getName() { + return entity.getName(); + } + + public IChatComponent getDisplayName() { + return entity.getDisplayName(); + } + + public void addChatMessage(IChatComponent component) { + parICommandSender.addChatMessage(component); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) { + return parICommandSender.canCommandSenderUseCommand(permLevel, commandName); + } + + public BlockPos getPosition() { + return blockpos; + } + + public Vec3 getPositionVector() { + return new Vec3(d0, d1, d2); + } + + public World getEntityWorld() { + return entity.worldObj; + } + + public Entity getCommandSenderEntity() { + return entity; + } + + public boolean sendCommandFeedback() { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + return minecraftserver == null + || minecraftserver.worldServers[0].getGameRules().getBoolean("commandBlockOutput"); + } + + public void setCommandStat(CommandResultStats.Type type, int amount) { + entity.setCommandStat(type, amount); + } + }; + ICommandManager icommandmanager = MinecraftServer.getServer().getCommandManager(); + + try { + int i = icommandmanager.executeCommand(icommandsender, s); + if (i < 1) { + throw new CommandException("commands.execute.allInvocationsFailed", new Object[] { s }); + } + } catch (Throwable var23) { + throw new CommandException("commands.execute.failed", new Object[] { s, entity.getName() }); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : (astring.length > 1 && astring.length <= 4 ? func_175771_a(astring, 1, blockpos) + : (astring.length > 5 && astring.length <= 8 && "detect".equals(astring[4]) + ? func_175771_a(astring, 5, blockpos) + : (astring.length == 9 && "detect".equals(astring[4]) + ? getListOfStringsMatchingLastWord(astring, Block.blockRegistry.getKeys()) + : null))); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandFill.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandFill.java new file mode 100644 index 0000000..1645a5b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandFill.java @@ -0,0 +1,228 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandFill extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandFill"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "fill"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.fill.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 7) { + throw new WrongUsageException("commands.fill.usage", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, false); + BlockPos blockpos1 = parseBlockPos(parICommandSender, parArrayOfString, 3, false); + Block block = CommandBase.getBlockByText(parICommandSender, parArrayOfString[6]); + int i = 0; + if (parArrayOfString.length >= 8) { + i = parseInt(parArrayOfString[7], 0, 15); + } + + BlockPos blockpos2 = new BlockPos(Math.min(blockpos.getX(), blockpos1.getX()), + Math.min(blockpos.getY(), blockpos1.getY()), Math.min(blockpos.getZ(), blockpos1.getZ())); + BlockPos blockpos3 = new BlockPos(Math.max(blockpos.getX(), blockpos1.getX()), + Math.max(blockpos.getY(), blockpos1.getY()), Math.max(blockpos.getZ(), blockpos1.getZ())); + int j = (blockpos3.getX() - blockpos2.getX() + 1) * (blockpos3.getY() - blockpos2.getY() + 1) + * (blockpos3.getZ() - blockpos2.getZ() + 1); + if (j > '\u8000') { + throw new CommandException("commands.fill.tooManyBlocks", + new Object[] { Integer.valueOf(j), Integer.valueOf('\u8000') }); + } else if (blockpos2.getY() >= 0 && blockpos3.getY() < 256) { + World world = parICommandSender.getEntityWorld(); + + for (int k = blockpos2.getZ(); k < blockpos3.getZ() + 16; k += 16) { + for (int l = blockpos2.getX(); l < blockpos3.getX() + 16; l += 16) { + if (!world.isBlockLoaded(new BlockPos(l, blockpos3.getY() - blockpos2.getY(), k))) { + throw new CommandException("commands.fill.outOfWorld", new Object[0]); + } + } + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + if (parArrayOfString.length >= 10 && block.hasTileEntity()) { + String s = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 9).getUnformattedText(); + + try { + nbttagcompound = JsonToNBT.getTagFromJson(s); + flag = true; + } catch (NBTException nbtexception) { + throw new CommandException("commands.fill.tagError", + new Object[] { nbtexception.getMessage() }); + } + } + + ArrayList arraylist = Lists.newArrayList(); + j = 0; + + for (int i1 = blockpos2.getZ(); i1 <= blockpos3.getZ(); ++i1) { + for (int j1 = blockpos2.getY(); j1 <= blockpos3.getY(); ++j1) { + for (int k1 = blockpos2.getX(); k1 <= blockpos3.getX(); ++k1) { + BlockPos blockpos4 = new BlockPos(k1, j1, i1); + if (parArrayOfString.length >= 9) { + if (!parArrayOfString[8].equals("outline") && !parArrayOfString[8].equals("hollow")) { + if (parArrayOfString[8].equals("destroy")) { + world.destroyBlock(blockpos4, true); + } else if (parArrayOfString[8].equals("keep")) { + if (!world.isAirBlock(blockpos4)) { + continue; + } + } else if (parArrayOfString[8].equals("replace") && !block.hasTileEntity()) { + if (parArrayOfString.length > 9) { + Block block1 = CommandBase.getBlockByText(parICommandSender, + parArrayOfString[9]); + if (world.getBlockState(blockpos4).getBlock() != block1) { + continue; + } + } + + if (parArrayOfString.length > 10) { + int l1 = CommandBase.parseInt(parArrayOfString[10]); + IBlockState iblockstate = world.getBlockState(blockpos4); + if (iblockstate.getBlock().getMetaFromState(iblockstate) != l1) { + continue; + } + } + } + } else if (k1 != blockpos2.getX() && k1 != blockpos3.getX() && j1 != blockpos2.getY() + && j1 != blockpos3.getY() && i1 != blockpos2.getZ() && i1 != blockpos3.getZ()) { + if (parArrayOfString[8].equals("hollow")) { + world.setBlockState(blockpos4, Blocks.air.getDefaultState(), 2); + arraylist.add(blockpos4); + } + continue; + } + } + + TileEntity tileentity1 = world.getTileEntity(blockpos4); + if (tileentity1 != null) { + if (tileentity1 instanceof IInventory) { + ((IInventory) tileentity1).clear(); + } + + world.setBlockState(blockpos4, Blocks.barrier.getDefaultState(), + block == Blocks.barrier ? 2 : 4); + } + + IBlockState iblockstate1 = block.getStateFromMeta(i); + if (world.setBlockState(blockpos4, iblockstate1, 2)) { + arraylist.add(blockpos4); + ++j; + if (flag) { + TileEntity tileentity = world.getTileEntity(blockpos4); + if (tileentity != null) { + nbttagcompound.setInteger("x", blockpos4.getX()); + nbttagcompound.setInteger("y", blockpos4.getY()); + nbttagcompound.setInteger("z", blockpos4.getZ()); + tileentity.readFromNBT(nbttagcompound); + } + } + } + } + } + } + + for (BlockPos blockpos5 : (ArrayList) arraylist) { + Block block2 = world.getBlockState(blockpos5).getBlock(); + world.notifyNeighborsRespectDebug(blockpos5, block2); + } + + if (j <= 0) { + throw new CommandException("commands.fill.failed", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, j); + notifyOperators(parICommandSender, this, "commands.fill.success", + new Object[] { Integer.valueOf(j) }); + } + } else { + throw new CommandException("commands.fill.outOfWorld", new Object[0]); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 + && astring.length <= 3 + ? func_175771_a(astring, 0, blockpos) + : (astring.length > 3 && astring.length <= 6 ? func_175771_a(astring, 3, blockpos) + : (astring.length == 7 + ? getListOfStringsMatchingLastWord(astring, Block.blockRegistry.getKeys()) + : (astring.length == 9 + ? getListOfStringsMatchingLastWord(astring, + new String[] { "replace", "destroy", "keep", "hollow", + "outline" }) + : (astring.length == 10 && "replace".equals(astring[8]) + ? getListOfStringsMatchingLastWord(astring, + Block.blockRegistry.getKeys()) + : null)))); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameMode.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameMode.java new file mode 100644 index 0000000..c9b12b8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameMode.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandGameMode extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandGameMode"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "gamemode"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.gamemode.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length <= 0) { + throw new WrongUsageException("commands.gamemode.usage", new Object[0]); + } else { + WorldSettings.GameType worldsettings$gametype = this.getGameModeFromCommand(parICommandSender, + parArrayOfString[0]); + EntityPlayerMP entityplayermp = parArrayOfString.length >= 2 + ? getPlayer(parICommandSender, parArrayOfString[1]) + : getCommandSenderAsPlayer(parICommandSender); + entityplayermp.setGameType(worldsettings$gametype); + entityplayermp.fallDistance = 0.0F; + if (parICommandSender.getEntityWorld().getGameRules().getBoolean("sendCommandFeedback")) { + entityplayermp.addChatMessage(new ChatComponentTranslation("gameMode.changed", new Object[0])); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "gameMode." + worldsettings$gametype.getName(), new Object[0]); + if (entityplayermp != parICommandSender) { + notifyOperators(parICommandSender, this, 1, "commands.gamemode.success.other", + new Object[] { entityplayermp.getName(), chatcomponenttranslation }); + } else { + notifyOperators(parICommandSender, this, 1, "commands.gamemode.success.self", + new Object[] { chatcomponenttranslation }); + } + + } + } + + /**+ + * Gets the Game Mode specified in the command. + */ + protected WorldSettings.GameType getGameModeFromCommand(ICommandSender parICommandSender, String parString1) + throws NumberInvalidException { + return !parString1.equalsIgnoreCase(WorldSettings.GameType.SURVIVAL.getName()) + && !parString1.equalsIgnoreCase("s") + ? (!parString1.equalsIgnoreCase(WorldSettings.GameType.CREATIVE.getName()) + && !parString1.equalsIgnoreCase("c") + ? (!parString1.equalsIgnoreCase(WorldSettings.GameType.ADVENTURE.getName()) + && !parString1.equalsIgnoreCase("a") + ? (!parString1.equalsIgnoreCase( + WorldSettings.GameType.SPECTATOR.getName()) + && !parString1.equalsIgnoreCase("sp") + ? WorldSettings.getGameTypeById(parseInt( + parString1, 0, + WorldSettings.GameType.values().length + - 2)) + : WorldSettings.GameType.SPECTATOR) + : WorldSettings.GameType.ADVENTURE) + : WorldSettings.GameType.CREATIVE) + : WorldSettings.GameType.SURVIVAL; + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, + new String[] { "survival", "creative", "adventure", "spectator" }) + : (astring.length == 2 ? getListOfStringsMatchingLastWord(astring, this.getListOfPlayerUsernames()) + : null); + } + + /**+ + * Returns String array containing all player usernames in the + * server. + */ + protected String[] getListOfPlayerUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameRule.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameRule.java new file mode 100644 index 0000000..03789ce --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameRule.java @@ -0,0 +1,134 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.GameRules; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandGameRule extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandGameRule"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "gamerule"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.gamerule.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + GameRules gamerules = this.getGameRules(); + String s = parArrayOfString.length > 0 ? parArrayOfString[0] : ""; + String s1 = parArrayOfString.length > 1 ? buildString(parArrayOfString, 1) : ""; + switch (parArrayOfString.length) { + case 0: + parICommandSender.addChatMessage(new ChatComponentText(joinNiceString(gamerules.getRules()))); + break; + case 1: + if (!gamerules.hasRule(s)) { + throw new CommandException("commands.gamerule.norule", new Object[] { s }); + } + + String s2 = gamerules.getString(s); + parICommandSender.addChatMessage((new ChatComponentText(s)).appendText(" = ").appendText(s2)); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, gamerules.getInt(s)); + break; + default: + if (gamerules.areSameType(s, GameRules.ValueType.BOOLEAN_VALUE) && !"true".equals(s1) + && !"false".equals(s1)) { + throw new CommandException("commands.generic.boolean.invalid", new Object[] { s1 }); + } + + gamerules.setOrCreateGameRule(s, s1); + func_175773_a(gamerules, s); + notifyOperators(parICommandSender, this, "commands.gamerule.success", new Object[0]); + } + + } + + public static void func_175773_a(GameRules parGameRules, String parString1) { + if ("reducedDebugInfo".equals(parString1)) { + int i = parGameRules.getBoolean(parString1) ? 22 : 23; + + for (EntityPlayerMP entityplayermp : MinecraftServer.getServer().getConfigurationManager() + .func_181057_v()) { + entityplayermp.playerNetServerHandler.sendPacket(new S19PacketEntityStatus(entityplayermp, (byte) i)); + } + } + + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + if (astring.length == 1) { + return getListOfStringsMatchingLastWord(astring, this.getGameRules().getRules()); + } else { + if (astring.length == 2) { + GameRules gamerules = this.getGameRules(); + if (gamerules.areSameType(astring[0], GameRules.ValueType.BOOLEAN_VALUE)) { + return getListOfStringsMatchingLastWord(astring, new String[] { "true", "false" }); + } + } + + return null; + } + } + + /**+ + * Return the game rule set this command should be able to + * manipulate. + */ + private GameRules getGameRules() { + return MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGive.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGive.java new file mode 100644 index 0000000..8ecd3f8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGive.java @@ -0,0 +1,137 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandGive extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandGive"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "give"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.give.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.give.usage", new Object[0]); + } else { + EntityPlayerMP entityplayermp = getPlayer(parICommandSender, parArrayOfString[0]); + Item item = getItemByText(parICommandSender, parArrayOfString[1]); + int i = parArrayOfString.length >= 3 ? parseInt(parArrayOfString[2], 1, 64) : 1; + int j = parArrayOfString.length >= 4 ? parseInt(parArrayOfString[3]) : 0; + ItemStack itemstack = new ItemStack(item, i, j); + if (parArrayOfString.length >= 5) { + String s = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 4).getUnformattedText(); + + try { + itemstack.setTagCompound(JsonToNBT.getTagFromJson(s)); + } catch (NBTException nbtexception) { + throw new CommandException("commands.give.tagError", new Object[] { nbtexception.getMessage() }); + } + } + + boolean flag = entityplayermp.inventory.addItemStackToInventory(itemstack); + if (flag) { + entityplayermp.worldObj.playSoundAtEntity(entityplayermp, "random.pop", 0.2F, + ((entityplayermp.getRNG().nextFloat() - entityplayermp.getRNG().nextFloat()) * 0.7F + 1.0F) + * 2.0F); + entityplayermp.inventoryContainer.detectAndSendChanges(); + } + + if (flag && itemstack.stackSize <= 0) { + itemstack.stackSize = 1; + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, i); + EntityItem entityitem1 = entityplayermp.dropPlayerItemWithRandomChoice(itemstack, false); + if (entityitem1 != null) { + entityitem1.func_174870_v(); + } + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, i - itemstack.stackSize); + EntityItem entityitem = entityplayermp.dropPlayerItemWithRandomChoice(itemstack, false); + if (entityitem != null) { + entityitem.setNoPickupDelay(); + entityitem.setOwner(entityplayermp.getName()); + } + } + + notifyOperators(parICommandSender, this, "commands.give.success", + new Object[] { itemstack.getChatComponent(), Integer.valueOf(i), entityplayermp.getName() }); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, this.getPlayers()) + : (astring.length == 2 ? getListOfStringsMatchingLastWord(astring, Item.itemRegistry.getKeys()) : null); + } + + protected String[] getPlayers() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHandler.java new file mode 100644 index 0000000..46c96bf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHandler.java @@ -0,0 +1,225 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerSelector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandHandler implements ICommandManager { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandHandler"); + } + + private static final Logger logger = LogManager.getLogger(); + private final Map commandMap = Maps.newHashMap(); + /**+ + * The set of ICommand objects currently loaded. + */ + private final Set commandSet = Sets.newHashSet(); + + public int executeCommand(ICommandSender sender, String rawCommand) { + rawCommand = rawCommand.trim(); + if (rawCommand.startsWith("/")) { + rawCommand = rawCommand.substring(1); + } + + String[] astring = rawCommand.split(" "); + String s = astring[0]; + astring = dropFirstString(astring); + ICommand icommand = (ICommand) this.commandMap.get(s); + int i = this.getUsernameIndex(icommand, astring); + int j = 0; + if (icommand == null) { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.generic.notFound", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation); + } else if (icommand.canCommandSenderUseCommand(sender)) { + if (i > -1) { + List list = PlayerSelector.matchEntities(sender, astring[i], Entity.class); + String s1 = astring[i]; + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, list.size()); + + for (Entity entity : (List) list) { + astring[i] = entity.getUniqueID().toString(); + if (this.tryExecute(sender, astring, icommand, rawCommand)) { + ++j; + } + } + + astring[i] = s1; + } else { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, 1); + if (this.tryExecute(sender, astring, icommand, rawCommand)) { + ++j; + } + } + } else { + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation( + "commands.generic.permission", new Object[0]); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation1); + } + + sender.setCommandStat(CommandResultStats.Type.SUCCESS_COUNT, j); + return j; + } + + protected boolean tryExecute(ICommandSender sender, String[] args, ICommand command, String input) { + try { + command.processCommand(sender, args); + return true; + } catch (WrongUsageException wrongusageexception) { + ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation("commands.generic.usage", + new Object[] { new ChatComponentTranslation(wrongusageexception.getMessage(), + wrongusageexception.getErrorObjects()) }); + chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation2); + } catch (CommandException commandexception) { + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation( + commandexception.getMessage(), commandexception.getErrorObjects()); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation1); + } catch (Throwable var9) { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.generic.exception", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation); + logger.warn("Couldn\'t process command: \'" + input + "\'"); + } + + return false; + } + + /**+ + * adds the command and any aliases it has to the internal map + * of available commands + */ + public ICommand registerCommand(ICommand command) { + this.commandMap.put(command.getCommandName(), command); + this.commandSet.add(command); + + for (String s : command.getCommandAliases()) { + ICommand icommand = (ICommand) this.commandMap.get(s); + if (icommand == null || !icommand.getCommandName().equals(s)) { + this.commandMap.put(s, command); + } + } + + return command; + } + + /**+ + * creates a new array and sets elements 0..n-2 to be 0..n-1 of + * the input (n elements) + */ + private static String[] dropFirstString(String[] input) { + String[] astring = new String[input.length - 1]; + System.arraycopy(input, 1, astring, 0, input.length - 1); + return astring; + } + + public List getTabCompletionOptions(ICommandSender sender, String input, BlockPos pos) { + String[] astring = input.split(" ", -1); + String s = astring[0]; + if (astring.length == 1) { + ArrayList arraylist = Lists.newArrayList(); + + for (Entry entry : this.commandMap.entrySet()) { + if (CommandBase.doesStringStartWith(s, (String) entry.getKey()) + && ((ICommand) entry.getValue()).canCommandSenderUseCommand(sender)) { + arraylist.add(entry.getKey()); + } + } + + return arraylist; + } else { + if (astring.length > 1) { + ICommand icommand = (ICommand) this.commandMap.get(s); + if (icommand != null && icommand.canCommandSenderUseCommand(sender)) { + return icommand.addTabCompletionOptions(sender, dropFirstString(astring), pos); + } + } + + return null; + } + } + + /**+ + * returns all commands that the commandSender can use + */ + public List getPossibleCommands(ICommandSender sender) { + ArrayList arraylist = Lists.newArrayList(); + + for (ICommand icommand : this.commandSet) { + if (icommand.canCommandSenderUseCommand(sender)) { + arraylist.add(icommand); + } + } + + return arraylist; + } + + public Map getCommands() { + return this.commandMap; + } + + /**+ + * Return a command's first parameter index containing a valid + * username. + */ + private int getUsernameIndex(ICommand command, String[] args) { + if (command == null) { + return -1; + } else { + for (int i = 0; i < args.length; ++i) { + if (command.isUsernameIndex(args, i) && PlayerSelector.matchesMultiplePlayers(args[i])) { + return i; + } + } + + return -1; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHelp.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHelp.java new file mode 100644 index 0000000..ba45dc6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHelp.java @@ -0,0 +1,153 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.ClickEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandHelp extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandHelp"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "help"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.help.usage"; + } + + /**+ + * Gets a list of aliases for this command + */ + public List getCommandAliases() { + return Arrays.asList(new String[] { "?" }); + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + List list = this.getSortedPossibleCommands(parICommandSender); + boolean flag = true; + int i = (list.size() - 1) / 7; + int j = 0; + + try { + j = parArrayOfString.length == 0 ? 0 : parseInt(parArrayOfString[0], 1, i + 1) - 1; + } catch (NumberInvalidException numberinvalidexception) { + Map map = this.getCommands(); + ICommand icommand = (ICommand) map.get(parArrayOfString[0]); + if (icommand != null) { + throw new WrongUsageException(icommand.getCommandUsage(parICommandSender), new Object[0]); + } + + if (MathHelper.parseIntWithDefault(parArrayOfString[0], -1) != -1) { + throw numberinvalidexception; + } + + throw new CommandNotFoundException(); + } + + int k = Math.min((j + 1) * 7, list.size()); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.help.header", + new Object[] { Integer.valueOf(j + 1), Integer.valueOf(i + 1) }); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation1); + + for (int l = j * 7; l < k; ++l) { + ICommand icommand1 = (ICommand) list.get(l); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + icommand1.getCommandUsage(parICommandSender), new Object[0]); + chatcomponenttranslation.getChatStyle().setChatClickEvent( + new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + icommand1.getCommandName() + " ")); + parICommandSender.addChatMessage(chatcomponenttranslation); + } + + if (j == 0 && parICommandSender instanceof EntityPlayer) { + ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation("commands.help.footer", + new Object[0]); + chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation2); + } + + } + + /**+ + * Returns a sorted list of all possible commands for the given + * ICommandSender. + */ + protected List getSortedPossibleCommands(ICommandSender parICommandSender) { + List list = MinecraftServer.getServer().getCommandManager().getPossibleCommands(parICommandSender); + Collections.sort(list); + return list; + } + + protected Map getCommands() { + return MinecraftServer.getServer().getCommandManager().getCommands(); + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + if (astring.length == 1) { + Set set = this.getCommands().keySet(); + return getListOfStringsMatchingLastWord(astring, (String[]) set.toArray(new String[set.size()])); + } else { + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandKill.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandKill.java new file mode 100644 index 0000000..eca7b58 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandKill.java @@ -0,0 +1,94 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandKill extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandKill"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "kill"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.kill.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length == 0) { + EntityPlayerMP entityplayermp = getCommandSenderAsPlayer(parICommandSender); + entityplayermp.onKillCommand(); + notifyOperators(parICommandSender, this, "commands.kill.successful", + new Object[] { entityplayermp.getDisplayName() }); + } else { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[0]); + entity.onKillCommand(); + notifyOperators(parICommandSender, this, "commands.kill.successful", + new Object[] { entity.getDisplayName() }); + } + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandNotFoundException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandNotFoundException.java new file mode 100644 index 0000000..6c7e22a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandNotFoundException.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandNotFoundException extends CommandException { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandNotFoundException"); + } + + public CommandNotFoundException() { + this("commands.generic.notFound", new Object[0]); + } + + public CommandNotFoundException(String parString1, Object... parArrayOfObject) { + super(parString1, parArrayOfObject); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandParticle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandParticle.java new file mode 100644 index 0000000..6a0acea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandParticle.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandParticle extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandParticle"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "particle"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.particle.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 8) { + throw new WrongUsageException("commands.particle.usage", new Object[0]); + } else { + boolean flag = false; + EnumParticleTypes enumparticletypes = null; + + for (EnumParticleTypes enumparticletypes1 : EnumParticleTypes.values()) { + if (enumparticletypes1.hasArguments()) { + if (parArrayOfString[0].startsWith(enumparticletypes1.getParticleName())) { + flag = true; + enumparticletypes = enumparticletypes1; + break; + } + } else if (parArrayOfString[0].equals(enumparticletypes1.getParticleName())) { + flag = true; + enumparticletypes = enumparticletypes1; + break; + } + } + + if (!flag) { + throw new CommandException("commands.particle.notFound", new Object[] { parArrayOfString[0] }); + } else { + String s = parArrayOfString[0]; + Vec3 vec3 = parICommandSender.getPositionVector(); + double d6 = (double) ((float) parseDouble(vec3.xCoord, parArrayOfString[1], true)); + double d0 = (double) ((float) parseDouble(vec3.yCoord, parArrayOfString[2], true)); + double d1 = (double) ((float) parseDouble(vec3.zCoord, parArrayOfString[3], true)); + double d2 = (double) ((float) parseDouble(parArrayOfString[4])); + double d3 = (double) ((float) parseDouble(parArrayOfString[5])); + double d4 = (double) ((float) parseDouble(parArrayOfString[6])); + double d5 = (double) ((float) parseDouble(parArrayOfString[7])); + int i = 0; + if (parArrayOfString.length > 8) { + i = parseInt(parArrayOfString[8], 0); + } + + boolean flag1 = false; + if (parArrayOfString.length > 9 && "force".equals(parArrayOfString[9])) { + flag1 = true; + } + + World world = parICommandSender.getEntityWorld(); + if (world instanceof WorldServer) { + WorldServer worldserver = (WorldServer) world; + int[] aint = new int[enumparticletypes.getArgumentCount()]; + if (enumparticletypes.hasArguments()) { + String[] astring = parArrayOfString[0].split("_", 3); + + for (int j = 1; j < astring.length; ++j) { + try { + aint[j - 1] = Integer.parseInt(astring[j]); + } catch (NumberFormatException var29) { + throw new CommandException("commands.particle.notFound", + new Object[] { parArrayOfString[0] }); + } + } + } + + worldserver.spawnParticle(enumparticletypes, flag1, d6, d0, d1, i, d2, d3, d4, d5, aint); + notifyOperators(parICommandSender, this, "commands.particle.success", + new Object[] { s, Integer.valueOf(Math.max(i, 1)) }); + } + + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, EnumParticleTypes.getParticleNames()) + : (astring.length > 1 && astring.length <= 4 ? func_175771_a(astring, 1, blockpos) + : (astring.length == 10 + ? getListOfStringsMatchingLastWord(astring, new String[] { "normal", "force" }) + : null)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandPlaySound.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandPlaySound.java new file mode 100644 index 0000000..13fa807 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandPlaySound.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S29PacketSoundEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandPlaySound extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandPlaySound"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "playsound"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.playsound.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException(this.getCommandUsage(parICommandSender), new Object[0]); + } else { + int i = 0; + String s = parArrayOfString[i++]; + EntityPlayerMP entityplayermp = getPlayer(parICommandSender, parArrayOfString[i++]); + Vec3 vec3 = parICommandSender.getPositionVector(); + double d0 = vec3.xCoord; + if (parArrayOfString.length > i) { + d0 = parseDouble(d0, parArrayOfString[i++], true); + } + + double d1 = vec3.yCoord; + if (parArrayOfString.length > i) { + d1 = parseDouble(d1, parArrayOfString[i++], 0, 0, false); + } + + double d2 = vec3.zCoord; + if (parArrayOfString.length > i) { + d2 = parseDouble(d2, parArrayOfString[i++], true); + } + + double d3 = 1.0D; + if (parArrayOfString.length > i) { + d3 = parseDouble(parArrayOfString[i++], 0.0D, 3.4028234663852886E38D); + } + + double d4 = 1.0D; + if (parArrayOfString.length > i) { + d4 = parseDouble(parArrayOfString[i++], 0.0D, 2.0D); + } + + double d5 = 0.0D; + if (parArrayOfString.length > i) { + d5 = parseDouble(parArrayOfString[i], 0.0D, 1.0D); + } + + double d6 = d3 > 1.0D ? d3 * 16.0D : 16.0D; + double d7 = entityplayermp.getDistance(d0, d1, d2); + if (d7 > d6) { + if (d5 <= 0.0D) { + throw new CommandException("commands.playsound.playerTooFar", + new Object[] { entityplayermp.getName() }); + } + + double d8 = d0 - entityplayermp.posX; + double d9 = d1 - entityplayermp.posY; + double d10 = d2 - entityplayermp.posZ; + double d11 = Math.sqrt(d8 * d8 + d9 * d9 + d10 * d10); + if (d11 > 0.0D) { + d0 = entityplayermp.posX + d8 / d11 * 2.0D; + d1 = entityplayermp.posY + d9 / d11 * 2.0D; + d2 = entityplayermp.posZ + d10 / d11 * 2.0D; + } + + d3 = d5; + } + + entityplayermp.playerNetServerHandler + .sendPacket(new S29PacketSoundEffect(s, d0, d1, d2, (float) d3, (float) d4)); + notifyOperators(parICommandSender, this, "commands.playsound.success", + new Object[] { s, entityplayermp.getName() }); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 2 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : (astring.length > 2 && astring.length <= 5 ? func_175771_a(astring, 2, blockpos) : null); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandReplaceItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandReplaceItem.java new file mode 100644 index 0000000..e10a64e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandReplaceItem.java @@ -0,0 +1,253 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandReplaceItem extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandReplaceItem"); + } + + private static final Map SHORTCUTS = Maps.newHashMap(); + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "replaceitem"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.replaceitem.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.replaceitem.usage", new Object[0]); + } else { + boolean flag; + if (parArrayOfString[0].equals("entity")) { + flag = false; + } else { + if (!parArrayOfString[0].equals("block")) { + throw new WrongUsageException("commands.replaceitem.usage", new Object[0]); + } + + flag = true; + } + + int i; + if (flag) { + if (parArrayOfString.length < 6) { + throw new WrongUsageException("commands.replaceitem.block.usage", new Object[0]); + } + + i = 4; + } else { + if (parArrayOfString.length < 4) { + throw new WrongUsageException("commands.replaceitem.entity.usage", new Object[0]); + } + + i = 2; + } + + int j = this.getSlotForShortcut(parArrayOfString[i++]); + + Item item; + try { + item = getItemByText(parICommandSender, parArrayOfString[i]); + } catch (NumberInvalidException numberinvalidexception) { + if (Block.getBlockFromName(parArrayOfString[i]) != Blocks.air) { + throw numberinvalidexception; + } + + item = null; + } + + ++i; + int k = parArrayOfString.length > i ? parseInt(parArrayOfString[i++], 1, 64) : 1; + int l = parArrayOfString.length > i ? parseInt(parArrayOfString[i++]) : 0; + ItemStack itemstack = new ItemStack(item, k, l); + if (parArrayOfString.length > i) { + String s = getChatComponentFromNthArg(parICommandSender, parArrayOfString, i).getUnformattedText(); + + try { + itemstack.setTagCompound(JsonToNBT.getTagFromJson(s)); + } catch (NBTException nbtexception) { + throw new CommandException("commands.replaceitem.tagError", + new Object[] { nbtexception.getMessage() }); + } + } + + if (itemstack.getItem() == null) { + itemstack = null; + } + + if (flag) { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 1, false); + World world = parICommandSender.getEntityWorld(); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity == null || !(tileentity instanceof IInventory)) { + throw new CommandException("commands.replaceitem.noContainer", + new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), + Integer.valueOf(blockpos.getZ()) }); + } + + IInventory iinventory = (IInventory) tileentity; + if (j >= 0 && j < iinventory.getSizeInventory()) { + iinventory.setInventorySlotContents(j, itemstack); + } + } else { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[1]); + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 0); + if (entity instanceof EntityPlayer) { + ((EntityPlayer) entity).inventoryContainer.detectAndSendChanges(); + } + + if (!entity.replaceItemInInventory(j, itemstack)) { + throw new CommandException("commands.replaceitem.failed", new Object[] { Integer.valueOf(j), + Integer.valueOf(k), itemstack == null ? "Air" : itemstack.getChatComponent() }); + } + + if (entity instanceof EntityPlayer) { + ((EntityPlayer) entity).inventoryContainer.detectAndSendChanges(); + } + } + + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, k); + notifyOperators(parICommandSender, this, "commands.replaceitem.success", new Object[] { Integer.valueOf(j), + Integer.valueOf(k), itemstack == null ? "Air" : itemstack.getChatComponent() }); + } + } + + private int getSlotForShortcut(String shortcut) throws CommandException { + if (!SHORTCUTS.containsKey(shortcut)) { + throw new CommandException("commands.generic.parameter.invalid", new Object[] { shortcut }); + } else { + return ((Integer) SHORTCUTS.get(shortcut)).intValue(); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, new String[] { "entity", "block" }) + : (astring.length == 2 && astring[0].equals("entity") + ? getListOfStringsMatchingLastWord(astring, this.getUsernames()) + : (astring.length >= 2 && astring.length <= 4 && astring[0].equals("block") + ? func_175771_a(astring, 1, blockpos) + : ((astring.length != 3 || !astring[0].equals("entity")) + && (astring.length != 5 || !astring[0].equals("block")) + ? ((astring.length != 4 || !astring[0].equals("entity")) + && (astring.length != 6 || !astring[0].equals("block")) + ? null + : getListOfStringsMatchingLastWord(astring, + Item.itemRegistry.getKeys())) + : getListOfStringsMatchingLastWord(astring, SHORTCUTS.keySet())))); + } + + protected String[] getUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] astring, int i) { + return astring.length > 0 && astring[0].equals("entity") && i == 1; + } + + static { + for (int i = 0; i < 54; ++i) { + SHORTCUTS.put("slot.container." + i, Integer.valueOf(i)); + } + + for (int j = 0; j < 9; ++j) { + SHORTCUTS.put("slot.hotbar." + j, Integer.valueOf(j)); + } + + for (int k = 0; k < 27; ++k) { + SHORTCUTS.put("slot.inventory." + k, Integer.valueOf(9 + k)); + } + + for (int l = 0; l < 27; ++l) { + SHORTCUTS.put("slot.enderchest." + l, Integer.valueOf(200 + l)); + } + + for (int i1 = 0; i1 < 8; ++i1) { + SHORTCUTS.put("slot.villager." + i1, Integer.valueOf(300 + i1)); + } + + for (int j1 = 0; j1 < 15; ++j1) { + SHORTCUTS.put("slot.horse." + j1, Integer.valueOf(500 + j1)); + } + + SHORTCUTS.put("slot.weapon", Integer.valueOf(99)); + SHORTCUTS.put("slot.armor.head", Integer.valueOf(103)); + SHORTCUTS.put("slot.armor.chest", Integer.valueOf(102)); + SHORTCUTS.put("slot.armor.legs", Integer.valueOf(101)); + SHORTCUTS.put("slot.armor.feet", Integer.valueOf(100)); + SHORTCUTS.put("slot.horse.saddle", Integer.valueOf(400)); + SHORTCUTS.put("slot.horse.armor", Integer.valueOf(401)); + SHORTCUTS.put("slot.horse.chest", Integer.valueOf(499)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandResultStats.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandResultStats.java new file mode 100644 index 0000000..5962501 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandResultStats.java @@ -0,0 +1,246 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.EntityNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandResultStats { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandResultStats"); + } + + /**+ + * The number of result command result types that are possible. + */ + private static final int NUM_RESULT_TYPES = CommandResultStats.Type.values().length; + private static final String[] STRING_RESULT_TYPES = new String[NUM_RESULT_TYPES]; + private String[] field_179675_c; + private String[] field_179673_d; + + public CommandResultStats() { + this.field_179675_c = STRING_RESULT_TYPES; + this.field_179673_d = STRING_RESULT_TYPES; + } + + public void func_179672_a(final ICommandSender sender, CommandResultStats.Type resultTypeIn, int parInt1) { + String s = this.field_179675_c[resultTypeIn.getTypeID()]; + if (s != null) { + ICommandSender icommandsender = new ICommandSender() { + public String getName() { + return sender.getName(); + } + + public IChatComponent getDisplayName() { + return sender.getDisplayName(); + } + + public void addChatMessage(IChatComponent ichatcomponent) { + sender.addChatMessage(ichatcomponent); + } + + public boolean canCommandSenderUseCommand(int var1, String var2) { + return true; + } + + public BlockPos getPosition() { + return sender.getPosition(); + } + + public Vec3 getPositionVector() { + return sender.getPositionVector(); + } + + public World getEntityWorld() { + return sender.getEntityWorld(); + } + + public Entity getCommandSenderEntity() { + return sender.getCommandSenderEntity(); + } + + public boolean sendCommandFeedback() { + return sender.sendCommandFeedback(); + } + + public void setCommandStat(CommandResultStats.Type commandresultstats$type, int i) { + sender.setCommandStat(commandresultstats$type, i); + } + }; + + String s1; + try { + s1 = CommandBase.getEntityName(icommandsender, s); + } catch (EntityNotFoundException var11) { + return; + } + + String s2 = this.field_179673_d[resultTypeIn.getTypeID()]; + if (s2 != null) { + Scoreboard scoreboard = sender.getEntityWorld().getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(s2); + if (scoreobjective != null) { + if (scoreboard.entityHasObjective(s1, scoreobjective)) { + Score score = scoreboard.getValueFromObjective(s1, scoreobjective); + score.setScorePoints(parInt1); + } + } + } + } + } + + public void readStatsFromNBT(NBTTagCompound tagcompound) { + if (tagcompound.hasKey("CommandStats", 10)) { + NBTTagCompound nbttagcompound = tagcompound.getCompoundTag("CommandStats"); + + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) { + String s = commandresultstats$type.getTypeName() + "Name"; + String s1 = commandresultstats$type.getTypeName() + "Objective"; + if (nbttagcompound.hasKey(s, 8) && nbttagcompound.hasKey(s1, 8)) { + String s2 = nbttagcompound.getString(s); + String s3 = nbttagcompound.getString(s1); + func_179667_a(this, commandresultstats$type, s2, s3); + } + } + + } + } + + public void writeStatsToNBT(NBTTagCompound tagcompound) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) { + String s = this.field_179675_c[commandresultstats$type.getTypeID()]; + String s1 = this.field_179673_d[commandresultstats$type.getTypeID()]; + if (s != null && s1 != null) { + nbttagcompound.setString(commandresultstats$type.getTypeName() + "Name", s); + nbttagcompound.setString(commandresultstats$type.getTypeName() + "Objective", s1); + } + } + + if (!nbttagcompound.hasNoTags()) { + tagcompound.setTag("CommandStats", nbttagcompound); + } + + } + + public static void func_179667_a(CommandResultStats stats, CommandResultStats.Type resultType, String parString1, + String parString2) { + if (parString1 != null && parString1.length() != 0 && parString2 != null && parString2.length() != 0) { + if (stats.field_179675_c == STRING_RESULT_TYPES || stats.field_179673_d == STRING_RESULT_TYPES) { + stats.field_179675_c = new String[NUM_RESULT_TYPES]; + stats.field_179673_d = new String[NUM_RESULT_TYPES]; + } + + stats.field_179675_c[resultType.getTypeID()] = parString1; + stats.field_179673_d[resultType.getTypeID()] = parString2; + } else { + func_179669_a(stats, resultType); + } + } + + private static void func_179669_a(CommandResultStats resultStatsIn, CommandResultStats.Type resultTypeIn) { + if (resultStatsIn.field_179675_c != STRING_RESULT_TYPES + && resultStatsIn.field_179673_d != STRING_RESULT_TYPES) { + resultStatsIn.field_179675_c[resultTypeIn.getTypeID()] = null; + resultStatsIn.field_179673_d[resultTypeIn.getTypeID()] = null; + boolean flag = true; + + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) { + if (resultStatsIn.field_179675_c[commandresultstats$type.getTypeID()] != null + && resultStatsIn.field_179673_d[commandresultstats$type.getTypeID()] != null) { + flag = false; + break; + } + } + + if (flag) { + resultStatsIn.field_179675_c = STRING_RESULT_TYPES; + resultStatsIn.field_179673_d = STRING_RESULT_TYPES; + } + + } + } + + public void func_179671_a(CommandResultStats resultStatsIn) { + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) { + func_179667_a(this, commandresultstats$type, + resultStatsIn.field_179675_c[commandresultstats$type.getTypeID()], + resultStatsIn.field_179673_d[commandresultstats$type.getTypeID()]); + } + + } + + public static enum Type { + SUCCESS_COUNT(0, "SuccessCount"), AFFECTED_BLOCKS(1, "AffectedBlocks"), + AFFECTED_ENTITIES(2, "AffectedEntities"), AFFECTED_ITEMS(3, "AffectedItems"), QUERY_RESULT(4, "QueryResult"); + + final int typeID; + final String typeName; + + private Type(int id, String name) { + this.typeID = id; + this.typeName = name; + } + + public int getTypeID() { + return this.typeID; + } + + public String getTypeName() { + return this.typeName; + } + + public static String[] getTypeNames() { + String[] astring = new String[values().length]; + int i = 0; + + for (CommandResultStats.Type commandresultstats$type : values()) { + astring[i++] = commandresultstats$type.getTypeName(); + } + + return astring; + } + + public static CommandResultStats.Type getTypeByName(String name) { + for (CommandResultStats.Type commandresultstats$type : values()) { + if (commandresultstats$type.getTypeName().equals(name)) { + return commandresultstats$type; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandServerKick.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandServerKick.java new file mode 100644 index 0000000..8f2c530 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandServerKick.java @@ -0,0 +1,107 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandServerKick extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandServerKick"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "kick"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.kick.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length > 0 && parArrayOfString[0].length() > 1) { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager() + .getPlayerByUsername(parArrayOfString[0]); + String s = "Kicked by an operator."; + boolean flag = false; + if (entityplayermp == null) { + throw new PlayerNotFoundException(); + } else { + if (parArrayOfString.length >= 2) { + s = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 1).getUnformattedText(); + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + s = StringUtils.translateControlCodesAlternate(s); + } + flag = true; + } + + entityplayermp.playerNetServerHandler.kickPlayerFromServer(s); + if (flag) { + notifyOperators(parICommandSender, this, "commands.kick.success.reason", + new Object[] { entityplayermp.getName(), s }); + } else { + notifyOperators(parICommandSender, this, "commands.kick.success", + new Object[] { entityplayermp.getName() }); + } + + } + } else { + throw new WrongUsageException("commands.kick.usage", new Object[0]); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length >= 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetPlayerTimeout.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetPlayerTimeout.java new file mode 100644 index 0000000..a29d488 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetPlayerTimeout.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandSetPlayerTimeout extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandSetPlayerTimeout"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "setidletimeout"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.setidletimeout.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length != 1) { + throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]); + } else { + int i = parseInt(parArrayOfString[0], 0); + MinecraftServer.getServer().setPlayerIdleTimeout(i); + notifyOperators(parICommandSender, this, "commands.setidletimeout.success", + new Object[] { Integer.valueOf(i) }); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetSpawnpoint.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetSpawnpoint.java new file mode 100644 index 0000000..515f095 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetSpawnpoint.java @@ -0,0 +1,100 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandSetSpawnpoint extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandSetSpawnpoint"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "spawnpoint"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.spawnpoint.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length > 1 && parArrayOfString.length < 4) { + throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); + } else { + EntityPlayerMP entityplayermp = parArrayOfString.length > 0 + ? getPlayer(parICommandSender, parArrayOfString[0]) + : getCommandSenderAsPlayer(parICommandSender); + BlockPos blockpos = parArrayOfString.length > 3 + ? parseBlockPos(parICommandSender, parArrayOfString, 1, true) + : entityplayermp.getPosition(); + if (entityplayermp.worldObj != null) { + entityplayermp.setSpawnPoint(blockpos, true); + notifyOperators(parICommandSender, this, "commands.spawnpoint.success", + new Object[] { entityplayermp.getName(), Integer.valueOf(blockpos.getX()), + Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()) }); + } + + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : (astring.length > 1 && astring.length <= 4 ? func_175771_a(astring, 1, blockpos) : null); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandShowSeed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandShowSeed.java new file mode 100644 index 0000000..6d33a08 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandShowSeed.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandShowSeed extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandShowSeed"); + } + + /**+ + * Returns true if the given command sender is allowed to use + * this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender icommandsender) { + return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(icommandsender); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "seed"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.seed.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + Object object = parICommandSender instanceof EntityPlayer ? ((EntityPlayer) parICommandSender).worldObj + : MinecraftServer.getServer().worldServerForDimension(0); + parICommandSender.addChatMessage(new ChatComponentTranslation("commands.seed.success", + new Object[] { Long.valueOf(((World) object).getSeed()) })); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSpreadPlayers.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSpreadPlayers.java new file mode 100644 index 0000000..9bdac57 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSpreadPlayers.java @@ -0,0 +1,387 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.EntityNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerSelector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandSpreadPlayers extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandSpreadPlayers"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "spreadplayers"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.spreadplayers.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 6) { + throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]); + } else { + int i = 0; + BlockPos blockpos = parICommandSender.getPosition(); + double d0 = parseDouble((double) blockpos.getX(), parArrayOfString[i++], true); + double d1 = parseDouble((double) blockpos.getZ(), parArrayOfString[i++], true); + double d2 = parseDouble(parArrayOfString[i++], 0.0D); + double d3 = parseDouble(parArrayOfString[i++], d2 + 1.0D); + boolean flag = parseBoolean(parArrayOfString[i++]); + ArrayList arraylist = Lists.newArrayList(); + + while (i < parArrayOfString.length) { + String s = parArrayOfString[i++]; + if (PlayerSelector.hasArguments(s)) { + List list = PlayerSelector.matchEntities(parICommandSender, s, Entity.class); + if (list.size() == 0) { + throw new EntityNotFoundException(); + } + + arraylist.addAll(list); + } else { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager() + .getPlayerByUsername(s); + if (entityplayermp == null) { + throw new PlayerNotFoundException(); + } + + arraylist.add(entityplayermp); + } + } + + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, arraylist.size()); + if (arraylist.isEmpty()) { + throw new EntityNotFoundException(); + } else { + parICommandSender.addChatMessage( + new ChatComponentTranslation("commands.spreadplayers.spreading." + (flag ? "teams" : "players"), + new Object[] { Integer.valueOf(arraylist.size()), Double.valueOf(d3), + Double.valueOf(d0), Double.valueOf(d1), Double.valueOf(d2) })); + this.func_110669_a(parICommandSender, arraylist, new CommandSpreadPlayers.Position(d0, d1), d2, d3, + ((Entity) arraylist.get(0)).worldObj, flag); + } + } + } + + private void func_110669_a(ICommandSender worldIn, List parList, CommandSpreadPlayers.Position parPosition, + double parDouble1, double parDouble2, World parWorld, boolean parFlag) throws CommandException { + EaglercraftRandom random = new EaglercraftRandom(); + double d0 = parPosition.field_111101_a - parDouble2; + double d1 = parPosition.field_111100_b - parDouble2; + double d2 = parPosition.field_111101_a + parDouble2; + double d3 = parPosition.field_111100_b + parDouble2; + CommandSpreadPlayers.Position[] acommandspreadplayers$position = this.func_110670_a(random, + parFlag ? this.func_110667_a(parList) : parList.size(), d0, d1, d2, d3); + int i = this.func_110668_a(parPosition, parDouble1, parWorld, random, d0, d1, d2, d3, + acommandspreadplayers$position, parFlag); + double d4 = this.func_110671_a(parList, parWorld, acommandspreadplayers$position, parFlag); + notifyOperators(worldIn, this, "commands.spreadplayers.success." + (parFlag ? "teams" : "players"), + new Object[] { Integer.valueOf(acommandspreadplayers$position.length), + Double.valueOf(parPosition.field_111101_a), Double.valueOf(parPosition.field_111100_b) }); + if (acommandspreadplayers$position.length > 1) { + worldIn.addChatMessage(new ChatComponentTranslation( + "commands.spreadplayers.info." + (parFlag ? "teams" : "players"), + new Object[] { HString.format("%.2f", new Object[] { Double.valueOf(d4) }), Integer.valueOf(i) })); + } + + } + + private int func_110667_a(List parList) { + HashSet hashset = Sets.newHashSet(); + + for (Entity entity : parList) { + if (entity instanceof EntityPlayer) { + hashset.add(((EntityPlayer) entity).getTeam()); + } else { + hashset.add((Object) null); + } + } + + return hashset.size(); + } + + private int func_110668_a(CommandSpreadPlayers.Position worldIn, double parDouble1, World parWorld, + EaglercraftRandom parRandom, double parDouble2, double parDouble3, double parDouble4, double parDouble5, + CommandSpreadPlayers.Position[] parArrayOfPosition, boolean parFlag) throws CommandException { + boolean flag = true; + double d0 = 3.4028234663852886E38D; + + int i; + for (i = 0; i < 10000 && flag; ++i) { + flag = false; + d0 = 3.4028234663852886E38D; + + for (int j = 0; j < parArrayOfPosition.length; ++j) { + CommandSpreadPlayers.Position commandspreadplayers$position = parArrayOfPosition[j]; + int k = 0; + CommandSpreadPlayers.Position commandspreadplayers$position1 = new CommandSpreadPlayers.Position(); + + for (int l = 0; l < parArrayOfPosition.length; ++l) { + if (j != l) { + CommandSpreadPlayers.Position commandspreadplayers$position2 = parArrayOfPosition[l]; + double d1 = commandspreadplayers$position.func_111099_a(commandspreadplayers$position2); + d0 = Math.min(d1, d0); + if (d1 < parDouble1) { + ++k; + commandspreadplayers$position1.field_111101_a += commandspreadplayers$position2.field_111101_a + - commandspreadplayers$position.field_111101_a; + commandspreadplayers$position1.field_111100_b += commandspreadplayers$position2.field_111100_b + - commandspreadplayers$position.field_111100_b; + } + } + } + + if (k > 0) { + commandspreadplayers$position1.field_111101_a /= (double) k; + commandspreadplayers$position1.field_111100_b /= (double) k; + double d2 = (double) commandspreadplayers$position1.func_111096_b(); + if (d2 > 0.0D) { + commandspreadplayers$position1.func_111095_a(); + commandspreadplayers$position.func_111094_b(commandspreadplayers$position1); + } else { + commandspreadplayers$position.func_111097_a(parRandom, parDouble2, parDouble3, parDouble4, + parDouble5); + } + + flag = true; + } + + if (commandspreadplayers$position.func_111093_a(parDouble2, parDouble3, parDouble4, parDouble5)) { + flag = true; + } + } + + if (!flag) { + for (CommandSpreadPlayers.Position commandspreadplayers$position3 : parArrayOfPosition) { + if (!commandspreadplayers$position3.func_111098_b(parWorld)) { + commandspreadplayers$position3.func_111097_a(parRandom, parDouble2, parDouble3, parDouble4, + parDouble5); + flag = true; + } + } + } + } + + if (i >= 10000) { + throw new CommandException("commands.spreadplayers.failure." + (parFlag ? "teams" : "players"), + new Object[] { Integer.valueOf(parArrayOfPosition.length), Double.valueOf(worldIn.field_111101_a), + Double.valueOf(worldIn.field_111100_b), + HString.format("%.2f", new Object[] { Double.valueOf(d0) }) }); + } else { + return i; + } + } + + private double func_110671_a(List worldIn, World parWorld, + CommandSpreadPlayers.Position[] parArrayOfPosition, boolean parFlag) { + double d0 = 0.0D; + int i = 0; + HashMap hashmap = Maps.newHashMap(); + + for (int j = 0; j < worldIn.size(); ++j) { + Entity entity = (Entity) worldIn.get(j); + CommandSpreadPlayers.Position commandspreadplayers$position; + if (parFlag) { + Team team = entity instanceof EntityPlayer ? ((EntityPlayer) entity).getTeam() : null; + if (!hashmap.containsKey(team)) { + hashmap.put(team, parArrayOfPosition[i++]); + } + + commandspreadplayers$position = (CommandSpreadPlayers.Position) hashmap.get(team); + } else { + commandspreadplayers$position = parArrayOfPosition[i++]; + } + + entity.setPositionAndUpdate( + (double) ((float) MathHelper.floor_double(commandspreadplayers$position.field_111101_a) + 0.5F), + (double) commandspreadplayers$position.func_111092_a(parWorld), + (double) MathHelper.floor_double(commandspreadplayers$position.field_111100_b) + 0.5D); + double d2 = Double.MAX_VALUE; + + for (int k = 0; k < parArrayOfPosition.length; ++k) { + if (commandspreadplayers$position != parArrayOfPosition[k]) { + double d1 = commandspreadplayers$position.func_111099_a(parArrayOfPosition[k]); + d2 = Math.min(d1, d2); + } + } + + d0 += d2; + } + + d0 = d0 / (double) worldIn.size(); + return d0; + } + + private CommandSpreadPlayers.Position[] func_110670_a(EaglercraftRandom parRandom, int parInt1, double parDouble1, + double parDouble2, double parDouble3, double parDouble4) { + CommandSpreadPlayers.Position[] acommandspreadplayers$position = new CommandSpreadPlayers.Position[parInt1]; + + for (int i = 0; i < acommandspreadplayers$position.length; ++i) { + CommandSpreadPlayers.Position commandspreadplayers$position = new CommandSpreadPlayers.Position(); + commandspreadplayers$position.func_111097_a(parRandom, parDouble1, parDouble2, parDouble3, parDouble4); + acommandspreadplayers$position[i] = commandspreadplayers$position; + } + + return acommandspreadplayers$position; + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length >= 1 && astring.length <= 2 ? func_181043_b(astring, 0, blockpos) : null; + } + + static class Position { + double field_111101_a; + double field_111100_b; + + Position() { + } + + Position(double parDouble1, double parDouble2) { + this.field_111101_a = parDouble1; + this.field_111100_b = parDouble2; + } + + double func_111099_a(CommandSpreadPlayers.Position parPosition) { + double d0 = this.field_111101_a - parPosition.field_111101_a; + double d1 = this.field_111100_b - parPosition.field_111100_b; + return Math.sqrt(d0 * d0 + d1 * d1); + } + + void func_111095_a() { + double d0 = (double) this.func_111096_b(); + this.field_111101_a /= d0; + this.field_111100_b /= d0; + } + + float func_111096_b() { + return MathHelper + .sqrt_double(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b); + } + + public void func_111094_b(CommandSpreadPlayers.Position parPosition) { + this.field_111101_a -= parPosition.field_111101_a; + this.field_111100_b -= parPosition.field_111100_b; + } + + public boolean func_111093_a(double parDouble1, double parDouble2, double parDouble3, double parDouble4) { + boolean flag = false; + if (this.field_111101_a < parDouble1) { + this.field_111101_a = parDouble1; + flag = true; + } else if (this.field_111101_a > parDouble3) { + this.field_111101_a = parDouble3; + flag = true; + } + + if (this.field_111100_b < parDouble2) { + this.field_111100_b = parDouble2; + flag = true; + } else if (this.field_111100_b > parDouble4) { + this.field_111100_b = parDouble4; + flag = true; + } + + return flag; + } + + public int func_111092_a(World worldIn) { + BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b); + + while (blockpos.getY() > 0) { + blockpos = blockpos.down(); + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { + return blockpos.getY() + 1; + } + } + + return 257; + } + + public boolean func_111098_b(World worldIn) { + BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b); + + while (blockpos.getY() > 0) { + blockpos = blockpos.down(); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + if (material != Material.air) { + return !material.isLiquid() && material != Material.fire; + } + } + + return false; + } + + public void func_111097_a(EaglercraftRandom parRandom, double parDouble1, double parDouble2, double parDouble3, + double parDouble4) { + this.field_111101_a = MathHelper.getRandomDoubleInRange(parRandom, parDouble1, parDouble3); + this.field_111100_b = MathHelper.getRandomDoubleInRange(parRandom, parDouble2, parDouble4); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandStats.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandStats.java new file mode 100644 index 0000000..cf85fd6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandStats.java @@ -0,0 +1,236 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandStats extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandStats"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "stats"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.stats.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.stats.usage", new Object[0]); + } else { + boolean flag; + if (parArrayOfString[0].equals("entity")) { + flag = false; + } else { + if (!parArrayOfString[0].equals("block")) { + throw new WrongUsageException("commands.stats.usage", new Object[0]); + } + + flag = true; + } + + int i; + if (flag) { + if (parArrayOfString.length < 5) { + throw new WrongUsageException("commands.stats.block.usage", new Object[0]); + } + + i = 4; + } else { + if (parArrayOfString.length < 3) { + throw new WrongUsageException("commands.stats.entity.usage", new Object[0]); + } + + i = 2; + } + + String s = parArrayOfString[i++]; + if ("set".equals(s)) { + if (parArrayOfString.length < i + 3) { + if (i == 5) { + throw new WrongUsageException("commands.stats.block.set.usage", new Object[0]); + } + + throw new WrongUsageException("commands.stats.entity.set.usage", new Object[0]); + } + } else { + if (!"clear".equals(s)) { + throw new WrongUsageException("commands.stats.usage", new Object[0]); + } + + if (parArrayOfString.length < i + 1) { + if (i == 5) { + throw new WrongUsageException("commands.stats.block.clear.usage", new Object[0]); + } + + throw new WrongUsageException("commands.stats.entity.clear.usage", new Object[0]); + } + } + + CommandResultStats.Type commandresultstats$type = CommandResultStats.Type + .getTypeByName(parArrayOfString[i++]); + if (commandresultstats$type == null) { + throw new CommandException("commands.stats.failed", new Object[0]); + } else { + World world = parICommandSender.getEntityWorld(); + CommandResultStats commandresultstats; + if (flag) { + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 1, false); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity == null) { + throw new CommandException("commands.stats.noCompatibleBlock", + new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), + Integer.valueOf(blockpos.getZ()) }); + } + + if (tileentity instanceof TileEntityCommandBlock) { + commandresultstats = ((TileEntityCommandBlock) tileentity).getCommandResultStats(); + } else { + if (!(tileentity instanceof TileEntitySign)) { + throw new CommandException("commands.stats.noCompatibleBlock", + new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), + Integer.valueOf(blockpos.getZ()) }); + } + + commandresultstats = ((TileEntitySign) tileentity).getStats(); + } + } else { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[1]); + commandresultstats = entity.getCommandStats(); + } + + if ("set".equals(s)) { + String s1 = parArrayOfString[i++]; + String s2 = parArrayOfString[i]; + if (s1.length() == 0 || s2.length() == 0) { + throw new CommandException("commands.stats.failed", new Object[0]); + } + + CommandResultStats.func_179667_a(commandresultstats, commandresultstats$type, s1, s2); + notifyOperators(parICommandSender, this, "commands.stats.success", + new Object[] { commandresultstats$type.getTypeName(), s2, s1 }); + } else if ("clear".equals(s)) { + CommandResultStats.func_179667_a(commandresultstats, commandresultstats$type, (String) null, + (String) null); + notifyOperators(parICommandSender, this, "commands.stats.cleared", + new Object[] { commandresultstats$type.getTypeName() }); + } + + if (flag) { + BlockPos blockpos1 = parseBlockPos(parICommandSender, parArrayOfString, 1, false); + TileEntity tileentity1 = world.getTileEntity(blockpos1); + tileentity1.markDirty(); + } + + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, new String[] { "entity", "block" }) + : (astring.length == 2 && astring[0].equals("entity") + ? getListOfStringsMatchingLastWord(astring, this.func_175776_d()) + : (astring.length >= 2 && astring.length <= 4 && astring[0].equals("block") + ? func_175771_a(astring, 1, blockpos) + : ((astring.length != 3 || !astring[0].equals("entity")) + && (astring.length != 5 || !astring[0].equals("block")) + ? ((astring.length != 4 || !astring[0].equals("entity")) + && (astring.length != 6 || !astring[0].equals("block")) + ? ((astring.length != 6 || !astring[0].equals("entity")) + && (astring.length != 8 + || !astring[0].equals("block")) + ? null + : getListOfStringsMatchingLastWord( + astring, + this.func_175777_e())) + : getListOfStringsMatchingLastWord(astring, + CommandResultStats.Type.getTypeNames())) + : getListOfStringsMatchingLastWord(astring, + new String[] { "set", "clear" })))); + } + + protected String[] func_175776_d() { + return MinecraftServer.getServer().getAllUsernames(); + } + + protected List func_175777_e() { + Collection collection = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard() + .getScoreObjectives(); + ArrayList arraylist = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : (Collection) collection) { + if (!scoreobjective.getCriteria().isReadOnly()) { + arraylist.add(scoreobjective.getName()); + } + } + + return arraylist; + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] astring, int i) { + return astring.length > 0 && astring[0].equals("entity") && i == 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTime.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTime.java new file mode 100644 index 0000000..48c6780 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTime.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandTime extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandTime"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "time"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.time.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length > 1) { + if (parArrayOfString[0].equals("set")) { + int l; + if (parArrayOfString[1].equals("day")) { + l = 1000; + } else if (parArrayOfString[1].equals("night")) { + l = 13000; + } else { + l = parseInt(parArrayOfString[1], 0); + } + + this.setTime(parICommandSender, l); + notifyOperators(parICommandSender, this, "commands.time.set", new Object[] { Integer.valueOf(l) }); + return; + } + + if (parArrayOfString[0].equals("add")) { + int k = parseInt(parArrayOfString[1], 0); + this.addTime(parICommandSender, k); + notifyOperators(parICommandSender, this, "commands.time.added", new Object[] { Integer.valueOf(k) }); + return; + } + + if (parArrayOfString[0].equals("query")) { + if (parArrayOfString[1].equals("daytime")) { + int j = (int) (parICommandSender.getEntityWorld().getWorldTime() % 2147483647L); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, j); + notifyOperators(parICommandSender, this, "commands.time.query", + new Object[] { Integer.valueOf(j) }); + return; + } + + if (parArrayOfString[1].equals("gametime")) { + int i = (int) (parICommandSender.getEntityWorld().getTotalWorldTime() % 2147483647L); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i); + notifyOperators(parICommandSender, this, "commands.time.query", + new Object[] { Integer.valueOf(i) }); + return; + } + } + } + + throw new WrongUsageException("commands.time.usage", new Object[0]); + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, new String[] { "set", "add", "query" }) + : (astring.length == 2 && astring[0].equals("set") + ? getListOfStringsMatchingLastWord(astring, new String[] { "day", "night" }) + : (astring.length == 2 && astring[0].equals("query") + ? getListOfStringsMatchingLastWord(astring, new String[] { "daytime", "gametime" }) + : null)); + } + + /**+ + * Set the time in the server object. + */ + protected void setTime(ICommandSender parICommandSender, int parInt1) { + for (int i = 0; i < MinecraftServer.getServer().worldServers.length; ++i) { + MinecraftServer.getServer().worldServers[i].setWorldTime((long) parInt1); + } + + } + + /**+ + * Adds (or removes) time in the server object. + */ + protected void addTime(ICommandSender parICommandSender, int parInt1) { + for (int i = 0; i < MinecraftServer.getServer().worldServers.length; ++i) { + WorldServer worldserver = MinecraftServer.getServer().worldServers[i]; + worldserver.setWorldTime(worldserver.getWorldTime() + (long) parInt1); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTitle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTitle.java new file mode 100644 index 0000000..f1475a3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTitle.java @@ -0,0 +1,150 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; + +import org.json.JSONException; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.SyntaxErrorException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S45PacketTitle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentProcessor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.ExceptionUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandTitle extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandTitle"); + } + + private static final Logger LOGGER = LogManager.getLogger(); + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "title"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.title.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } else { + if (parArrayOfString.length < 3) { + if ("title".equals(parArrayOfString[1]) || "subtitle".equals(parArrayOfString[1])) { + throw new WrongUsageException("commands.title.usage.title", new Object[0]); + } + + if ("times".equals(parArrayOfString[1])) { + throw new WrongUsageException("commands.title.usage.times", new Object[0]); + } + } + + EntityPlayerMP entityplayermp = getPlayer(parICommandSender, parArrayOfString[0]); + S45PacketTitle.Type s45packettitle$type = S45PacketTitle.Type.byName(parArrayOfString[1]); + if (s45packettitle$type != S45PacketTitle.Type.CLEAR && s45packettitle$type != S45PacketTitle.Type.RESET) { + if (s45packettitle$type == S45PacketTitle.Type.TIMES) { + if (parArrayOfString.length != 5) { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } else { + int i = parseInt(parArrayOfString[2]); + int j = parseInt(parArrayOfString[3]); + int k = parseInt(parArrayOfString[4]); + S45PacketTitle s45packettitle2 = new S45PacketTitle(i, j, k); + entityplayermp.playerNetServerHandler.sendPacket(s45packettitle2); + notifyOperators(parICommandSender, this, "commands.title.success", new Object[0]); + } + } else if (parArrayOfString.length < 3) { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } else { + String s = buildString(parArrayOfString, 2); + + IChatComponent ichatcomponent; + try { + ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + } catch (JSONException jsonparseexception) { + Throwable throwable = ExceptionUtils.getRootCause(jsonparseexception); + throw new SyntaxErrorException("commands.tellraw.jsonException", + new Object[] { throwable == null ? "" : throwable.getMessage() }); + } + + S45PacketTitle s45packettitle1 = new S45PacketTitle(s45packettitle$type, + ChatComponentProcessor.processComponent(parICommandSender, ichatcomponent, entityplayermp)); + entityplayermp.playerNetServerHandler.sendPacket(s45packettitle1); + notifyOperators(parICommandSender, this, "commands.title.success", new Object[0]); + } + } else if (parArrayOfString.length != 2) { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } else { + S45PacketTitle s45packettitle = new S45PacketTitle(s45packettitle$type, (IChatComponent) null); + entityplayermp.playerNetServerHandler.sendPacket(s45packettitle); + notifyOperators(parICommandSender, this, "commands.title.success", new Object[0]); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : (astring.length == 2 ? getListOfStringsMatchingLastWord(astring, S45PacketTitle.Type.getNames()) + : null); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandToggleDownfall.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandToggleDownfall.java new file mode 100644 index 0000000..d69f46a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandToggleDownfall.java @@ -0,0 +1,73 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +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.storage.WorldInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandToggleDownfall extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandToggleDownfall"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "toggledownfall"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.downfall.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + this.toggleDownfall(); + notifyOperators(parICommandSender, this, "commands.downfall.success", new Object[0]); + } + + /**+ + * Toggle rain and enable thundering. + */ + protected void toggleDownfall() { + WorldInfo worldinfo = MinecraftServer.getServer().worldServers[0].getWorldInfo(); + worldinfo.setRaining(!worldinfo.isRaining()); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTrigger.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTrigger.java new file mode 100644 index 0000000..b0ee6d4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTrigger.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandTrigger extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandTrigger"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "trigger"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.trigger.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 3) { + throw new WrongUsageException("commands.trigger.usage", new Object[0]); + } else { + EntityPlayerMP entityplayermp; + if (parICommandSender instanceof EntityPlayerMP) { + entityplayermp = (EntityPlayerMP) parICommandSender; + } else { + Entity entity = parICommandSender.getCommandSenderEntity(); + if (!(entity instanceof EntityPlayerMP)) { + throw new CommandException("commands.trigger.invalidPlayer", new Object[0]); + } + + entityplayermp = (EntityPlayerMP) entity; + } + + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(parArrayOfString[0]); + if (scoreobjective != null && scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER) { + int i = parseInt(parArrayOfString[2]); + if (!scoreboard.entityHasObjective(entityplayermp.getName(), scoreobjective)) { + throw new CommandException("commands.trigger.invalidObjective", + new Object[] { parArrayOfString[0] }); + } else { + Score score = scoreboard.getValueFromObjective(entityplayermp.getName(), scoreobjective); + if (score.isLocked()) { + throw new CommandException("commands.trigger.disabled", new Object[] { parArrayOfString[0] }); + } else { + if ("set".equals(parArrayOfString[1])) { + score.setScorePoints(i); + } else { + if (!"add".equals(parArrayOfString[1])) { + throw new CommandException("commands.trigger.invalidMode", + new Object[] { parArrayOfString[1] }); + } + + score.increseScore(i); + } + + score.setLocked(true); + if (entityplayermp.theItemInWorldManager.isCreative()) { + notifyOperators(parICommandSender, this, "commands.trigger.success", + new Object[] { parArrayOfString[0], parArrayOfString[1], parArrayOfString[2] }); + } + + } + } + } else { + throw new CommandException("commands.trigger.invalidObjective", new Object[] { parArrayOfString[0] }); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + if (astring.length == 1) { + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + ArrayList arraylist = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : scoreboard.getScoreObjectives()) { + if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER) { + arraylist.add(scoreobjective.getName()); + } + } + + return getListOfStringsMatchingLastWord(astring, + (String[]) arraylist.toArray(new String[arraylist.size()])); + } else { + return astring.length == 2 ? getListOfStringsMatchingLastWord(astring, new String[] { "add", "set" }) + : null; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWeather.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWeather.java new file mode 100644 index 0000000..9766bcd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWeather.java @@ -0,0 +1,115 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +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.storage.WorldInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandWeather extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandWeather"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "weather"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.weather.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length >= 1 && parArrayOfString.length <= 2) { + int i = (300 + (new EaglercraftRandom()).nextInt(600)) * 20 * 2; + if (parArrayOfString.length >= 2) { + i = parseInt(parArrayOfString[1], 1, 1000000) * 20; + } + + WorldServer worldserver = MinecraftServer.getServer().worldServers[0]; + WorldInfo worldinfo = worldserver.getWorldInfo(); + if ("clear".equalsIgnoreCase(parArrayOfString[0])) { + worldinfo.setCleanWeatherTime(i); + worldinfo.setRainTime(0); + worldinfo.setThunderTime(0); + worldinfo.setRaining(false); + worldinfo.setThundering(false); + notifyOperators(parICommandSender, this, "commands.weather.clear", new Object[0]); + } else if ("rain".equalsIgnoreCase(parArrayOfString[0])) { + worldinfo.setCleanWeatherTime(0); + worldinfo.setRainTime(i); + worldinfo.setThunderTime(i); + worldinfo.setRaining(true); + worldinfo.setThundering(false); + notifyOperators(parICommandSender, this, "commands.weather.rain", new Object[0]); + } else { + if (!"thunder".equalsIgnoreCase(parArrayOfString[0])) { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + + worldinfo.setCleanWeatherTime(0); + worldinfo.setRainTime(i); + worldinfo.setThunderTime(i); + worldinfo.setRaining(true); + worldinfo.setThundering(true); + notifyOperators(parICommandSender, this, "commands.weather.thunder", new Object[0]); + } + + } else { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, new String[] { "clear", "rain", "thunder" }) + : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWorldBorder.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWorldBorder.java new file mode 100644 index 0000000..4e1f870 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWorldBorder.java @@ -0,0 +1,229 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandWorldBorder extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandWorldBorder"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "worldborder"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.worldborder.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.worldborder.usage", new Object[0]); + } else { + WorldBorder worldborder = this.getWorldBorder(); + if (parArrayOfString[0].equals("set")) { + if (parArrayOfString.length != 2 && parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.set.usage", new Object[0]); + } + + double d0 = worldborder.getTargetSize(); + double d2 = parseDouble(parArrayOfString[1], 1.0D, 6.0E7D); + long i = parArrayOfString.length > 2 ? parseLong(parArrayOfString[2], 0L, 9223372036854775L) * 1000L + : 0L; + if (i > 0L) { + worldborder.setTransition(d0, d2, i); + if (d0 > d2) { + notifyOperators(parICommandSender, this, "commands.worldborder.setSlowly.shrink.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d2) }), + HString.format("%.1f", new Object[] { Double.valueOf(d0) }), + Long.toString(i / 1000L) }); + } else { + notifyOperators(parICommandSender, this, "commands.worldborder.setSlowly.grow.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d2) }), + HString.format("%.1f", new Object[] { Double.valueOf(d0) }), + Long.toString(i / 1000L) }); + } + } else { + worldborder.setTransition(d2); + notifyOperators(parICommandSender, this, "commands.worldborder.set.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d2) }), + HString.format("%.1f", new Object[] { Double.valueOf(d0) }) }); + } + } else if (parArrayOfString[0].equals("add")) { + if (parArrayOfString.length != 2 && parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.add.usage", new Object[0]); + } + + double d4 = worldborder.getDiameter(); + double d8 = d4 + parseDouble(parArrayOfString[1], -d4, 6.0E7D - d4); + long i1 = worldborder.getTimeUntilTarget() + + (parArrayOfString.length > 2 ? parseLong(parArrayOfString[2], 0L, 9223372036854775L) * 1000L + : 0L); + if (i1 > 0L) { + worldborder.setTransition(d4, d8, i1); + if (d4 > d8) { + notifyOperators(parICommandSender, this, "commands.worldborder.setSlowly.shrink.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d8) }), + HString.format("%.1f", new Object[] { Double.valueOf(d4) }), + Long.toString(i1 / 1000L) }); + } else { + notifyOperators(parICommandSender, this, "commands.worldborder.setSlowly.grow.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d8) }), + HString.format("%.1f", new Object[] { Double.valueOf(d4) }), + Long.toString(i1 / 1000L) }); + } + } else { + worldborder.setTransition(d8); + notifyOperators(parICommandSender, this, "commands.worldborder.set.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d8) }), + HString.format("%.1f", new Object[] { Double.valueOf(d4) }) }); + } + } else if (parArrayOfString[0].equals("center")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.center.usage", new Object[0]); + } + + BlockPos blockpos = parICommandSender.getPosition(); + double d1 = parseDouble((double) blockpos.getX() + 0.5D, parArrayOfString[1], true); + double d3 = parseDouble((double) blockpos.getZ() + 0.5D, parArrayOfString[2], true); + worldborder.setCenter(d1, d3); + notifyOperators(parICommandSender, this, "commands.worldborder.center.success", + new Object[] { Double.valueOf(d1), Double.valueOf(d3) }); + } else if (parArrayOfString[0].equals("damage")) { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.worldborder.damage.usage", new Object[0]); + } + + if (parArrayOfString[1].equals("buffer")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.damage.buffer.usage", new Object[0]); + } + + double d5 = parseDouble(parArrayOfString[2], 0.0D); + double d9 = worldborder.getDamageBuffer(); + worldborder.setDamageBuffer(d5); + notifyOperators(parICommandSender, this, "commands.worldborder.damage.buffer.success", + new Object[] { HString.format("%.1f", new Object[] { Double.valueOf(d5) }), + HString.format("%.1f", new Object[] { Double.valueOf(d9) }) }); + } else if (parArrayOfString[1].equals("amount")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.damage.amount.usage", new Object[0]); + } + + double d6 = parseDouble(parArrayOfString[2], 0.0D); + double d10 = worldborder.getDamageAmount(); + worldborder.setDamageAmount(d6); + notifyOperators(parICommandSender, this, "commands.worldborder.damage.amount.success", + new Object[] { HString.format("%.2f", new Object[] { Double.valueOf(d6) }), + HString.format("%.2f", new Object[] { Double.valueOf(d10) }) }); + } + } else if (parArrayOfString[0].equals("warning")) { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.worldborder.warning.usage", new Object[0]); + } + + int j = parseInt(parArrayOfString[2], 0); + if (parArrayOfString[1].equals("time")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.warning.time.usage", new Object[0]); + } + + int k = worldborder.getWarningTime(); + worldborder.setWarningTime(j); + notifyOperators(parICommandSender, this, "commands.worldborder.warning.time.success", + new Object[] { Integer.valueOf(j), Integer.valueOf(k) }); + } else if (parArrayOfString[1].equals("distance")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.worldborder.warning.distance.usage", new Object[0]); + } + + int l = worldborder.getWarningDistance(); + worldborder.setWarningDistance(j); + notifyOperators(parICommandSender, this, "commands.worldborder.warning.distance.success", + new Object[] { Integer.valueOf(j), Integer.valueOf(l) }); + } + } else { + if (!parArrayOfString[0].equals("get")) { + throw new WrongUsageException("commands.worldborder.usage", new Object[0]); + } + + double d7 = worldborder.getDiameter(); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, + MathHelper.floor_double(d7 + 0.5D)); + parICommandSender.addChatMessage(new ChatComponentTranslation("commands.worldborder.get.success", + new Object[] { HString.format("%.0f", new Object[] { Double.valueOf(d7) }) })); + } + + } + } + + protected WorldBorder getWorldBorder() { + return MinecraftServer.getServer().worldServers[0].getWorldBorder(); + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, + new String[] { "set", "center", "damage", "warning", "add", "get" }) + : (astring.length == 2 && astring[0].equals("damage") + ? getListOfStringsMatchingLastWord(astring, new String[] { "buffer", "amount" }) + : (astring.length >= 2 && astring.length <= 3 && astring[0].equals("center") + ? func_181043_b(astring, 1, blockpos) + : (astring.length == 2 && astring[0].equals("warning") + ? getListOfStringsMatchingLastWord(astring, new String[] { "time", "distance" }) + : null))); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandXP.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandXP.java new file mode 100644 index 0000000..a713098 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandXP.java @@ -0,0 +1,127 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandXP extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/CommandXP"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "xp"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.xp.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length <= 0) { + throw new WrongUsageException("commands.xp.usage", new Object[0]); + } else { + String s = parArrayOfString[0]; + boolean flag = s.endsWith("l") || s.endsWith("L"); + if (flag && s.length() > 1) { + s = s.substring(0, s.length() - 1); + } + + int i = parseInt(s); + boolean flag1 = i < 0; + if (flag1) { + i *= -1; + } + + EntityPlayerMP entityplayermp = parArrayOfString.length > 1 + ? getPlayer(parICommandSender, parArrayOfString[1]) + : getCommandSenderAsPlayer(parICommandSender); + if (flag) { + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, entityplayermp.experienceLevel); + if (flag1) { + entityplayermp.addExperienceLevel(-i); + notifyOperators(parICommandSender, this, "commands.xp.success.negative.levels", + new Object[] { Integer.valueOf(i), entityplayermp.getName() }); + } else { + entityplayermp.addExperienceLevel(i); + notifyOperators(parICommandSender, this, "commands.xp.success.levels", + new Object[] { Integer.valueOf(i), entityplayermp.getName() }); + } + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, entityplayermp.experienceTotal); + if (flag1) { + throw new CommandException("commands.xp.failure.widthdrawXp", new Object[0]); + } + + entityplayermp.addExperience(i); + notifyOperators(parICommandSender, this, "commands.xp.success", + new Object[] { Integer.valueOf(i), entityplayermp.getName() }); + } + + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 2 ? getListOfStringsMatchingLastWord(astring, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/EntityNotFoundException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/EntityNotFoundException.java new file mode 100644 index 0000000..66239de --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/EntityNotFoundException.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityNotFoundException extends CommandException { + + static { + __checkIntegratedContextValid("net/minecraft/command/EntityNotFoundException"); + } + + public EntityNotFoundException() { + this("commands.generic.entity.notFound", new Object[0]); + } + + public EntityNotFoundException(String parString1, Object... parArrayOfObject) { + super(parString1, parArrayOfObject); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/IAdminCommand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/IAdminCommand.java new file mode 100644 index 0000000..89576d6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/IAdminCommand.java @@ -0,0 +1,31 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IAdminCommand { + /**+ + * Send an informative message to the server operators + */ + void notifyOperators(ICommandSender var1, ICommand var2, int var3, String var4, Object... var5); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommand.java new file mode 100644 index 0000000..2170161 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommand.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ICommand extends Comparable { + /**+ + * Gets the name of the command + */ + String getCommandName(); + + /**+ + * Gets the usage string for the command. + */ + String getCommandUsage(ICommandSender var1); + + /**+ + * Gets a list of aliases for this command + */ + List getCommandAliases(); + + /**+ + * Callback when the command is invoked + */ + void processCommand(ICommandSender var1, String[] var2) throws CommandException; + + /**+ + * Returns true if the given command sender is allowed to use + * this command. + */ + boolean canCommandSenderUseCommand(ICommandSender var1); + + /**+ + * Return a list of options when the user types TAB + */ + List addTabCompletionOptions(ICommandSender var1, String[] var2, BlockPos var3); + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + boolean isUsernameIndex(String[] var1, int var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandManager.java new file mode 100644 index 0000000..8580c13 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandManager.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ICommandManager { + int executeCommand(ICommandSender var1, String var2); + + List getTabCompletionOptions(ICommandSender var1, String var2, BlockPos var3); + + /**+ + * returns all commands that the commandSender can use + */ + List getPossibleCommands(ICommandSender var1); + + Map getCommands(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandSender.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandSender.java new file mode 100644 index 0000000..ef0f8fc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandSender.java @@ -0,0 +1,88 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ICommandSender { + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + String getName(); + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + IChatComponent getDisplayName(); + + /**+ + * Send a chat message to the CommandSender + */ + void addChatMessage(IChatComponent var1); + + /**+ + * Returns {@code true} if the CommandSender is allowed to + * execute the command, {@code false} if not + */ + boolean canCommandSenderUseCommand(int var1, String var2); + + /**+ + * Get the position in the world. {@code null} is not + * allowed! If you are not an entity in the world, return + * the coordinates 0, 0, 0 + */ + BlockPos getPosition(); + + /**+ + * Get the position vector. {@code null} is not allowed! + * If you are not an entity in the world, return 0.0D, 0.0D, + * 0.0D + */ + Vec3 getPositionVector(); + + /**+ + * Get the world, if available. {@code null} is not + * allowed! If you are not an entity in the world, return + * the overworld + */ + World getEntityWorld(); + + /**+ + * Returns the entity associated with the command sender. MAY BE + * NULL! + */ + Entity getCommandSenderEntity(); + + /**+ + * Returns true if the command sender should be sent feedback + * about executed commands + */ + boolean sendCommandFeedback(); + + void setCommandStat(CommandResultStats.Type var1, int var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/NumberInvalidException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/NumberInvalidException.java new file mode 100644 index 0000000..c5c96a1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/NumberInvalidException.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NumberInvalidException extends CommandException { + + static { + __checkIntegratedContextValid("net/minecraft/command/NumberInvalidException"); + } + + public NumberInvalidException() { + this("commands.generic.num.invalid", new Object[0]); + } + + public NumberInvalidException(String message, Object... replacements) { + super(message, replacements); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerNotFoundException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerNotFoundException.java new file mode 100644 index 0000000..0b371d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerNotFoundException.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PlayerNotFoundException extends CommandException { + + static { + __checkIntegratedContextValid("net/minecraft/command/PlayerNotFoundException"); + } + + public PlayerNotFoundException() { + this("commands.generic.player.notFound", new Object[0]); + } + + public PlayerNotFoundException(String message, Object... replacements) { + super(message, replacements); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerSelector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerSelector.java new file mode 100644 index 0000000..29f52ab --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerSelector.java @@ -0,0 +1,619 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PlayerSelector { + + static { + __checkIntegratedContextValid("net/minecraft/command/PlayerSelector"); + } + + /**+ + * This matches the at-tokens introduced for command blocks, + * including their arguments, if any. + */ + private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w=,!-]*)\\])?$"); + /**+ + * This matches things like "-1,,4", and is used for getting + * x,y,z,range from the token's argument list. + */ + private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); + /**+ + * This matches things like "rm=4,c=2" and is used for handling + * named token arguments. + */ + private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); + /**+ + * A set of arguments that will change the selector's world list + * to the sender's world instead of all the worlds when present + */ + private static final Set WORLD_BINDING_ARGS = Sets + .newHashSet(new String[] { "x", "y", "z", "dx", "dy", "dz", "rm", "r" }); + + /**+ + * Returns the one player that matches the given at-token. + * Returns null if more than one player matches. + */ + public static EntityPlayerMP matchOnePlayer(ICommandSender sender, String token) { + return (EntityPlayerMP) matchOneEntity(sender, token, EntityPlayerMP.class); + } + + public static T matchOneEntity(ICommandSender sender, String token, + Class targetClass) { + List list = matchEntities(sender, token, targetClass); + return (T) (list.size() == 1 ? (Entity) list.get(0) : null); + } + + public static IChatComponent matchEntitiesToChatComponent(ICommandSender sender, String token) { + List list = matchEntities(sender, token, Entity.class); + if (list.isEmpty()) { + return null; + } else { + ArrayList arraylist = Lists.newArrayList(); + + for (Entity entity : (ArrayList) list) { + arraylist.add(entity.getDisplayName()); + } + + return CommandBase.join(arraylist); + } + } + + public static List matchEntities(ICommandSender sender, String token, + Class targetClass) { + Matcher matcher = tokenPattern.matcher(token); + if (matcher.matches() && sender.canCommandSenderUseCommand(1, "@")) { + Map map = getArgumentMap(matcher.group(2)); + if (!isEntityTypeValid(sender, map)) { + return Collections.emptyList(); + } else { + String s = matcher.group(1); + BlockPos blockpos = func_179664_b(map, sender.getPosition()); + List list = getWorlds(sender, map); + ArrayList arraylist = Lists.newArrayList(); + + for (World world : (ArrayList) list) { + if (world != null) { + ArrayList arraylist1 = Lists.newArrayList(); + arraylist1.addAll(func_179663_a(map, s)); + arraylist1.addAll(func_179648_b(map)); + arraylist1.addAll(func_179649_c(map)); + arraylist1.addAll(func_179659_d(map)); + arraylist1.addAll(func_179657_e(map)); + arraylist1.addAll(func_179647_f(map)); + arraylist1.addAll(func_180698_a(map, blockpos)); + arraylist1.addAll(func_179662_g(map)); + arraylist.addAll(filterResults(map, targetClass, arraylist1, s, world, blockpos)); + } + } + + return func_179658_a(arraylist, map, sender, targetClass, s, blockpos); + } + } else { + return Collections.emptyList(); + } + } + + /**+ + * Returns the worlds to match the entities in for the specified + * command sender and token. This returns the sender's world if + * the selector specifies a location or all currently loaded + * worlds on the server if not. + */ + private static List getWorlds(ICommandSender sender, Map argumentMap) { + ArrayList arraylist = Lists.newArrayList(); + if (func_179665_h(argumentMap)) { + arraylist.add(sender.getEntityWorld()); + } else { + Collections.addAll(arraylist, MinecraftServer.getServer().worldServers); + } + + return arraylist; + } + + private static boolean isEntityTypeValid(ICommandSender commandSender, + Map params) { + String s = func_179651_b(params, "type"); + s = s != null && s.startsWith("!") ? s.substring(1) : s; + if (s != null && !EntityList.isStringValidEntityName(s)) { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.generic.entity.invalidType", new Object[] { s }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + commandSender.addChatMessage(chatcomponenttranslation); + return false; + } else { + return true; + } + } + + private static List> func_179663_a(Map parMap, String parString1) { + ArrayList arraylist = Lists.newArrayList(); + String s = func_179651_b(parMap, "type"); + final boolean flag = s != null && s.startsWith("!"); + if (flag) { + s = s.substring(1); + } + + boolean flag1 = !parString1.equals("e"); + boolean flag2 = parString1.equals("r") && s != null; + if ((s == null || !parString1.equals("e")) && !flag2) { + if (flag1) { + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof EntityPlayer; + } + }); + } + } else { + final String ss = s; + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + return EntityList.isStringEntityName(entity, ss) != flag; + } + }); + } + + return arraylist; + } + + private static List> func_179648_b(Map parMap) { + ArrayList arraylist = Lists.newArrayList(); + final int i = parseIntWithDefault(parMap, "lm", -1); + final int j = parseIntWithDefault(parMap, "l", -1); + if (i > -1 || j > -1) { + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + if (!(entity instanceof EntityPlayerMP)) { + return false; + } else { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entity; + return (i <= -1 || entityplayermp.experienceLevel >= i) + && (j <= -1 || entityplayermp.experienceLevel <= j); + } + } + }); + } + + return arraylist; + } + + private static List> func_179649_c(Map parMap) { + ArrayList arraylist = Lists.newArrayList(); + final int i = parseIntWithDefault(parMap, "m", WorldSettings.GameType.NOT_SET.getID()); + if (i != WorldSettings.GameType.NOT_SET.getID()) { + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + if (!(entity instanceof EntityPlayerMP)) { + return false; + } else { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entity; + return entityplayermp.theItemInWorldManager.getGameType().getID() == i; + } + } + }); + } + + return arraylist; + } + + private static List> func_179659_d(Map parMap) { + ArrayList arraylist = Lists.newArrayList(); + String s = func_179651_b(parMap, "team"); + final boolean flag = s != null && s.startsWith("!"); + if (flag) { + s = s.substring(1); + } + + if (s != null) { + final String ss = s; + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + if (!(entity instanceof EntityLivingBase)) { + return false; + } else { + EntityLivingBase entitylivingbase = (EntityLivingBase) entity; + Team team = entitylivingbase.getTeam(); + String s1 = team == null ? "" : team.getRegisteredName(); + return s1.equals(ss) != flag; + } + } + }); + } + + return arraylist; + } + + private static List> func_179657_e(Map parMap) { + ArrayList arraylist = Lists.newArrayList(); + final Map map = func_96560_a(parMap); + if (map != null && map.size() > 0) { + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + + for (Entry entry : (Set) map.entrySet()) { + String s = (String) entry.getKey(); + boolean flag = false; + if (s.endsWith("_min") && s.length() > 4) { + flag = true; + s = s.substring(0, s.length() - 4); + } + + ScoreObjective scoreobjective = scoreboard.getObjective(s); + if (scoreobjective == null) { + return false; + } + + String s1 = entity instanceof EntityPlayerMP ? entity.getName() + : entity.getUniqueID().toString(); + if (!scoreboard.entityHasObjective(s1, scoreobjective)) { + return false; + } + + Score score = scoreboard.getValueFromObjective(s1, scoreobjective); + int i = score.getScorePoints(); + if (i < ((Integer) entry.getValue()).intValue() && flag) { + return false; + } + + if (i > ((Integer) entry.getValue()).intValue() && !flag) { + return false; + } + } + + return true; + } + }); + } + + return arraylist; + } + + private static List> func_179647_f(Map parMap) { + ArrayList arraylist = Lists.newArrayList(); + String s = func_179651_b(parMap, "name"); + final boolean flag = s != null && s.startsWith("!"); + if (flag) { + s = s.substring(1); + } + + if (s != null) { + final String ss = s; + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + return entity.getName().equals(ss) != flag; + } + }); + } + + return arraylist; + } + + private static List> func_180698_a(Map parMap, final BlockPos parBlockPos) { + ArrayList arraylist = Lists.newArrayList(); + final int i = parseIntWithDefault(parMap, "rm", -1); + final int j = parseIntWithDefault(parMap, "r", -1); + if (parBlockPos != null && (i >= 0 || j >= 0)) { + final int k = i * i; + final int l = j * j; + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + int i1 = (int) entity.getDistanceSqToCenter(parBlockPos); + return (i < 0 || i1 >= k) && (j < 0 || i1 <= l); + } + }); + } + + return arraylist; + } + + private static List> func_179662_g(Map parMap) { + ArrayList arraylist = Lists.newArrayList(); + if (parMap.containsKey("rym") || parMap.containsKey("ry")) { + final int i = func_179650_a(parseIntWithDefault(parMap, "rym", 0)); + final int j = func_179650_a(parseIntWithDefault(parMap, "ry", 359)); + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + int i1 = PlayerSelector.func_179650_a((int) Math.floor((double) entity.rotationYaw)); + return i > j ? i1 >= i || i1 <= j : i1 >= i && i1 <= j; + } + }); + } + + if (parMap.containsKey("rxm") || parMap.containsKey("rx")) { + final int k = func_179650_a(parseIntWithDefault(parMap, "rxm", 0)); + final int l = func_179650_a(parseIntWithDefault(parMap, "rx", 359)); + arraylist.add(new Predicate() { + public boolean apply(Entity entity) { + int i1 = PlayerSelector.func_179650_a((int) Math.floor((double) entity.rotationPitch)); + return k > l ? i1 >= k || i1 <= l : i1 >= k && i1 <= l; + } + }); + } + + return arraylist; + } + + private static List filterResults(Map params, Class entityClass, + List> inputList, String type, World worldIn, BlockPos position) { + ArrayList arraylist = Lists.newArrayList(); + String s = func_179651_b(params, "type"); + s = s != null && s.startsWith("!") ? s.substring(1) : s; + boolean flag = !type.equals("e"); + boolean flag1 = type.equals("r") && s != null; + int i = parseIntWithDefault(params, "dx", 0); + int j = parseIntWithDefault(params, "dy", 0); + int k = parseIntWithDefault(params, "dz", 0); + int l = parseIntWithDefault(params, "r", -1); + Predicate predicate = Predicates.and(inputList); + Predicate predicate1 = Predicates.and(EntitySelectors.selectAnything, predicate); + if (position != null) { + int i1 = worldIn.playerEntities.size(); + int j1 = worldIn.loadedEntityList.size(); + boolean flag2 = i1 < j1 / 16; + if (!params.containsKey("dx") && !params.containsKey("dy") && !params.containsKey("dz")) { + if (l >= 0) { + AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double) (position.getX() - l), + (double) (position.getY() - l), (double) (position.getZ() - l), + (double) (position.getX() + l + 1), (double) (position.getY() + l + 1), + (double) (position.getZ() + l + 1)); + if (flag && flag2 && !flag1) { + arraylist.addAll(worldIn.getPlayers(entityClass, predicate1)); + } else { + arraylist.addAll(worldIn.getEntitiesWithinAABB(entityClass, axisalignedbb1, predicate1)); + } + } else if (type.equals("a")) { + arraylist.addAll(worldIn.getPlayers(entityClass, predicate)); + } else if (!type.equals("p") && (!type.equals("r") || flag1)) { + arraylist.addAll(worldIn.getEntities(entityClass, predicate1)); + } else { + arraylist.addAll(worldIn.getPlayers(entityClass, predicate1)); + } + } else { + final AxisAlignedBB axisalignedbb = func_179661_a(position, i, j, k); + if (flag && flag2 && !flag1) { + Predicate predicate2 = new Predicate() { + public boolean apply(Entity entity) { + return entity.posX >= axisalignedbb.minX && entity.posY >= axisalignedbb.minY + && entity.posZ >= axisalignedbb.minZ + ? entity.posX < axisalignedbb.maxX && entity.posY < axisalignedbb.maxY + && entity.posZ < axisalignedbb.maxZ + : false; + } + }; + arraylist.addAll(worldIn.getPlayers(entityClass, Predicates.and(predicate1, predicate2))); + } else { + arraylist.addAll(worldIn.getEntitiesWithinAABB(entityClass, axisalignedbb, predicate1)); + } + } + } else if (type.equals("a")) { + arraylist.addAll(worldIn.getPlayers(entityClass, predicate)); + } else if (!type.equals("p") && (!type.equals("r") || flag1)) { + arraylist.addAll(worldIn.getEntities(entityClass, predicate1)); + } else { + arraylist.addAll(worldIn.getPlayers(entityClass, predicate1)); + } + + return arraylist; + } + + private static List func_179658_a(List parList, Map parMap, + ICommandSender parICommandSender, Class parClass1, String parString1, + final BlockPos parBlockPos) { + int i = parseIntWithDefault(parMap, "c", !parString1.equals("a") && !parString1.equals("e") ? 1 : 0); + if (!parString1.equals("p") && !parString1.equals("a") && !parString1.equals("e")) { + if (parString1.equals("r")) { + Collections.shuffle((List) parList); + } + } else if (parBlockPos != null) { + Collections.sort((List) parList, new Comparator() { + public int compare(Entity entity1, Entity entity2) { + return ComparisonChain.start() + .compare(entity1.getDistanceSq(parBlockPos), entity2.getDistanceSq(parBlockPos)).result(); + } + }); + } + + Entity entity = parICommandSender.getCommandSenderEntity(); + if (entity != null && parClass1.isAssignableFrom(entity.getClass()) && i == 1 + && ((List) parList).contains(entity) && !"r".equals(parString1)) { + parList = (List) Lists.newArrayList(entity); + } + + if (i != 0) { + if (i < 0) { + Collections.reverse((List) parList); + } + + parList = ((List) parList).subList(0, Math.min(Math.abs(i), ((List) parList).size())); + } + + return (List) parList; + } + + private static AxisAlignedBB func_179661_a(BlockPos parBlockPos, int parInt1, int parInt2, int parInt3) { + boolean flag = parInt1 < 0; + boolean flag1 = parInt2 < 0; + boolean flag2 = parInt3 < 0; + int i = parBlockPos.getX() + (flag ? parInt1 : 0); + int j = parBlockPos.getY() + (flag1 ? parInt2 : 0); + int k = parBlockPos.getZ() + (flag2 ? parInt3 : 0); + int l = parBlockPos.getX() + (flag ? 0 : parInt1) + 1; + int i1 = parBlockPos.getY() + (flag1 ? 0 : parInt2) + 1; + int j1 = parBlockPos.getZ() + (flag2 ? 0 : parInt3) + 1; + return new AxisAlignedBB((double) i, (double) j, (double) k, (double) l, (double) i1, (double) j1); + } + + public static int func_179650_a(int parInt1) { + parInt1 = parInt1 % 360; + if (parInt1 >= 160) { + parInt1 -= 360; + } + + if (parInt1 < 0) { + parInt1 += 360; + } + + return parInt1; + } + + private static BlockPos func_179664_b(Map parMap, BlockPos parBlockPos) { + return new BlockPos(parseIntWithDefault(parMap, "x", parBlockPos.getX()), + parseIntWithDefault(parMap, "y", parBlockPos.getY()), + parseIntWithDefault(parMap, "z", parBlockPos.getZ())); + } + + private static boolean func_179665_h(Map parMap) { + for (String s : WORLD_BINDING_ARGS) { + if (parMap.containsKey(s)) { + return true; + } + } + + return false; + } + + private static int parseIntWithDefault(Map parMap, String parString1, int parInt1) { + return parMap.containsKey(parString1) ? MathHelper.parseIntWithDefault((String) parMap.get(parString1), parInt1) + : parInt1; + } + + private static String func_179651_b(Map parMap, String parString1) { + return (String) parMap.get(parString1); + } + + public static Map func_96560_a(Map parMap) { + HashMap hashmap = Maps.newHashMap(); + + for (String s : parMap.keySet()) { + if (s.startsWith("score_") && s.length() > "score_".length()) { + hashmap.put(s.substring("score_".length()), + Integer.valueOf(MathHelper.parseIntWithDefault((String) parMap.get(s), 1))); + } + } + + return hashmap; + } + + /**+ + * Returns whether the given pattern can match more than one + * player. + */ + public static boolean matchesMultiplePlayers(String parString1) { + Matcher matcher = tokenPattern.matcher(parString1); + if (!matcher.matches()) { + return false; + } else { + Map map = getArgumentMap(matcher.group(2)); + String s = matcher.group(1); + int i = !"a".equals(s) && !"e".equals(s) ? 1 : 0; + return parseIntWithDefault(map, "c", i) != 1; + } + } + + /**+ + * Returns whether the given token has any arguments set. + */ + public static boolean hasArguments(String parString1) { + return tokenPattern.matcher(parString1).matches(); + } + + private static Map getArgumentMap(String argumentString) { + HashMap hashmap = Maps.newHashMap(); + if (argumentString == null) { + return hashmap; + } else { + int i = 0; + int j = -1; + + for (Matcher matcher = intListPattern.matcher(argumentString); matcher.find(); j = matcher.end()) { + String s = null; + switch (i++) { + case 0: + s = "x"; + break; + case 1: + s = "y"; + break; + case 2: + s = "z"; + break; + case 3: + s = "r"; + } + + if (s != null && matcher.group(1).length() > 0) { + hashmap.put(s, matcher.group(1)); + } + } + + if (j < argumentString.length()) { + Matcher matcher1 = keyValueListPattern.matcher(j == -1 ? argumentString : argumentString.substring(j)); + + while (matcher1.find()) { + hashmap.put(matcher1.group(1), matcher1.group(2)); + } + } + + return hashmap; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ServerCommandManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ServerCommandManager.java new file mode 100644 index 0000000..cb645e1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ServerCommandManager.java @@ -0,0 +1,142 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandAchievement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBlockLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBroadcast; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandEmote; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandListPlayers; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandMessage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandMessageRaw; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandScoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandSetBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandSetDefaultSpawnpoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandSummon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandTeleport; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandTestFor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandTestForBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.lax1dude.eaglercraft.v1_8.sp.server.ClientCommandDummy; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ServerCommandManager extends CommandHandler implements IAdminCommand { + + static { + __checkIntegratedContextValid("net/minecraft/command/ServerCommandManager"); + } + + public ServerCommandManager() { + this.registerCommand(new CommandTime()); + this.registerCommand(new CommandGameMode()); + this.registerCommand(new CommandDifficulty()); + this.registerCommand(new CommandDefaultGameMode()); + this.registerCommand(new CommandKill()); + this.registerCommand(new CommandToggleDownfall()); + this.registerCommand(new CommandWeather()); + this.registerCommand(new CommandXP()); + this.registerCommand(new CommandTeleport()); + this.registerCommand(new CommandGive()); + this.registerCommand(new CommandReplaceItem()); + this.registerCommand(new CommandStats()); + this.registerCommand(new CommandEffect()); + this.registerCommand(new CommandEnchant()); + this.registerCommand(new CommandParticle()); + this.registerCommand(new CommandEmote()); + this.registerCommand(new CommandShowSeed()); + this.registerCommand(new CommandHelp()); + this.registerCommand(new CommandMessage()); + this.registerCommand(new CommandBroadcast()); + this.registerCommand(new CommandSetSpawnpoint()); + this.registerCommand(new CommandSetDefaultSpawnpoint()); + this.registerCommand(new CommandGameRule()); + this.registerCommand(new CommandClearInventory()); + this.registerCommand(new CommandTestFor()); + this.registerCommand(new CommandSpreadPlayers()); + this.registerCommand(new CommandPlaySound()); + this.registerCommand(new CommandScoreboard()); + this.registerCommand(new CommandExecuteAt()); + this.registerCommand(new CommandTrigger()); + this.registerCommand(new CommandAchievement()); + this.registerCommand(new CommandSummon()); + this.registerCommand(new CommandSetBlock()); + this.registerCommand(new CommandFill()); + this.registerCommand(new CommandClone()); + this.registerCommand(new CommandCompare()); + this.registerCommand(new CommandBlockData()); + this.registerCommand(new CommandTestForBlock()); + this.registerCommand(new CommandMessageRaw()); + this.registerCommand(new CommandWorldBorder()); + this.registerCommand(new CommandTitle()); + this.registerCommand(new CommandEntityData()); + this.registerCommand(new CommandServerKick()); + this.registerCommand(new CommandListPlayers()); + this.registerCommand(new CommandSetPlayerTimeout()); + this.registerCommand(new ClientCommandDummy("eagskull", 2, "command.skull.usage")); + CommandBase.setAdminCommander(this); + } + + /**+ + * Send an informative message to the server operators + */ + public void notifyOperators(ICommandSender sender, ICommand command, int flags, String msgFormat, + Object... msgParams) { + boolean flag = true; + MinecraftServer minecraftserver = MinecraftServer.getServer(); + if (!sender.sendCommandFeedback()) { + flag = false; + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.type.admin", + new Object[] { sender.getName(), new ChatComponentTranslation(msgFormat, msgParams) }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY); + chatcomponenttranslation.getChatStyle().setItalic(Boolean.valueOf(true)); + if (flag) { + for (EntityPlayer entityplayer : minecraftserver.getConfigurationManager().func_181057_v()) { + if (entityplayer != sender + && minecraftserver.getConfigurationManager().canSendCommands(entityplayer.getGameProfile()) + && command.canCommandSenderUseCommand(sender)) { + entityplayer.addChatMessage(chatcomponenttranslation); + } + } + } + + if (sender != minecraftserver + && minecraftserver.worldServers[0].getGameRules().getBoolean("logAdminCommands")) { + minecraftserver.addChatMessage(chatcomponenttranslation); + } + + boolean flag3 = minecraftserver.worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); + if (sender instanceof CommandBlockLogic) { + flag3 = ((CommandBlockLogic) sender).shouldTrackOutput(); + } + + if ((flags & 1) != 1 && flag3 || sender instanceof MinecraftServer) { + sender.addChatMessage(new ChatComponentTranslation(msgFormat, msgParams)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/SyntaxErrorException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/SyntaxErrorException.java new file mode 100644 index 0000000..2628ff2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/SyntaxErrorException.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SyntaxErrorException extends CommandException { + + static { + __checkIntegratedContextValid("net/minecraft/command/SyntaxErrorException"); + } + + public SyntaxErrorException() { + this("commands.generic.snytax", new Object[0]); + } + + public SyntaxErrorException(String message, Object... replacements) { + super(message, replacements); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/WrongUsageException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/WrongUsageException.java new file mode 100644 index 0000000..3c684ea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/WrongUsageException.java @@ -0,0 +1,36 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.SyntaxErrorException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WrongUsageException extends SyntaxErrorException { + + static { + __checkIntegratedContextValid("net/minecraft/command/WrongUsageException"); + } + + public WrongUsageException(String message, Object... replacements) { + super(message, replacements); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandAchievement.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandAchievement.java new file mode 100644 index 0000000..5cea81d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandAchievement.java @@ -0,0 +1,205 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.Achievement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandAchievement extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandAchievement"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "achievement"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.achievement.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.achievement.usage", new Object[0]); + } else { + final StatBase statbase = StatList.getOneShotStat(parArrayOfString[1]); + if (statbase == null && !parArrayOfString[1].equals("*")) { + throw new CommandException("commands.achievement.unknownAchievement", + new Object[] { parArrayOfString[1] }); + } else { + final EntityPlayerMP entityplayermp = parArrayOfString.length >= 3 + ? getPlayer(parICommandSender, parArrayOfString[2]) + : getCommandSenderAsPlayer(parICommandSender); + boolean flag = parArrayOfString[0].equalsIgnoreCase("give"); + boolean flag1 = parArrayOfString[0].equalsIgnoreCase("take"); + if (flag || flag1) { + if (statbase == null) { + if (flag) { + for (Achievement achievement4 : AchievementList.achievementList) { + entityplayermp.triggerAchievement(achievement4); + } + + notifyOperators(parICommandSender, this, "commands.achievement.give.success.all", + new Object[] { entityplayermp.getName() }); + } else if (flag1) { + for (Achievement achievement5 : Lists.reverse(AchievementList.achievementList)) { + entityplayermp.func_175145_a(achievement5); + } + + notifyOperators(parICommandSender, this, "commands.achievement.take.success.all", + new Object[] { entityplayermp.getName() }); + } + + } else { + if (statbase instanceof Achievement) { + Achievement achievement = (Achievement) statbase; + if (flag) { + if (entityplayermp.getStatFile().hasAchievementUnlocked(achievement)) { + throw new CommandException("commands.achievement.alreadyHave", + new Object[] { entityplayermp.getName(), statbase.func_150955_j() }); + } + + ArrayList arraylist; + for (arraylist = Lists.newArrayList(); achievement.parentAchievement != null + && !entityplayermp.getStatFile().hasAchievementUnlocked( + achievement.parentAchievement); achievement = achievement.parentAchievement) { + arraylist.add(achievement.parentAchievement); + } + + for (Achievement achievement1 : (List) Lists.reverse(arraylist)) { + entityplayermp.triggerAchievement(achievement1); + } + } else if (flag1) { + if (!entityplayermp.getStatFile().hasAchievementUnlocked(achievement)) { + throw new CommandException("commands.achievement.dontHave", + new Object[] { entityplayermp.getName(), statbase.func_150955_j() }); + } + + ArrayList arraylist1 = Lists.newArrayList(Iterators.filter( + AchievementList.achievementList.iterator(), new Predicate() { + public boolean apply(Achievement achievement7) { + return entityplayermp.getStatFile().hasAchievementUnlocked(achievement7) + && achievement7 != statbase; + } + })); + ArrayList arraylist2 = Lists.newArrayList(arraylist1); + + for (Achievement achievement2 : (ArrayList) arraylist1) { + Achievement achievement3 = achievement2; + + boolean flag2; + for (flag2 = false; achievement3 != null; achievement3 = achievement3.parentAchievement) { + if (achievement3 == statbase) { + flag2 = true; + } + } + + if (!flag2) { + for (achievement3 = achievement2; achievement3 != null; achievement3 = achievement3.parentAchievement) { + arraylist2.remove(achievement2); + } + } + } + + for (Achievement achievement6 : (ArrayList) arraylist2) { + entityplayermp.func_175145_a(achievement6); + } + } + } + + if (flag) { + entityplayermp.triggerAchievement(statbase); + notifyOperators(parICommandSender, this, "commands.achievement.give.success.one", + new Object[] { entityplayermp.getName(), statbase.func_150955_j() }); + } else if (flag1) { + entityplayermp.func_175145_a(statbase); + notifyOperators(parICommandSender, this, "commands.achievement.take.success.one", + new Object[] { statbase.func_150955_j(), entityplayermp.getName() }); + } + + } + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + if (astring.length == 1) { + return getListOfStringsMatchingLastWord(astring, new String[] { "give", "take" }); + } else if (astring.length != 2) { + return astring.length == 3 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : null; + } else { + ArrayList arraylist = Lists.newArrayList(); + + for (StatBase statbase : StatList.allStats) { + arraylist.add(statbase.statId); + } + + return getListOfStringsMatchingLastWord(astring, arraylist); + } + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBlockLogic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBlockLogic.java new file mode 100644 index 0000000..d116cb6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBlockLogic.java @@ -0,0 +1,247 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.Callable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class CommandBlockLogic implements ICommandSender { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandBlockLogic"); + } + + /**+ + * The formatting for the timestamp on commands run. + */ + private static final SimpleDateFormat timestampFormat = EagRuntime.fixDateFormat(new SimpleDateFormat("HH:mm:ss")); + private int successCount; + private boolean trackOutput = true; + /**+ + * The previously run command. + */ + private IChatComponent lastOutput = null; + /**+ + * The command stored in the command block. + */ + private String commandStored = ""; + /**+ + * The custom name of the command block. (defaults to "@") + */ + private String customName = "@"; + private final CommandResultStats resultStats = new CommandResultStats(); + + /**+ + * returns the successCount int. + */ + public int getSuccessCount() { + return this.successCount; + } + + /**+ + * Returns the lastOutput. + */ + public IChatComponent getLastOutput() { + return this.lastOutput; + } + + /**+ + * Stores data to NBT format. + */ + public void writeDataToNBT(NBTTagCompound tagCompound) { + tagCompound.setString("Command", this.commandStored); + tagCompound.setInteger("SuccessCount", this.successCount); + tagCompound.setString("CustomName", this.customName); + tagCompound.setBoolean("TrackOutput", this.trackOutput); + if (this.lastOutput != null && this.trackOutput) { + tagCompound.setString("LastOutput", IChatComponent.Serializer.componentToJson(this.lastOutput)); + } + + this.resultStats.writeStatsToNBT(tagCompound); + } + + /**+ + * Reads NBT formatting and stored data into variables. + */ + public void readDataFromNBT(NBTTagCompound nbt) { + this.commandStored = nbt.getString("Command"); + this.successCount = nbt.getInteger("SuccessCount"); + if (nbt.hasKey("CustomName", 8)) { + this.customName = nbt.getString("CustomName"); + } + + if (nbt.hasKey("TrackOutput", 1)) { + this.trackOutput = nbt.getBoolean("TrackOutput"); + } + + if (nbt.hasKey("LastOutput", 8) && this.trackOutput) { + this.lastOutput = IChatComponent.Serializer.jsonToComponent(nbt.getString("LastOutput")); + } + + this.resultStats.readStatsFromNBT(nbt); + } + + /**+ + * Returns {@code true} if the CommandSender is allowed to + * execute the command, {@code false} if not + */ + public boolean canCommandSenderUseCommand(int i, String var2) { + return i <= 2; + } + + /**+ + * Sets the command. + */ + public void setCommand(String command) { + this.commandStored = command; + this.successCount = 0; + } + + /**+ + * Returns the command of the command block. + */ + public String getCommand() { + return this.commandStored; + } + + public void trigger(World worldIn) { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + if (minecraftserver != null && minecraftserver.isCommandBlockEnabled()) { + ICommandManager icommandmanager = minecraftserver.getCommandManager(); + + try { + this.lastOutput = null; + this.successCount = icommandmanager.executeCommand(this, this.commandStored); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Executing command block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Command to be executed"); + crashreportcategory.addCrashSectionCallable("Command", new Callable() { + public String call() throws Exception { + return CommandBlockLogic.this.getCommand(); + } + }); + crashreportcategory.addCrashSectionCallable("Name", new Callable() { + public String call() throws Exception { + return CommandBlockLogic.this.getName(); + } + }); + throw new ReportedException(crashreport); + } + } else { + this.successCount = 0; + } + + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.customName; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return new ChatComponentText(this.getName()); + } + + public void setName(String parString1) { + this.customName = parString1; + } + + /**+ + * Send a chat message to the CommandSender + */ + public void addChatMessage(IChatComponent ichatcomponent) { + if (this.trackOutput && this.getEntityWorld() != null) { + this.lastOutput = (new ChatComponentText("[" + timestampFormat.format(new Date()) + "] ")) + .appendSibling(ichatcomponent); + this.updateCommand(); + } + + } + + /**+ + * Returns true if the command sender should be sent feedback + * about executed commands + */ + public boolean sendCommandFeedback() { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + return minecraftserver == null + || minecraftserver.worldServers[0].getGameRules().getBoolean("commandBlockOutput"); + } + + public void setCommandStat(CommandResultStats.Type commandresultstats$type, int i) { + this.resultStats.func_179672_a(this, commandresultstats$type, i); + } + + public abstract void updateCommand(); + + public abstract int func_145751_f(); + + public abstract void func_145757_a(ByteBuf var1); + + public void setLastOutput(IChatComponent lastOutputMessage) { + this.lastOutput = lastOutputMessage; + } + + public void setTrackOutput(boolean shouldTrackOutput) { + this.trackOutput = shouldTrackOutput; + } + + public boolean shouldTrackOutput() { + return this.trackOutput; + } + + public boolean tryOpenEditCommandBlock(EntityPlayer playerIn) { + if (!playerIn.capabilities.isCreativeMode) { + return false; + } else { + return true; + } + } + + public CommandResultStats getCommandResultStats() { + return this.resultStats; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBroadcast.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBroadcast.java new file mode 100644 index 0000000..a03f224 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBroadcast.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandBroadcast extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandBroadcast"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "say"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 1; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.say.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length > 0 && parArrayOfString[0].length() > 0) { + IChatComponent ichatcomponent = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 0, true); + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + ichatcomponent = new ChatComponentText( + StringUtils.translateControlCodesAlternate(ichatcomponent.getFormattedText())); + } + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation( + "chat.type.announcement", new Object[] { parICommandSender.getDisplayName(), ichatcomponent })); + } else { + throw new WrongUsageException("commands.say.usage", new Object[0]); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length >= 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandEmote.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandEmote.java new file mode 100644 index 0000000..a0bd64f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandEmote.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandEmote extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandEmote"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "me"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender sender) { + return "commands.me.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length <= 0) { + throw new WrongUsageException("commands.me.usage", new Object[0]); + } else { + IChatComponent ichatcomponent = getChatComponentFromNthArg(sender, args, 0, + !(sender instanceof EntityPlayer)); + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + ichatcomponent = new ChatComponentText( + StringUtils.translateControlCodesAlternate(ichatcomponent.getFormattedText())); + } + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation( + "chat.type.emote", new Object[] { sender.getDisplayName(), ichatcomponent })); + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandListPlayers.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandListPlayers.java new file mode 100644 index 0000000..7bfb14c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandListPlayers.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandListPlayers extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandListPlayers"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "list"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.players.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + int i = MinecraftServer.getServer().getCurrentPlayerCount(); + parICommandSender.addChatMessage(new ChatComponentTranslation("commands.players.list", + new Object[] { Integer.valueOf(i), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers()) })); + parICommandSender.addChatMessage(new ChatComponentText(MinecraftServer.getServer().getConfigurationManager() + .func_181058_b(parArrayOfString.length > 0 && "uuids".equalsIgnoreCase(parArrayOfString[0])))); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessage.java new file mode 100644 index 0000000..9d67b25 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessage.java @@ -0,0 +1,124 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.Arrays; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandMessage extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandMessage"); + } + + /**+ + * Gets a list of aliases for this command + */ + public List getCommandAliases() { + return Arrays.asList(new String[] { "w", "msg" }); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "tell"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.message.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.message.usage", new Object[0]); + } else { + EntityPlayerMP entityplayermp = getPlayer(parICommandSender, parArrayOfString[0]); + if (entityplayermp == parICommandSender) { + throw new PlayerNotFoundException("commands.message.sameTarget", new Object[0]); + } else { + IChatComponent ichatcomponent = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 1, + !(parICommandSender instanceof EntityPlayer)); + if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + ichatcomponent = new ChatComponentText( + StringUtils.translateControlCodesAlternate(ichatcomponent.getFormattedText())); + } + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.message.display.incoming", + new Object[] { parICommandSender.getDisplayName(), ichatcomponent.createCopy() }); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation( + "commands.message.display.outgoing", + new Object[] { entityplayermp.getDisplayName(), ichatcomponent.createCopy() }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY) + .setItalic(Boolean.valueOf(true)); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.GRAY) + .setItalic(Boolean.valueOf(true)); + entityplayermp.addChatMessage(chatcomponenttranslation); + parICommandSender.addChatMessage(chatcomponenttranslation1); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessageRaw.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessageRaw.java new file mode 100644 index 0000000..330cac6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessageRaw.java @@ -0,0 +1,106 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; + +import org.json.JSONException; + +import net.lax1dude.eaglercraft.v1_8.ExceptionUtils; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.SyntaxErrorException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentProcessor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandMessageRaw extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandMessageRaw"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "tellraw"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.tellraw.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 2) { + throw new WrongUsageException("commands.tellraw.usage", new Object[0]); + } else { + EntityPlayerMP entityplayermp = getPlayer(parICommandSender, parArrayOfString[0]); + String s = buildString(parArrayOfString, 1); + + try { + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + entityplayermp.addChatMessage( + ChatComponentProcessor.processComponent(parICommandSender, ichatcomponent, entityplayermp)); + } catch (JSONException jsonparseexception) { + Throwable throwable = ExceptionUtils.getRootCause(jsonparseexception); + throw new SyntaxErrorException("commands.tellraw.jsonException", + new Object[] { throwable == null ? "" : throwable.getMessage() }); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : null; + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandScoreboard.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandScoreboard.java new file mode 100644 index 0000000..d32f08d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandScoreboard.java @@ -0,0 +1,1068 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.SyntaxErrorException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandScoreboard extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandScoreboard"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "scoreboard"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.scoreboard.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (!this.func_175780_b(parICommandSender, parArrayOfString)) { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.scoreboard.usage", new Object[0]); + } else { + if (parArrayOfString[0].equalsIgnoreCase("objectives")) { + if (parArrayOfString.length == 1) { + throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); + } + + if (parArrayOfString[1].equalsIgnoreCase("list")) { + this.listObjectives(parICommandSender); + } else if (parArrayOfString[1].equalsIgnoreCase("add")) { + if (parArrayOfString.length < 4) { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); + } + + this.addObjective(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("remove")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.scoreboard.objectives.remove.usage", new Object[0]); + } + + this.removeObjective(parICommandSender, parArrayOfString[2]); + } else { + if (!parArrayOfString[1].equalsIgnoreCase("setdisplay")) { + throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); + } + + if (parArrayOfString.length != 3 && parArrayOfString.length != 4) { + throw new WrongUsageException("commands.scoreboard.objectives.setdisplay.usage", + new Object[0]); + } + + this.setObjectiveDisplay(parICommandSender, parArrayOfString, 2); + } + } else if (parArrayOfString[0].equalsIgnoreCase("players")) { + if (parArrayOfString.length == 1) { + throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); + } + + if (parArrayOfString[1].equalsIgnoreCase("list")) { + if (parArrayOfString.length > 3) { + throw new WrongUsageException("commands.scoreboard.players.list.usage", new Object[0]); + } + + this.listPlayers(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("add")) { + if (parArrayOfString.length < 5) { + throw new WrongUsageException("commands.scoreboard.players.add.usage", new Object[0]); + } + + this.setPlayer(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("remove")) { + if (parArrayOfString.length < 5) { + throw new WrongUsageException("commands.scoreboard.players.remove.usage", new Object[0]); + } + + this.setPlayer(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("set")) { + if (parArrayOfString.length < 5) { + throw new WrongUsageException("commands.scoreboard.players.set.usage", new Object[0]); + } + + this.setPlayer(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("reset")) { + if (parArrayOfString.length != 3 && parArrayOfString.length != 4) { + throw new WrongUsageException("commands.scoreboard.players.reset.usage", new Object[0]); + } + + this.resetPlayers(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("enable")) { + if (parArrayOfString.length != 4) { + throw new WrongUsageException("commands.scoreboard.players.enable.usage", new Object[0]); + } + + this.func_175779_n(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("test")) { + if (parArrayOfString.length != 5 && parArrayOfString.length != 6) { + throw new WrongUsageException("commands.scoreboard.players.test.usage", new Object[0]); + } + + this.func_175781_o(parICommandSender, parArrayOfString, 2); + } else { + if (!parArrayOfString[1].equalsIgnoreCase("operation")) { + throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); + } + + if (parArrayOfString.length != 7) { + throw new WrongUsageException("commands.scoreboard.players.operation.usage", new Object[0]); + } + + this.func_175778_p(parICommandSender, parArrayOfString, 2); + } + } else { + if (!parArrayOfString[0].equalsIgnoreCase("teams")) { + throw new WrongUsageException("commands.scoreboard.usage", new Object[0]); + } + + if (parArrayOfString.length == 1) { + throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); + } + + if (parArrayOfString[1].equalsIgnoreCase("list")) { + if (parArrayOfString.length > 3) { + throw new WrongUsageException("commands.scoreboard.teams.list.usage", new Object[0]); + } + + this.listTeams(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("add")) { + if (parArrayOfString.length < 3) { + throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); + } + + this.addTeam(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("remove")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.scoreboard.teams.remove.usage", new Object[0]); + } + + this.removeTeam(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("empty")) { + if (parArrayOfString.length != 3) { + throw new WrongUsageException("commands.scoreboard.teams.empty.usage", new Object[0]); + } + + this.emptyTeam(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("join")) { + if (parArrayOfString.length < 4 + && (parArrayOfString.length != 3 || !(parICommandSender instanceof EntityPlayer))) { + throw new WrongUsageException("commands.scoreboard.teams.join.usage", new Object[0]); + } + + this.joinTeam(parICommandSender, parArrayOfString, 2); + } else if (parArrayOfString[1].equalsIgnoreCase("leave")) { + if (parArrayOfString.length < 3 && !(parICommandSender instanceof EntityPlayer)) { + throw new WrongUsageException("commands.scoreboard.teams.leave.usage", new Object[0]); + } + + this.leaveTeam(parICommandSender, parArrayOfString, 2); + } else { + if (!parArrayOfString[1].equalsIgnoreCase("option")) { + throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); + } + + if (parArrayOfString.length != 4 && parArrayOfString.length != 5) { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + + this.setTeamOption(parICommandSender, parArrayOfString, 2); + } + } + + } + } + } + + private boolean func_175780_b(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + int i = -1; + + for (int j = 0; j < parArrayOfString.length; ++j) { + if (this.isUsernameIndex(parArrayOfString, j) && "*".equals(parArrayOfString[j])) { + if (i >= 0) { + throw new CommandException("commands.scoreboard.noMultiWildcard", new Object[0]); + } + + i = j; + } + } + + if (i < 0) { + return false; + } else { + ArrayList arraylist1 = Lists.newArrayList(this.getScoreboard().getObjectiveNames()); + String s = parArrayOfString[i]; + ArrayList arraylist = Lists.newArrayList(); + + for (String s1 : (ArrayList) arraylist1) { + parArrayOfString[i] = s1; + + try { + this.processCommand(parICommandSender, parArrayOfString); + arraylist.add(s1); + } catch (CommandException commandexception) { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + commandexception.getMessage(), commandexception.getErrorObjects()); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + parICommandSender.addChatMessage(chatcomponenttranslation); + } + } + + parArrayOfString[i] = s; + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, arraylist.size()); + if (arraylist.size() == 0) { + throw new WrongUsageException("commands.scoreboard.allMatchesFailed", new Object[0]); + } else { + return true; + } + } + } + + protected Scoreboard getScoreboard() { + return MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + } + + protected ScoreObjective getObjective(String name, boolean edit) throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(name); + if (scoreobjective == null) { + throw new CommandException("commands.scoreboard.objectiveNotFound", new Object[] { name }); + } else if (edit && scoreobjective.getCriteria().isReadOnly()) { + throw new CommandException("commands.scoreboard.objectiveReadOnly", new Object[] { name }); + } else { + return scoreobjective; + } + } + + protected ScorePlayerTeam getTeam(String name) throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + ScorePlayerTeam scoreplayerteam = scoreboard.getTeam(name); + if (scoreplayerteam == null) { + throw new CommandException("commands.scoreboard.teamNotFound", new Object[] { name }); + } else { + return scoreplayerteam; + } + } + + protected void addObjective(ICommandSender sender, String[] args, int index) throws CommandException { + String s = args[index++]; + String s1 = args[index++]; + Scoreboard scoreboard = this.getScoreboard(); + IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria) IScoreObjectiveCriteria.INSTANCES + .get(s1); + if (iscoreobjectivecriteria == null) { + throw new WrongUsageException("commands.scoreboard.objectives.add.wrongType", new Object[] { s1 }); + } else if (scoreboard.getObjective(s) != null) { + throw new CommandException("commands.scoreboard.objectives.add.alreadyExists", new Object[] { s }); + } else if (s.length() > 16) { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.tooLong", + new Object[] { s, Integer.valueOf(16) }); + } else if (s.length() == 0) { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); + } else { + if (args.length > index) { + String s2 = getChatComponentFromNthArg(sender, args, index).getUnformattedText(); + if (s2.length() > 32) { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.displayTooLong", + new Object[] { s2, Integer.valueOf(32) }); + } + + if (s2.length() > 0) { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria).setDisplayName(s2); + } else { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria); + } + } else { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria); + } + + notifyOperators(sender, this, "commands.scoreboard.objectives.add.success", new Object[] { s }); + } + } + + protected void addTeam(ICommandSender sender, String[] args, int index) throws CommandException { + String s = args[index++]; + Scoreboard scoreboard = this.getScoreboard(); + if (scoreboard.getTeam(s) != null) { + throw new CommandException("commands.scoreboard.teams.add.alreadyExists", new Object[] { s }); + } else if (s.length() > 16) { + throw new SyntaxErrorException("commands.scoreboard.teams.add.tooLong", + new Object[] { s, Integer.valueOf(16) }); + } else if (s.length() == 0) { + throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); + } else { + if (args.length > index) { + String s1 = getChatComponentFromNthArg(sender, args, index).getUnformattedText(); + if (s1.length() > 32) { + throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", + new Object[] { s1, Integer.valueOf(32) }); + } + + if (s1.length() > 0) { + scoreboard.createTeam(s).setTeamName(s1); + } else { + scoreboard.createTeam(s); + } + } else { + scoreboard.createTeam(s); + } + + notifyOperators(sender, this, "commands.scoreboard.teams.add.success", new Object[] { s }); + } + } + + protected void setTeamOption(ICommandSender sender, String[] args, int index) throws CommandException { + ScorePlayerTeam scoreplayerteam = this.getTeam(args[index++]); + if (scoreplayerteam != null) { + String s = args[index++].toLowerCase(); + if (!s.equalsIgnoreCase("color") && !s.equalsIgnoreCase("friendlyfire") + && !s.equalsIgnoreCase("seeFriendlyInvisibles") && !s.equalsIgnoreCase("nametagVisibility") + && !s.equalsIgnoreCase("deathMessageVisibility")) { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } else if (args.length == 4) { + if (s.equalsIgnoreCase("color")) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] { s, + joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false)) }); + } else if (!s.equalsIgnoreCase("friendlyfire") && !s.equalsIgnoreCase("seeFriendlyInvisibles")) { + if (!s.equalsIgnoreCase("nametagVisibility") && !s.equalsIgnoreCase("deathMessageVisibility")) { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } else { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", + new Object[] { s, joinNiceString(Team.EnumVisible.func_178825_a()) }); + } + } else { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] { s, + joinNiceStringFromCollection(Arrays.asList(new String[] { "true", "false" })) }); + } + } else { + String s1 = args[index]; + if (s.equalsIgnoreCase("color")) { + EnumChatFormatting enumchatformatting = EnumChatFormatting.getValueByName(s1); + if (enumchatformatting == null || enumchatformatting.isFancyStyling()) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] { s, + joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false)) }); + } + + scoreplayerteam.setChatFormat(enumchatformatting); + scoreplayerteam.setNamePrefix(enumchatformatting.toString()); + scoreplayerteam.setNameSuffix(EnumChatFormatting.RESET.toString()); + } else if (s.equalsIgnoreCase("friendlyfire")) { + if (!s1.equalsIgnoreCase("true") && !s1.equalsIgnoreCase("false")) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] { s, + joinNiceStringFromCollection(Arrays.asList(new String[] { "true", "false" })) }); + } + + scoreplayerteam.setAllowFriendlyFire(s1.equalsIgnoreCase("true")); + } else if (s.equalsIgnoreCase("seeFriendlyInvisibles")) { + if (!s1.equalsIgnoreCase("true") && !s1.equalsIgnoreCase("false")) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] { s, + joinNiceStringFromCollection(Arrays.asList(new String[] { "true", "false" })) }); + } + + scoreplayerteam.setSeeFriendlyInvisiblesEnabled(s1.equalsIgnoreCase("true")); + } else if (s.equalsIgnoreCase("nametagVisibility")) { + Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(s1); + if (team$enumvisible == null) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", + new Object[] { s, joinNiceString(Team.EnumVisible.func_178825_a()) }); + } + + scoreplayerteam.setNameTagVisibility(team$enumvisible); + } else if (s.equalsIgnoreCase("deathMessageVisibility")) { + Team.EnumVisible team$enumvisible1 = Team.EnumVisible.func_178824_a(s1); + if (team$enumvisible1 == null) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", + new Object[] { s, joinNiceString(Team.EnumVisible.func_178825_a()) }); + } + + scoreplayerteam.setDeathMessageVisibility(team$enumvisible1); + } + + notifyOperators(sender, this, "commands.scoreboard.teams.option.success", + new Object[] { s, scoreplayerteam.getRegisteredName(), s1 }); + } + } + } + + protected void removeTeam(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + ScorePlayerTeam scoreplayerteam = this.getTeam(parArrayOfString[parInt1]); + if (scoreplayerteam != null) { + scoreboard.removeTeam(scoreplayerteam); + notifyOperators(parICommandSender, this, "commands.scoreboard.teams.remove.success", + new Object[] { scoreplayerteam.getRegisteredName() }); + } + } + + protected void listTeams(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + if (parArrayOfString.length > parInt1) { + ScorePlayerTeam scoreplayerteam = this.getTeam(parArrayOfString[parInt1]); + if (scoreplayerteam == null) { + return; + } + + Collection collection = scoreplayerteam.getMembershipCollection(); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection.size()); + if (collection.size() <= 0) { + throw new CommandException("commands.scoreboard.teams.list.player.empty", + new Object[] { scoreplayerteam.getRegisteredName() }); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.scoreboard.teams.list.player.count", + new Object[] { Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName() }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation); + parICommandSender.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray()))); + } else { + Collection collection1 = scoreboard.getTeams(); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection1.size()); + if (collection1.size() <= 0) { + throw new CommandException("commands.scoreboard.teams.list.empty", new Object[0]); + } + + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation( + "commands.scoreboard.teams.list.count", new Object[] { Integer.valueOf(collection1.size()) }); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation1); + + for (ScorePlayerTeam scoreplayerteam1 : (Collection) collection1) { + parICommandSender.addChatMessage(new ChatComponentTranslation("commands.scoreboard.teams.list.entry", + new Object[] { scoreplayerteam1.getRegisteredName(), scoreplayerteam1.getTeamName(), + Integer.valueOf(scoreplayerteam1.getMembershipCollection().size()) })); + } + } + + } + + protected void joinTeam(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + String s = parArrayOfString[parInt1++]; + HashSet hashset = Sets.newHashSet(); + HashSet hashset1 = Sets.newHashSet(); + if (parICommandSender instanceof EntityPlayer && parInt1 == parArrayOfString.length) { + String s4 = getCommandSenderAsPlayer(parICommandSender).getName(); + if (scoreboard.addPlayerToTeam(s4, s)) { + hashset.add(s4); + } else { + hashset1.add(s4); + } + } else { + while (parInt1 < parArrayOfString.length) { + String s1 = parArrayOfString[parInt1++]; + if (s1.startsWith("@")) { + for (Entity entity : func_175763_c(parICommandSender, s1)) { + String s3 = getEntityName(parICommandSender, entity.getUniqueID().toString()); + if (scoreboard.addPlayerToTeam(s3, s)) { + hashset.add(s3); + } else { + hashset1.add(s3); + } + } + } else { + String s2 = getEntityName(parICommandSender, s1); + if (scoreboard.addPlayerToTeam(s2, s)) { + hashset.add(s2); + } else { + hashset1.add(s2); + } + } + } + } + + if (!hashset.isEmpty()) { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, hashset.size()); + notifyOperators(parICommandSender, this, "commands.scoreboard.teams.join.success", new Object[] { + Integer.valueOf(hashset.size()), s, joinNiceString(hashset.toArray(new String[hashset.size()])) }); + } + + if (!hashset1.isEmpty()) { + throw new CommandException("commands.scoreboard.teams.join.failure", + new Object[] { Integer.valueOf(hashset1.size()), s, + joinNiceString(hashset1.toArray(new String[hashset1.size()])) }); + } + } + + protected void leaveTeam(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + HashSet hashset = Sets.newHashSet(); + HashSet hashset1 = Sets.newHashSet(); + if (parICommandSender instanceof EntityPlayer && parInt1 == parArrayOfString.length) { + String s3 = getCommandSenderAsPlayer(parICommandSender).getName(); + if (scoreboard.removePlayerFromTeams(s3)) { + hashset.add(s3); + } else { + hashset1.add(s3); + } + } else { + while (parInt1 < parArrayOfString.length) { + String s = parArrayOfString[parInt1++]; + if (s.startsWith("@")) { + for (Entity entity : func_175763_c(parICommandSender, s)) { + String s2 = getEntityName(parICommandSender, entity.getUniqueID().toString()); + if (scoreboard.removePlayerFromTeams(s2)) { + hashset.add(s2); + } else { + hashset1.add(s2); + } + } + } else { + String s1 = getEntityName(parICommandSender, s); + if (scoreboard.removePlayerFromTeams(s1)) { + hashset.add(s1); + } else { + hashset1.add(s1); + } + } + } + } + + if (!hashset.isEmpty()) { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, hashset.size()); + notifyOperators(parICommandSender, this, "commands.scoreboard.teams.leave.success", new Object[] { + Integer.valueOf(hashset.size()), joinNiceString(hashset.toArray(new String[hashset.size()])) }); + } + + if (!hashset1.isEmpty()) { + throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] { + Integer.valueOf(hashset1.size()), joinNiceString(hashset1.toArray(new String[hashset1.size()])) }); + } + } + + protected void emptyTeam(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + ScorePlayerTeam scoreplayerteam = this.getTeam(parArrayOfString[parInt1]); + if (scoreplayerteam != null) { + ArrayList arraylist = Lists.newArrayList(scoreplayerteam.getMembershipCollection()); + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, arraylist.size()); + if (arraylist.isEmpty()) { + throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", + new Object[] { scoreplayerteam.getRegisteredName() }); + } else { + for (String s : (ArrayList) arraylist) { + scoreboard.removePlayerFromTeam(s, scoreplayerteam); + } + + notifyOperators(parICommandSender, this, "commands.scoreboard.teams.empty.success", + new Object[] { Integer.valueOf(arraylist.size()), scoreplayerteam.getRegisteredName() }); + } + } + } + + protected void removeObjective(ICommandSender parICommandSender, String parString1) throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + ScoreObjective scoreobjective = this.getObjective(parString1, false); + scoreboard.removeObjective(scoreobjective); + notifyOperators(parICommandSender, this, "commands.scoreboard.objectives.remove.success", + new Object[] { parString1 }); + } + + protected void listObjectives(ICommandSender parICommandSender) throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + Collection collection = scoreboard.getScoreObjectives(); + if (collection.size() <= 0) { + throw new CommandException("commands.scoreboard.objectives.list.empty", new Object[0]); + } else { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.scoreboard.objectives.list.count", new Object[] { Integer.valueOf(collection.size()) }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation); + + for (ScoreObjective scoreobjective : (Collection) collection) { + parICommandSender.addChatMessage(new ChatComponentTranslation( + "commands.scoreboard.objectives.list.entry", new Object[] { scoreobjective.getName(), + scoreobjective.getDisplayName(), scoreobjective.getCriteria().getName() })); + } + + } + } + + protected void setObjectiveDisplay(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + String s = parArrayOfString[parInt1++]; + int i = Scoreboard.getObjectiveDisplaySlotNumber(s); + ScoreObjective scoreobjective = null; + if (parArrayOfString.length == 4) { + scoreobjective = this.getObjective(parArrayOfString[parInt1], false); + } + + if (i < 0) { + throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[] { s }); + } else { + scoreboard.setObjectiveInDisplaySlot(i, scoreobjective); + if (scoreobjective != null) { + notifyOperators(parICommandSender, this, "commands.scoreboard.objectives.setdisplay.successSet", + new Object[] { Scoreboard.getObjectiveDisplaySlot(i), scoreobjective.getName() }); + } else { + notifyOperators(parICommandSender, this, "commands.scoreboard.objectives.setdisplay.successCleared", + new Object[] { Scoreboard.getObjectiveDisplaySlot(i) }); + } + + } + } + + protected void listPlayers(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + if (parArrayOfString.length > parInt1) { + String s = getEntityName(parICommandSender, parArrayOfString[parInt1]); + Map map = scoreboard.getObjectivesForEntity(s); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, map.size()); + if (map.size() <= 0) { + throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[] { s }); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "commands.scoreboard.players.list.player.count", new Object[] { Integer.valueOf(map.size()), s }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation); + + for (Score score : (Collection) map.values()) { + parICommandSender + .addChatMessage(new ChatComponentTranslation("commands.scoreboard.players.list.player.entry", + new Object[] { Integer.valueOf(score.getScorePoints()), + score.getObjective().getDisplayName(), score.getObjective().getName() })); + } + } else { + Collection collection = scoreboard.getObjectiveNames(); + parICommandSender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection.size()); + if (collection.size() <= 0) { + throw new CommandException("commands.scoreboard.players.list.empty", new Object[0]); + } + + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation( + "commands.scoreboard.players.list.count", new Object[] { Integer.valueOf(collection.size()) }); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + parICommandSender.addChatMessage(chatcomponenttranslation1); + parICommandSender.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray()))); + } + + } + + protected void setPlayer(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + String s = parArrayOfString[parInt1 - 1]; + int i = parInt1; + String s1 = getEntityName(parICommandSender, parArrayOfString[parInt1++]); + if (s1.length() > 40) { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", + new Object[] { s1, Integer.valueOf(40) }); + } else { + ScoreObjective scoreobjective = this.getObjective(parArrayOfString[parInt1++], true); + int j = s.equalsIgnoreCase("set") ? parseInt(parArrayOfString[parInt1++]) + : parseInt(parArrayOfString[parInt1++], 0); + if (parArrayOfString.length > parInt1) { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[i]); + + try { + NBTTagCompound nbttagcompound = JsonToNBT.getTagFromJson(buildString(parArrayOfString, parInt1)); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity.writeToNBT(nbttagcompound1); + if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true)) { + throw new CommandException("commands.scoreboard.players.set.tagMismatch", new Object[] { s1 }); + } + } catch (NBTException nbtexception) { + throw new CommandException("commands.scoreboard.players.set.tagError", + new Object[] { nbtexception.getMessage() }); + } + } + + Scoreboard scoreboard = this.getScoreboard(); + Score score = scoreboard.getValueFromObjective(s1, scoreobjective); + if (s.equalsIgnoreCase("set")) { + score.setScorePoints(j); + } else if (s.equalsIgnoreCase("add")) { + score.increseScore(j); + } else { + score.decreaseScore(j); + } + + notifyOperators(parICommandSender, this, "commands.scoreboard.players.set.success", + new Object[] { scoreobjective.getName(), s1, Integer.valueOf(score.getScorePoints()) }); + } + } + + protected void resetPlayers(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + String s = getEntityName(parICommandSender, parArrayOfString[parInt1++]); + if (parArrayOfString.length > parInt1) { + ScoreObjective scoreobjective = this.getObjective(parArrayOfString[parInt1++], false); + scoreboard.removeObjectiveFromEntity(s, scoreobjective); + notifyOperators(parICommandSender, this, "commands.scoreboard.players.resetscore.success", + new Object[] { scoreobjective.getName(), s }); + } else { + scoreboard.removeObjectiveFromEntity(s, (ScoreObjective) null); + notifyOperators(parICommandSender, this, "commands.scoreboard.players.reset.success", new Object[] { s }); + } + + } + + protected void func_175779_n(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + String s = getPlayerName(parICommandSender, parArrayOfString[parInt1++]); + if (s.length() > 40) { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", + new Object[] { s, Integer.valueOf(40) }); + } else { + ScoreObjective scoreobjective = this.getObjective(parArrayOfString[parInt1], false); + if (scoreobjective.getCriteria() != IScoreObjectiveCriteria.TRIGGER) { + throw new CommandException("commands.scoreboard.players.enable.noTrigger", + new Object[] { scoreobjective.getName() }); + } else { + Score score = scoreboard.getValueFromObjective(s, scoreobjective); + score.setLocked(false); + notifyOperators(parICommandSender, this, "commands.scoreboard.players.enable.success", + new Object[] { scoreobjective.getName(), s }); + } + } + } + + protected void func_175781_o(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + String s = getEntityName(parICommandSender, parArrayOfString[parInt1++]); + if (s.length() > 40) { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", + new Object[] { s, Integer.valueOf(40) }); + } else { + ScoreObjective scoreobjective = this.getObjective(parArrayOfString[parInt1++], false); + if (!scoreboard.entityHasObjective(s, scoreobjective)) { + throw new CommandException("commands.scoreboard.players.test.notFound", + new Object[] { scoreobjective.getName(), s }); + } else { + int i = parArrayOfString[parInt1].equals("*") ? Integer.MIN_VALUE : parseInt(parArrayOfString[parInt1]); + ++parInt1; + int j = parInt1 < parArrayOfString.length && !parArrayOfString[parInt1].equals("*") + ? parseInt(parArrayOfString[parInt1], i) + : Integer.MAX_VALUE; + Score score = scoreboard.getValueFromObjective(s, scoreobjective); + if (score.getScorePoints() >= i && score.getScorePoints() <= j) { + notifyOperators(parICommandSender, this, "commands.scoreboard.players.test.success", new Object[] { + Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j) }); + } else { + throw new CommandException("commands.scoreboard.players.test.failed", new Object[] { + Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j) }); + } + } + } + } + + protected void func_175778_p(ICommandSender parICommandSender, String[] parArrayOfString, int parInt1) + throws CommandException { + Scoreboard scoreboard = this.getScoreboard(); + String s = getEntityName(parICommandSender, parArrayOfString[parInt1++]); + ScoreObjective scoreobjective = this.getObjective(parArrayOfString[parInt1++], true); + String s1 = parArrayOfString[parInt1++]; + String s2 = getEntityName(parICommandSender, parArrayOfString[parInt1++]); + ScoreObjective scoreobjective1 = this.getObjective(parArrayOfString[parInt1], false); + if (s.length() > 40) { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", + new Object[] { s, Integer.valueOf(40) }); + } else if (s2.length() > 40) { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", + new Object[] { s2, Integer.valueOf(40) }); + } else { + Score score = scoreboard.getValueFromObjective(s, scoreobjective); + if (!scoreboard.entityHasObjective(s2, scoreobjective1)) { + throw new CommandException("commands.scoreboard.players.operation.notFound", + new Object[] { scoreobjective1.getName(), s2 }); + } else { + Score score1 = scoreboard.getValueFromObjective(s2, scoreobjective1); + if (s1.equals("+=")) { + score.setScorePoints(score.getScorePoints() + score1.getScorePoints()); + } else if (s1.equals("-=")) { + score.setScorePoints(score.getScorePoints() - score1.getScorePoints()); + } else if (s1.equals("*=")) { + score.setScorePoints(score.getScorePoints() * score1.getScorePoints()); + } else if (s1.equals("/=")) { + if (score1.getScorePoints() != 0) { + score.setScorePoints(score.getScorePoints() / score1.getScorePoints()); + } + } else if (s1.equals("%=")) { + if (score1.getScorePoints() != 0) { + score.setScorePoints(score.getScorePoints() % score1.getScorePoints()); + } + } else if (s1.equals("=")) { + score.setScorePoints(score1.getScorePoints()); + } else if (s1.equals("<")) { + score.setScorePoints(Math.min(score.getScorePoints(), score1.getScorePoints())); + } else if (s1.equals(">")) { + score.setScorePoints(Math.max(score.getScorePoints(), score1.getScorePoints())); + } else { + if (!s1.equals("><")) { + throw new CommandException("commands.scoreboard.players.operation.invalidOperation", + new Object[] { s1 }); + } + + int i = score.getScorePoints(); + score.setScorePoints(score1.getScorePoints()); + score1.setScorePoints(i); + } + + notifyOperators(parICommandSender, this, "commands.scoreboard.players.operation.success", + new Object[0]); + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + if (astring.length == 1) { + return getListOfStringsMatchingLastWord(astring, new String[] { "objectives", "players", "teams" }); + } else { + if (astring[0].equalsIgnoreCase("objectives")) { + if (astring.length == 2) { + return getListOfStringsMatchingLastWord(astring, + new String[] { "list", "add", "remove", "setdisplay" }); + } + + if (astring[1].equalsIgnoreCase("add")) { + if (astring.length == 4) { + Set set = IScoreObjectiveCriteria.INSTANCES.keySet(); + return getListOfStringsMatchingLastWord(astring, set); + } + } else if (astring[1].equalsIgnoreCase("remove")) { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, this.func_147184_a(false)); + } + } else if (astring[1].equalsIgnoreCase("setdisplay")) { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, Scoreboard.getDisplaySlotStrings()); + } + + if (astring.length == 4) { + return getListOfStringsMatchingLastWord(astring, this.func_147184_a(false)); + } + } + } else if (astring[0].equalsIgnoreCase("players")) { + if (astring.length == 2) { + return getListOfStringsMatchingLastWord(astring, + new String[] { "set", "add", "remove", "reset", "list", "enable", "test", "operation" }); + } + + if (!astring[1].equalsIgnoreCase("set") && !astring[1].equalsIgnoreCase("add") + && !astring[1].equalsIgnoreCase("remove") && !astring[1].equalsIgnoreCase("reset")) { + if (astring[1].equalsIgnoreCase("enable")) { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, + MinecraftServer.getServer().getAllUsernames()); + } + + if (astring.length == 4) { + return getListOfStringsMatchingLastWord(astring, this.func_175782_e()); + } + } else if (!astring[1].equalsIgnoreCase("list") && !astring[1].equalsIgnoreCase("test")) { + if (astring[1].equalsIgnoreCase("operation")) { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, + this.getScoreboard().getObjectiveNames()); + } + + if (astring.length == 4) { + return getListOfStringsMatchingLastWord(astring, this.func_147184_a(true)); + } + + if (astring.length == 5) { + return getListOfStringsMatchingLastWord(astring, + new String[] { "+=", "-=", "*=", "/=", "%=", "=", "<", ">", "><" }); + } + + if (astring.length == 6) { + return getListOfStringsMatchingLastWord(astring, + MinecraftServer.getServer().getAllUsernames()); + } + + if (astring.length == 7) { + return getListOfStringsMatchingLastWord(astring, this.func_147184_a(false)); + } + } + } else { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, this.getScoreboard().getObjectiveNames()); + } + + if (astring.length == 4 && astring[1].equalsIgnoreCase("test")) { + return getListOfStringsMatchingLastWord(astring, this.func_147184_a(false)); + } + } + } else { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()); + } + + if (astring.length == 4) { + return getListOfStringsMatchingLastWord(astring, this.func_147184_a(true)); + } + } + } else if (astring[0].equalsIgnoreCase("teams")) { + if (astring.length == 2) { + return getListOfStringsMatchingLastWord(astring, + new String[] { "add", "remove", "join", "leave", "empty", "list", "option" }); + } + + if (astring[1].equalsIgnoreCase("join")) { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, this.getScoreboard().getTeamNames()); + } + + if (astring.length >= 4) { + return getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()); + } + } else { + if (astring[1].equalsIgnoreCase("leave")) { + return getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()); + } + + if (!astring[1].equalsIgnoreCase("empty") && !astring[1].equalsIgnoreCase("list") + && !astring[1].equalsIgnoreCase("remove")) { + if (astring[1].equalsIgnoreCase("option")) { + if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, this.getScoreboard().getTeamNames()); + } + + if (astring.length == 4) { + return getListOfStringsMatchingLastWord(astring, new String[] { "color", "friendlyfire", + "seeFriendlyInvisibles", "nametagVisibility", "deathMessageVisibility" }); + } + + if (astring.length == 5) { + if (astring[3].equalsIgnoreCase("color")) { + return getListOfStringsMatchingLastWord(astring, + EnumChatFormatting.getValidValues(true, false)); + } + + if (astring[3].equalsIgnoreCase("nametagVisibility") + || astring[3].equalsIgnoreCase("deathMessageVisibility")) { + return getListOfStringsMatchingLastWord(astring, Team.EnumVisible.func_178825_a()); + } + + if (astring[3].equalsIgnoreCase("friendlyfire") + || astring[3].equalsIgnoreCase("seeFriendlyInvisibles")) { + return getListOfStringsMatchingLastWord(astring, new String[] { "true", "false" }); + } + } + } + } else if (astring.length == 3) { + return getListOfStringsMatchingLastWord(astring, this.getScoreboard().getTeamNames()); + } + } + } + + return null; + } + } + + protected List func_147184_a(boolean parFlag) { + Collection collection = this.getScoreboard().getScoreObjectives(); + ArrayList arraylist = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : (Collection) collection) { + if (!parFlag || !scoreobjective.getCriteria().isReadOnly()) { + arraylist.add(scoreobjective.getName()); + } + } + + return arraylist; + } + + protected List func_175782_e() { + Collection collection = this.getScoreboard().getScoreObjectives(); + ArrayList arraylist = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : (Collection) collection) { + if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER) { + arraylist.add(scoreobjective.getName()); + } + } + + return arraylist; + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] astring, int i) { + return !astring[0].equalsIgnoreCase("players") ? (astring[0].equalsIgnoreCase("teams") ? i == 2 : false) + : (astring.length > 1 && astring[1].equalsIgnoreCase("operation") ? i == 2 || i == 5 : i == 2); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetBlock.java new file mode 100644 index 0000000..822acea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetBlock.java @@ -0,0 +1,156 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandSetBlock extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandSetBlock"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "setblock"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.setblock.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 4) { + throw new WrongUsageException("commands.setblock.usage", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, false); + Block block = CommandBase.getBlockByText(parICommandSender, parArrayOfString[3]); + int i = 0; + if (parArrayOfString.length >= 5) { + i = parseInt(parArrayOfString[4], 0, 15); + } + + World world = parICommandSender.getEntityWorld(); + if (!world.isBlockLoaded(blockpos)) { + throw new CommandException("commands.setblock.outOfWorld", new Object[0]); + } else { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + if (parArrayOfString.length >= 7 && block.hasTileEntity()) { + String s = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 6).getUnformattedText(); + + try { + nbttagcompound = JsonToNBT.getTagFromJson(s); + flag = true; + } catch (NBTException nbtexception) { + throw new CommandException("commands.setblock.tagError", + new Object[] { nbtexception.getMessage() }); + } + } + + if (parArrayOfString.length >= 6) { + if (parArrayOfString[5].equals("destroy")) { + world.destroyBlock(blockpos, true); + if (block == Blocks.air) { + notifyOperators(parICommandSender, this, "commands.setblock.success", new Object[0]); + return; + } + } else if (parArrayOfString[5].equals("keep") && !world.isAirBlock(blockpos)) { + throw new CommandException("commands.setblock.noChange", new Object[0]); + } + } + + TileEntity tileentity1 = world.getTileEntity(blockpos); + if (tileentity1 != null) { + if (tileentity1 instanceof IInventory) { + ((IInventory) tileentity1).clear(); + } + + world.setBlockState(blockpos, Blocks.air.getDefaultState(), block == Blocks.air ? 2 : 4); + } + + IBlockState iblockstate = block.getStateFromMeta(i); + if (!world.setBlockState(blockpos, iblockstate, 2)) { + throw new CommandException("commands.setblock.noChange", new Object[0]); + } else { + if (flag) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity != null) { + nbttagcompound.setInteger("x", blockpos.getX()); + nbttagcompound.setInteger("y", blockpos.getY()); + nbttagcompound.setInteger("z", blockpos.getZ()); + tileentity.readFromNBT(nbttagcompound); + } + } + + world.notifyNeighborsRespectDebug(blockpos, iblockstate.getBlock()); + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 1); + notifyOperators(parICommandSender, this, "commands.setblock.success", new Object[0]); + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 && astring.length <= 3 ? func_175771_a(astring, 0, blockpos) + : (astring.length == 4 ? getListOfStringsMatchingLastWord(astring, Block.blockRegistry.getKeys()) + : (astring.length == 6 + ? getListOfStringsMatchingLastWord(astring, + new String[] { "replace", "destroy", "keep" }) + : null)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java new file mode 100644 index 0000000..12082d4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandSetDefaultSpawnpoint extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandSetDefaultSpawnpoint"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "setworldspawn"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.setworldspawn.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + BlockPos blockpos; + if (parArrayOfString.length == 0) { + blockpos = getCommandSenderAsPlayer(parICommandSender).getPosition(); + } else { + if (parArrayOfString.length != 3 || parICommandSender.getEntityWorld() == null) { + throw new WrongUsageException("commands.setworldspawn.usage", new Object[0]); + } + + blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, true); + } + + parICommandSender.getEntityWorld().setSpawnPoint(blockpos); + MinecraftServer.getServer().getConfigurationManager() + .sendPacketToAllPlayers(new S05PacketSpawnPosition(blockpos)); + notifyOperators(parICommandSender, this, "commands.setworldspawn.success", new Object[] { + Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()) }); + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 && astring.length <= 3 ? func_175771_a(astring, 0, blockpos) : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSummon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSummon.java new file mode 100644 index 0000000..d3610ae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSummon.java @@ -0,0 +1,158 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandSummon extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandSummon"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "summon"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.summon.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.summon.usage", new Object[0]); + } else { + String s = parArrayOfString[0]; + BlockPos blockpos = parICommandSender.getPosition(); + Vec3 vec3 = parICommandSender.getPositionVector(); + double d0 = vec3.xCoord; + double d1 = vec3.yCoord; + double d2 = vec3.zCoord; + if (parArrayOfString.length >= 4) { + d0 = parseDouble(d0, parArrayOfString[1], true); + d1 = parseDouble(d1, parArrayOfString[2], false); + d2 = parseDouble(d2, parArrayOfString[3], true); + blockpos = new BlockPos(d0, d1, d2); + } + + World world = parICommandSender.getEntityWorld(); + if (!world.isBlockLoaded(blockpos)) { + throw new CommandException("commands.summon.outOfWorld", new Object[0]); + } else if ("LightningBolt".equals(s)) { + world.addWeatherEffect(new EntityLightningBolt(world, d0, d1, d2)); + notifyOperators(parICommandSender, this, "commands.summon.success", new Object[0]); + } else { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + if (parArrayOfString.length >= 5) { + IChatComponent ichatcomponent = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 4); + + try { + nbttagcompound = JsonToNBT.getTagFromJson(ichatcomponent.getUnformattedText()); + flag = true; + } catch (NBTException nbtexception) { + throw new CommandException("commands.summon.tagError", + new Object[] { nbtexception.getMessage() }); + } + } + + nbttagcompound.setString("id", s); + + Entity entity2; + try { + entity2 = EntityList.createEntityFromNBT(nbttagcompound, world); + } catch (RuntimeException var19) { + throw new CommandException("commands.summon.failed", new Object[0]); + } + + if (entity2 == null) { + throw new CommandException("commands.summon.failed", new Object[0]); + } else { + entity2.setLocationAndAngles(d0, d1, d2, entity2.rotationYaw, entity2.rotationPitch); + if (!flag && entity2 instanceof EntityLiving) { + ((EntityLiving) entity2).onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entity2)), + (IEntityLivingData) null); + } + + world.spawnEntityInWorld(entity2); + Entity entity = entity2; + + for (NBTTagCompound nbttagcompound1 = nbttagcompound; entity != null && nbttagcompound1 + .hasKey("Riding", 10); nbttagcompound1 = nbttagcompound1.getCompoundTag("Riding")) { + Entity entity1 = EntityList.createEntityFromNBT(nbttagcompound1.getCompoundTag("Riding"), + world); + if (entity1 != null) { + entity1.setLocationAndAngles(d0, d1, d2, entity1.rotationYaw, entity1.rotationPitch); + world.spawnEntityInWorld(entity1); + entity.mountEntity(entity1); + } + + entity = entity1; + } + + notifyOperators(parICommandSender, this, "commands.summon.success", new Object[0]); + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length == 1 ? getListOfStringsMatchingLastWord(astring, EntityList.getEntityNameList()) + : (astring.length > 1 && astring.length <= 4 ? func_175771_a(astring, 1, blockpos) : null); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTeleport.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTeleport.java new file mode 100644 index 0000000..df43d72 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTeleport.java @@ -0,0 +1,196 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.EnumSet; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandTeleport extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandTeleport"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "tp"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.tp.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.tp.usage", new Object[0]); + } else { + byte b0 = 0; + Object object; + if (parArrayOfString.length != 2 && parArrayOfString.length != 4 && parArrayOfString.length != 6) { + object = getCommandSenderAsPlayer(parICommandSender); + } else { + object = func_175768_b(parICommandSender, parArrayOfString[0]); + b0 = 1; + } + + if (parArrayOfString.length != 1 && parArrayOfString.length != 2) { + if (parArrayOfString.length < b0 + 3) { + throw new WrongUsageException("commands.tp.usage", new Object[0]); + } else if (((Entity) object).worldObj != null) { + int i = b0 + 1; + CommandBase.CoordinateArg commandbase$coordinatearg = parseCoordinate(((Entity) object).posX, + parArrayOfString[b0], true); + CommandBase.CoordinateArg commandbase$coordinatearg1 = parseCoordinate(((Entity) object).posY, + parArrayOfString[i++], 0, 0, false); + CommandBase.CoordinateArg commandbase$coordinatearg2 = parseCoordinate(((Entity) object).posZ, + parArrayOfString[i++], true); + CommandBase.CoordinateArg commandbase$coordinatearg3 = parseCoordinate( + (double) ((Entity) object).rotationYaw, + parArrayOfString.length > i ? parArrayOfString[i++] : "~", false); + CommandBase.CoordinateArg commandbase$coordinatearg4 = parseCoordinate( + (double) ((Entity) object).rotationPitch, + parArrayOfString.length > i ? parArrayOfString[i] : "~", false); + if (object instanceof EntityPlayerMP) { + EnumSet enumset = EnumSet.noneOf(S08PacketPlayerPosLook.EnumFlags.class); + if (commandbase$coordinatearg.func_179630_c()) { + enumset.add(S08PacketPlayerPosLook.EnumFlags.X); + } + + if (commandbase$coordinatearg1.func_179630_c()) { + enumset.add(S08PacketPlayerPosLook.EnumFlags.Y); + } + + if (commandbase$coordinatearg2.func_179630_c()) { + enumset.add(S08PacketPlayerPosLook.EnumFlags.Z); + } + + if (commandbase$coordinatearg4.func_179630_c()) { + enumset.add(S08PacketPlayerPosLook.EnumFlags.X_ROT); + } + + if (commandbase$coordinatearg3.func_179630_c()) { + enumset.add(S08PacketPlayerPosLook.EnumFlags.Y_ROT); + } + + float f = (float) commandbase$coordinatearg3.func_179629_b(); + if (!commandbase$coordinatearg3.func_179630_c()) { + f = MathHelper.wrapAngleTo180_float(f); + } + + float f1 = (float) commandbase$coordinatearg4.func_179629_b(); + if (!commandbase$coordinatearg4.func_179630_c()) { + f1 = MathHelper.wrapAngleTo180_float(f1); + } + + if (f1 > 90.0F || f1 < -90.0F) { + f1 = MathHelper.wrapAngleTo180_float(180.0F - f1); + f = MathHelper.wrapAngleTo180_float(f + 180.0F); + } + + ((Entity) object).mountEntity((Entity) null); + ((EntityPlayerMP) object).playerNetServerHandler.setPlayerLocation( + commandbase$coordinatearg.func_179629_b(), commandbase$coordinatearg1.func_179629_b(), + commandbase$coordinatearg2.func_179629_b(), f, f1, enumset); + ((Entity) object).setRotationYawHead(f); + } else { + float f2 = (float) MathHelper.wrapAngleTo180_double(commandbase$coordinatearg3.func_179628_a()); + float f3 = (float) MathHelper.wrapAngleTo180_double(commandbase$coordinatearg4.func_179628_a()); + if (f3 > 90.0F || f3 < -90.0F) { + f3 = MathHelper.wrapAngleTo180_float(180.0F - f3); + f2 = MathHelper.wrapAngleTo180_float(f2 + 180.0F); + } + + ((Entity) object).setLocationAndAngles(commandbase$coordinatearg.func_179628_a(), + commandbase$coordinatearg1.func_179628_a(), commandbase$coordinatearg2.func_179628_a(), + f2, f3); + ((Entity) object).setRotationYawHead(f2); + } + + notifyOperators(parICommandSender, this, "commands.tp.success.coordinates", + new Object[] { ((Entity) object).getName(), + Double.valueOf(commandbase$coordinatearg.func_179628_a()), + Double.valueOf(commandbase$coordinatearg1.func_179628_a()), + Double.valueOf(commandbase$coordinatearg2.func_179628_a()) }); + } + } else { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[parArrayOfString.length - 1]); + if (entity.worldObj != ((Entity) object).worldObj) { + throw new CommandException("commands.tp.notSameDimension", new Object[0]); + } else { + ((Entity) object).mountEntity((Entity) null); + if (object instanceof EntityPlayerMP) { + ((EntityPlayerMP) object).playerNetServerHandler.setPlayerLocation(entity.posX, entity.posY, + entity.posZ, entity.rotationYaw, entity.rotationPitch); + } else { + ((Entity) object).setLocationAndAngles(entity.posX, entity.posY, entity.posZ, + entity.rotationYaw, entity.rotationPitch); + } + + notifyOperators(parICommandSender, this, "commands.tp.success", + new Object[] { ((Entity) object).getName(), entity.getName() }); + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length != 1 && astring.length != 2 ? null + : getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()); + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestFor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestFor.java new file mode 100644 index 0000000..564e319 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestFor.java @@ -0,0 +1,110 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandTestFor extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandTestFor"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "testfor"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.testfor.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 1) { + throw new WrongUsageException("commands.testfor.usage", new Object[0]); + } else { + Entity entity = func_175768_b(parICommandSender, parArrayOfString[0]); + NBTTagCompound nbttagcompound = null; + if (parArrayOfString.length >= 2) { + try { + nbttagcompound = JsonToNBT.getTagFromJson(buildString(parArrayOfString, 1)); + } catch (NBTException nbtexception) { + throw new CommandException("commands.testfor.tagError", new Object[] { nbtexception.getMessage() }); + } + } + + if (nbttagcompound != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity.writeToNBT(nbttagcompound1); + if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true)) { + throw new CommandException("commands.testfor.failure", new Object[] { entity.getName() }); + } + } + + notifyOperators(parICommandSender, this, "commands.testfor.success", new Object[] { entity.getName() }); + } + } + + /**+ + * Return whether the specified command parameter index is a + * username parameter. + */ + public boolean isUsernameIndex(String[] var1, int i) { + return i == 0; + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos var3) { + return astring.length == 1 + ? getListOfStringsMatchingLastWord(astring, MinecraftServer.getServer().getAllUsernames()) + : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestForBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestForBlock.java new file mode 100644 index 0000000..a43a2aa --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestForBlock.java @@ -0,0 +1,159 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.NumberInvalidException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CommandTestForBlock extends CommandBase { + + static { + __checkIntegratedContextValid("net/minecraft/command/server/CommandTestForBlock"); + } + + /**+ + * Gets the name of the command + */ + public String getCommandName() { + return "testforblock"; + } + + /**+ + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + /**+ + * Gets the usage string for the command. + */ + public String getCommandUsage(ICommandSender var1) { + return "commands.testforblock.usage"; + } + + /**+ + * Callback when the command is invoked + */ + public void processCommand(ICommandSender parICommandSender, String[] parArrayOfString) throws CommandException { + if (parArrayOfString.length < 4) { + throw new WrongUsageException("commands.testforblock.usage", new Object[0]); + } else { + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(parICommandSender, parArrayOfString, 0, false); + Block block = Block.getBlockFromName(parArrayOfString[3]); + if (block == null) { + throw new NumberInvalidException("commands.setblock.notFound", new Object[] { parArrayOfString[3] }); + } else { + int i = -1; + if (parArrayOfString.length >= 5) { + i = parseInt(parArrayOfString[4], -1, 15); + } + + World world = parICommandSender.getEntityWorld(); + if (!world.isBlockLoaded(blockpos)) { + throw new CommandException("commands.testforblock.outOfWorld", new Object[0]); + } else { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + if (parArrayOfString.length >= 6 && block.hasTileEntity()) { + String s = getChatComponentFromNthArg(parICommandSender, parArrayOfString, 5) + .getUnformattedText(); + + try { + nbttagcompound = JsonToNBT.getTagFromJson(s); + flag = true; + } catch (NBTException nbtexception) { + throw new CommandException("commands.setblock.tagError", + new Object[] { nbtexception.getMessage() }); + } + } + + IBlockState iblockstate = world.getBlockState(blockpos); + Block block1 = iblockstate.getBlock(); + if (block1 != block) { + throw new CommandException("commands.testforblock.failed.tile", + new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), + Integer.valueOf(blockpos.getZ()), block1.getLocalizedName(), + block.getLocalizedName() }); + } else { + if (i > -1) { + int j = iblockstate.getBlock().getMetaFromState(iblockstate); + if (j != i) { + throw new CommandException("commands.testforblock.failed.data", + new Object[] { Integer.valueOf(blockpos.getX()), + Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()), + Integer.valueOf(j), Integer.valueOf(i) }); + } + } + + if (flag) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity == null) { + throw new CommandException("commands.testforblock.failed.tileEntity", + new Object[] { Integer.valueOf(blockpos.getX()), + Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()) }); + } + + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound1); + if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true)) { + throw new CommandException("commands.testforblock.failed.nbt", + new Object[] { Integer.valueOf(blockpos.getX()), + Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()) }); + } + } + + parICommandSender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 1); + notifyOperators(parICommandSender, this, "commands.testforblock.success", + new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), + Integer.valueOf(blockpos.getZ()) }); + } + } + } + } + } + + /**+ + * Return a list of options when the user types TAB + */ + public List addTabCompletionOptions(ICommandSender var1, String[] astring, BlockPos blockpos) { + return astring.length > 0 && astring.length <= 3 ? func_175771_a(astring, 0, blockpos) + : (astring.length == 4 ? getListOfStringsMatchingLastWord(astring, Block.blockRegistry.getKeys()) + : null); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/creativetab/CreativeTabs.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/creativetab/CreativeTabs.java new file mode 100644 index 0000000..cb9cfe3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/creativetab/CreativeTabs.java @@ -0,0 +1,269 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class CreativeTabs { + + static { + __checkIntegratedContextValid("net/minecraft/creativetab/CreativeTabs"); + } + + public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; + public static final CreativeTabs tabBlock = new CreativeTabs(0, "buildingBlocks") { + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.brick_block); + } + }; + public static final CreativeTabs tabDecorations = new CreativeTabs(1, "decorations") { + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.double_plant); + } + + public int getIconItemDamage() { + return BlockDoublePlant.EnumPlantType.PAEONIA.getMeta(); + } + }; + public static final CreativeTabs tabRedstone = new CreativeTabs(2, "redstone") { + public Item getTabIconItem() { + return Items.redstone; + } + }; + public static final CreativeTabs tabTransport = new CreativeTabs(3, "transportation") { + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.golden_rail); + } + }; + public static final CreativeTabs tabMisc = (new CreativeTabs(4, "misc") { + public Item getTabIconItem() { + return Items.lava_bucket; + } + }).setRelevantEnchantmentTypes(new EnumEnchantmentType[] { EnumEnchantmentType.ALL }); + public static final CreativeTabs tabAllSearch = (new CreativeTabs(5, "search") { + public Item getTabIconItem() { + return Items.compass; + } + }).setBackgroundImageName("item_search.png"); + public static final CreativeTabs tabFood = new CreativeTabs(6, "food") { + public Item getTabIconItem() { + return Items.apple; + } + }; + public static final CreativeTabs tabTools = (new CreativeTabs(7, "tools") { + public Item getTabIconItem() { + return Items.iron_axe; + } + }).setRelevantEnchantmentTypes(new EnumEnchantmentType[] { EnumEnchantmentType.DIGGER, + EnumEnchantmentType.FISHING_ROD, EnumEnchantmentType.BREAKABLE }); + public static final CreativeTabs tabCombat = (new CreativeTabs(8, "combat") { + public Item getTabIconItem() { + return Items.golden_sword; + } + }).setRelevantEnchantmentTypes(new EnumEnchantmentType[] { EnumEnchantmentType.ARMOR, + EnumEnchantmentType.ARMOR_FEET, EnumEnchantmentType.ARMOR_HEAD, EnumEnchantmentType.ARMOR_LEGS, + EnumEnchantmentType.ARMOR_TORSO, EnumEnchantmentType.BOW, EnumEnchantmentType.WEAPON }); + public static final CreativeTabs tabBrewing = new CreativeTabs(9, "brewing") { + public Item getTabIconItem() { + return Items.potionitem; + } + }; + public static final CreativeTabs tabMaterials = new CreativeTabs(10, "materials") { + public Item getTabIconItem() { + return Items.stick; + } + }; + public static final CreativeTabs tabInventory = (new CreativeTabs(11, "inventory") { + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.chest); + } + }).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); + private final int tabIndex; + private final String tabLabel; + /**+ + * Texture to use. + */ + private String theTexture = "items.png"; + private boolean hasScrollbar = true; + /**+ + * Whether to draw the title in the foreground of the creative + * GUI + */ + private boolean drawTitle = true; + private EnumEnchantmentType[] enchantmentTypes; + private ItemStack iconItemStack; + + public CreativeTabs(int index, String label) { + this.tabIndex = index; + this.tabLabel = label; + creativeTabArray[index] = this; + } + + public int getTabIndex() { + return this.tabIndex; + } + + public String getTabLabel() { + return this.tabLabel; + } + + /**+ + * Gets the translated Label. + */ + public String getTranslatedTabLabel() { + return "itemGroup." + this.getTabLabel(); + } + + public ItemStack getIconItemStack() { + if (this.iconItemStack == null) { + this.iconItemStack = new ItemStack(this.getTabIconItem(), 1, this.getIconItemDamage()); + } + + return this.iconItemStack; + } + + public abstract Item getTabIconItem(); + + public int getIconItemDamage() { + return 0; + } + + public String getBackgroundImageName() { + return this.theTexture; + } + + public CreativeTabs setBackgroundImageName(String texture) { + this.theTexture = texture; + return this; + } + + public boolean drawInForegroundOfTab() { + return this.drawTitle; + } + + public CreativeTabs setNoTitle() { + this.drawTitle = false; + return this; + } + + public boolean shouldHidePlayerInventory() { + return this.hasScrollbar; + } + + public CreativeTabs setNoScrollbar() { + this.hasScrollbar = false; + return this; + } + + /**+ + * returns index % 6 + */ + public int getTabColumn() { + return this.tabIndex % 6; + } + + /**+ + * returns tabIndex < 6 + */ + public boolean isTabInFirstRow() { + return this.tabIndex < 6; + } + + /**+ + * Returns the enchantment types relevant to this tab + */ + public EnumEnchantmentType[] getRelevantEnchantmentTypes() { + return this.enchantmentTypes; + } + + /**+ + * Sets the enchantment types for populating this tab with + * enchanting books + */ + public CreativeTabs setRelevantEnchantmentTypes(EnumEnchantmentType... types) { + this.enchantmentTypes = types; + return this; + } + + public boolean hasRelevantEnchantmentType(EnumEnchantmentType enchantmentType) { + if (this.enchantmentTypes == null) { + return false; + } else { + for (EnumEnchantmentType enumenchantmenttype : this.enchantmentTypes) { + if (enumenchantmenttype == enchantmentType) { + return true; + } + } + + return false; + } + } + + /**+ + * only shows items which have tabToDisplayOn == this + */ + public void displayAllReleventItems(List parList) { + for (Item item : Item.itemRegistry) { + if (item != null && item.getCreativeTab() == this) { + item.getSubItems(item, this, parList); + } + } + + if (this.getRelevantEnchantmentTypes() != null) { + this.addEnchantmentBooksToList(parList, this.getRelevantEnchantmentTypes()); + } + + } + + /**+ + * Adds the enchantment books from the supplied + * EnumEnchantmentType to the given list. + */ + public void addEnchantmentBooksToList(List itemList, EnumEnchantmentType... enchantmentType) { + for (Enchantment enchantment : Enchantment.enchantmentsBookList) { + if (enchantment != null && enchantment.type != null) { + boolean flag = false; + + for (int i = 0; i < enchantmentType.length && !flag; ++i) { + if (enchantment.type == enchantmentType[i]) { + flag = true; + } + } + + if (flag) { + itemList.add(Items.enchanted_book + .getEnchantedItemStack(new EnchantmentData(enchantment, enchantment.getMaxLevel()))); + } + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java new file mode 100644 index 0000000..7668c14 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBehaviorDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BehaviorDefaultDispenseItem implements IBehaviorDispenseItem { + + static { + __checkIntegratedContextValid("net/minecraft/dispenser/BehaviorDefaultDispenseItem"); + } + + /**+ + * Dispenses the specified ItemStack from a dispenser. + */ + public final ItemStack dispense(IBlockSource source, ItemStack stack) { + ItemStack itemstack = this.dispenseStack(source, stack); + this.playDispenseSound(source); + this.spawnDispenseParticles(source, BlockDispenser.getFacing(source.getBlockMetadata())); + return itemstack; + } + + /**+ + * Dispense the specified stack, play the dispense sound and + * spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + IPosition iposition = BlockDispenser.getDispensePosition(iblocksource); + ItemStack itemstack1 = itemstack.splitStack(1); + doDispense(iblocksource.getWorld(), itemstack1, 6, enumfacing, iposition); + return itemstack; + } + + public static void doDispense(World worldIn, ItemStack stack, int speed, EnumFacing facing, IPosition position) { + double d0 = position.getX(); + double d1 = position.getY(); + double d2 = position.getZ(); + if (facing.getAxis() == EnumFacing.Axis.Y) { + d1 = d1 - 0.125D; + } else { + d1 = d1 - 0.15625D; + } + + EntityItem entityitem = new EntityItem(worldIn, d0, d1, d2, stack); + double d3 = worldIn.rand.nextDouble() * 0.1D + 0.2D; + entityitem.motionX = (double) facing.getFrontOffsetX() * d3; + entityitem.motionY = 0.20000000298023224D; + entityitem.motionZ = (double) facing.getFrontOffsetZ() * d3; + entityitem.motionX += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double) speed; + entityitem.motionY += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double) speed; + entityitem.motionZ += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double) speed; + worldIn.spawnEntityInWorld(entityitem); + } + + /**+ + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource iblocksource) { + iblocksource.getWorld().playAuxSFX(1000, iblocksource.getBlockPos(), 0); + } + + /**+ + * Order clients to display dispense particles from the + * specified block and facing. + */ + protected void spawnDispenseParticles(IBlockSource source, EnumFacing facingIn) { + source.getWorld().playAuxSFX(2000, source.getBlockPos(), this.func_82488_a(facingIn)); + } + + private int func_82488_a(EnumFacing facingIn) { + return facingIn.getFrontOffsetX() + 1 + (facingIn.getFrontOffsetZ() + 1) * 3; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorProjectileDispense.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorProjectileDispense.java new file mode 100644 index 0000000..eaf4ba8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorProjectileDispense.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IProjectile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem { + + static { + __checkIntegratedContextValid("net/minecraft/dispenser/BehaviorProjectileDispense"); + } + + /**+ + * Dispense the specified stack, play the dispense sound and + * spawn particles. + */ + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + World world = iblocksource.getWorld(); + IPosition iposition = BlockDispenser.getDispensePosition(iblocksource); + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + IProjectile iprojectile = this.getProjectileEntity(world, iposition); + iprojectile.setThrowableHeading((double) enumfacing.getFrontOffsetX(), + (double) ((float) enumfacing.getFrontOffsetY() + 0.1F), (double) enumfacing.getFrontOffsetZ(), + this.func_82500_b(), this.func_82498_a()); + world.spawnEntityInWorld((Entity) iprojectile); + itemstack.splitStack(1); + return itemstack; + } + + /**+ + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource iblocksource) { + iblocksource.getWorld().playAuxSFX(1002, iblocksource.getBlockPos(), 0); + } + + protected abstract IProjectile getProjectileEntity(World var1, IPosition var2); + + protected float func_82498_a() { + return 6.0F; + } + + protected float func_82500_b() { + return 1.1F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBehaviorDispenseItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBehaviorDispenseItem.java new file mode 100644 index 0000000..ded99e3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBehaviorDispenseItem.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IBehaviorDispenseItem { + IBehaviorDispenseItem itemDispenseBehaviorProvider = new IBehaviorDispenseItem() { + /**+ + * Dispenses the specified ItemStack from a dispenser. + */ + public ItemStack dispense(IBlockSource var1, ItemStack itemstack) { + return itemstack; + } + }; + + /**+ + * Dispenses the specified ItemStack from a dispenser. + */ + ItemStack dispense(IBlockSource var1, ItemStack var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBlockSource.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBlockSource.java new file mode 100644 index 0000000..ab06a7c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBlockSource.java @@ -0,0 +1,39 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.ILocatableSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IBlockSource extends ILocatableSource { + double getX(); + + double getY(); + + double getZ(); + + BlockPos getBlockPos(); + + int getBlockMetadata(); + + T getBlockTileEntity(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocatableSource.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocatableSource.java new file mode 100644 index 0000000..1bae210 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocatableSource.java @@ -0,0 +1,26 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.ILocation; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ILocatableSource extends ILocation { +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocation.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocation.java new file mode 100644 index 0000000..d0c9e03 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocation.java @@ -0,0 +1,28 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ILocation extends IPosition { + World getWorld(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IPosition.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IPosition.java new file mode 100644 index 0000000..ecf9531 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IPosition.java @@ -0,0 +1,29 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IPosition { + double getX(); + + double getY(); + + double getZ(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/PositionImpl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/PositionImpl.java new file mode 100644 index 0000000..b46fbbf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/PositionImpl.java @@ -0,0 +1,54 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IPosition; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PositionImpl implements IPosition { + + static { + __checkIntegratedContextValid("net/minecraft/dispenser/PositionImpl"); + } + + protected final double x; + protected final double y; + protected final double z; + + public PositionImpl(double xCoord, double yCoord, double zCoord) { + this.x = xCoord; + this.y = yCoord; + this.z = zCoord; + } + + public double getX() { + return this.x; + } + + public double getY() { + return this.y; + } + + public double getZ() { + return this.z; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/Enchantment.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/Enchantment.java new file mode 100644 index 0000000..60c37ee --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/Enchantment.java @@ -0,0 +1,306 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.util.ArrayList; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentArrowDamage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentArrowFire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentArrowInfinite; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentArrowKnockback; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentDamage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentDigging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentDurability; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentFireAspect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentFishingSpeed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentKnockback; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentLootBonus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentOxygen; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentProtection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentThorns; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentUntouching; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentWaterWalker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentWaterWorker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/Enchantment"); + } + + private static final Enchantment[] enchantmentsList = new Enchantment[256]; + public static final Enchantment[] enchantmentsBookList; + private static final Map locationEnchantments = Maps.newHashMap(); + public static final Enchantment protection = new EnchantmentProtection(0, new ResourceLocation("protection"), 10, + 0); + /**+ + * Protection against fire + */ + public static final Enchantment fireProtection = new EnchantmentProtection(1, + new ResourceLocation("fire_protection"), 5, 1); + public static final Enchantment featherFalling = new EnchantmentProtection(2, + new ResourceLocation("feather_falling"), 5, 2); + /**+ + * Protection against explosions + */ + public static final Enchantment blastProtection = new EnchantmentProtection(3, + new ResourceLocation("blast_protection"), 2, 3); + public static final Enchantment projectileProtection = new EnchantmentProtection(4, + new ResourceLocation("projectile_protection"), 5, 4); + public static final Enchantment respiration = new EnchantmentOxygen(5, new ResourceLocation("respiration"), 2); + /**+ + * Increases underwater mining rate + */ + public static final Enchantment aquaAffinity = new EnchantmentWaterWorker(6, new ResourceLocation("aqua_affinity"), + 2); + public static final Enchantment thorns = new EnchantmentThorns(7, new ResourceLocation("thorns"), 1); + public static final Enchantment depthStrider = new EnchantmentWaterWalker(8, new ResourceLocation("depth_strider"), + 2); + public static final Enchantment sharpness = new EnchantmentDamage(16, new ResourceLocation("sharpness"), 10, 0); + public static final Enchantment smite = new EnchantmentDamage(17, new ResourceLocation("smite"), 5, 1); + public static final Enchantment baneOfArthropods = new EnchantmentDamage(18, + new ResourceLocation("bane_of_arthropods"), 5, 2); + public static final Enchantment knockback = new EnchantmentKnockback(19, new ResourceLocation("knockback"), 5); + /**+ + * Lights mobs on fire + */ + public static final Enchantment fireAspect = new EnchantmentFireAspect(20, new ResourceLocation("fire_aspect"), 2); + /**+ + * Mobs have a chance to drop more loot + */ + public static final Enchantment looting = new EnchantmentLootBonus(21, new ResourceLocation("looting"), 2, + EnumEnchantmentType.WEAPON); + /**+ + * Faster resource gathering while in use + */ + public static final Enchantment efficiency = new EnchantmentDigging(32, new ResourceLocation("efficiency"), 10); + /**+ + * Blocks mined will drop themselves, even if it should drop + * something else (e.g. stone will drop stone, not cobblestone) + */ + public static final Enchantment silkTouch = new EnchantmentUntouching(33, new ResourceLocation("silk_touch"), 1); + /**+ + * Sometimes, the tool's durability will not be spent when the + * tool is used + */ + public static final Enchantment unbreaking = new EnchantmentDurability(34, new ResourceLocation("unbreaking"), 5); + /**+ + * Can multiply the drop rate of items from blocks + */ + public static final Enchantment fortune = new EnchantmentLootBonus(35, new ResourceLocation("fortune"), 2, + EnumEnchantmentType.DIGGER); + /**+ + * Power enchantment for bows, add's extra damage to arrows. + */ + public static final Enchantment power = new EnchantmentArrowDamage(48, new ResourceLocation("power"), 10); + /**+ + * Knockback enchantments for bows, the arrows will knockback + * the target when hit. + */ + public static final Enchantment punch = new EnchantmentArrowKnockback(49, new ResourceLocation("punch"), 2); + /**+ + * Flame enchantment for bows. Arrows fired by the bow will be + * on fire. Any target hit will also set on fire. + */ + public static final Enchantment flame = new EnchantmentArrowFire(50, new ResourceLocation("flame"), 2); + /**+ + * Infinity enchantment for bows. The bow will not consume + * arrows anymore, but will still required at least one arrow on + * inventory use the bow. + */ + public static final Enchantment infinity = new EnchantmentArrowInfinite(51, new ResourceLocation("infinity"), 1); + public static final Enchantment luckOfTheSea = new EnchantmentLootBonus(61, new ResourceLocation("luck_of_the_sea"), + 2, EnumEnchantmentType.FISHING_ROD); + public static final Enchantment lure = new EnchantmentFishingSpeed(62, new ResourceLocation("lure"), 2, + EnumEnchantmentType.FISHING_ROD); + public final int effectId; + private final int weight; + public EnumEnchantmentType type; + protected String name; + + /**+ + * Retrieves an Enchantment from the enchantmentsList + */ + public static Enchantment getEnchantmentById(int enchID) { + return enchID >= 0 && enchID < enchantmentsList.length ? enchantmentsList[enchID] : null; + } + + protected Enchantment(int enchID, ResourceLocation enchName, int enchWeight, EnumEnchantmentType enchType) { + this.effectId = enchID; + this.weight = enchWeight; + this.type = enchType; + if (enchantmentsList[enchID] != null) { + throw new IllegalArgumentException("Duplicate enchantment id!"); + } else { + enchantmentsList[enchID] = this; + locationEnchantments.put(enchName, this); + } + } + + /**+ + * Retrieves an enchantment by using its location name. + */ + public static Enchantment getEnchantmentByLocation(String location) { + return (Enchantment) locationEnchantments.get(new ResourceLocation(location)); + } + + public static Set func_181077_c() { + return locationEnchantments.keySet(); + } + + /**+ + * Retrieves the weight value of an Enchantment. This weight + * value is used within vanilla to determine how rare an + * enchantment is. + */ + public int getWeight() { + return this.weight; + } + + /**+ + * Returns the minimum level that the enchantment can have. + */ + public int getMinLevel() { + return 1; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 1 + i * 10; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + 5; + } + + /**+ + * Calculates the damage protection of the enchantment based on + * level and damage source passed. + */ + public int calcModifierDamage(int level, DamageSource source) { + return 0; + } + + /**+ + * Calculates the additional damage that will be dealt by an + * item with this enchantment. This alternative to + * calcModifierDamage is sensitive to the targets + * EnumCreatureAttribute. + */ + public float calcDamageByCreature(int var1, EnumCreatureAttribute var2) { + return 0.0F; + } + + /**+ + * Determines if the enchantment passed can be applyied together + * with this enchantment. + */ + public boolean canApplyTogether(Enchantment enchantment) { + return this != enchantment; + } + + /**+ + * Sets the enchantment name + */ + public Enchantment setName(String enchName) { + this.name = enchName; + return this; + } + + /**+ + * Return the name of key in translation table of this + * enchantment. + */ + public String getName() { + return "enchantment." + this.name; + } + + /**+ + * Returns the correct traslated name of the enchantment and the + * level in roman numbers. + */ + public String getTranslatedName(int level) { + String s = StatCollector.translateToLocal(this.getName()); + return s + " " + StatCollector.translateToLocal("enchantment.level." + level); + } + + /**+ + * Determines if this enchantment can be applied to a specific + * ItemStack. + */ + public boolean canApply(ItemStack itemstack) { + return this.type.canEnchantItem(itemstack.getItem()); + } + + /**+ + * Called whenever a mob is damaged with an item that has this + * enchantment on it. + */ + public void onEntityDamaged(EntityLivingBase var1, Entity var2, int var3) { + } + + /**+ + * Whenever an entity that has this enchantment on one of its + * associated items is damaged this method will be called. + */ + public void onUserHurt(EntityLivingBase user, Entity attacker, int level) { + } + + static { + ArrayList arraylist = Lists.newArrayList(); + + for (Enchantment enchantment : enchantmentsList) { + if (enchantment != null) { + arraylist.add(enchantment); + } + } + + enchantmentsBookList = (Enchantment[]) arraylist.toArray(new Enchantment[arraylist.size()]); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowDamage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowDamage.java new file mode 100644 index 0000000..bf5318c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowDamage.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentArrowDamage extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentArrowDamage"); + } + + public EnchantmentArrowDamage(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowDamage"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int enchantmentLevel) { + return 1 + (enchantmentLevel - 1) * 10; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int enchantmentLevel) { + return this.getMinEnchantability(enchantmentLevel) + 15; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 5; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowFire.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowFire.java new file mode 100644 index 0000000..196c9d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowFire.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentArrowFire extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentArrowFire"); + } + + public EnchantmentArrowFire(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowFire"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int var1) { + return 20; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int var1) { + return 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowInfinite.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowInfinite.java new file mode 100644 index 0000000..c840adc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowInfinite.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentArrowInfinite extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentArrowInfinite"); + } + + public EnchantmentArrowInfinite(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowInfinite"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int var1) { + return 20; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int var1) { + return 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowKnockback.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowKnockback.java new file mode 100644 index 0000000..b6c8f41 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowKnockback.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentArrowKnockback extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentArrowKnockback"); + } + + public EnchantmentArrowKnockback(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowKnockback"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 12 + (i - 1) * 20; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + 25; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDamage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDamage.java new file mode 100644 index 0000000..dc7007f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDamage.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemAxe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentDamage extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentDamage"); + } + + /**+ + * Holds the name to be translated of each protection type. + */ + private static final String[] protectionName = new String[] { "all", "undead", "arthropods" }; + /**+ + * Holds the base factor of enchantability needed to be able to + * use the enchant. + */ + private static final int[] baseEnchantability = new int[] { 1, 5, 5 }; + /**+ + * Holds how much each level increased the enchantability factor + * to be able to use this enchant. + */ + private static final int[] levelEnchantability = new int[] { 11, 8, 8 }; + /**+ + * Used on the formula of base enchantability, this is the + * 'window' factor of values to be able to use thing enchant. + */ + private static final int[] thresholdEnchantability = new int[] { 20, 20, 20 }; + public final int damageType; + + public EnchantmentDamage(int enchID, ResourceLocation enchName, int enchWeight, int classification) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.WEAPON); + this.damageType = classification; + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return baseEnchantability[this.damageType] + (i - 1) * levelEnchantability[this.damageType]; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + thresholdEnchantability[this.damageType]; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 5; + } + + /**+ + * Calculates the additional damage that will be dealt by an + * item with this enchantment. This alternative to + * calcModifierDamage is sensitive to the targets + * EnumCreatureAttribute. + */ + public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType) { + return this.damageType == 0 ? (float) level * 1.25F + : (this.damageType == 1 && creatureType == EnumCreatureAttribute.UNDEAD ? (float) level * 2.5F + : (this.damageType == 2 && creatureType == EnumCreatureAttribute.ARTHROPOD + ? (float) level * 2.5F + : 0.0F)); + } + + /**+ + * Return the name of key in translation table of this + * enchantment. + */ + public String getName() { + return "enchantment.damage." + protectionName[this.damageType]; + } + + /**+ + * Determines if the enchantment passed can be applyied together + * with this enchantment. + */ + public boolean canApplyTogether(Enchantment ench) { + return !(ench instanceof EnchantmentDamage); + } + + /**+ + * Determines if this enchantment can be applied to a specific + * ItemStack. + */ + public boolean canApply(ItemStack stack) { + return stack.getItem() instanceof ItemAxe ? true : super.canApply(stack); + } + + /**+ + * Called whenever a mob is damaged with an item that has this + * enchantment on it. + */ + public void onEntityDamaged(EntityLivingBase user, Entity target, int level) { + if (target instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) target; + if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) { + int i = 20 + user.getRNG().nextInt(10 * level); + entitylivingbase.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, i, 3)); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentData.java new file mode 100644 index 0000000..246a98b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentData.java @@ -0,0 +1,42 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentData extends WeightedRandom.Item { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentData"); + } + + public final Enchantment enchantmentobj; + public final int enchantmentLevel; + + public EnchantmentData(Enchantment enchantmentObj, int enchLevel) { + super(enchantmentObj.getWeight()); + this.enchantmentobj = enchantmentObj; + this.enchantmentLevel = enchLevel; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDigging.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDigging.java new file mode 100644 index 0000000..2653349 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDigging.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentDigging extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentDigging"); + } + + protected EnchantmentDigging(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.DIGGER); + this.setName("digging"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 1 + 10 * (i - 1); + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 5; + } + + /**+ + * Determines if this enchantment can be applied to a specific + * ItemStack. + */ + public boolean canApply(ItemStack itemstack) { + return itemstack.getItem() == Items.shears ? true : super.canApply(itemstack); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDurability.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDurability.java new file mode 100644 index 0000000..8f3db67 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDurability.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentDurability extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentDurability"); + } + + protected EnchantmentDurability(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BREAKABLE); + this.setName("durability"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 5 + (i - 1) * 8; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } + + /**+ + * Determines if this enchantment can be applied to a specific + * ItemStack. + */ + public boolean canApply(ItemStack itemstack) { + return itemstack.isItemStackDamageable() ? true : super.canApply(itemstack); + } + + /**+ + * Used by ItemStack.attemptDamageItem. Randomly determines if a + * point of damage should be negated using the enchantment level + * (par1). If the ItemStack is Armor then there is a flat 60% + * chance for damage to be negated no matter the enchantment + * level, otherwise there is a 1-(par/1) chance for damage to be + * negated. + */ + public static boolean negateDamage(ItemStack parItemStack, int parInt1, EaglercraftRandom parRandom) { + return parItemStack.getItem() instanceof ItemArmor && parRandom.nextFloat() < 0.6F ? false + : parRandom.nextInt(parInt1 + 1) > 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFireAspect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFireAspect.java new file mode 100644 index 0000000..feede11 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFireAspect.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentFireAspect extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentFireAspect"); + } + + protected EnchantmentFireAspect(int enchID, ResourceLocation enchName, int enchWeight) { + super(enchID, enchName, enchWeight, EnumEnchantmentType.WEAPON); + this.setName("fire"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 10 + 20 * (i - 1); + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFishingSpeed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFishingSpeed.java new file mode 100644 index 0000000..acf0883 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFishingSpeed.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentFishingSpeed extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentFishingSpeed"); + } + + protected EnchantmentFishingSpeed(int enchID, ResourceLocation enchName, int enchWeight, + EnumEnchantmentType enchType) { + super(enchID, enchName, enchWeight, enchType); + this.setName("fishingSpeed"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 15 + (i - 1) * 9; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentHelper.java new file mode 100644 index 0000000..2a796b1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentHelper.java @@ -0,0 +1,557 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentHelper { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentHelper"); + } + + /**+ + * Is the random seed of enchantment effects. + */ + private static final EaglercraftRandom enchantmentRand = new EaglercraftRandom(); + /**+ + * Used to calculate the extra armor of enchantments on armors + * equipped on player. + */ + private static final EnchantmentHelper.ModifierDamage enchantmentModifierDamage = new EnchantmentHelper.ModifierDamage(); + /**+ + * Used to calculate the (magic) extra damage done by + * enchantments on current equipped item of player. + */ + private static final EnchantmentHelper.ModifierLiving enchantmentModifierLiving = new EnchantmentHelper.ModifierLiving(); + private static final EnchantmentHelper.HurtIterator ENCHANTMENT_ITERATOR_HURT = new EnchantmentHelper.HurtIterator(); + private static final EnchantmentHelper.DamageIterator ENCHANTMENT_ITERATOR_DAMAGE = new EnchantmentHelper.DamageIterator(); + + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + public static int getEnchantmentLevel(int enchID, ItemStack stack) { + if (stack == null) { + return 0; + } else { + NBTTagList nbttaglist = stack.getEnchantmentTagList(); + if (nbttaglist == null) { + return 0; + } else { + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + if (short1 == enchID) { + return short2; + } + } + + return 0; + } + } + } + + public static Map getEnchantments(ItemStack stack) { + LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(); + NBTTagList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) + : stack.getEnchantmentTagList(); + if (nbttaglist != null) { + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + linkedhashmap.put(Integer.valueOf(short1), Integer.valueOf(short2)); + } + } + + return linkedhashmap; + } + + /**+ + * Set the enchantments for the specified stack. + */ + public static void setEnchantments(Map enchMap, ItemStack stack) { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = enchMap.keySet().iterator(); + + while (iterator.hasNext()) { + int i = ((Integer) iterator.next()).intValue(); + Enchantment enchantment = Enchantment.getEnchantmentById(i); + if (enchantment != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setShort("id", (short) i); + nbttagcompound.setShort("lvl", (short) ((Integer) enchMap.get(Integer.valueOf(i))).intValue()); + nbttaglist.appendTag(nbttagcompound); + if (stack.getItem() == Items.enchanted_book) { + Items.enchanted_book.addEnchantment(stack, + new EnchantmentData(enchantment, ((Integer) enchMap.get(Integer.valueOf(i))).intValue())); + } + } + } + + if (nbttaglist.tagCount() > 0) { + if (stack.getItem() != Items.enchanted_book) { + stack.setTagInfo("ench", nbttaglist); + } + } else if (stack.hasTagCompound()) { + stack.getTagCompound().removeTag("ench"); + } + + } + + /**+ + * Returns the biggest level of the enchantment on the array of + * ItemStack passed. + */ + public static int getMaxEnchantmentLevel(int enchID, ItemStack[] stacks) { + if (stacks == null) { + return 0; + } else { + int i = 0; + + for (ItemStack itemstack : stacks) { + int j = getEnchantmentLevel(enchID, itemstack); + if (j > i) { + i = j; + } + } + + return i; + } + } + + /**+ + * Executes the enchantment modifier on the ItemStack passed. + */ + private static void applyEnchantmentModifier(EnchantmentHelper.IModifier modifier, ItemStack stack) { + if (stack != null) { + NBTTagList nbttaglist = stack.getEnchantmentTagList(); + if (nbttaglist != null) { + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + if (Enchantment.getEnchantmentById(short1) != null) { + modifier.calculateModifier(Enchantment.getEnchantmentById(short1), short2); + } + } + + } + } + } + + /**+ + * Executes the enchantment modifier on the array of ItemStack + * passed. + */ + private static void applyEnchantmentModifierArray(EnchantmentHelper.IModifier modifier, ItemStack[] stacks) { + for (ItemStack itemstack : stacks) { + applyEnchantmentModifier(modifier, itemstack); + } + + } + + /**+ + * Returns the modifier of protection enchantments on armors + * equipped on player. + */ + public static int getEnchantmentModifierDamage(ItemStack[] stacks, DamageSource source) { + enchantmentModifierDamage.damageModifier = 0; + enchantmentModifierDamage.source = source; + applyEnchantmentModifierArray(enchantmentModifierDamage, stacks); + if (enchantmentModifierDamage.damageModifier > 25) { + enchantmentModifierDamage.damageModifier = 25; + } else if (enchantmentModifierDamage.damageModifier < 0) { + enchantmentModifierDamage.damageModifier = 0; + } + + return (enchantmentModifierDamage.damageModifier + 1 >> 1) + + enchantmentRand.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); + } + + public static float func_152377_a(ItemStack parItemStack, EnumCreatureAttribute parEnumCreatureAttribute) { + enchantmentModifierLiving.livingModifier = 0.0F; + enchantmentModifierLiving.entityLiving = parEnumCreatureAttribute; + applyEnchantmentModifier(enchantmentModifierLiving, parItemStack); + return enchantmentModifierLiving.livingModifier; + } + + public static void applyThornEnchantments(EntityLivingBase parEntityLivingBase, Entity parEntity) { + ENCHANTMENT_ITERATOR_HURT.attacker = parEntity; + ENCHANTMENT_ITERATOR_HURT.user = parEntityLivingBase; + if (parEntityLivingBase != null) { + applyEnchantmentModifierArray(ENCHANTMENT_ITERATOR_HURT, parEntityLivingBase.getInventory()); + } + + if (parEntity instanceof EntityPlayer) { + applyEnchantmentModifier(ENCHANTMENT_ITERATOR_HURT, parEntityLivingBase.getHeldItem()); + } + + } + + public static void applyArthropodEnchantments(EntityLivingBase parEntityLivingBase, Entity parEntity) { + ENCHANTMENT_ITERATOR_DAMAGE.user = parEntityLivingBase; + ENCHANTMENT_ITERATOR_DAMAGE.target = parEntity; + if (parEntityLivingBase != null) { + applyEnchantmentModifierArray(ENCHANTMENT_ITERATOR_DAMAGE, parEntityLivingBase.getInventory()); + } + + if (parEntityLivingBase instanceof EntityPlayer) { + applyEnchantmentModifier(ENCHANTMENT_ITERATOR_DAMAGE, parEntityLivingBase.getHeldItem()); + } + + } + + /**+ + * Returns the Knockback modifier of the enchantment on the + * players held item. + */ + public static int getKnockbackModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.knockback.effectId, player.getHeldItem()); + } + + /**+ + * Returns the fire aspect modifier of the players held item. + */ + public static int getFireAspectModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.fireAspect.effectId, player.getHeldItem()); + } + + /**+ + * Returns the 'Water Breathing' modifier of enchantments on + * player equipped armors. + */ + public static int getRespiration(Entity player) { + /**+ + * Returns the biggest level of the enchantment on the array of + * ItemStack passed. + */ + return getMaxEnchantmentLevel(Enchantment.respiration.effectId, player.getInventory()); + } + + /**+ + * Returns the level of the Depth Strider enchantment. + */ + public static int getDepthStriderModifier(Entity player) { + /**+ + * Returns the biggest level of the enchantment on the array of + * ItemStack passed. + */ + return getMaxEnchantmentLevel(Enchantment.depthStrider.effectId, player.getInventory()); + } + + /**+ + * Return the extra efficiency of tools based on enchantments on + * equipped player item. + */ + public static int getEfficiencyModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.efficiency.effectId, player.getHeldItem()); + } + + /**+ + * Returns the silk touch status of enchantments on current + * equipped item of player. + */ + public static boolean getSilkTouchModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.silkTouch.effectId, player.getHeldItem()) > 0; + } + + /**+ + * Returns the fortune enchantment modifier of the current + * equipped item of player. + */ + public static int getFortuneModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.fortune.effectId, player.getHeldItem()); + } + + /**+ + * Returns the level of the 'Luck Of The Sea' enchantment. + */ + public static int getLuckOfSeaModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.luckOfTheSea.effectId, player.getHeldItem()); + } + + /**+ + * Returns the level of the 'Lure' enchantment on the players + * held item. + */ + public static int getLureModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.lure.effectId, player.getHeldItem()); + } + + /**+ + * Returns the looting enchantment modifier of the current + * equipped item of player. + */ + public static int getLootingModifier(EntityLivingBase player) { + /**+ + * Returns the level of enchantment on the ItemStack passed. + */ + return getEnchantmentLevel(Enchantment.looting.effectId, player.getHeldItem()); + } + + /**+ + * Returns the aqua affinity status of enchantments on current + * equipped item of player. + */ + public static boolean getAquaAffinityModifier(EntityLivingBase player) { + /**+ + * Returns the biggest level of the enchantment on the array of + * ItemStack passed. + */ + return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, player.getInventory()) > 0; + } + + public static ItemStack getEnchantedItem(Enchantment parEnchantment, EntityLivingBase parEntityLivingBase) { + for (ItemStack itemstack : parEntityLivingBase.getInventory()) { + if (itemstack != null && getEnchantmentLevel(parEnchantment.effectId, itemstack) > 0) { + return itemstack; + } + } + + return null; + } + + /**+ + * Returns the enchantability of itemstack, it's uses a singular + * formula for each index (2nd parameter: 0, 1 and 2), cutting + * to the max enchantability power of the table (3rd parameter) + */ + public static int calcItemStackEnchantability(EaglercraftRandom parRandom, int parInt1, int parInt2, + ItemStack parItemStack) { + Item item = parItemStack.getItem(); + int i = item.getItemEnchantability(); + if (i <= 0) { + return 0; + } else { + if (parInt2 > 15) { + parInt2 = 15; + } + + int j = parRandom.nextInt(8) + 1 + (parInt2 >> 1) + parRandom.nextInt(parInt2 + 1); + return parInt1 == 0 ? Math.max(j / 3, 1) : (parInt1 == 1 ? j * 2 / 3 + 1 : Math.max(j, parInt2 * 2)); + } + } + + /**+ + * Adds a random enchantment to the specified item. Args: + * random, itemStack, enchantabilityLevel + */ + public static ItemStack addRandomEnchantment(EaglercraftRandom parRandom, ItemStack parItemStack, int parInt1) { + List list = buildEnchantmentList(parRandom, parItemStack, parInt1); + boolean flag = parItemStack.getItem() == Items.book; + if (flag) { + parItemStack.setItem(Items.enchanted_book); + } + + if (list != null) { + for (EnchantmentData enchantmentdata : (List) list) { + if (flag) { + Items.enchanted_book.addEnchantment(parItemStack, enchantmentdata); + } else { + parItemStack.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel); + } + } + } + + return parItemStack; + } + + /**+ + * Create a list of random EnchantmentData (enchantments) that + * can be added together to the ItemStack, the 3rd parameter is + * the total enchantability level. + */ + public static List buildEnchantmentList(EaglercraftRandom randomIn, ItemStack itemStackIn, + int parInt1) { + Item item = itemStackIn.getItem(); + int i = item.getItemEnchantability(); + if (i <= 0) { + return null; + } else { + i = i / 2; + i = 1 + randomIn.nextInt((i >> 1) + 1) + randomIn.nextInt((i >> 1) + 1); + int j = i + parInt1; + float f = (randomIn.nextFloat() + randomIn.nextFloat() - 1.0F) * 0.15F; + int k = (int) ((float) j * (1.0F + f) + 0.5F); + if (k < 1) { + k = 1; + } + + ArrayList arraylist = null; + Map map = mapEnchantmentData(k, itemStackIn); + if (map != null && !map.isEmpty()) { + EnchantmentData enchantmentdata = (EnchantmentData) WeightedRandom.getRandomItem(randomIn, + map.values()); + if (enchantmentdata != null) { + arraylist = Lists.newArrayList(); + arraylist.add(enchantmentdata); + + for (int l = k; randomIn.nextInt(50) <= l; l >>= 1) { + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) { + Integer integer = (Integer) iterator.next(); + boolean flag = true; + + for (EnchantmentData enchantmentdata1 : (ArrayList) arraylist) { + if (!enchantmentdata1.enchantmentobj + .canApplyTogether(Enchantment.getEnchantmentById(integer.intValue()))) { + flag = false; + break; + } + } + + if (!flag) { + iterator.remove(); + } + } + + if (!map.isEmpty()) { + EnchantmentData enchantmentdata2 = (EnchantmentData) WeightedRandom.getRandomItem(randomIn, + map.values()); + arraylist.add(enchantmentdata2); + } + } + } + } + + return arraylist; + } + } + + public static Map mapEnchantmentData(int parInt1, ItemStack parItemStack) { + Item item = parItemStack.getItem(); + HashMap hashmap = null; + boolean flag = parItemStack.getItem() == Items.book; + + for (Enchantment enchantment : Enchantment.enchantmentsBookList) { + if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) { + for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) { + if (parInt1 >= enchantment.getMinEnchantability(i) + && parInt1 <= enchantment.getMaxEnchantability(i)) { + if (hashmap == null) { + hashmap = Maps.newHashMap(); + } + + hashmap.put(Integer.valueOf(enchantment.effectId), new EnchantmentData(enchantment, i)); + } + } + } + } + + return hashmap; + } + + static final class DamageIterator implements EnchantmentHelper.IModifier { + public EntityLivingBase user; + public Entity target; + + private DamageIterator() { + } + + public void calculateModifier(Enchantment enchantmentIn, int enchantmentLevel) { + enchantmentIn.onEntityDamaged(this.user, this.target, enchantmentLevel); + } + } + + static final class HurtIterator implements EnchantmentHelper.IModifier { + public EntityLivingBase user; + public Entity attacker; + + private HurtIterator() { + } + + public void calculateModifier(Enchantment enchantment, int i) { + enchantment.onUserHurt(this.user, this.attacker, i); + } + } + + interface IModifier { + void calculateModifier(Enchantment var1, int var2); + } + + static final class ModifierDamage implements EnchantmentHelper.IModifier { + public int damageModifier; + public DamageSource source; + + private ModifierDamage() { + } + + public void calculateModifier(Enchantment enchantment, int i) { + this.damageModifier += enchantment.calcModifierDamage(i, this.source); + } + } + + static final class ModifierLiving implements EnchantmentHelper.IModifier { + public float livingModifier; + public EnumCreatureAttribute entityLiving; + + private ModifierLiving() { + } + + public void calculateModifier(Enchantment enchantment, int i) { + this.livingModifier += enchantment.calcDamageByCreature(i, this.entityLiving); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentKnockback.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentKnockback.java new file mode 100644 index 0000000..1a8b5b7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentKnockback.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentKnockback extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentKnockback"); + } + + protected EnchantmentKnockback(int parInt1, ResourceLocation parResourceLocation, int parInt2) { + super(parInt1, parResourceLocation, parInt2, EnumEnchantmentType.WEAPON); + this.setName("knockback"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 5 + 20 * (i - 1); + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentLootBonus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentLootBonus.java new file mode 100644 index 0000000..58b584a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentLootBonus.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentLootBonus extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentLootBonus"); + } + + protected EnchantmentLootBonus(int parInt1, ResourceLocation parResourceLocation, int parInt2, + EnumEnchantmentType parEnumEnchantmentType) { + super(parInt1, parResourceLocation, parInt2, parEnumEnchantmentType); + if (parEnumEnchantmentType == EnumEnchantmentType.DIGGER) { + this.setName("lootBonusDigger"); + } else if (parEnumEnchantmentType == EnumEnchantmentType.FISHING_ROD) { + this.setName("lootBonusFishing"); + } else { + this.setName("lootBonus"); + } + + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 15 + (i - 1) * 9; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } + + /**+ + * Determines if the enchantment passed can be applyied together + * with this enchantment. + */ + public boolean canApplyTogether(Enchantment enchantment) { + return super.canApplyTogether(enchantment) && enchantment.effectId != silkTouch.effectId; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentOxygen.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentOxygen.java new file mode 100644 index 0000000..57ec190 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentOxygen.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentOxygen extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentOxygen"); + } + + public EnchantmentOxygen(int enchID, ResourceLocation parResourceLocation, int parInt1) { + super(enchID, parResourceLocation, parInt1, EnumEnchantmentType.ARMOR_HEAD); + this.setName("oxygen"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 10 * i; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + 30; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentProtection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentProtection.java new file mode 100644 index 0000000..82ca89b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentProtection.java @@ -0,0 +1,157 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentProtection extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentProtection"); + } + + /**+ + * Holds the name to be translated of each protection type. + */ + private static final String[] protectionName = new String[] { "all", "fire", "fall", "explosion", "projectile" }; + /**+ + * Holds the base factor of enchantability needed to be able to + * use the enchant. + */ + private static final int[] baseEnchantability = new int[] { 1, 10, 5, 5, 3 }; + /**+ + * Holds how much each level increased the enchantability factor + * to be able to use this enchant. + */ + private static final int[] levelEnchantability = new int[] { 11, 8, 6, 8, 6 }; + /**+ + * Used on the formula of base enchantability, this is the + * 'window' factor of values to be able to use thing enchant. + */ + private static final int[] thresholdEnchantability = new int[] { 20, 12, 10, 12, 15 }; + public final int protectionType; + + public EnchantmentProtection(int parInt1, ResourceLocation parResourceLocation, int parInt2, int parInt3) { + super(parInt1, parResourceLocation, parInt2, EnumEnchantmentType.ARMOR); + this.protectionType = parInt3; + if (parInt3 == 2) { + this.type = EnumEnchantmentType.ARMOR_FEET; + } + + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return baseEnchantability[this.protectionType] + (i - 1) * levelEnchantability[this.protectionType]; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + thresholdEnchantability[this.protectionType]; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 4; + } + + /**+ + * Calculates the damage protection of the enchantment based on + * level and damage source passed. + */ + public int calcModifierDamage(int i, DamageSource damagesource) { + if (damagesource.canHarmInCreative()) { + return 0; + } else { + float f = (float) (6 + i * i) / 3.0F; + return this.protectionType == 0 ? MathHelper.floor_float(f * 0.75F) + : (this.protectionType == 1 && damagesource.isFireDamage() ? MathHelper.floor_float(f * 1.25F) + : (this.protectionType == 2 && damagesource == DamageSource.fall + ? MathHelper.floor_float(f * 2.5F) + : (this.protectionType == 3 && damagesource.isExplosion() + ? MathHelper.floor_float(f * 1.5F) + : (this.protectionType == 4 && damagesource.isProjectile() + ? MathHelper.floor_float(f * 1.5F) + : 0)))); + } + } + + /**+ + * Return the name of key in translation table of this + * enchantment. + */ + public String getName() { + return "enchantment.protect." + protectionName[this.protectionType]; + } + + /**+ + * Determines if the enchantment passed can be applyied together + * with this enchantment. + */ + public boolean canApplyTogether(Enchantment enchantment) { + if (enchantment instanceof EnchantmentProtection) { + EnchantmentProtection enchantmentprotection = (EnchantmentProtection) enchantment; + return enchantmentprotection.protectionType == this.protectionType ? false + : this.protectionType == 2 || enchantmentprotection.protectionType == 2; + } else { + return super.canApplyTogether(enchantment); + } + } + + /**+ + * Gets the amount of ticks an entity should be set fire, + * adjusted for fire protection. + */ + public static int getFireTimeForEntity(Entity parEntity, int parInt1) { + int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, parEntity.getInventory()); + if (i > 0) { + parInt1 -= MathHelper.floor_float((float) parInt1 * (float) i * 0.15F); + } + + return parInt1; + } + + public static double func_92092_a(Entity parEntity, double parDouble1) { + int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, + parEntity.getInventory()); + if (i > 0) { + parDouble1 -= (double) MathHelper.floor_double(parDouble1 * (double) ((float) i * 0.15F)); + } + + return parDouble1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentThorns.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentThorns.java new file mode 100644 index 0000000..795e8ed --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentThorns.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentThorns extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentThorns"); + } + + public EnchantmentThorns(int parInt1, ResourceLocation parResourceLocation, int parInt2) { + super(parInt1, parResourceLocation, parInt2, EnumEnchantmentType.ARMOR_TORSO); + this.setName("thorns"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return 10 + 20 * (i - 1); + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } + + /**+ + * Determines if this enchantment can be applied to a specific + * ItemStack. + */ + public boolean canApply(ItemStack itemstack) { + return itemstack.getItem() instanceof ItemArmor ? true : super.canApply(itemstack); + } + + /**+ + * Whenever an entity that has this enchantment on one of its + * associated items is damaged this method will be called. + */ + public void onUserHurt(EntityLivingBase entitylivingbase, Entity entity, int i) { + EaglercraftRandom random = entitylivingbase.getRNG(); + ItemStack itemstack = EnchantmentHelper.getEnchantedItem(Enchantment.thorns, entitylivingbase); + if (func_92094_a(i, random)) { + if (entity != null) { + entity.attackEntityFrom(DamageSource.causeThornsDamage(entitylivingbase), + (float) func_92095_b(i, random)); + entity.playSound("damage.thorns", 0.5F, 1.0F); + } + + if (itemstack != null) { + itemstack.damageItem(3, entitylivingbase); + } + } else if (itemstack != null) { + itemstack.damageItem(1, entitylivingbase); + } + + } + + public static boolean func_92094_a(int parInt1, EaglercraftRandom parRandom) { + return parInt1 <= 0 ? false : parRandom.nextFloat() < 0.15F * (float) parInt1; + } + + public static int func_92095_b(int parInt1, EaglercraftRandom parRandom) { + return parInt1 > 10 ? parInt1 - 10 : 1 + parRandom.nextInt(4); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentUntouching.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentUntouching.java new file mode 100644 index 0000000..64b505e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentUntouching.java @@ -0,0 +1,80 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentUntouching extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentUntouching"); + } + + protected EnchantmentUntouching(int parInt1, ResourceLocation parResourceLocation, int parInt2) { + super(parInt1, parResourceLocation, parInt2, EnumEnchantmentType.DIGGER); + this.setName("untouching"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int var1) { + return 15; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return super.getMinEnchantability(i) + 50; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } + + /**+ + * Determines if the enchantment passed can be applyied together + * with this enchantment. + */ + public boolean canApplyTogether(Enchantment enchantment) { + return super.canApplyTogether(enchantment) && enchantment.effectId != fortune.effectId; + } + + /**+ + * Determines if this enchantment can be applied to a specific + * ItemStack. + */ + public boolean canApply(ItemStack itemstack) { + return itemstack.getItem() == Items.shears ? true : super.canApply(itemstack); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWalker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWalker.java new file mode 100644 index 0000000..89099a0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWalker.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentWaterWalker extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentWaterWalker"); + } + + public EnchantmentWaterWalker(int parInt1, ResourceLocation parResourceLocation, int parInt2) { + super(parInt1, parResourceLocation, parInt2, EnumEnchantmentType.ARMOR_FEET); + this.setName("waterWalker"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int i) { + return i * 10; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + 15; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWorker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWorker.java new file mode 100644 index 0000000..b0cebc5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWorker.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnumEnchantmentType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentWaterWorker extends Enchantment { + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnchantmentWaterWorker"); + } + + public EnchantmentWaterWorker(int parInt1, ResourceLocation parResourceLocation, int parInt2) { + super(parInt1, parResourceLocation, parInt2, EnumEnchantmentType.ARMOR_HEAD); + this.setName("waterWorker"); + } + + /**+ + * Returns the minimal value of enchantability needed on the + * enchantment level passed. + */ + public int getMinEnchantability(int var1) { + return 1; + } + + /**+ + * Returns the maximum value of enchantability nedded on the + * enchantment level passed. + */ + public int getMaxEnchantability(int i) { + return this.getMinEnchantability(i) + 40; + } + + /**+ + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnumEnchantmentType.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnumEnchantmentType.java new file mode 100644 index 0000000..ff822bd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnumEnchantmentType.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishingRod; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSword; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemTool; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumEnchantmentType { + ALL, ARMOR, ARMOR_FEET, ARMOR_LEGS, ARMOR_TORSO, ARMOR_HEAD, WEAPON, DIGGER, FISHING_ROD, BREAKABLE, BOW; + + static { + __checkIntegratedContextValid("net/minecraft/enchantment/EnumEnchantmentType"); + } + + /**+ + * Return true if the item passed can be enchanted by a + * enchantment of this type. + */ + public boolean canEnchantItem(Item parItem) { + if (this == ALL) { + return true; + } else if (this == BREAKABLE && parItem.isDamageable()) { + return true; + } else if (parItem instanceof ItemArmor) { + if (this == ARMOR) { + return true; + } else { + ItemArmor itemarmor = (ItemArmor) parItem; + return itemarmor.armorType == 0 ? this == ARMOR_HEAD + : (itemarmor.armorType == 2 ? this == ARMOR_LEGS + : (itemarmor.armorType == 1 ? this == ARMOR_TORSO + : (itemarmor.armorType == 3 ? this == ARMOR_FEET : false))); + } + } else { + return parItem instanceof ItemSword ? this == WEAPON + : (parItem instanceof ItemTool ? this == DIGGER + : (parItem instanceof ItemBow ? this == BOW + : (parItem instanceof ItemFishingRod ? this == FISHING_ROD : false))); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/DataWatcher.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/DataWatcher.java new file mode 100644 index 0000000..4570961 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/DataWatcher.java @@ -0,0 +1,413 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Rotations; +import org.apache.commons.lang3.ObjectUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DataWatcher { + + static { + __checkIntegratedContextValid("net/minecraft/entity/DataWatcher"); + } + + private final Entity owner; + /**+ + * When isBlank is true the DataWatcher is not watching any + * objects + */ + private boolean isBlank = true; + private static final Map, Integer> dataTypes = Maps.newHashMap(); + private final Map watchedObjects = Maps.newHashMap(); + private boolean objectChanged; + // private ReadWriteLock lock = new ReentrantReadWriteLock(); + + public DataWatcher(Entity owner) { + this.owner = owner; + } + + public void addObject(int id, T object) { + Integer integer = (Integer) dataTypes.get(object.getClass()); + if (integer == null) { + throw new IllegalArgumentException("Unknown data type: " + object.getClass()); + } else if (id > 31) { + throw new IllegalArgumentException("Data value id is too big with " + id + "! (Max is " + 31 + ")"); + } else if (this.watchedObjects.containsKey(Integer.valueOf(id))) { + throw new IllegalArgumentException("Duplicate id value for " + id + "!"); + } else { + DataWatcher.WatchableObject datawatcher$watchableobject = new DataWatcher.WatchableObject( + integer.intValue(), id, object); + // this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(id), datawatcher$watchableobject); + // this.lock.writeLock().unlock(); + this.isBlank = false; + } + } + + /**+ + * Add a new object for the DataWatcher to watch, using the + * specified data type. + */ + public void addObjectByDataType(int id, int type) { + DataWatcher.WatchableObject datawatcher$watchableobject = new DataWatcher.WatchableObject(type, id, + (Object) null); + // this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(id), datawatcher$watchableobject); + // this.lock.writeLock().unlock(); + this.isBlank = false; + } + + /**+ + * gets the bytevalue of a watchable object + */ + public byte getWatchableObjectByte(int id) { + return ((Byte) this.getWatchedObject(id).getObject()).byteValue(); + } + + public short getWatchableObjectShort(int id) { + return ((Short) this.getWatchedObject(id).getObject()).shortValue(); + } + + /**+ + * gets a watchable object and returns it as a Integer + */ + public int getWatchableObjectInt(int id) { + return ((Integer) this.getWatchedObject(id).getObject()).intValue(); + } + + public float getWatchableObjectFloat(int id) { + return ((Float) this.getWatchedObject(id).getObject()).floatValue(); + } + + /**+ + * gets a watchable object and returns it as a String + */ + public String getWatchableObjectString(int id) { + return (String) this.getWatchedObject(id).getObject(); + } + + /**+ + * Get a watchable object as an ItemStack. + */ + public ItemStack getWatchableObjectItemStack(int id) { + return (ItemStack) this.getWatchedObject(id).getObject(); + } + + /**+ + * is threadsafe, unless it throws an exception, then + */ + private DataWatcher.WatchableObject getWatchedObject(int id) { + // this.lock.readLock().lock(); + + DataWatcher.WatchableObject datawatcher$watchableobject; + try { + datawatcher$watchableobject = (DataWatcher.WatchableObject) this.watchedObjects.get(Integer.valueOf(id)); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting synched entity data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Synched entity data"); + crashreportcategory.addCrashSection("Data ID", Integer.valueOf(id)); + throw new ReportedException(crashreport); + } + + // this.lock.readLock().unlock(); + return datawatcher$watchableobject; + } + + public Rotations getWatchableObjectRotations(int id) { + return (Rotations) this.getWatchedObject(id).getObject(); + } + + public void updateObject(int id, T newData) { + DataWatcher.WatchableObject datawatcher$watchableobject = this.getWatchedObject(id); + if (ObjectUtils.notEqual(newData, datawatcher$watchableobject.getObject())) { + datawatcher$watchableobject.setObject(newData); + this.owner.onDataWatcherUpdate(id); + datawatcher$watchableobject.setWatched(true); + this.objectChanged = true; + } + + } + + public void setObjectWatched(int id) { + this.getWatchedObject(id).watched = true; + this.objectChanged = true; + } + + /**+ + * true if one or more object was changed + */ + public boolean hasObjectChanged() { + return this.objectChanged; + } + + /**+ + * Writes the list of watched objects (entity attribute of type + * {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) to the specified PacketBuffer + */ + public static void writeWatchedListToPacketBuffer(List objectsList, + PacketBuffer buffer) throws IOException { + if (objectsList != null) { + for (DataWatcher.WatchableObject datawatcher$watchableobject : objectsList) { + writeWatchableObjectToPacketBuffer(buffer, datawatcher$watchableobject); + } + } + + buffer.writeByte(127); + } + + public List getChanged() { + ArrayList arraylist = null; + if (this.objectChanged) { + // this.lock.readLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : this.watchedObjects.values()) { + if (datawatcher$watchableobject.isWatched()) { + datawatcher$watchableobject.setWatched(false); + if (arraylist == null) { + arraylist = Lists.newArrayList(); + } + + arraylist.add(datawatcher$watchableobject); + } + } + + // this.lock.readLock().unlock(); + } + + this.objectChanged = false; + return arraylist; + } + + public void writeTo(PacketBuffer buffer) throws IOException { + // this.lock.readLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : this.watchedObjects.values()) { + writeWatchableObjectToPacketBuffer(buffer, datawatcher$watchableobject); + } + + // this.lock.readLock().unlock(); + buffer.writeByte(127); + } + + public List getAllWatched() { + ArrayList arraylist = null; + // this.lock.readLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : this.watchedObjects.values()) { + if (arraylist == null) { + arraylist = Lists.newArrayList(); + } + + arraylist.add(datawatcher$watchableobject); + } + + // this.lock.readLock().unlock(); + return arraylist; + } + + /**+ + * Writes a watchable object (entity attribute of type {byte, + * short, int, float, string, ItemStack, ChunkCoordinates}) to + * the specified PacketBuffer + */ + private static void writeWatchableObjectToPacketBuffer(PacketBuffer buffer, DataWatcher.WatchableObject object) + throws IOException { + int i = (object.getObjectType() << 5 | object.getDataValueId() & 31) & 255; + buffer.writeByte(i); + switch (object.getObjectType()) { + case 0: + buffer.writeByte(((Byte) object.getObject()).byteValue()); + break; + case 1: + buffer.writeShort(((Short) object.getObject()).shortValue()); + break; + case 2: + buffer.writeInt(((Integer) object.getObject()).intValue()); + break; + case 3: + buffer.writeFloat(((Float) object.getObject()).floatValue()); + break; + case 4: + buffer.writeString((String) object.getObject()); + break; + case 5: + ItemStack itemstack = (ItemStack) object.getObject(); + buffer.writeItemStackToBuffer_server(itemstack); + break; + case 6: + BlockPos blockpos = (BlockPos) object.getObject(); + buffer.writeInt(blockpos.getX()); + buffer.writeInt(blockpos.getY()); + buffer.writeInt(blockpos.getZ()); + break; + case 7: + Rotations rotations = (Rotations) object.getObject(); + buffer.writeFloat(rotations.getX()); + buffer.writeFloat(rotations.getY()); + buffer.writeFloat(rotations.getZ()); + } + + } + + /**+ + * Reads a list of watched objects (entity attribute of type + * {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) from the supplied PacketBuffer + */ + public static List readWatchedListFromPacketBuffer(PacketBuffer buffer) + throws IOException { + ArrayList arraylist = null; + + for (byte b0 = buffer.readByte(); b0 != 127; b0 = buffer.readByte()) { + if (arraylist == null) { + arraylist = Lists.newArrayList(); + } + + int i = (b0 & 224) >> 5; + int j = b0 & 31; + DataWatcher.WatchableObject datawatcher$watchableobject = null; + switch (i) { + case 0: + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, Byte.valueOf(buffer.readByte())); + break; + case 1: + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, Short.valueOf(buffer.readShort())); + break; + case 2: + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, Integer.valueOf(buffer.readInt())); + break; + case 3: + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, Float.valueOf(buffer.readFloat())); + break; + case 4: + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, buffer.readStringFromBuffer(32767)); + break; + case 5: + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, + buffer.readItemStackFromBuffer_server()); + break; + case 6: + int k = buffer.readInt(); + int l = buffer.readInt(); + int i1 = buffer.readInt(); + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, new BlockPos(k, l, i1)); + break; + case 7: + float f = buffer.readFloat(); + float f1 = buffer.readFloat(); + float f2 = buffer.readFloat(); + datawatcher$watchableobject = new DataWatcher.WatchableObject(i, j, new Rotations(f, f1, f2)); + } + + arraylist.add(datawatcher$watchableobject); + } + + return arraylist; + } + + public void updateWatchedObjectsFromList(List parList) { + // this.lock.writeLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : parList) { + DataWatcher.WatchableObject datawatcher$watchableobject1 = (DataWatcher.WatchableObject) this.watchedObjects + .get(Integer.valueOf(datawatcher$watchableobject.getDataValueId())); + if (datawatcher$watchableobject1 != null) { + datawatcher$watchableobject1.setObject(datawatcher$watchableobject.getObject()); + this.owner.onDataWatcherUpdate(datawatcher$watchableobject.getDataValueId()); + } + } + + // this.lock.writeLock().unlock(); + this.objectChanged = true; + } + + public boolean getIsBlank() { + return this.isBlank; + } + + public void func_111144_e() { + this.objectChanged = false; + } + + static { + dataTypes.put(Byte.class, Integer.valueOf(0)); + dataTypes.put(Short.class, Integer.valueOf(1)); + dataTypes.put(Integer.class, Integer.valueOf(2)); + dataTypes.put(Float.class, Integer.valueOf(3)); + dataTypes.put(String.class, Integer.valueOf(4)); + dataTypes.put(ItemStack.class, Integer.valueOf(5)); + dataTypes.put(BlockPos.class, Integer.valueOf(6)); + dataTypes.put(Rotations.class, Integer.valueOf(7)); + } + + public static class WatchableObject { + private final int objectType; + private final int dataValueId; + private Object watchedObject; + private boolean watched; + + public WatchableObject(int type, int id, Object object) { + this.dataValueId = id; + this.watchedObject = object; + this.objectType = type; + this.watched = true; + } + + public int getDataValueId() { + return this.dataValueId; + } + + public void setObject(Object object) { + this.watchedObject = object; + } + + public Object getObject() { + return this.watchedObject; + } + + public int getObjectType() { + return this.objectType; + } + + public boolean isWatched() { + return this.watched; + } + + public void setWatched(boolean watched) { + this.watched = watched; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/Entity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/Entity.java new file mode 100644 index 0000000..7537b93 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/Entity.java @@ -0,0 +1,2378 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.HString; + +import java.util.concurrent.Callable; + +import net.lax1dude.eaglercraft.v1_8.sp.server.CrashReportHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFenceGate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWall; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentProtection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.DataWatcher; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.HoverEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Entity implements ICommandSender { + + static { + __checkIntegratedContextValid("net/minecraft/entity/Entity"); + } + + private static final AxisAlignedBB ZERO_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + private static int nextEntityID; + private int entityId; + public double renderDistanceWeight; + public boolean preventEntitySpawning; + public Entity riddenByEntity; + public Entity ridingEntity; + public boolean forceSpawn; + public World worldObj; + public double prevPosX; + public double prevPosY; + public double prevPosZ; + public double posX; + public double posY; + public double posZ; + public double motionX; + public double motionY; + public double motionZ; + public float rotationYaw; + public float rotationPitch; + public float prevRotationYaw; + public float prevRotationPitch; + private AxisAlignedBB boundingBox; + public boolean onGround; + public boolean isCollidedHorizontally; + public boolean isCollidedVertically; + public boolean isCollided; + public boolean velocityChanged; + protected boolean isInWeb; + private boolean isOutsideBorder; + public boolean isDead; + public float width; + public float height; + public float prevDistanceWalkedModified; + public float distanceWalkedModified; + public float distanceWalkedOnStepModified; + public float fallDistance; + private int nextStepDistance; + public double lastTickPosX; + public double lastTickPosY; + public double lastTickPosZ; + public float stepHeight; + public boolean noClip; + public float entityCollisionReduction; + protected EaglercraftRandom rand; + public int ticksExisted; + public int fireResistance; + private int fire; + protected boolean inWater; + public int hurtResistantTime; + protected boolean firstUpdate; + protected boolean isImmuneToFire; + protected DataWatcher dataWatcher; + private double entityRiderPitchDelta; + private double entityRiderYawDelta; + public boolean addedToChunk; + public int chunkCoordX; + public int chunkCoordY; + public int chunkCoordZ; + public int serverPosX; + public int serverPosY; + public int serverPosZ; + public boolean ignoreFrustumCheck; + public boolean isAirBorne; + public int timeUntilPortal; + protected boolean inPortal; + protected int portalCounter; + public int dimension; + protected BlockPos field_181016_an; + protected Vec3 field_181017_ao; + protected EnumFacing field_181018_ap; + private boolean invulnerable; + protected EaglercraftUUID entityUniqueID; + private final CommandResultStats cmdResultStats; + + public int getEntityId() { + return this.entityId; + } + + public void setEntityId(int id) { + this.entityId = id; + } + + /**+ + * Called by the /kill command. + */ + public void onKillCommand() { + this.setDead(); + } + + public Entity(World worldIn) { + this.entityId = nextEntityID++; + this.renderDistanceWeight = 1.0D; + this.boundingBox = ZERO_AABB; + this.width = 0.6F; + this.height = 1.8F; + this.nextStepDistance = 1; + this.rand = new EaglercraftRandom(); + this.fireResistance = 1; + this.firstUpdate = true; + this.entityUniqueID = MathHelper.getRandomUuid(this.rand); + this.cmdResultStats = new CommandResultStats(); + this.worldObj = worldIn; + this.setPosition(0.0D, 0.0D, 0.0D); + if (worldIn != null) { + this.dimension = worldIn.provider.getDimensionId(); + } + + this.dataWatcher = new DataWatcher(this); + this.dataWatcher.addObject(0, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(1, Short.valueOf((short) 300)); + this.dataWatcher.addObject(3, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(2, ""); + this.dataWatcher.addObject(4, Byte.valueOf((byte) 0)); + this.entityInit(); + } + + protected abstract void entityInit(); + + public DataWatcher getDataWatcher() { + return this.dataWatcher; + } + + public boolean equals(Object object) { + return object instanceof Entity ? ((Entity) object).entityId == this.entityId : false; + } + + public int hashCode() { + return this.entityId; + } + + /**+ + * Keeps moving the entity up so it isn't colliding with blocks + * and other requirements for this entity to be spawned (only + * actually used on players though its also on Entity) + */ + protected void preparePlayerToSpawn() { + if (this.worldObj != null) { + while (this.posY > 0.0D && this.posY < 256.0D) { + this.setPosition(this.posX, this.posY, this.posZ); + if (this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty()) { + break; + } + + ++this.posY; + } + + this.motionX = this.motionY = this.motionZ = 0.0D; + this.rotationPitch = 0.0F; + } + } + + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + this.isDead = true; + } + + /**+ + * Sets the width and height of the entity. Args: width, height + */ + protected void setSize(float f, float f1) { + if (f != this.width || f1 != this.height) { + float f2 = this.width; + this.width = f; + this.height = f1; + this.setEntityBoundingBox( + new AxisAlignedBB(this.getEntityBoundingBox().minX, this.getEntityBoundingBox().minY, + this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().minX + (double) this.width, + this.getEntityBoundingBox().minY + (double) this.height, + this.getEntityBoundingBox().minZ + (double) this.width)); + if (this.width > f2 && !this.firstUpdate) { + this.moveEntity((double) (f2 - this.width), 0.0D, (double) (f2 - this.width)); + } + } + + } + + /**+ + * Sets the rotation of the entity. Args: yaw, pitch (both in + * degrees) + */ + protected void setRotation(float yaw, float pitch) { + this.rotationYaw = yaw % 360.0F; + this.rotationPitch = pitch % 360.0F; + } + + /**+ + * Sets the x,y,z of the entity from the given parameters. Also + * seems to set up a bounding box. + */ + public void setPosition(double x, double y, double z) { + this.posX = x; + this.posY = y; + this.posZ = z; + float f = this.width / 2.0F; + float f1 = this.height; + this.setEntityBoundingBox( + new AxisAlignedBB(x - (double) f, y, z - (double) f, x + (double) f, y + (double) f1, z + (double) f)); + } + + /**+ + * Adds 15% to the entity's yaw and subtracts 15% from the + * pitch. Clamps pitch from -90 to 90. Both arguments in + * degrees. + */ + public void setAngles(float yaw, float pitch) { + float f = this.rotationPitch; + float f1 = this.rotationYaw; + this.rotationYaw = (float) ((double) this.rotationYaw + (double) yaw * 0.15D); + this.rotationPitch = (float) ((double) this.rotationPitch - (double) pitch * 0.15D); + this.rotationPitch = MathHelper.clamp_float(this.rotationPitch, -90.0F, 90.0F); + this.prevRotationPitch += this.rotationPitch - f; + this.prevRotationYaw += this.rotationYaw - f1; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.onEntityUpdate(); + } + + /**+ + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + this.worldObj.theProfiler.startSection("entityBaseTick"); + if (this.ridingEntity != null && this.ridingEntity.isDead) { + this.ridingEntity = null; + } + + this.prevDistanceWalkedModified = this.distanceWalkedModified; + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + if (this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer minecraftserver = ((WorldServer) this.worldObj).getMinecraftServer(); + int i = this.getMaxInPortalTime(); + if (this.inPortal) { + if (minecraftserver.getAllowNether()) { + if (this.ridingEntity == null && this.portalCounter++ >= i) { + this.portalCounter = i; + this.timeUntilPortal = this.getPortalCooldown(); + byte b0; + if (this.worldObj.provider.getDimensionId() == -1) { + b0 = 0; + } else { + b0 = -1; + } + + this.travelToDimension(b0); + } + + this.inPortal = false; + } + } else { + if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + this.spawnRunningParticles(); + this.handleWaterMovement(); + if (this.fire > 0) { + if (this.isImmuneToFire) { + this.fire -= 4; + if (this.fire < 0) { + this.fire = 0; + } + } else { + if (this.fire % 20 == 0) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + --this.fire; + } + } + + if (this.isInLava()) { + this.setOnFireFromLava(); + this.fallDistance *= 0.5F; + } + + if (this.posY < -64.0D) { + this.kill(); + } + + this.setFlag(0, this.fire > 0); + + this.firstUpdate = false; + this.worldObj.theProfiler.endSection(); + } + + /**+ + * Return the amount of time this entity should stay in a portal + * before being transported. + */ + public int getMaxInPortalTime() { + return 0; + } + + /**+ + * Called whenever the entity is walking inside of lava. + */ + protected void setOnFireFromLava() { + if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.lava, 4.0F); + this.setFire(15); + } + } + + /**+ + * Sets entity to burn for x amount of seconds, cannot lower + * amount of existing fire. + */ + public void setFire(int seconds) { + int i = seconds * 20; + i = EnchantmentProtection.getFireTimeForEntity(this, i); + if (this.fire < i) { + this.fire = i; + } + + } + + /**+ + * Removes fire from entity. + */ + public void extinguish() { + this.fire = 0; + } + + /**+ + * sets the dead flag. Used when you fall off the bottom of the + * world. + */ + protected void kill() { + this.setDead(); + } + + /**+ + * Checks if the offset position from the entity's current + * position is inside of liquid. Args: x, y, z + */ + public boolean isOffsetPositionInLiquid(double x, double y, double z) { + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().offset(x, y, z); + return this.isLiquidPresentInAABB(axisalignedbb); + } + + /**+ + * Determines if a liquid is present within the specified + * AxisAlignedBB. + */ + private boolean isLiquidPresentInAABB(AxisAlignedBB bb) { + return this.worldObj.getCollidingBoundingBoxes(this, bb).isEmpty() && !this.worldObj.isAnyLiquid(bb); + } + + /**+ + * Tries to moves the entity by the passed in displacement. + * Args: x, y, z + */ + public void moveEntity(double x, double y, double z) { + if (this.noClip) { + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, y, z)); + this.resetPositionToBB(); + } else { + this.worldObj.theProfiler.startSection("move"); + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + if (this.isInWeb) { + this.isInWeb = false; + x *= 0.25D; + y *= 0.05000000074505806D; + z *= 0.25D; + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + } + + double d3 = x; + double d4 = y; + double d5 = z; + boolean flag = this.onGround && this.isSneaking() && this instanceof EntityPlayer; + if (flag) { + double d6; + for (d6 = 0.05D; x != 0.0D && this.worldObj + .getCollidingBoundingBoxes(this, this.getEntityBoundingBox().offset(x, -1.0D, 0.0D)) + .isEmpty(); d3 = x) { + if (x < d6 && x >= -d6) { + x = 0.0D; + } else if (x > 0.0D) { + x -= d6; + } else { + x += d6; + } + } + + for (; z != 0.0D && this.worldObj + .getCollidingBoundingBoxes(this, this.getEntityBoundingBox().offset(0.0D, -1.0D, z)) + .isEmpty(); d5 = z) { + if (z < d6 && z >= -d6) { + z = 0.0D; + } else if (z > 0.0D) { + z -= d6; + } else { + z += d6; + } + } + + for (; x != 0.0D && z != 0.0D + && this.worldObj + .getCollidingBoundingBoxes(this, this.getEntityBoundingBox().offset(x, -1.0D, z)) + .isEmpty(); d5 = z) { + if (x < d6 && x >= -d6) { + x = 0.0D; + } else if (x > 0.0D) { + x -= d6; + } else { + x += d6; + } + + d3 = x; + if (z < d6 && z >= -d6) { + z = 0.0D; + } else if (z > 0.0D) { + z -= d6; + } else { + z += d6; + } + } + } + + List list1 = this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().addCoord(x, y, z)); + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox(); + + for (AxisAlignedBB axisalignedbb1 : (List) list1) { + y = axisalignedbb1.calculateYOffset(this.getEntityBoundingBox(), y); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, y, 0.0D)); + boolean flag1 = this.onGround || d4 != y && d4 < 0.0D; + + for (AxisAlignedBB axisalignedbb2 : (List) list1) { + x = axisalignedbb2.calculateXOffset(this.getEntityBoundingBox(), x); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, 0.0D, 0.0D)); + + for (AxisAlignedBB axisalignedbb13 : (List) list1) { + z = axisalignedbb13.calculateZOffset(this.getEntityBoundingBox(), z); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, 0.0D, z)); + if (this.stepHeight > 0.0F && flag1 && (d3 != x || d5 != z)) { + double d11 = x; + double d7 = y; + double d8 = z; + AxisAlignedBB axisalignedbb3 = this.getEntityBoundingBox(); + this.setEntityBoundingBox(axisalignedbb); + y = (double) this.stepHeight; + List list = this.worldObj.getCollidingBoundingBoxes(this, + this.getEntityBoundingBox().addCoord(d3, y, d5)); + AxisAlignedBB axisalignedbb4 = this.getEntityBoundingBox(); + AxisAlignedBB axisalignedbb5 = axisalignedbb4.addCoord(d3, 0.0D, d5); + double d9 = y; + + for (AxisAlignedBB axisalignedbb6 : (List) list) { + d9 = axisalignedbb6.calculateYOffset(axisalignedbb5, d9); + } + + axisalignedbb4 = axisalignedbb4.offset(0.0D, d9, 0.0D); + double d15 = d3; + + for (AxisAlignedBB axisalignedbb7 : (List) list) { + d15 = axisalignedbb7.calculateXOffset(axisalignedbb4, d15); + } + + axisalignedbb4 = axisalignedbb4.offset(d15, 0.0D, 0.0D); + double d16 = d5; + + for (AxisAlignedBB axisalignedbb8 : (List) list) { + d16 = axisalignedbb8.calculateZOffset(axisalignedbb4, d16); + } + + axisalignedbb4 = axisalignedbb4.offset(0.0D, 0.0D, d16); + AxisAlignedBB axisalignedbb14 = this.getEntityBoundingBox(); + double d17 = y; + + for (AxisAlignedBB axisalignedbb9 : (List) list) { + d17 = axisalignedbb9.calculateYOffset(axisalignedbb14, d17); + } + + axisalignedbb14 = axisalignedbb14.offset(0.0D, d17, 0.0D); + double d18 = d3; + + for (AxisAlignedBB axisalignedbb10 : (List) list) { + d18 = axisalignedbb10.calculateXOffset(axisalignedbb14, d18); + } + + axisalignedbb14 = axisalignedbb14.offset(d18, 0.0D, 0.0D); + double d19 = d5; + + for (AxisAlignedBB axisalignedbb11 : (List) list) { + d19 = axisalignedbb11.calculateZOffset(axisalignedbb14, d19); + } + + axisalignedbb14 = axisalignedbb14.offset(0.0D, 0.0D, d19); + double d20 = d15 * d15 + d16 * d16; + double d10 = d18 * d18 + d19 * d19; + if (d20 > d10) { + x = d15; + z = d16; + y = -d9; + this.setEntityBoundingBox(axisalignedbb4); + } else { + x = d18; + z = d19; + y = -d17; + this.setEntityBoundingBox(axisalignedbb14); + } + + for (AxisAlignedBB axisalignedbb12 : (List) list) { + y = axisalignedbb12.calculateYOffset(this.getEntityBoundingBox(), y); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, y, 0.0D)); + if (d11 * d11 + d8 * d8 >= x * x + z * z) { + x = d11; + y = d7; + z = d8; + this.setEntityBoundingBox(axisalignedbb3); + } + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rest"); + this.resetPositionToBB(); + this.isCollidedHorizontally = d3 != x || d5 != z; + this.isCollidedVertically = d4 != y; + this.onGround = this.isCollidedVertically && d4 < 0.0D; + this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically; + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + Block block1 = this.worldObj.getBlockState(blockpos).getBlock(); + if (block1.getMaterial() == Material.air) { + Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); + if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate) { + block1 = block; + blockpos = blockpos.down(); + } + } + + this.updateFallState(y, this.onGround, block1, blockpos); + if (d3 != x) { + this.motionX = 0.0D; + } + + if (d5 != z) { + this.motionZ = 0.0D; + } + + if (d4 != y) { + block1.onLanded(this.worldObj, this); + } + + if (this.canTriggerWalking() && !flag && this.ridingEntity == null) { + double d12 = this.posX - d0; + double d13 = this.posY - d1; + double d14 = this.posZ - d2; + if (block1 != Blocks.ladder) { + d13 = 0.0D; + } + + if (block1 != null && this.onGround) { + block1.onEntityCollidedWithBlock(this.worldObj, blockpos, this); + } + + this.distanceWalkedModified = (float) ((double) this.distanceWalkedModified + + (double) MathHelper.sqrt_double(d12 * d12 + d14 * d14) * 0.6D); + this.distanceWalkedOnStepModified = (float) ((double) this.distanceWalkedOnStepModified + + (double) MathHelper.sqrt_double(d12 * d12 + d13 * d13 + d14 * d14) * 0.6D); + if (this.distanceWalkedOnStepModified > (float) this.nextStepDistance + && block1.getMaterial() != Material.air) { + this.nextStepDistance = (int) this.distanceWalkedOnStepModified + 1; + if (this.isInWater()) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) + * 0.35F; + if (f > 1.0F) { + f = 1.0F; + } + + this.playSound(this.getSwimSound(), f, + 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + } + + this.playStepSound(blockpos, block1); + } + } + + try { + this.doBlockCollisions(); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Checking entity block collision"); + CrashReportCategory crashreportcategory = crashreport + .makeCategory("Entity being checked for collision"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + + boolean flag2 = this.isWet(); + if (this.worldObj.isFlammableWithin(this.getEntityBoundingBox().contract(0.001D, 0.001D, 0.001D))) { + this.dealFireDamage(1); + if (!flag2) { + ++this.fire; + if (this.fire == 0) { + this.setFire(8); + } + } + } else if (this.fire <= 0) { + this.fire = -this.fireResistance; + } + + if (flag2 && this.fire > 0) { + this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + this.fire = -this.fireResistance; + } + + this.worldObj.theProfiler.endSection(); + } + } + + /**+ + * Resets the entity's position to the center (planar) and + * bottom (vertical) points of its bounding box. + */ + private void resetPositionToBB() { + this.posX = (this.getEntityBoundingBox().minX + this.getEntityBoundingBox().maxX) / 2.0D; + this.posY = this.getEntityBoundingBox().minY; + this.posZ = (this.getEntityBoundingBox().minZ + this.getEntityBoundingBox().maxZ) / 2.0D; + } + + protected String getSwimSound() { + return "game.neutral.swim"; + } + + protected void doBlockCollisions() { + BlockPos blockpos = new BlockPos(this.getEntityBoundingBox().minX + 0.001D, + this.getEntityBoundingBox().minY + 0.001D, this.getEntityBoundingBox().minZ + 0.001D); + BlockPos blockpos1 = new BlockPos(this.getEntityBoundingBox().maxX - 0.001D, + this.getEntityBoundingBox().maxY - 0.001D, this.getEntityBoundingBox().maxZ - 0.001D); + if (this.worldObj.isAreaLoaded(blockpos, blockpos1)) { + for (int i = blockpos.getX(); i <= blockpos1.getX(); ++i) { + for (int j = blockpos.getY(); j <= blockpos1.getY(); ++j) { + for (int k = blockpos.getZ(); k <= blockpos1.getZ(); ++k) { + BlockPos blockpos2 = new BlockPos(i, j, k); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos2); + + try { + iblockstate.getBlock().onEntityCollidedWithBlock(this.worldObj, blockpos2, iblockstate, + this); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, + "Colliding entity with block"); + CrashReportCategory crashreportcategory = crashreport + .makeCategory("Block being collided with"); + CrashReportHelper.addIntegratedServerBlockInfo(crashreportcategory, blockpos2, iblockstate); + throw new ReportedException(crashreport); + } + } + } + } + } + + } + + protected void playStepSound(BlockPos pos, Block blockIn) { + Block.SoundType block$soundtype = blockIn.stepSound; + if (this.worldObj.getBlockState(pos.up()).getBlock() == Blocks.snow_layer) { + block$soundtype = Blocks.snow_layer.stepSound; + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F, + block$soundtype.getFrequency()); + } else if (!blockIn.getMaterial().isLiquid()) { + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F, + block$soundtype.getFrequency()); + } + + } + + public void playSound(String s, float f, float f1) { + if (!this.isSilent()) { + this.worldObj.playSoundAtEntity(this, s, f, f1); + } + + } + + /**+ + * @return True if this entity will not play sounds + */ + public boolean isSilent() { + return this.dataWatcher.getWatchableObjectByte(4) == 1; + } + + /**+ + * When set to true the entity will not play sounds. + */ + public void setSilent(boolean isSilent) { + this.dataWatcher.updateObject(4, Byte.valueOf((byte) (isSilent ? 1 : 0))); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return true; + } + + protected void updateFallState(double d0, boolean flag, Block block, BlockPos blockpos) { + if (flag) { + if (this.fallDistance > 0.0F) { + if (block != null) { + block.onFallenUpon(this.worldObj, blockpos, this, this.fallDistance); + } else { + this.fall(this.fallDistance, 1.0F); + } + + this.fallDistance = 0.0F; + } + } else if (d0 < 0.0D) { + this.fallDistance = (float) ((double) this.fallDistance - d0); + } + + } + + /**+ + * Returns the collision bounding box for this entity + */ + public AxisAlignedBB getCollisionBoundingBox() { + return null; + } + + /**+ + * Will deal the specified amount of damage to the entity if the + * entity isn't immune to fire damage. Args: amountDamage + */ + protected void dealFireDamage(int amount) { + if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.inFire, (float) amount); + } + + } + + public final boolean isImmuneToFire() { + return this.isImmuneToFire; + } + + public void fall(float distance, float damageMultiplier) { + if (this.riddenByEntity != null) { + this.riddenByEntity.fall(distance, damageMultiplier); + } + + } + + /**+ + * Checks if this entity is either in water or on an open air + * block in rain (used in wolves). + */ + public boolean isWet() { + return this.inWater || this.worldObj.canLightningStrike(new BlockPos(this.posX, this.posY, this.posZ)) + || this.worldObj + .canLightningStrike(new BlockPos(this.posX, this.posY + (double) this.height, this.posZ)); + } + + /**+ + * Checks if this entity is inside water (if inWater field is + * true as a result of handleWaterMovement() returning true) + */ + public boolean isInWater() { + return this.inWater; + } + + /**+ + * Returns if this entity is in water and will end up adding the + * waters velocity to the entity + */ + public boolean handleWaterMovement() { + if (this.worldObj.handleMaterialAcceleration( + this.getEntityBoundingBox().expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), + Material.water, this)) { + if (!this.inWater && !this.firstUpdate) { + this.resetHeight(); + } + + this.fallDistance = 0.0F; + this.inWater = true; + this.fire = 0; + } else { + this.inWater = false; + } + + return this.inWater; + } + + /**+ + * sets the players height back to normal after doing things + * like sleeping and dieing + */ + protected void resetHeight() { + float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; + if (f > 1.0F) { + f = 1.0F; + } + + this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float f1 = (float) MathHelper.floor_double(this.getEntityBoundingBox().minY); + + for (int i = 0; (float) i < 1.0F + this.width * 20.0F; ++i) { + float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + float f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (double) f2, (double) (f1 + 1.0F), + this.posZ + (double) f3, this.motionX, this.motionY - (double) (this.rand.nextFloat() * 0.2F), + this.motionZ, new int[0]); + } + + for (int j = 0; (float) j < 1.0F + this.width * 20.0F; ++j) { + float f4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + float f5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double) f4, (double) (f1 + 1.0F), + this.posZ + (double) f5, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + } + + /**+ + * Attempts to create sprinting particles if the entity is + * sprinting and not in water. + */ + public void spawnRunningParticles() { + if (this.isSprinting() && !this.isInWater()) { + this.createRunningParticles(); + } + + } + + protected void createRunningParticles() { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (block.getRenderType() != -1) { + this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, + this.posX + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width, + this.getEntityBoundingBox().minY + 0.1D, + this.posZ + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width, -this.motionX * 4.0D, + 1.5D, -this.motionZ * 4.0D, new int[] { Block.getStateId(iblockstate) }); + } + + } + + protected String getSplashSound() { + return "game.neutral.swim.splash"; + } + + /**+ + * Checks if the current block the entity is within of the + * specified material type + */ + public boolean isInsideOfMaterial(Material materialIn) { + double d0 = this.posY + (double) this.getEyeHeight(); + BlockPos blockpos = new BlockPos(this.posX, d0, this.posZ); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (block.getMaterial() == materialIn) { + float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) + - 0.11111111F; + float f1 = (float) (blockpos.getY() + 1) - f; + boolean flag = d0 < (double) f1; + return !flag && this instanceof EntityPlayer ? false : flag; + } else { + return false; + } + } + + public boolean isInLava() { + return this.worldObj.isMaterialInBB( + this.getEntityBoundingBox().expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), + Material.lava); + } + + /**+ + * Used in both water and by flying objects + */ + public void moveFlying(float strafe, float forward, float friction) { + float f = strafe * strafe + forward * forward; + if (f >= 1.0E-4F) { + f = MathHelper.sqrt_float(f); + if (f < 1.0F) { + f = 1.0F; + } + + f = friction / f; + strafe = strafe * f; + forward = forward * f; + float f1 = MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F); + float f2 = MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F); + this.motionX += (double) (strafe * f2 - forward * f1); + this.motionZ += (double) (forward * f2 + strafe * f1); + } + } + + public int getBrightnessForRender(float var1) { + BlockPos blockpos = new BlockPos(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getCombinedLight(blockpos, 0) : 0; + } + + /**+ + * Gets how bright this entity is. + */ + public float getBrightness(float var1) { + BlockPos blockpos = new BlockPos(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getLightBrightness(blockpos) : 0.0F; + } + + /**+ + * Sets the reference to the World object. + */ + public void setWorld(World worldIn) { + this.worldObj = worldIn; + } + + /**+ + * Sets the entity's position and rotation. + */ + public void setPositionAndRotation(double x, double y, double z, float yaw, float pitch) { + this.prevPosX = this.posX = x; + this.prevPosY = this.posY = y; + this.prevPosZ = this.posZ = z; + this.prevRotationYaw = this.rotationYaw = yaw; + this.prevRotationPitch = this.rotationPitch = pitch; + double d0 = (double) (this.prevRotationYaw - yaw); + if (d0 < -180.0D) { + this.prevRotationYaw += 360.0F; + } + + if (d0 >= 180.0D) { + this.prevRotationYaw -= 360.0F; + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(yaw, pitch); + } + + public void moveToBlockPosAndAngles(BlockPos pos, float rotationYawIn, float rotationPitchIn) { + this.setLocationAndAngles((double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D, + rotationYawIn, rotationPitchIn); + } + + /**+ + * Sets the location and Yaw/Pitch of an entity in the world + */ + public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch) { + this.lastTickPosX = this.prevPosX = this.posX = x; + this.lastTickPosY = this.prevPosY = this.posY = y; + this.lastTickPosZ = this.prevPosZ = this.posZ = z; + this.rotationYaw = yaw; + this.rotationPitch = pitch; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /**+ + * Returns the distance to the entity. Args: entity + */ + public float getDistanceToEntity(Entity entityIn) { + float f = (float) (this.posX - entityIn.posX); + float f1 = (float) (this.posY - entityIn.posY); + float f2 = (float) (this.posZ - entityIn.posZ); + return MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2); + } + + /**+ + * Gets the squared distance to the position. Args: x, y, z + */ + public double getDistanceSq(double x, double y, double z) { + double d0 = this.posX - x; + double d1 = this.posY - y; + double d2 = this.posZ - z; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /**+ + * Gets the squared distance to the position. Args: x, y, z + */ + public double getDistanceSq(BlockPos pos) { + return pos.distanceSq(this.posX, this.posY, this.posZ); + } + + public double getDistanceSqToCenter(BlockPos pos) { + return pos.distanceSqToCenter(this.posX, this.posY, this.posZ); + } + + /**+ + * Gets the distance to the position. Args: x, y, z + */ + public double getDistance(double x, double y, double z) { + double d0 = this.posX - x; + double d1 = this.posY - y; + double d2 = this.posZ - z; + return (double) MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2); + } + + /**+ + * Returns the squared distance to the entity. Args: entity + */ + public double getDistanceSqToEntity(Entity entityIn) { + double d0 = this.posX - entityIn.posX; + double d1 = this.posY - entityIn.posY; + double d2 = this.posZ - entityIn.posZ; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer parEntityPlayer) { + } + + /**+ + * Applies a velocity to each of the entities pushing them away + * from each other. Args: entity + */ + public void applyEntityCollision(Entity entityIn) { + if (entityIn.riddenByEntity != this && entityIn.ridingEntity != this) { + if (!entityIn.noClip && !this.noClip) { + double d0 = entityIn.posX - this.posX; + double d1 = entityIn.posZ - this.posZ; + double d2 = MathHelper.abs_max(d0, d1); + if (d2 >= 0.009999999776482582D) { + d2 = (double) MathHelper.sqrt_double(d2); + d0 = d0 / d2; + d1 = d1 / d2; + double d3 = 1.0D / d2; + if (d3 > 1.0D) { + d3 = 1.0D; + } + + d0 = d0 * d3; + d1 = d1 * d3; + d0 = d0 * 0.05000000074505806D; + d1 = d1 * 0.05000000074505806D; + d0 = d0 * (double) (1.0F - this.entityCollisionReduction); + d1 = d1 * (double) (1.0F - this.entityCollisionReduction); + if (this.riddenByEntity == null) { + this.addVelocity(-d0, 0.0D, -d1); + } + + if (entityIn.riddenByEntity == null) { + entityIn.addVelocity(d0, 0.0D, d1); + } + } + + } + } + } + + /**+ + * Adds to the current velocity of the entity. Args: x, y, z + */ + public void addVelocity(double x, double y, double z) { + this.motionX += x; + this.motionY += y; + this.motionZ += z; + this.isAirBorne = true; + } + + /**+ + * Sets that this entity has been attacked. + */ + protected void setBeenAttacked() { + this.velocityChanged = true; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float var2) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.setBeenAttacked(); + return false; + } + } + + /**+ + * interpolated look vector + */ + public Vec3 getLook(float partialTicks) { + if (partialTicks == 1.0F) { + return this.getVectorForRotation(this.rotationPitch, this.rotationYaw); + } else { + float f = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * partialTicks; + float f1 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * partialTicks; + return this.getVectorForRotation(f, f1); + } + } + + /**+ + * Creates a Vec3 using the pitch and yaw of the entities + * rotation. + */ + protected final Vec3 getVectorForRotation(float pitch, float yaw) { + float f = MathHelper.cos(-yaw * 0.017453292F - 3.1415927F); + float f1 = MathHelper.sin(-yaw * 0.017453292F - 3.1415927F); + float f2 = -MathHelper.cos(-pitch * 0.017453292F); + float f3 = MathHelper.sin(-pitch * 0.017453292F); + return new Vec3((double) (f1 * f2), (double) f3, (double) (f * f2)); + } + + public Vec3 getPositionEyes(float partialTicks) { + if (partialTicks == 1.0F) { + return new Vec3(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + } else { + double d0 = this.prevPosX + (this.posX - this.prevPosX) * (double) partialTicks; + double d1 = this.prevPosY + (this.posY - this.prevPosY) * (double) partialTicks + + (double) this.getEyeHeight(); + double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTicks; + return new Vec3(d0, d1, d2); + } + } + + public MovingObjectPosition rayTrace(double blockReachDistance, float partialTicks) { + Vec3 vec3 = this.getPositionEyes(partialTicks); + Vec3 vec31 = this.getLook(partialTicks); + Vec3 vec32 = vec3.addVector(vec31.xCoord * blockReachDistance, vec31.yCoord * blockReachDistance, + vec31.zCoord * blockReachDistance); + return this.worldObj.rayTraceBlocks(vec3, vec32, false, false, true); + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return false; + } + + /**+ + * Adds a value to the player score. Currently not actually used + * and the entity passed in does nothing. Args: entity, + * scoreToAdd + */ + public void addToPlayerScore(Entity entityIn, int amount) { + } + + public boolean isInRangeToRender3d(double x, double y, double z) { + double d0 = this.posX - x; + double d1 = this.posY - y; + double d2 = this.posZ - z; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + return this.isInRangeToRenderDist(d3); + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double distance) { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength(); + if (Double.isNaN(d0)) { + d0 = 1.0D; + } + + d0 = d0 * 64.0D * this.renderDistanceWeight; + return distance < d0 * d0; + } + + /**+ + * Like writeToNBTOptional but does not check if the entity is + * ridden. Used for saving ridden entities with their riders. + */ + public boolean writeMountToNBT(NBTTagCompound tagCompund) { + String s = this.getEntityString(); + if (!this.isDead && s != null) { + tagCompund.setString("id", s); + this.writeToNBT(tagCompund); + return true; + } else { + return false; + } + } + + /**+ + * Either write this entity to the NBT tag given and return + * true, or return false without doing anything. If this returns + * false the entity is not saved on disk. Ridden entities return + * false here as they are saved with their rider. + */ + public boolean writeToNBTOptional(NBTTagCompound tagCompund) { + String s = this.getEntityString(); + if (!this.isDead && s != null && this.riddenByEntity == null) { + tagCompund.setString("id", s); + this.writeToNBT(tagCompund); + return true; + } else { + return false; + } + } + + /**+ + * Save the entity to NBT (calls an abstract helper method to + * write extra data) + */ + public void writeToNBT(NBTTagCompound tagCompund) { + try { + tagCompund.setTag("Pos", this.newDoubleNBTList(new double[] { this.posX, this.posY, this.posZ })); + tagCompund.setTag("Motion", + this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ })); + tagCompund.setTag("Rotation", this.newFloatNBTList(new float[] { this.rotationYaw, this.rotationPitch })); + tagCompund.setFloat("FallDistance", this.fallDistance); + tagCompund.setShort("Fire", (short) this.fire); + tagCompund.setShort("Air", (short) this.getAir()); + tagCompund.setBoolean("OnGround", this.onGround); + tagCompund.setInteger("Dimension", this.dimension); + tagCompund.setBoolean("Invulnerable", this.invulnerable); + tagCompund.setInteger("PortalCooldown", this.timeUntilPortal); + tagCompund.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits()); + tagCompund.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits()); + if (this.getCustomNameTag() != null && this.getCustomNameTag().length() > 0) { + tagCompund.setString("CustomName", this.getCustomNameTag()); + tagCompund.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); + } + + this.cmdResultStats.writeStatsToNBT(tagCompund); + if (this.isSilent()) { + tagCompund.setBoolean("Silent", this.isSilent()); + } + + this.writeEntityToNBT(tagCompund); + if (this.ridingEntity != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + if (this.ridingEntity.writeMountToNBT(nbttagcompound)) { + tagCompund.setTag("Riding", nbttagcompound); + } + } + + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Saving entity NBT"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being saved"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + /**+ + * Reads the entity from NBT (calls an abstract helper method to + * read specialized data) + */ + public void readFromNBT(NBTTagCompound tagCompund) { + try { + NBTTagList nbttaglist = tagCompund.getTagList("Pos", 6); + NBTTagList nbttaglist1 = tagCompund.getTagList("Motion", 6); + NBTTagList nbttaglist2 = tagCompund.getTagList("Rotation", 5); + this.motionX = nbttaglist1.getDoubleAt(0); + this.motionY = nbttaglist1.getDoubleAt(1); + this.motionZ = nbttaglist1.getDoubleAt(2); + if (Math.abs(this.motionX) > 10.0D) { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) > 10.0D) { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) > 10.0D) { + this.motionZ = 0.0D; + } + + this.prevPosX = this.lastTickPosX = this.posX = nbttaglist.getDoubleAt(0); + this.prevPosY = this.lastTickPosY = this.posY = nbttaglist.getDoubleAt(1); + this.prevPosZ = this.lastTickPosZ = this.posZ = nbttaglist.getDoubleAt(2); + this.prevRotationYaw = this.rotationYaw = nbttaglist2.getFloatAt(0); + this.prevRotationPitch = this.rotationPitch = nbttaglist2.getFloatAt(1); + this.setRotationYawHead(this.rotationYaw); + this.func_181013_g(this.rotationYaw); + this.fallDistance = tagCompund.getFloat("FallDistance"); + this.fire = tagCompund.getShort("Fire"); + this.setAir(tagCompund.getShort("Air")); + this.onGround = tagCompund.getBoolean("OnGround"); + this.dimension = tagCompund.getInteger("Dimension"); + this.invulnerable = tagCompund.getBoolean("Invulnerable"); + this.timeUntilPortal = tagCompund.getInteger("PortalCooldown"); + if (tagCompund.hasKey("UUIDMost", 4) && tagCompund.hasKey("UUIDLeast", 4)) { + this.entityUniqueID = new EaglercraftUUID(tagCompund.getLong("UUIDMost"), + tagCompund.getLong("UUIDLeast")); + } else if (tagCompund.hasKey("UUID", 8)) { + this.entityUniqueID = EaglercraftUUID.fromString(tagCompund.getString("UUID")); + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0) { + this.setCustomNameTag(tagCompund.getString("CustomName")); + } + + this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); + this.cmdResultStats.readStatsFromNBT(tagCompund); + this.setSilent(tagCompund.getBoolean("Silent")); + this.readEntityFromNBT(tagCompund); + if (this.shouldSetPosAfterLoading()) { + this.setPosition(this.posX, this.posY, this.posZ); + } + + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Loading entity NBT"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being loaded"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + protected boolean shouldSetPosAfterLoading() { + return true; + } + + /**+ + * Returns the string that identifies this Entity's class + */ + protected final String getEntityString() { + return EntityList.getEntityString(this); + } + + protected abstract void readEntityFromNBT(NBTTagCompound var1); + + protected abstract void writeEntityToNBT(NBTTagCompound var1); + + public void onChunkLoad() { + } + + /**+ + * creates a NBT list from the array of doubles passed to this + * function + */ + protected NBTTagList newDoubleNBTList(double... numbers) { + NBTTagList nbttaglist = new NBTTagList(); + + for (double d0 : numbers) { + nbttaglist.appendTag(new NBTTagDouble(d0)); + } + + return nbttaglist; + } + + /**+ + * Returns a new NBTTagList filled with the specified floats + */ + protected NBTTagList newFloatNBTList(float... numbers) { + NBTTagList nbttaglist = new NBTTagList(); + + for (float f : numbers) { + nbttaglist.appendTag(new NBTTagFloat(f)); + } + + return nbttaglist; + } + + public EntityItem dropItem(Item itemIn, int size) { + return this.dropItemWithOffset(itemIn, size, 0.0F); + } + + public EntityItem dropItemWithOffset(Item itemIn, int size, float offsetY) { + return this.entityDropItem(new ItemStack(itemIn, size, 0), offsetY); + } + + /**+ + * Drops an item at the position of the entity. + */ + public EntityItem entityDropItem(ItemStack itemStackIn, float offsetY) { + if (itemStackIn.stackSize != 0 && itemStackIn.getItem() != null) { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double) offsetY, this.posZ, + itemStackIn); + entityitem.setDefaultPickupDelay(); + this.worldObj.spawnEntityInWorld(entityitem); + return entityitem; + } else { + return null; + } + } + + /**+ + * Checks whether target entity is alive. + */ + public boolean isEntityAlive() { + return !this.isDead; + } + + /**+ + * Checks if this entity is inside of an opaque block + */ + public boolean isEntityInsideOpaqueBlock() { + if (this.noClip) { + return false; + } else { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(Integer.MIN_VALUE, + Integer.MIN_VALUE, Integer.MIN_VALUE); + + for (int i = 0; i < 8; ++i) { + int j = MathHelper.floor_double( + this.posY + (double) (((float) ((i >> 0) % 2) - 0.5F) * 0.1F) + (double) this.getEyeHeight()); + int k = MathHelper + .floor_double(this.posX + (double) (((float) ((i >> 1) % 2) - 0.5F) * this.width * 0.8F)); + int l = MathHelper + .floor_double(this.posZ + (double) (((float) ((i >> 2) % 2) - 0.5F) * this.width * 0.8F)); + if (blockpos$mutableblockpos.getX() != k || blockpos$mutableblockpos.getY() != j + || blockpos$mutableblockpos.getZ() != l) { + blockpos$mutableblockpos.func_181079_c(k, j, l); + if (this.worldObj.getBlockState(blockpos$mutableblockpos).getBlock().isVisuallyOpaque()) { + return true; + } + } + } + + return false; + } + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer playerIn) { + return false; + } + + /**+ + * Returns a boundingBox used to collide the entity with other + * entities and blocks. This enables the entity to be pushable + * on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity entityIn) { + return null; + } + + /**+ + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + if (this.ridingEntity.isDead) { + this.ridingEntity = null; + } else { + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.onUpdate(); + if (this.ridingEntity != null) { + this.ridingEntity.updateRiderPosition(); + this.entityRiderYawDelta += (double) (this.ridingEntity.rotationYaw + - this.ridingEntity.prevRotationYaw); + + for (this.entityRiderPitchDelta += (double) (this.ridingEntity.rotationPitch + - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { + ; + } + + while (this.entityRiderYawDelta < -180.0D) { + this.entityRiderYawDelta += 360.0D; + } + + while (this.entityRiderPitchDelta >= 180.0D) { + this.entityRiderPitchDelta -= 360.0D; + } + + while (this.entityRiderPitchDelta < -180.0D) { + this.entityRiderPitchDelta += 360.0D; + } + + double d0 = this.entityRiderYawDelta * 0.5D; + double d1 = this.entityRiderPitchDelta * 0.5D; + float f = 10.0F; + if (d0 > (double) f) { + d0 = (double) f; + } + + if (d0 < (double) (-f)) { + d0 = (double) (-f); + } + + if (d1 > (double) f) { + d1 = (double) f; + } + + if (d1 < (double) (-f)) { + d1 = (double) (-f); + } + + this.entityRiderYawDelta -= d0; + this.entityRiderPitchDelta -= d1; + } + } + } + + public void updateRiderPosition() { + if (this.riddenByEntity != null) { + this.riddenByEntity.setPosition(this.posX, + this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); + } + } + + /**+ + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return 0.0D; + } + + /**+ + * Returns the Y offset from the entity's position for any + * entity riding this one. + */ + public double getMountedYOffset() { + return (double) this.height * 0.75D; + } + + /**+ + * Called when a player mounts an entity. e.g. mounts a pig, + * mounts a boat. + */ + public void mountEntity(Entity entity) { + this.entityRiderPitchDelta = 0.0D; + this.entityRiderYawDelta = 0.0D; + if (entity == null) { + if (this.ridingEntity != null) { + this.setLocationAndAngles(this.ridingEntity.posX, + this.ridingEntity.getEntityBoundingBox().minY + (double) this.ridingEntity.height, + this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch); + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { + if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + + if (entity != null) { + for (Entity entity1 = entity.ridingEntity; entity1 != null; entity1 = entity1.ridingEntity) { + if (entity1 == this) { + return; + } + } + } + + this.ridingEntity = entity; + entity.riddenByEntity = this; + } + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int var9, boolean var10) { + this.setPosition(d0, d1, d2); + this.setRotation(f, f1); + List list = this.worldObj.getCollidingBoundingBoxes(this, + this.getEntityBoundingBox().contract(0.03125D, 0.0D, 0.03125D)); + if (!list.isEmpty()) { + double d3 = 0.0D; + + for (AxisAlignedBB axisalignedbb : (List) list) { + if (axisalignedbb.maxY > d3) { + d3 = axisalignedbb.maxY; + } + } + + d1 = d1 + (d3 - this.getEntityBoundingBox().minY); + this.setPosition(d0, d1, d2); + } + + } + + public float getCollisionBorderSize() { + return 0.1F; + } + + /**+ + * returns a (normalized) vector of where this entity is looking + */ + public Vec3 getLookVec() { + return null; + } + + public void func_181015_d(BlockPos parBlockPos) { + if (this.timeUntilPortal > 0) { + this.timeUntilPortal = this.getPortalCooldown(); + } else { + if (!parBlockPos.equals(this.field_181016_an)) { + this.field_181016_an = parBlockPos; + BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.portal.func_181089_f(this.worldObj, + parBlockPos); + double d0 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X + ? (double) blockpattern$patternhelper.func_181117_a().getZ() + : (double) blockpattern$patternhelper.func_181117_a().getX(); + double d1 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? this.posZ + : this.posX; + d1 = Math.abs(MathHelper.func_181160_c( + d1 - (double) (blockpattern$patternhelper.getFinger().rotateY() + .getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ? 1 : 0), + d0, d0 - (double) blockpattern$patternhelper.func_181118_d())); + double d2 = MathHelper.func_181160_c(this.posY - 1.0D, + (double) blockpattern$patternhelper.func_181117_a().getY(), + (double) (blockpattern$patternhelper.func_181117_a().getY() + - blockpattern$patternhelper.func_181119_e())); + this.field_181017_ao = new Vec3(d1, d2, 0.0D); + this.field_181018_ap = blockpattern$patternhelper.getFinger(); + } + + this.inPortal = true; + } + } + + /**+ + * Return the amount of cooldown before this entity can use a + * portal again. + */ + public int getPortalCooldown() { + return 300; + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double x, double y, double z) { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + } + + public void handleStatusUpdate(byte id) { + } + + /**+ + * Setups the entity to do the hurt animation. Only used by + * packets in multiplayer. + */ + public void performHurtAnimation() { + } + + /**+ + * returns the inventory of this entity (only used in + * EntityPlayerMP it seems) + */ + public ItemStack[] getInventory() { + return null; + } + + /**+ + * Sets the held item, or an armor slot. Slot 0 is held item. + * Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int var1, ItemStack var2) { + } + + /**+ + * Returns true if the entity is on fire. Used by render to add + * the fire effect on rendering. + */ + public boolean isBurning() { + return !this.isImmuneToFire && this.fire > 0; + } + + /**+ + * Returns true if the entity is riding another entity, used by + * render to rotate the legs to be in 'sit' position for + * players. + */ + public boolean isRiding() { + return this.ridingEntity != null; + } + + /**+ + * Returns if this entity is sneaking. + */ + public boolean isSneaking() { + return this.getFlag(1); + } + + /**+ + * Sets the sneaking flag. + */ + public void setSneaking(boolean sneaking) { + this.setFlag(1, sneaking); + } + + /**+ + * Get if the Entity is sprinting. + */ + public boolean isSprinting() { + return this.getFlag(3); + } + + /**+ + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean flag) { + this.setFlag(3, flag); + } + + public boolean isInvisible() { + return this.getFlag(5); + } + + /**+ + * Only used by renderer in EntityLivingBase + * subclasses.\nDetermines if an entity is visible or not to a + * specfic player, if the entity is normally invisible.\nFor + * EntityLivingBase subclasses, returning false when invisible + * will render the entity semitransparent. + */ + public boolean isInvisibleToPlayer(EntityPlayer player) { + return player.isSpectator() ? false : this.isInvisible(); + } + + public void setInvisible(boolean invisible) { + this.setFlag(5, invisible); + } + + public boolean isEating() { + return this.getFlag(4); + } + + public void setEating(boolean eating) { + this.setFlag(4, eating); + } + + /**+ + * Returns true if the flag is active for the entity. Known + * flags: 0) is burning; 1) is sneaking; 2) is riding something; + * 3) is sprinting; 4) is eating + */ + protected boolean getFlag(int flag) { + return (this.dataWatcher.getWatchableObjectByte(0) & 1 << flag) != 0; + } + + /**+ + * Enable or disable a entity flag, see getEntityFlag to read + * the know flags. + */ + protected void setFlag(int flag, boolean set) { + byte b0 = this.dataWatcher.getWatchableObjectByte(0); + if (set) { + this.dataWatcher.updateObject(0, Byte.valueOf((byte) (b0 | 1 << flag))); + } else { + this.dataWatcher.updateObject(0, Byte.valueOf((byte) (b0 & ~(1 << flag)))); + } + + } + + public int getAir() { + return this.dataWatcher.getWatchableObjectShort(1); + } + + public void setAir(int air) { + this.dataWatcher.updateObject(1, Short.valueOf((short) air)); + } + + /**+ + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt lightningBolt) { + this.attackEntityFrom(DamageSource.lightningBolt, 5.0F); + ++this.fire; + if (this.fire == 0) { + this.setFire(8); + } + + } + + /**+ + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase entityLivingIn) { + } + + protected boolean pushOutOfBlocks(double d0, double d1, double d2) { + BlockPos blockpos = new BlockPos(d0, d1, d2); + double d3 = d0 - (double) blockpos.getX(); + double d4 = d1 - (double) blockpos.getY(); + double d5 = d2 - (double) blockpos.getZ(); + List list = this.worldObj.func_147461_a(this.getEntityBoundingBox()); + if (list.isEmpty() && !this.worldObj.isBlockFullCube(blockpos)) { + return false; + } else { + byte b0 = 3; + double d6 = 9999.0D; + if (!this.worldObj.isBlockFullCube(blockpos.west()) && d3 < d6) { + d6 = d3; + b0 = 0; + } + + if (!this.worldObj.isBlockFullCube(blockpos.east()) && 1.0D - d3 < d6) { + d6 = 1.0D - d3; + b0 = 1; + } + + if (!this.worldObj.isBlockFullCube(blockpos.up()) && 1.0D - d4 < d6) { + d6 = 1.0D - d4; + b0 = 3; + } + + if (!this.worldObj.isBlockFullCube(blockpos.north()) && d5 < d6) { + d6 = d5; + b0 = 4; + } + + if (!this.worldObj.isBlockFullCube(blockpos.south()) && 1.0D - d5 < d6) { + d6 = 1.0D - d5; + b0 = 5; + } + + float f = this.rand.nextFloat() * 0.2F + 0.1F; + if (b0 == 0) { + this.motionX = (double) (-f); + } + + if (b0 == 1) { + this.motionX = (double) f; + } + + if (b0 == 3) { + this.motionY = (double) f; + } + + if (b0 == 4) { + this.motionZ = (double) (-f); + } + + if (b0 == 5) { + this.motionZ = (double) f; + } + + return true; + } + } + + /**+ + * Sets the Entity inside a web block. + */ + public void setInWeb() { + this.isInWeb = true; + this.fallDistance = 0.0F; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + if (this.hasCustomName()) { + return this.getCustomNameTag(); + } else { + String s = EntityList.getEntityString(this); + if (s == null) { + s = "generic"; + } + + return StatCollector.translateToLocal("entity." + s + ".name"); + } + } + + /**+ + * Return the Entity parts making up this Entity (currently only + * for dragons) + */ + public Entity[] getParts() { + return null; + } + + /**+ + * Returns true if Entity argument is equal to this Entity + */ + public boolean isEntityEqual(Entity entityIn) { + return this == entityIn; + } + + public float getRotationYawHead() { + return 0.0F; + } + + /**+ + * Sets the head's yaw rotation of the entity. + */ + public void setRotationYawHead(float rotation) { + } + + public void func_181013_g(float parFloat1) { + } + + /**+ + * If returns false, the item will not inflict any damage + * against entities. + */ + public boolean canAttackWithItem() { + return true; + } + + /**+ + * Called when a player attacks an entity. If this returns true + * the attack will not happen. + */ + public boolean hitByEntity(Entity entityIn) { + return false; + } + + public String toString() { + return HString.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", + new Object[] { this.getClass().getSimpleName(), this.getName(), Integer.valueOf(this.entityId), + this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), + Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ) }); + } + + public boolean isEntityInvulnerable(DamageSource source) { + return this.invulnerable && source != DamageSource.outOfWorld && !source.isCreativePlayer(); + } + + /**+ + * Sets this entity's location and angles to the location and + * angles of the passed in entity. + */ + public void copyLocationAndAnglesFrom(Entity entityIn) { + this.setLocationAndAngles(entityIn.posX, entityIn.posY, entityIn.posZ, entityIn.rotationYaw, + entityIn.rotationPitch); + } + + /**+ + * Prepares this entity in new dimension by copying NBT data + * from entity in old dimension + */ + public void copyDataFromOld(Entity entityIn) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entityIn.writeToNBT(nbttagcompound); + this.readFromNBT(nbttagcompound); + this.timeUntilPortal = entityIn.timeUntilPortal; + this.field_181016_an = entityIn.field_181016_an; + this.field_181017_ao = entityIn.field_181017_ao; + this.field_181018_ap = entityIn.field_181018_ap; + } + + /**+ + * Teleports the entity to another dimension. Params: Dimension + * number to teleport to + */ + public void travelToDimension(int i) { + if (!this.isDead) { + this.worldObj.theProfiler.startSection("changeDimension"); + MinecraftServer minecraftserver = MinecraftServer.getServer(); + int j = this.dimension; + WorldServer worldserver = minecraftserver.worldServerForDimension(j); + WorldServer worldserver1 = minecraftserver.worldServerForDimension(i); + this.dimension = i; + if (j == 1 && i == 1) { + worldserver1 = minecraftserver.worldServerForDimension(0); + this.dimension = 0; + } + + this.worldObj.removeEntity(this); + this.isDead = false; + this.worldObj.theProfiler.startSection("reposition"); + minecraftserver.getConfigurationManager().transferEntityToWorld(this, j, worldserver, worldserver1); + this.worldObj.theProfiler.endStartSection("reloading"); + Entity entity = EntityList.createEntityByName(EntityList.getEntityString(this), worldserver1); + if (entity != null) { + entity.copyDataFromOld(this); + if (j == 1 && i == 1) { + BlockPos blockpos = this.worldObj.getTopSolidOrLiquidBlock(worldserver1.getSpawnPoint()); + entity.moveToBlockPosAndAngles(blockpos, entity.rotationYaw, entity.rotationPitch); + } + + worldserver1.spawnEntityInWorld(entity); + } + + this.isDead = true; + this.worldObj.theProfiler.endSection(); + worldserver.resetUpdateEntityTick(); + worldserver1.resetUpdateEntityTick(); + this.worldObj.theProfiler.endSection(); + } + } + + /**+ + * Explosion resistance of a block relative to this entity + */ + public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { + return blockStateIn.getBlock().getExplosionResistance(this); + } + + public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, + float parFloat1) { + return true; + } + + /**+ + * The maximum height from where the entity is alowed to jump + * (used in pathfinder) + */ + public int getMaxFallHeight() { + return 3; + } + + public Vec3 func_181014_aG() { + return this.field_181017_ao; + } + + public EnumFacing func_181012_aH() { + return this.field_181018_ap; + } + + /**+ + * Return whether this entity should NOT trigger a pressure + * plate or a tripwire. + */ + public boolean doesEntityNotTriggerPressurePlate() { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory category) { + category.addCrashSectionCallable("Entity Type", new Callable() { + public String call() throws Exception { + return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")"; + } + }); + category.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); + category.addCrashSectionCallable("Entity Name", new Callable() { + public String call() throws Exception { + return Entity.this.getName(); + } + }); + category.addCrashSection("Entity\'s Exact location", HString.format("%.2f, %.2f, %.2f", + new Object[] { Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ) })); + category.addCrashSection("Entity\'s Block location", + CrashReportCategory.getCoordinateInfo((double) MathHelper.floor_double(this.posX), + (double) MathHelper.floor_double(this.posY), (double) MathHelper.floor_double(this.posZ))); + category.addCrashSection("Entity\'s Momentum", HString.format("%.2f, %.2f, %.2f", new Object[] { + Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ) })); + category.addCrashSectionCallable("Entity\'s Rider", new Callable() { + public String call() throws Exception { + return Entity.this.riddenByEntity.toString(); + } + }); + category.addCrashSectionCallable("Entity\'s Vehicle", new Callable() { + public String call() throws Exception { + return Entity.this.ridingEntity.toString(); + } + }); + } + + /**+ + * Return whether this entity should be rendered as on fire. + */ + public boolean canRenderOnFire() { + return this.isBurning(); + } + + public EaglercraftUUID getUniqueID() { + return this.entityUniqueID; + } + + public boolean isPushedByWater() { + return true; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + ChatComponentText chatcomponenttext = new ChatComponentText(this.getName()); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttext; + } + + /**+ + * Sets the custom name tag for this entity + */ + public void setCustomNameTag(String name) { + this.dataWatcher.updateObject(2, name); + } + + public String getCustomNameTag() { + return this.dataWatcher.getWatchableObjectString(2); + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.dataWatcher.getWatchableObjectString(2).length() > 0; + } + + public void setAlwaysRenderNameTag(boolean alwaysRenderNameTag) { + this.dataWatcher.updateObject(3, Byte.valueOf((byte) (alwaysRenderNameTag ? 1 : 0))); + } + + public boolean getAlwaysRenderNameTag() { + return this.dataWatcher.getWatchableObjectByte(3) == 1; + } + + /**+ + * Sets the position of the entity and updates the 'last' + * variables + */ + public void setPositionAndUpdate(double d0, double d1, double d2) { + this.setLocationAndAngles(d0, d1, d2, this.rotationYaw, this.rotationPitch); + } + + public boolean getAlwaysRenderNameTagForRender() { + return this.getAlwaysRenderNameTag(); + } + + public void onDataWatcherUpdate(int dataID) { + } + + public EnumFacing getHorizontalFacing() { + return EnumFacing + .getHorizontal(MathHelper.floor_double((double) (this.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3); + } + + protected HoverEvent getHoverEvent() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + String s = EntityList.getEntityString(this); + nbttagcompound.setString("id", this.getUniqueID().toString()); + if (s != null) { + nbttagcompound.setString("type", s); + } + + nbttagcompound.setString("name", this.getName()); + return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new ChatComponentText(nbttagcompound.toString())); + } + + public boolean isSpectatedByPlayer(EntityPlayerMP var1) { + return true; + } + + public AxisAlignedBB getEntityBoundingBox() { + return this.boundingBox; + } + + public void setEntityBoundingBox(AxisAlignedBB bb) { + this.boundingBox = bb; + } + + public float getEyeHeight() { + return this.height * 0.85F; + } + + public boolean isOutsideBorder() { + return this.isOutsideBorder; + } + + public void setOutsideBorder(boolean outsideBorder) { + this.isOutsideBorder = outsideBorder; + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) { + return false; + } + + /**+ + * Send a chat message to the CommandSender + */ + public void addChatMessage(IChatComponent var1) { + } + + /**+ + * Returns {@code true} if the CommandSender is allowed to + * execute the command, {@code false} if not + */ + public boolean canCommandSenderUseCommand(int var1, String var2) { + return true; + } + + /**+ + * Get the position in the world. {@code null} is not + * allowed! If you are not an entity in the world, return + * the coordinates 0, 0, 0 + */ + public BlockPos getPosition() { + return new BlockPos(this.posX, this.posY + 0.5D, this.posZ); + } + + /**+ + * Get the position vector. {@code null} is not allowed! + * If you are not an entity in the world, return 0.0D, 0.0D, + * 0.0D + */ + public Vec3 getPositionVector() { + return new Vec3(this.posX, this.posY, this.posZ); + } + + /**+ + * Get the world, if available. {@code null} is not + * allowed! If you are not an entity in the world, return + * the overworld + */ + public World getEntityWorld() { + return this.worldObj; + } + + /**+ + * Returns the entity associated with the command sender. MAY BE + * NULL! + */ + public Entity getCommandSenderEntity() { + return this; + } + + /**+ + * Returns true if the command sender should be sent feedback + * about executed commands + */ + public boolean sendCommandFeedback() { + return false; + } + + public void setCommandStat(CommandResultStats.Type commandresultstats$type, int i) { + this.cmdResultStats.func_179672_a(this, commandresultstats$type, i); + } + + public CommandResultStats getCommandStats() { + return this.cmdResultStats; + } + + public void func_174817_o(Entity entityIn) { + this.cmdResultStats.func_179671_a(entityIn.getCommandStats()); + } + + public NBTTagCompound getNBTTagCompound() { + return null; + } + + /**+ + * Called when client receives entity's NBTTagCompound from + * server. + */ + public void clientUpdateEntityNBT(NBTTagCompound compound) { + } + + /**+ + * New version of interactWith that includes vector information + * on where precisely the player targeted. + */ + public boolean interactAt(EntityPlayer player, Vec3 targetVec3) { + return false; + } + + public boolean isImmuneToExplosions() { + return false; + } + + protected void applyEnchantments(EntityLivingBase entityLivingBaseIn, Entity entityIn) { + if (entityIn instanceof EntityLivingBase) { + EnchantmentHelper.applyThornEnchantments((EntityLivingBase) entityIn, entityLivingBaseIn); + } + + EnchantmentHelper.applyArthropodEnchantments(entityLivingBaseIn, entityIn); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityAgeable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityAgeable.java new file mode 100644 index 0000000..e0502f6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityAgeable.java @@ -0,0 +1,232 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAgeable extends EntityCreature { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityAgeable"); + } + + protected int growingAge; + protected int field_175502_b; + protected int field_175503_c; + private float ageWidth = -1.0F; + private float ageHeight; + + public EntityAgeable(World worldIn) { + super(worldIn); + } + + public abstract EntityAgeable createChild(EntityAgeable var1); + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer player) { + ItemStack itemstack = player.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) { + { + Class oclass = EntityList.getClassFromID(itemstack.getMetadata()); + if (oclass != null && this.getClass() == oclass) { + EntityAgeable entityageable = this.createChild(this); + if (entityageable != null) { + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityageable); + if (itemstack.hasDisplayName()) { + entityageable.setCustomNameTag(itemstack.getDisplayName()); + } + + if (!player.capabilities.isCreativeMode) { + --itemstack.stackSize; + if (itemstack.stackSize <= 0) { + player.inventory.setInventorySlotContents(player.inventory.currentItem, + (ItemStack) null); + } + } + } + } + return true; + } + } else { + return false; + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(12, Byte.valueOf((byte) 0)); + } + + /**+ + * The age value may be negative or positive or zero. If it's + * negative, it get's incremented on each tick, if it's + * positive, it get's decremented each tick. Don't confuse this + * with EntityLiving.getAge. With a negative value the Entity is + * considered a child. + */ + public int getGrowingAge() { + return this.growingAge; + } + + public void func_175501_a(int parInt1, boolean parFlag) { + int i = this.getGrowingAge(); + int j = i; + i = i + parInt1 * 20; + if (i > 0) { + i = 0; + if (j < 0) { + this.onGrowingAdult(); + } + } + + int k = i - j; + this.setGrowingAge(i); + if (parFlag) { + this.field_175502_b += k; + if (this.field_175503_c == 0) { + this.field_175503_c = 40; + } + } + + if (this.getGrowingAge() == 0) { + this.setGrowingAge(this.field_175502_b); + } + + } + + /**+ + * "Adds the value of the parameter times 20 to the age of this + * entity. If the entity is an adult (if the entity's age is + * greater than 0), it will have no effect." + */ + public void addGrowth(int growth) { + this.func_175501_a(growth, false); + } + + /**+ + * The age value may be negative or positive or zero. If it's + * negative, it get's incremented on each tick, if it's + * positive, it get's decremented each tick. With a negative + * value the Entity is considered a child. + */ + public void setGrowingAge(int age) { + this.dataWatcher.updateObject(12, Byte.valueOf((byte) MathHelper.clamp_int(age, -1, 1))); + this.growingAge = age; + this.setScaleForAge(this.isChild()); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("Age", this.getGrowingAge()); + nbttagcompound.setInteger("ForcedAge", this.field_175502_b); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setGrowingAge(nbttagcompound.getInteger("Age")); + this.field_175502_b = nbttagcompound.getInteger("ForcedAge"); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + { + int i = this.getGrowingAge(); + if (i < 0) { + ++i; + this.setGrowingAge(i); + if (i == 0) { + this.onGrowingAdult(); + } + } else if (i > 0) { + --i; + this.setGrowingAge(i); + } + } + } + + /**+ + * This is called when Entity's growing age timer reaches 0 + * (negative values are considered as a child, positive as an + * adult) + */ + protected void onGrowingAdult() { + } + + /**+ + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return this.getGrowingAge() < 0; + } + + /**+ + * "Sets the scale for an ageable entity according to the + * boolean parameter, which says if it's a child." + */ + public void setScaleForAge(boolean parFlag) { + this.setScale(parFlag ? 0.5F : 1.0F); + } + + /**+ + * Sets the width and height of the entity. Args: width, height + */ + protected final void setSize(float width, float height) { + boolean flag = this.ageWidth > 0.0F; + this.ageWidth = width; + this.ageHeight = height; + if (!flag) { + this.setScale(1.0F); + } + + } + + protected final void setScale(float scale) { + super.setSize(this.ageWidth * scale, this.ageHeight * scale); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityBodyHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityBodyHelper.java new file mode 100644 index 0000000..09c5b9f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityBodyHelper.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityBodyHelper { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityBodyHelper"); + } + + private EntityLivingBase theLiving; + private int rotationTickCounter; + private float prevRenderYawHead; + + public EntityBodyHelper(EntityLivingBase parEntityLivingBase) { + this.theLiving = parEntityLivingBase; + } + + /**+ + * Update the Head and Body rendenring angles + */ + public void updateRenderAngles() { + double d0 = this.theLiving.posX - this.theLiving.prevPosX; + double d1 = this.theLiving.posZ - this.theLiving.prevPosZ; + if (d0 * d0 + d1 * d1 > 2.500000277905201E-7D) { + this.theLiving.renderYawOffset = this.theLiving.rotationYaw; + this.theLiving.rotationYawHead = this.computeAngleWithBound(this.theLiving.renderYawOffset, + this.theLiving.rotationYawHead, 75.0F); + this.prevRenderYawHead = this.theLiving.rotationYawHead; + this.rotationTickCounter = 0; + } else { + float f = 75.0F; + if (Math.abs(this.theLiving.rotationYawHead - this.prevRenderYawHead) > 15.0F) { + this.rotationTickCounter = 0; + this.prevRenderYawHead = this.theLiving.rotationYawHead; + } else { + ++this.rotationTickCounter; + boolean flag = true; + if (this.rotationTickCounter > 10) { + f = Math.max(1.0F - (float) (this.rotationTickCounter - 10) / 10.0F, 0.0F) * 75.0F; + } + } + + this.theLiving.renderYawOffset = this.computeAngleWithBound(this.theLiving.rotationYawHead, + this.theLiving.renderYawOffset, f); + } + } + + /**+ + * Return the new angle2 such that the difference between angle1 + * and angle2 is lower than angleMax. Args : angle1, angle2, + * angleMax + */ + private float computeAngleWithBound(float parFloat1, float parFloat2, float parFloat3) { + float f = MathHelper.wrapAngleTo180_float(parFloat1 - parFloat2); + if (f < -parFloat3) { + f = -parFloat3; + } + + if (f >= parFloat3) { + f = parFloat3; + } + + return parFloat1 - f; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityConstructor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityConstructor.java new file mode 100644 index 0000000..00f1da8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityConstructor.java @@ -0,0 +1,24 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/** + * 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 interface EntityConstructor { + + T createEntity(World world); + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityCreature.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityCreature.java new file mode 100644 index 0000000..b9f5231 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityCreature.java @@ -0,0 +1,173 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityCreature extends EntityLiving { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityCreature"); + } + + public static final EaglercraftUUID FLEEING_SPEED_MODIFIER_UUID = EaglercraftUUID + .fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); + public static final AttributeModifier FLEEING_SPEED_MODIFIER = (new AttributeModifier(FLEEING_SPEED_MODIFIER_UUID, + "Fleeing speed bonus", 2.0D, 2)).setSaved(false); + private BlockPos homePosition = BlockPos.ORIGIN; + /**+ + * If -1 there is no maximum distance + */ + private float maximumHomeDistance = -1.0F; + private EntityAIBase aiBase = new EntityAIMoveTowardsRestriction(this, 1.0D); + private boolean isMovementAITaskSet; + + public EntityCreature(World worldIn) { + super(worldIn); + } + + public float getBlockPathWeight(BlockPos pos) { + return 0.0F; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return super.getCanSpawnHere() && this + .getBlockPathWeight(new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ)) >= 0.0F; + } + + /**+ + * if the entity got a PathEntity it returns true, else false + */ + public boolean hasPath() { + return !this.navigator.noPath(); + } + + public boolean isWithinHomeDistanceCurrentPosition() { + return this.isWithinHomeDistanceFromPosition(new BlockPos(this)); + } + + public boolean isWithinHomeDistanceFromPosition(BlockPos pos) { + return this.maximumHomeDistance == -1.0F ? true + : this.homePosition.distanceSq(pos) < (double) (this.maximumHomeDistance * this.maximumHomeDistance); + } + + /**+ + * Sets home position and max distance for it + */ + public void setHomePosAndDistance(BlockPos pos, int distance) { + this.homePosition = pos; + this.maximumHomeDistance = (float) distance; + } + + public BlockPos getHomePosition() { + return this.homePosition; + } + + public float getMaximumHomeDistance() { + return this.maximumHomeDistance; + } + + public void detachHome() { + this.maximumHomeDistance = -1.0F; + } + + /**+ + * Returns whether a home area is defined for this entity. + */ + public boolean hasHome() { + return this.maximumHomeDistance != -1.0F; + } + + /**+ + * Applies logic related to leashes, for example dragging the + * entity or breaking the leash. + */ + protected void updateLeashedState() { + super.updateLeashedState(); + if (this.getLeashed() && this.getLeashedToEntity() != null + && this.getLeashedToEntity().worldObj == this.worldObj) { + Entity entity = this.getLeashedToEntity(); + this.setHomePosAndDistance(new BlockPos((int) entity.posX, (int) entity.posY, (int) entity.posZ), 5); + float f = this.getDistanceToEntity(entity); + if (this instanceof EntityTameable && ((EntityTameable) this).isSitting()) { + if (f > 10.0F) { + this.clearLeashed(true, true); + } + + return; + } + + if (!this.isMovementAITaskSet) { + this.tasks.addTask(2, this.aiBase); + if (this.getNavigator() instanceof PathNavigateGround) { + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(false); + } + + this.isMovementAITaskSet = true; + } + + this.func_142017_o(f); + if (f > 4.0F) { + this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); + } + + if (f > 6.0F) { + double d0 = (entity.posX - this.posX) / (double) f; + double d1 = (entity.posY - this.posY) / (double) f; + double d2 = (entity.posZ - this.posZ) / (double) f; + this.motionX += d0 * Math.abs(d0) * 0.4D; + this.motionY += d1 * Math.abs(d1) * 0.4D; + this.motionZ += d2 * Math.abs(d2) * 0.4D; + } + + if (f > 10.0F) { + this.clearLeashed(true, true); + } + } else if (!this.getLeashed() && this.isMovementAITaskSet) { + this.isMovementAITaskSet = false; + this.tasks.removeTask(this.aiBase); + if (this.getNavigator() instanceof PathNavigateGround) { + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + } + + this.detachHome(); + } + + } + + protected void func_142017_o(float parFloat1) { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityFlying.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityFlying.java new file mode 100644 index 0000000..0afffc9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityFlying.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityFlying extends EntityLiving { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityFlying"); + } + + public EntityFlying(World worldIn) { + super(worldIn); + } + + public void fall(float var1, float var2) { + } + + protected void updateFallState(double var1, boolean var3, Block var4, BlockPos var5) { + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float strafe, float forward) { + if (this.isInWater()) { + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + } else if (this.isInLava()) { + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } else { + float f = 0.91F; + if (this.onGround) { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, + MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + float f1 = 0.16277136F / (f * f * f); + this.moveFlying(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); + f = 0.91F; + if (this.onGround) { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, + MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= (double) f; + this.motionY *= (double) f; + this.motionZ *= (double) f; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f2 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; + if (f2 > 1.0F) { + f2 = 1.0F; + } + + this.limbSwingAmount += (f2 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + /**+ + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityHanging.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityHanging.java new file mode 100644 index 0000000..ed8a62b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityHanging.java @@ -0,0 +1,285 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneDiode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import org.apache.commons.lang3.Validate; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityHanging extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityHanging"); + } + + private int tickCounter1; + protected BlockPos hangingPosition; + public EnumFacing facingDirection; + + public EntityHanging(World worldIn) { + super(worldIn); + this.setSize(0.5F, 0.5F); + } + + public EntityHanging(World worldIn, BlockPos hangingPositionIn) { + this(worldIn); + this.hangingPosition = hangingPositionIn; + } + + protected void entityInit() { + } + + /**+ + * Updates facing and bounding box based on it + */ + protected void updateFacingWithBoundingBox(EnumFacing facingDirectionIn) { + Validate.notNull(facingDirectionIn); + Validate.isTrue(facingDirectionIn.getAxis().isHorizontal()); + this.facingDirection = facingDirectionIn; + this.prevRotationYaw = this.rotationYaw = (float) (this.facingDirection.getHorizontalIndex() * 90); + this.updateBoundingBox(); + } + + /**+ + * Updates the entity bounding box based on current facing + */ + private void updateBoundingBox() { + if (this.facingDirection != null) { + double d0 = (double) this.hangingPosition.getX() + 0.5D; + double d1 = (double) this.hangingPosition.getY() + 0.5D; + double d2 = (double) this.hangingPosition.getZ() + 0.5D; + double d3 = 0.46875D; + double d4 = this.func_174858_a(this.getWidthPixels()); + double d5 = this.func_174858_a(this.getHeightPixels()); + d0 = d0 - (double) this.facingDirection.getFrontOffsetX() * 0.46875D; + d2 = d2 - (double) this.facingDirection.getFrontOffsetZ() * 0.46875D; + d1 = d1 + d5; + EnumFacing enumfacing = this.facingDirection.rotateYCCW(); + d0 = d0 + d4 * (double) enumfacing.getFrontOffsetX(); + d2 = d2 + d4 * (double) enumfacing.getFrontOffsetZ(); + this.posX = d0; + this.posY = d1; + this.posZ = d2; + double d6 = (double) this.getWidthPixels(); + double d7 = (double) this.getHeightPixels(); + double d8 = (double) this.getWidthPixels(); + if (this.facingDirection.getAxis() == EnumFacing.Axis.Z) { + d8 = 1.0D; + } else { + d6 = 1.0D; + } + + d6 = d6 / 32.0D; + d7 = d7 / 32.0D; + d8 = d8 / 32.0D; + this.setEntityBoundingBox(new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8)); + } + } + + private double func_174858_a(int parInt1) { + return parInt1 % 32 == 0 ? 0.5D : 0.0D; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + if (this.tickCounter1++ == 100) { + this.tickCounter1 = 0; + if (!this.isDead && !this.onValidSurface()) { + this.setDead(); + this.onBroken((Entity) null); + } + } + + } + + /**+ + * checks to make sure painting can be placed there + */ + public boolean onValidSurface() { + if (!this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty()) { + return false; + } else { + int i = Math.max(1, this.getWidthPixels() / 16); + int j = Math.max(1, this.getHeightPixels() / 16); + BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite()); + EnumFacing enumfacing = this.facingDirection.rotateYCCW(); + + for (int k = 0; k < i; ++k) { + for (int l = 0; l < j; ++l) { + BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l); + Block block = this.worldObj.getBlockState(blockpos1).getBlock(); + if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block)) { + return false; + } + } + } + + for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, + this.getEntityBoundingBox())) { + if (entity instanceof EntityHanging) { + return false; + } + } + + return true; + } + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + /**+ + * Called when a player attacks an entity. If this returns true + * the attack will not happen. + */ + public boolean hitByEntity(Entity entity) { + return entity instanceof EntityPlayer + ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) entity), 0.0F) + : false; + } + + public EnumFacing getHorizontalFacing() { + return this.facingDirection; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float var2) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + if (!this.isDead) { + this.setDead(); + this.setBeenAttacked(); + this.onBroken(damagesource.getEntity()); + } + + return true; + } + } + + /**+ + * Tries to moves the entity by the passed in displacement. + * Args: x, y, z + */ + public void moveEntity(double d0, double d1, double d2) { + if (!this.isDead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { + this.setDead(); + this.onBroken((Entity) null); + } + + } + + /**+ + * Adds to the current velocity of the entity. Args: x, y, z + */ + public void addVelocity(double d0, double d1, double d2) { + if (!this.isDead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { + this.setDead(); + this.onBroken((Entity) null); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setByte("Facing", (byte) this.facingDirection.getHorizontalIndex()); + nbttagcompound.setInteger("TileX", this.getHangingPosition().getX()); + nbttagcompound.setInteger("TileY", this.getHangingPosition().getY()); + nbttagcompound.setInteger("TileZ", this.getHangingPosition().getZ()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.hangingPosition = new BlockPos(nbttagcompound.getInteger("TileX"), nbttagcompound.getInteger("TileY"), + nbttagcompound.getInteger("TileZ")); + EnumFacing enumfacing; + if (nbttagcompound.hasKey("Direction", 99)) { + enumfacing = EnumFacing.getHorizontal(nbttagcompound.getByte("Direction")); + this.hangingPosition = this.hangingPosition.offset(enumfacing); + } else if (nbttagcompound.hasKey("Facing", 99)) { + enumfacing = EnumFacing.getHorizontal(nbttagcompound.getByte("Facing")); + } else { + enumfacing = EnumFacing.getHorizontal(nbttagcompound.getByte("Dir")); + } + + this.updateFacingWithBoundingBox(enumfacing); + } + + public abstract int getWidthPixels(); + + public abstract int getHeightPixels(); + + public abstract void onBroken(Entity var1); + + protected boolean shouldSetPosAfterLoading() { + return false; + } + + /**+ + * Sets the x,y,z of the entity from the given parameters. Also + * seems to set up a bounding box. + */ + public void setPosition(double d0, double d1, double d2) { + this.posX = d0; + this.posY = d1; + this.posZ = d2; + BlockPos blockpos = this.hangingPosition; + this.hangingPosition = new BlockPos(d0, d1, d2); + if (!this.hangingPosition.equals(blockpos)) { + this.updateBoundingBox(); + this.isAirBorne = true; + } + + } + + public BlockPos getHangingPosition() { + return this.hangingPosition; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLeashKnot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLeashKnot.java new file mode 100644 index 0000000..87b259f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLeashKnot.java @@ -0,0 +1,186 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityHanging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityLeashKnot extends EntityHanging { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityLeashKnot"); + } + + public EntityLeashKnot(World worldIn) { + super(worldIn); + } + + public EntityLeashKnot(World worldIn, BlockPos hangingPositionIn) { + super(worldIn, hangingPositionIn); + this.setPosition((double) hangingPositionIn.getX() + 0.5D, (double) hangingPositionIn.getY() + 0.5D, + (double) hangingPositionIn.getZ() + 0.5D); + float f = 0.125F; + float f1 = 0.1875F; + float f2 = 0.25F; + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.1875D, this.posY - 0.25D + 0.125D, + this.posZ - 0.1875D, this.posX + 0.1875D, this.posY + 0.25D + 0.125D, this.posZ + 0.1875D)); + } + + protected void entityInit() { + super.entityInit(); + } + + /**+ + * Updates facing and bounding box based on it + */ + public void updateFacingWithBoundingBox(EnumFacing var1) { + } + + public int getWidthPixels() { + return 9; + } + + public int getHeightPixels() { + return 9; + } + + public float getEyeHeight() { + return -0.0625F; + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + return d0 < 1024.0D; + } + + /**+ + * Called when this entity is broken. Entity parameter may be + * null. + */ + public void onBroken(Entity var1) { + } + + /**+ + * Either write this entity to the NBT tag given and return + * true, or return false without doing anything. If this returns + * false the entity is not saved on disk. Ridden entities return + * false here as they are saved with their rider. + */ + public boolean writeToNBTOptional(NBTTagCompound var1) { + return false; + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound var1) { + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound var1) { + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.getHeldItem(); + boolean flag = false; + if (itemstack != null && itemstack.getItem() == Items.lead) { + double d0 = 7.0D; + + for (EntityLiving entityliving : this.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB( + this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + d0, this.posZ + d0))) { + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == entityplayer) { + entityliving.setLeashedToEntity(this, true); + flag = true; + } + } + } + + if (!flag) { + this.setDead(); + if (entityplayer.capabilities.isCreativeMode) { + double d1 = 7.0D; + + for (EntityLiving entityliving1 : this.worldObj.getEntitiesWithinAABB(EntityLiving.class, + new AxisAlignedBB(this.posX - d1, this.posY - d1, this.posZ - d1, this.posX + d1, + this.posY + d1, this.posZ + d1))) { + if (entityliving1.getLeashed() && entityliving1.getLeashedToEntity() == this) { + entityliving1.clearLeashed(true, false); + } + } + } + } + + return true; + } + + /**+ + * checks to make sure painting can be placed there + */ + public boolean onValidSurface() { + return this.worldObj.getBlockState(this.hangingPosition).getBlock() instanceof BlockFence; + } + + public static EntityLeashKnot createKnot(World worldIn, BlockPos fence) { + EntityLeashKnot entityleashknot = new EntityLeashKnot(worldIn, fence); + entityleashknot.forceSpawn = true; + worldIn.spawnEntityInWorld(entityleashknot); + return entityleashknot; + } + + public static EntityLeashKnot getKnotForPosition(World worldIn, BlockPos pos) { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + + for (EntityLeashKnot entityleashknot : worldIn.getEntitiesWithinAABB(EntityLeashKnot.class, + new AxisAlignedBB((double) i - 1.0D, (double) j - 1.0D, (double) k - 1.0D, (double) i + 1.0D, + (double) j + 1.0D, (double) k + 1.0D))) { + if (entityleashknot.getHangingPosition().equals(pos)) { + return entityleashknot; + } + } + + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityList.java new file mode 100644 index 0000000..e85bd18 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityList.java @@ -0,0 +1,412 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLeashKnot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityMinecartCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityWither; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderCrystal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderEye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderPearl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityExpBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFallingBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFireworkRocket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartEmpty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartTNT; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityTNTPrimed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityBlaze; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCaveSpider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEnderman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEndermite; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGhast; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGiantZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGuardian; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMagmaCube; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityPigZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySlime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySnowman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySpider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityWitch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityBat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityCow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityMooshroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityOcelot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityPig; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityRabbit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityLargeFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySmallFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityList { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityList"); + } + + private static final Logger logger = LogManager.getLogger(); + private static final Map> stringToClassMapping = Maps.newHashMap(); + private static final Map> stringToConstructorMapping = Maps + .newHashMap(); + private static final Map, String> classToStringMapping = Maps.newHashMap(); + private static final Map> idToClassMapping = Maps.newHashMap(); + private static final Map> idToConstructorMapping = Maps.newHashMap(); + private static final Map, Integer> classToIDMapping = Maps.newHashMap(); + private static final Map, EntityConstructor> classToConstructorMapping = Maps + .newHashMap(); + private static final Map stringToIDMapping = Maps.newHashMap(); + public static final Map entityEggs = Maps.newLinkedHashMap(); + + /**+ + * adds a mapping between Entity classes and both a string + * representation and an ID + */ + private static void addMapping(Class entityClass, + EntityConstructor entityConstructor, String entityName, int id) { + if (stringToClassMapping.containsKey(entityName)) { + throw new IllegalArgumentException("ID is already registered: " + entityName); + } else if (idToClassMapping.containsKey(Integer.valueOf(id))) { + throw new IllegalArgumentException("ID is already registered: " + id); + } else if (id == 0) { + throw new IllegalArgumentException("Cannot register to reserved id: " + id); + } else if (entityClass == null) { + throw new IllegalArgumentException("Cannot register null clazz for id: " + id); + } else { + stringToClassMapping.put(entityName, entityClass); + stringToConstructorMapping.put(entityName, entityConstructor); + classToStringMapping.put(entityClass, entityName); + idToClassMapping.put(Integer.valueOf(id), entityClass); + idToConstructorMapping.put(Integer.valueOf(id), entityConstructor); + classToIDMapping.put(entityClass, Integer.valueOf(id)); + classToConstructorMapping.put(entityClass, entityConstructor); + stringToIDMapping.put(entityName, Integer.valueOf(id)); + } + } + + /**+ + * adds a mapping between Entity classes and both a string + * representation and an ID + */ + private static void addMapping(Class entityClass, + EntityConstructor entityConstructor, String entityName, int entityID, int baseColor, + int spotColor) { + addMapping(entityClass, entityConstructor, entityName, entityID); + entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, baseColor, spotColor)); + } + + /**+ + * Create a new instance of an entity in the world by using the + * entity name. + */ + public static Entity createEntityByName(String entityName, World worldIn) { + Entity entity = null; + + try { + EntityConstructor constructor = stringToConstructorMapping.get(entityName); + if (constructor != null) { + entity = constructor.createEntity(worldIn); + } + } catch (Exception exception) { + logger.error("Could not create entity", exception); + } + + return entity; + } + + public static Entity createEntityByClass(Class entityClass, World worldIn) { + Entity entity = null; + + try { + EntityConstructor constructor = classToConstructorMapping.get(entityClass); + if (constructor != null) { + entity = constructor.createEntity(worldIn); + } + } catch (Exception exception) { + logger.error("Could not create entity", exception); + } + + return entity; + } + + public static Entity createEntityByClassUnsafe(Class entityClass, World worldIn) { + EntityConstructor constructor = classToConstructorMapping.get(entityClass); + if (constructor != null) { + return constructor.createEntity(worldIn); + } + return null; + } + + /**+ + * create a new instance of an entity from NBT store + */ + public static Entity createEntityFromNBT(NBTTagCompound nbt, World worldIn) { + Entity entity = null; + if ("Minecart".equals(nbt.getString("id"))) { + nbt.setString("id", EntityMinecart.EnumMinecartType.byNetworkID(nbt.getInteger("Type")).getName()); + nbt.removeTag("Type"); + } + + try { + EntityConstructor constructor = stringToConstructorMapping.get(nbt.getString("id")); + if (constructor != null) { + entity = constructor.createEntity(worldIn); + } + } catch (Exception exception) { + logger.error("Could not create entity", exception); + } + + if (entity != null) { + entity.readFromNBT(nbt); + } else { + logger.warn("Skipping Entity with id " + nbt.getString("id")); + } + + return entity; + } + + /**+ + * Create a new instance of an entity in the world by using an + * entity ID. + */ + public static Entity createEntityByID(int entityID, World worldIn) { + Entity entity = null; + + try { + EntityConstructor constructor = getConstructorFromID(entityID); + if (constructor != null) { + entity = constructor.createEntity(worldIn); + } + } catch (Exception exception) { + logger.error("Could not create entity", exception); + } + + if (entity == null) { + logger.warn("Skipping Entity with id " + entityID); + } + + return entity; + } + + /**+ + * gets the entityID of a specific entity + */ + public static int getEntityID(Entity entityIn) { + Integer integer = (Integer) classToIDMapping.get(entityIn.getClass()); + return integer == null ? 0 : integer.intValue(); + } + + public static Class getClassFromID(int entityID) { + return (Class) idToClassMapping.get(Integer.valueOf(entityID)); + } + + public static EntityConstructor getConstructorFromID(int entityID) { + return idToConstructorMapping.get(Integer.valueOf(entityID)); + } + + /**+ + * Gets the string representation of a specific entity. + */ + public static String getEntityString(Entity entityIn) { + return (String) classToStringMapping.get(entityIn.getClass()); + } + + /**+ + * Returns the ID assigned to it's string representation + */ + public static int getIDFromString(String entityName) { + Integer integer = (Integer) stringToIDMapping.get(entityName); + return integer == null ? 90 : integer.intValue(); + } + + /**+ + * Finds the class using IDtoClassMapping and + * classToStringMapping + */ + public static String getStringFromID(int entityID) { + return (String) classToStringMapping.get(getClassFromID(entityID)); + } + + public static void func_151514_a() { + } + + public static List getEntityNameList() { + Set set = stringToClassMapping.keySet(); + ArrayList arraylist = Lists.newArrayList(); + + for (String s : (Set) set) { + Class oclass = (Class) stringToClassMapping.get(s); + if ((oclass.getModifiers() & 1024) != 1024) { + arraylist.add(s); + } + } + + arraylist.add("LightningBolt"); + return arraylist; + } + + public static boolean isStringEntityName(Entity entityIn, String entityName) { + String s = getEntityString(entityIn); + if (s == null && entityIn instanceof EntityPlayer) { + s = "Player"; + } else if (s == null && entityIn instanceof EntityLightningBolt) { + s = "LightningBolt"; + } + + return entityName.equals(s); + } + + public static boolean isStringValidEntityName(String entityName) { + return "Player".equals(entityName) || getEntityNameList().contains(entityName); + } + + static { + addMapping(EntityItem.class, (w) -> new EntityItem(w), "Item", 1); + addMapping(EntityXPOrb.class, (w) -> new EntityXPOrb(w), "XPOrb", 2); + addMapping(EntityEgg.class, (w) -> new EntityEgg(w), "ThrownEgg", 7); + addMapping(EntityLeashKnot.class, (w) -> new EntityLeashKnot(w), "LeashKnot", 8); + addMapping(EntityPainting.class, (w) -> new EntityPainting(w), "Painting", 9); + addMapping(EntityArrow.class, (w) -> new EntityArrow(w), "Arrow", 10); + addMapping(EntitySnowball.class, (w) -> new EntitySnowball(w), "Snowball", 11); + addMapping(EntityLargeFireball.class, (w) -> new EntityLargeFireball(w), "Fireball", 12); + addMapping(EntitySmallFireball.class, (w) -> new EntitySmallFireball(w), "SmallFireball", 13); + addMapping(EntityEnderPearl.class, (w) -> new EntityEnderPearl(w), "ThrownEnderpearl", 14); + addMapping(EntityEnderEye.class, (w) -> new EntityEnderEye(w), "EyeOfEnderSignal", 15); + addMapping(EntityPotion.class, (w) -> new EntityPotion(w), "ThrownPotion", 16); + addMapping(EntityExpBottle.class, (w) -> new EntityExpBottle(w), "ThrownExpBottle", 17); + addMapping(EntityItemFrame.class, (w) -> new EntityItem(w), "ItemFrame", 18); + addMapping(EntityWitherSkull.class, (w) -> new EntityWitherSkull(w), "WitherSkull", 19); + addMapping(EntityTNTPrimed.class, (w) -> new EntityTNTPrimed(w), "PrimedTnt", 20); + addMapping(EntityFallingBlock.class, (w) -> new EntityFallingBlock(w), "FallingSand", 21); + addMapping(EntityFireworkRocket.class, (w) -> new EntityFireworkRocket(w), "FireworksRocketEntity", 22); + addMapping(EntityArmorStand.class, (w) -> new EntityArmorStand(w), "ArmorStand", 30); + addMapping(EntityBoat.class, (w) -> new EntityBoat(w), "Boat", 41); + addMapping(EntityMinecartEmpty.class, (w) -> new EntityMinecartEmpty(w), + EntityMinecart.EnumMinecartType.RIDEABLE.getName(), 42); + addMapping(EntityMinecartChest.class, (w) -> new EntityMinecartChest(w), + EntityMinecart.EnumMinecartType.CHEST.getName(), 43); + addMapping(EntityMinecartFurnace.class, (w) -> new EntityMinecartFurnace(w), + EntityMinecart.EnumMinecartType.FURNACE.getName(), 44); + addMapping(EntityMinecartTNT.class, (w) -> new EntityMinecartTNT(w), + EntityMinecart.EnumMinecartType.TNT.getName(), 45); + addMapping(EntityMinecartHopper.class, (w) -> new EntityMinecartHopper(w), + EntityMinecart.EnumMinecartType.HOPPER.getName(), 46); + addMapping(EntityMinecartMobSpawner.class, (w) -> new EntityMinecartMobSpawner(w), + EntityMinecart.EnumMinecartType.SPAWNER.getName(), 47); + addMapping(EntityMinecartCommandBlock.class, (w) -> new EntityMinecartCommandBlock(w), + EntityMinecart.EnumMinecartType.COMMAND_BLOCK.getName(), 40); + addMapping(EntityLiving.class, null, "Mob", 48); + addMapping(EntityMob.class, null, "Monster", 49); + addMapping(EntityCreeper.class, (w) -> new EntityCreeper(w), "Creeper", 50, 894731, 0); + addMapping(EntitySkeleton.class, (w) -> new EntitySkeleton(w), "Skeleton", 51, 12698049, 4802889); + addMapping(EntitySpider.class, (w) -> new EntitySpider(w), "Spider", 52, 3419431, 11013646); + addMapping(EntityGiantZombie.class, (w) -> new EntityGiantZombie(w), "Giant", 53); + addMapping(EntityZombie.class, (w) -> new EntityZombie(w), "Zombie", 54, '\uafaf', 7969893); + addMapping(EntitySlime.class, (w) -> new EntitySlime(w), "Slime", 55, 5349438, 8306542); + addMapping(EntityGhast.class, (w) -> new EntityGhast(w), "Ghast", 56, 16382457, 12369084); + addMapping(EntityPigZombie.class, (w) -> new EntityPigZombie(w), "PigZombie", 57, 15373203, 5009705); + addMapping(EntityEnderman.class, (w) -> new EntityEnderman(w), "Enderman", 58, 1447446, 0); + addMapping(EntityCaveSpider.class, (w) -> new EntityCaveSpider(w), "CaveSpider", 59, 803406, 11013646); + addMapping(EntitySilverfish.class, (w) -> new EntitySilverfish(w), "Silverfish", 60, 7237230, 3158064); + addMapping(EntityBlaze.class, (w) -> new EntityBlaze(w), "Blaze", 61, 16167425, 16775294); + addMapping(EntityMagmaCube.class, (w) -> new EntityMagmaCube(w), "LavaSlime", 62, 3407872, 16579584); + addMapping(EntityDragon.class, (w) -> new EntityDragon(w), "EnderDragon", 63); + addMapping(EntityWither.class, (w) -> new EntityWither(w), "WitherBoss", 64); + addMapping(EntityBat.class, (w) -> new EntityBat(w), "Bat", 65, 4996656, 986895); + addMapping(EntityWitch.class, (w) -> new EntityWitch(w), "Witch", 66, 3407872, 5349438); + addMapping(EntityEndermite.class, (w) -> new EntityEndermite(w), "Endermite", 67, 1447446, 7237230); + addMapping(EntityGuardian.class, (w) -> new EntityGuardian(w), "Guardian", 68, 5931634, 15826224); + addMapping(EntityPig.class, (w) -> new EntityPig(w), "Pig", 90, 15771042, 14377823); + addMapping(EntitySheep.class, (w) -> new EntitySheep(w), "Sheep", 91, 15198183, 16758197); + addMapping(EntityCow.class, (w) -> new EntityCow(w), "Cow", 92, 4470310, 10592673); + addMapping(EntityChicken.class, (w) -> new EntityChicken(w), "Chicken", 93, 10592673, 16711680); + addMapping(EntitySquid.class, (w) -> new EntitySquid(w), "Squid", 94, 2243405, 7375001); + addMapping(EntityWolf.class, (w) -> new EntityWolf(w), "Wolf", 95, 14144467, 13545366); + addMapping(EntityMooshroom.class, (w) -> new EntityMooshroom(w), "MushroomCow", 96, 10489616, 12040119); + addMapping(EntitySnowman.class, (w) -> new EntitySnowman(w), "SnowMan", 97); + addMapping(EntityOcelot.class, (w) -> new EntityOcelot(w), "Ozelot", 98, 15720061, 5653556); + addMapping(EntityIronGolem.class, (w) -> new EntityIronGolem(w), "VillagerGolem", 99); + addMapping(EntityHorse.class, (w) -> new EntityHorse(w), "EntityHorse", 100, 12623485, 15656192); + addMapping(EntityRabbit.class, (w) -> new EntityRabbit(w), "Rabbit", 101, 10051392, 7555121); + addMapping(EntityVillager.class, (w) -> new EntityVillager(w), "Villager", 120, 5651507, 12422002); + addMapping(EntityEnderCrystal.class, (w) -> new EntityEnderCrystal(w), "EnderCrystal", 200); + } + + public static class EntityEggInfo { + public final int spawnedID; + public final int primaryColor; + public final int secondaryColor; + public final StatBase field_151512_d; + public final StatBase field_151513_e; + + public EntityEggInfo(int id, int baseColor, int spotColor) { + this.spawnedID = id; + this.primaryColor = baseColor; + this.secondaryColor = spotColor; + this.field_151512_d = StatList.getStatKillEntity(this); + this.field_151513_e = StatList.getStatEntityKilledBy(this); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLiving.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLiving.java new file mode 100644 index 0000000..46e3af3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLiving.java @@ -0,0 +1,1078 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityBodyHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityHanging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLeashKnot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITasks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityJumpHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityLookHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMoveHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntitySenses; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGhast; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityLiving extends EntityLivingBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityLiving"); + } + + public int livingSoundTime; + protected int experienceValue; + private EntityLookHelper lookHelper; + protected EntityMoveHelper moveHelper; + protected EntityJumpHelper jumpHelper; + private EntityBodyHelper bodyHelper; + protected PathNavigate navigator; + protected final EntityAITasks tasks; + protected final EntityAITasks targetTasks; + private EntityLivingBase attackTarget; + private EntitySenses senses; + /**+ + * Equipment (armor and held item) for this entity. + */ + private ItemStack[] equipment = new ItemStack[5]; + /**+ + * Chances for each equipment piece from dropping when this + * entity dies. + */ + protected float[] equipmentDropChances = new float[5]; + private boolean canPickUpLoot; + private boolean persistenceRequired; + private boolean isLeashed; + private Entity leashedToEntity; + private NBTTagCompound leashNBTTag; + + public EntityLiving(World worldIn) { + super(worldIn); + this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null); + this.targetTasks = new EntityAITasks( + worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null); + this.lookHelper = new EntityLookHelper(this); + this.moveHelper = new EntityMoveHelper(this); + this.jumpHelper = new EntityJumpHelper(this); + this.bodyHelper = new EntityBodyHelper(this); + this.navigator = this.getNewNavigator(worldIn); + this.senses = new EntitySenses(this); + + for (int i = 0; i < this.equipmentDropChances.length; ++i) { + this.equipmentDropChances[i] = 0.085F; + } + + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); + } + + /**+ + * Returns new PathNavigateGround instance + */ + protected PathNavigate getNewNavigator(World worldIn) { + return new PathNavigateGround(this, worldIn); + } + + public EntityLookHelper getLookHelper() { + return this.lookHelper; + } + + public EntityMoveHelper getMoveHelper() { + return this.moveHelper; + } + + public EntityJumpHelper getJumpHelper() { + return this.jumpHelper; + } + + public PathNavigate getNavigator() { + return this.navigator; + } + + /**+ + * returns the EntitySenses Object for the EntityLiving + */ + public EntitySenses getEntitySenses() { + return this.senses; + } + + /**+ + * Gets the active target the Task system uses for tracking + */ + public EntityLivingBase getAttackTarget() { + return this.attackTarget; + } + + /**+ + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase entitylivingbaseIn) { + this.attackTarget = entitylivingbaseIn; + } + + /**+ + * Returns true if this entity can attack entities of the + * specified class. + */ + public boolean canAttackClass(Class cls) { + return cls != EntityGhast.class; + } + + /**+ + * This function applies the benefits of growing back wool and + * faster growing up to the acting entity. (This function is + * used in the AIEatGrass) + */ + public void eatGrassBonus() { + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(15, Byte.valueOf((byte) 0)); + } + + /**+ + * Get number of ticks, at least during which the living entity + * will be silent. + */ + public int getTalkInterval() { + return 80; + } + + /**+ + * Plays living's sound at its position + */ + public void playLivingSound() { + String s = this.getLivingSound(); + if (s != null) { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + + } + + /**+ + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("mobBaseTick"); + if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) { + this.livingSoundTime = -this.getTalkInterval(); + this.playLivingSound(); + } + + this.worldObj.theProfiler.endSection(); + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer var1) { + if (this.experienceValue > 0) { + int i = this.experienceValue; + ItemStack[] aitemstack = this.getInventory(); + + for (int j = 0; j < aitemstack.length; ++j) { + if (aitemstack[j] != null && this.equipmentDropChances[j] <= 1.0F) { + i += 1 + this.rand.nextInt(3); + } + } + + return i; + } else { + return this.experienceValue; + } + } + + /**+ + * Spawns an explosion particle around the Entity's location + */ + public void spawnExplosionParticle() { + this.worldObj.setEntityState(this, (byte) 20); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 20) { + this.spawnExplosionParticle(); + } else { + super.handleStatusUpdate(b0); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + this.updateLeashedState(); + } + + protected float func_110146_f(float var1, float f) { + this.bodyHelper.updateRenderAngles(); + return f; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return null; + } + + protected Item getDropItem() { + return null; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + Item item = this.getDropItem(); + if (item != null) { + int j = this.rand.nextInt(3); + if (i > 0) { + j += this.rand.nextInt(i + 1); + } + + for (int k = 0; k < j; ++k) { + this.dropItem(item, 1); + } + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("CanPickUpLoot", this.canPickUpLoot()); + nbttagcompound.setBoolean("PersistenceRequired", this.persistenceRequired); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.equipment.length; ++i) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + if (this.equipment[i] != null) { + this.equipment[i].writeToNBT(nbttagcompound1); + } + + nbttaglist.appendTag(nbttagcompound1); + } + + nbttagcompound.setTag("Equipment", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (int j = 0; j < this.equipmentDropChances.length; ++j) { + nbttaglist1.appendTag(new NBTTagFloat(this.equipmentDropChances[j])); + } + + nbttagcompound.setTag("DropChances", nbttaglist1); + nbttagcompound.setBoolean("Leashed", this.isLeashed); + if (this.leashedToEntity != null) { + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + if (this.leashedToEntity instanceof EntityLivingBase) { + nbttagcompound2.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits()); + nbttagcompound2.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits()); + } else if (this.leashedToEntity instanceof EntityHanging) { + BlockPos blockpos = ((EntityHanging) this.leashedToEntity).getHangingPosition(); + nbttagcompound2.setInteger("X", blockpos.getX()); + nbttagcompound2.setInteger("Y", blockpos.getY()); + nbttagcompound2.setInteger("Z", blockpos.getZ()); + } + + nbttagcompound.setTag("Leash", nbttagcompound2); + } + + if (this.isAIDisabled()) { + nbttagcompound.setBoolean("NoAI", this.isAIDisabled()); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("CanPickUpLoot", 1)) { + this.setCanPickUpLoot(nbttagcompound.getBoolean("CanPickUpLoot")); + } + + this.persistenceRequired = nbttagcompound.getBoolean("PersistenceRequired"); + if (nbttagcompound.hasKey("Equipment", 9)) { + NBTTagList nbttaglist = nbttagcompound.getTagList("Equipment", 10); + + for (int i = 0; i < this.equipment.length; ++i) { + this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + } + } + + if (nbttagcompound.hasKey("DropChances", 9)) { + NBTTagList nbttaglist1 = nbttagcompound.getTagList("DropChances", 5); + + for (int j = 0; j < nbttaglist1.tagCount(); ++j) { + this.equipmentDropChances[j] = nbttaglist1.getFloatAt(j); + } + } + + this.isLeashed = nbttagcompound.getBoolean("Leashed"); + if (this.isLeashed && nbttagcompound.hasKey("Leash", 10)) { + this.leashNBTTag = nbttagcompound.getCompoundTag("Leash"); + } + + this.setNoAI(nbttagcompound.getBoolean("NoAI")); + } + + public void setMoveForward(float parFloat1) { + this.moveForward = parFloat1; + } + + /**+ + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float f) { + super.setAIMoveSpeed(f); + this.setMoveForward(f); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.worldObj.theProfiler.startSection("looting"); + if (this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getBoolean("mobGriefing")) { + for (EntityItem entityitem : this.worldObj.getEntitiesWithinAABB(EntityItem.class, + this.getEntityBoundingBox().expand(1.0D, 0.0D, 1.0D))) { + if (!entityitem.isDead && entityitem.getEntityItem() != null && !entityitem.cannotPickup()) { + this.updateEquipmentIfNeeded(entityitem); + } + } + } + + this.worldObj.theProfiler.endSection(); + } + + /**+ + * Tests if this entity should pickup a weapon or an armor. + * Entity drops current weapon or armor if the new one is + * better. + */ + protected void updateEquipmentIfNeeded(EntityItem itemEntity) { + ItemStack itemstack = itemEntity.getEntityItem(); + int i = getArmorPosition(itemstack); + if (i > -1) { + boolean flag = true; + ItemStack itemstack1 = this.getEquipmentInSlot(i); + if (itemstack1 != null) { + if (i == 0) { + if (itemstack.getItem() instanceof ItemSword && !(itemstack1.getItem() instanceof ItemSword)) { + flag = true; + } else if (itemstack.getItem() instanceof ItemSword && itemstack1.getItem() instanceof ItemSword) { + ItemSword itemsword = (ItemSword) itemstack.getItem(); + ItemSword itemsword1 = (ItemSword) itemstack1.getItem(); + if (itemsword.getDamageVsEntity() != itemsword1.getDamageVsEntity()) { + flag = itemsword.getDamageVsEntity() > itemsword1.getDamageVsEntity(); + } else { + flag = itemstack.getMetadata() > itemstack1.getMetadata() + || itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + } else if (itemstack.getItem() instanceof ItemBow && itemstack1.getItem() instanceof ItemBow) { + flag = itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } else { + flag = false; + } + } else if (itemstack.getItem() instanceof ItemArmor && !(itemstack1.getItem() instanceof ItemArmor)) { + flag = true; + } else if (itemstack.getItem() instanceof ItemArmor && itemstack1.getItem() instanceof ItemArmor) { + ItemArmor itemarmor = (ItemArmor) itemstack.getItem(); + ItemArmor itemarmor1 = (ItemArmor) itemstack1.getItem(); + if (itemarmor.damageReduceAmount != itemarmor1.damageReduceAmount) { + flag = itemarmor.damageReduceAmount > itemarmor1.damageReduceAmount; + } else { + flag = itemstack.getMetadata() > itemstack1.getMetadata() + || itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + } else { + flag = false; + } + } + + if (flag && this.func_175448_a(itemstack)) { + if (itemstack1 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[i]) { + this.entityDropItem(itemstack1, 0.0F); + } + + if (itemstack.getItem() == Items.diamond && itemEntity.getThrower() != null) { + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByName(itemEntity.getThrower()); + if (entityplayer != null) { + entityplayer.triggerAchievement(AchievementList.diamondsToYou); + } + } + + this.setCurrentItemOrArmor(i, itemstack); + this.equipmentDropChances[i] = 2.0F; + this.persistenceRequired = true; + this.onItemPickup(itemEntity, 1); + itemEntity.setDead(); + } + } + + } + + protected boolean func_175448_a(ItemStack stack) { + return true; + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return true; + } + + /**+ + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() { + if (this.persistenceRequired) { + this.entityAge = 0; + } else { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, -1.0D); + if (entityplayer != null) { + double d0 = entityplayer.posX - this.posX; + double d1 = entityplayer.posY - this.posY; + double d2 = entityplayer.posZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + if (this.canDespawn() && d3 > 16384.0D) { + this.setDead(); + } + + if (this.entityAge > 600 && this.rand.nextInt(800) == 0 && d3 > 1024.0D && this.canDespawn()) { + this.setDead(); + } else if (d3 < 1024.0D) { + this.entityAge = 0; + } + } + + } + } + + protected final void updateEntityActionState() { + ++this.entityAge; + this.worldObj.theProfiler.startSection("checkDespawn"); + this.despawnEntity(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("sensing"); + this.senses.clearSensingCache(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("targetSelector"); + this.targetTasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("goalSelector"); + this.tasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("navigation"); + this.navigator.onUpdateNavigation(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("mob tick"); + this.updateAITasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("controls"); + this.worldObj.theProfiler.startSection("move"); + this.moveHelper.onUpdateMoveHelper(); + this.worldObj.theProfiler.endStartSection("look"); + this.lookHelper.onUpdateLook(); + this.worldObj.theProfiler.endStartSection("jump"); + this.jumpHelper.doJump(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.endSection(); + } + + protected void updateAITasks() { + } + + /**+ + * The speed it takes to move the entityliving's rotationPitch + * through the faceEntity method. This is only currently use in + * wolves. + */ + public int getVerticalFaceSpeed() { + return 40; + } + + /**+ + * Changes pitch and yaw so that the entity calling the function + * is facing the entity provided as an argument. + */ + public void faceEntity(Entity entityIn, float parFloat1, float parFloat2) { + double d0 = entityIn.posX - this.posX; + double d2 = entityIn.posZ - this.posZ; + double d1; + if (entityIn instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) entityIn; + d1 = entitylivingbase.posY + (double) entitylivingbase.getEyeHeight() + - (this.posY + (double) this.getEyeHeight()); + } else { + d1 = (entityIn.getEntityBoundingBox().minY + entityIn.getEntityBoundingBox().maxY) / 2.0D + - (this.posY + (double) this.getEyeHeight()); + } + + double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + float f = (float) (MathHelper.func_181159_b(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F; + float f1 = (float) (-(MathHelper.func_181159_b(d1, d3) * 180.0D / 3.1415927410125732D)); + this.rotationPitch = this.updateRotation(this.rotationPitch, f1, parFloat2); + this.rotationYaw = this.updateRotation(this.rotationYaw, f, parFloat1); + } + + /**+ + * Arguments: current rotation, intended rotation, max + * increment. + */ + private float updateRotation(float parFloat1, float parFloat2, float parFloat3) { + float f = MathHelper.wrapAngleTo180_float(parFloat2 - parFloat1); + if (f > parFloat3) { + f = parFloat3; + } + + if (f < -parFloat3) { + f = -parFloat3; + } + + return parFloat1 + f; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return true; + } + + /**+ + * Checks that the entity is not colliding with any blocks / + * liquids + */ + public boolean isNotColliding() { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) + && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() + && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + } + + /**+ + * Returns render size modifier + */ + public float getRenderSizeModifier() { + return 1.0F; + } + + /**+ + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 4; + } + + /**+ + * The maximum height from where the entity is alowed to jump + * (used in pathfinder) + */ + public int getMaxFallHeight() { + if (this.getAttackTarget() == null) { + return 3; + } else { + int i = (int) (this.getHealth() - this.getMaxHealth() * 0.33F); + i = i - (3 - this.worldObj.getDifficulty().getDifficultyId()) * 4; + if (i < 0) { + i = 0; + } + + return i + 3; + } + } + + /**+ + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() { + return this.equipment[0]; + } + + /**+ + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int i) { + return this.equipment[i]; + } + + public ItemStack getCurrentArmor(int i) { + return this.equipment[i + 1]; + } + + /**+ + * Sets the held item, or an armor slot. Slot 0 is held item. + * Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int i, ItemStack itemstack) { + this.equipment[i] = itemstack; + } + + /**+ + * returns the inventory of this entity (only used in + * EntityPlayerMP it seems) + */ + public ItemStack[] getInventory() { + return this.equipment; + } + + /**+ + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean flag, int i) { + for (int j = 0; j < this.getInventory().length; ++j) { + ItemStack itemstack = this.getEquipmentInSlot(j); + boolean flag1 = this.equipmentDropChances[j] > 1.0F; + if (itemstack != null && (flag || flag1) + && this.rand.nextFloat() - (float) i * 0.01F < this.equipmentDropChances[j]) { + if (!flag1 && itemstack.isItemStackDamageable()) { + int k = Math.max(itemstack.getMaxDamage() - 25, 1); + int l = itemstack.getMaxDamage() - this.rand.nextInt(this.rand.nextInt(k) + 1); + if (l > k) { + l = k; + } + + if (l < 1) { + l = 1; + } + + itemstack.setItemDamage(l); + } + + this.entityDropItem(itemstack, 0.0F); + } + } + + } + + /**+ + * Gives armor or weapon for entity based on given + * DifficultyInstance + */ + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) { + if (this.rand.nextFloat() < 0.15F * difficulty.getClampedAdditionalDifficulty()) { + int i = this.rand.nextInt(2); + float f = this.worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.25F; + if (this.rand.nextFloat() < 0.095F) { + ++i; + } + + if (this.rand.nextFloat() < 0.095F) { + ++i; + } + + if (this.rand.nextFloat() < 0.095F) { + ++i; + } + + for (int j = 3; j >= 0; --j) { + ItemStack itemstack = this.getCurrentArmor(j); + if (j < 3 && this.rand.nextFloat() < f) { + break; + } + + if (itemstack == null) { + Item item = getArmorItemForSlot(j + 1, i); + if (item != null) { + this.setCurrentItemOrArmor(j + 1, new ItemStack(item)); + } + } + } + } + + } + + public static int getArmorPosition(ItemStack stack) { + if (stack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull) { + if (stack.getItem() instanceof ItemArmor) { + switch (((ItemArmor) stack.getItem()).armorType) { + case 0: + return 4; + case 1: + return 3; + case 2: + return 2; + case 3: + return 1; + } + } + + return 0; + } else { + return 4; + } + } + + /**+ + * Gets the vanilla armor Item that can go in the slot specified + * for the given tier. + */ + public static Item getArmorItemForSlot(int armorSlot, int itemTier) { + switch (armorSlot) { + case 4: + if (itemTier == 0) { + return Items.leather_helmet; + } else if (itemTier == 1) { + return Items.golden_helmet; + } else if (itemTier == 2) { + return Items.chainmail_helmet; + } else if (itemTier == 3) { + return Items.iron_helmet; + } else if (itemTier == 4) { + return Items.diamond_helmet; + } + case 3: + if (itemTier == 0) { + return Items.leather_chestplate; + } else if (itemTier == 1) { + return Items.golden_chestplate; + } else if (itemTier == 2) { + return Items.chainmail_chestplate; + } else if (itemTier == 3) { + return Items.iron_chestplate; + } else if (itemTier == 4) { + return Items.diamond_chestplate; + } + case 2: + if (itemTier == 0) { + return Items.leather_leggings; + } else if (itemTier == 1) { + return Items.golden_leggings; + } else if (itemTier == 2) { + return Items.chainmail_leggings; + } else if (itemTier == 3) { + return Items.iron_leggings; + } else if (itemTier == 4) { + return Items.diamond_leggings; + } + case 1: + if (itemTier == 0) { + return Items.leather_boots; + } else if (itemTier == 1) { + return Items.golden_boots; + } else if (itemTier == 2) { + return Items.chainmail_boots; + } else if (itemTier == 3) { + return Items.iron_boots; + } else if (itemTier == 4) { + return Items.diamond_boots; + } + default: + return null; + } + } + + /**+ + * Enchants Entity's current equipments based on given + * DifficultyInstance + */ + protected void setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty) { + float f = difficulty.getClampedAdditionalDifficulty(); + if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * f) { + EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), + (int) (5.0F + f * (float) this.rand.nextInt(18))); + } + + for (int i = 0; i < 4; ++i) { + ItemStack itemstack = this.getCurrentArmor(i); + if (itemstack != null && this.rand.nextFloat() < 0.5F * f) { + EnchantmentHelper.addRandomEnchantment(this.rand, itemstack, + (int) (5.0F + f * (float) this.rand.nextInt(18))); + } + } + + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { + this.getEntityAttribute(SharedMonsterAttributes.followRange) + .applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1)); + return livingdata; + } + + /**+ + * returns true if all the conditions for steering the entity + * are met. For pigs, this is true if it is being ridden by a + * player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() { + return false; + } + + /**+ + * Enable the Entity persistence + */ + public void enablePersistence() { + this.persistenceRequired = true; + } + + public void setEquipmentDropChance(int slotIn, float chance) { + this.equipmentDropChances[slotIn] = chance; + } + + public boolean canPickUpLoot() { + return this.canPickUpLoot; + } + + public void setCanPickUpLoot(boolean canPickup) { + this.canPickUpLoot = canPickup; + } + + public boolean isNoDespawnRequired() { + return this.persistenceRequired; + } + + /**+ + * First layer of player interaction + */ + public final boolean interactFirst(EntityPlayer entityplayer) { + if (this.getLeashed() && this.getLeashedToEntity() == entityplayer) { + this.clearLeashed(true, !entityplayer.capabilities.isCreativeMode); + return true; + } else { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.lead && this.allowLeashing()) { + if (!(this instanceof EntityTameable) || !((EntityTameable) this).isTamed()) { + this.setLeashedToEntity(entityplayer, true); + --itemstack.stackSize; + return true; + } + + if (((EntityTameable) this).isOwner(entityplayer)) { + this.setLeashedToEntity(entityplayer, true); + --itemstack.stackSize; + return true; + } + } + + if (this.interact(entityplayer)) { + return true; + } else { + return super.interactFirst(entityplayer); + } + } + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer var1) { + return false; + } + + /**+ + * Applies logic related to leashes, for example dragging the + * entity or breaking the leash. + */ + protected void updateLeashedState() { + if (this.leashNBTTag != null) { + this.recreateLeash(); + } + + if (this.isLeashed) { + if (!this.isEntityAlive()) { + this.clearLeashed(true, true); + } + + if (this.leashedToEntity == null || this.leashedToEntity.isDead) { + this.clearLeashed(true, true); + } + } + } + + /**+ + * Removes the leash from this entity + */ + public void clearLeashed(boolean sendPacket, boolean dropLead) { + if (this.isLeashed) { + this.isLeashed = false; + this.leashedToEntity = null; + if (dropLead) { + this.dropItem(Items.lead, 1); + } + + if (sendPacket && this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S1BPacketEntityAttach(1, this, (Entity) null)); + } + } + + } + + public boolean allowLeashing() { + return !this.getLeashed() && !(this instanceof IMob); + } + + public boolean getLeashed() { + return this.isLeashed; + } + + public Entity getLeashedToEntity() { + return this.leashedToEntity; + } + + /**+ + * Sets the entity to be leashed to. + */ + public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification) { + this.isLeashed = true; + this.leashedToEntity = entityIn; + if (sendAttachNotification && this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S1BPacketEntityAttach(1, this, this.leashedToEntity)); + } + + } + + private void recreateLeash() { + if (this.isLeashed && this.leashNBTTag != null) { + if (this.leashNBTTag.hasKey("UUIDMost", 4) && this.leashNBTTag.hasKey("UUIDLeast", 4)) { + EaglercraftUUID uuid = new EaglercraftUUID(this.leashNBTTag.getLong("UUIDMost"), + this.leashNBTTag.getLong("UUIDLeast")); + + for (EntityLivingBase entitylivingbase : this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, + this.getEntityBoundingBox().expand(10.0D, 10.0D, 10.0D))) { + if (entitylivingbase.getUniqueID().equals(uuid)) { + this.leashedToEntity = entitylivingbase; + break; + } + } + } else if (this.leashNBTTag.hasKey("X", 99) && this.leashNBTTag.hasKey("Y", 99) + && this.leashNBTTag.hasKey("Z", 99)) { + BlockPos blockpos = new BlockPos(this.leashNBTTag.getInteger("X"), this.leashNBTTag.getInteger("Y"), + this.leashNBTTag.getInteger("Z")); + EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(this.worldObj, blockpos); + if (entityleashknot == null) { + entityleashknot = EntityLeashKnot.createKnot(this.worldObj, blockpos); + } + + this.leashedToEntity = entityleashknot; + } else { + this.clearLeashed(false, true); + } + } + + this.leashNBTTag = null; + } + + public boolean replaceItemInInventory(int i, ItemStack itemstack) { + int j; + if (i == 99) { + j = 0; + } else { + j = i - 100 + 1; + if (j < 0 || j >= this.equipment.length) { + return false; + } + } + + if (itemstack != null && getArmorPosition(itemstack) != j + && (j != 4 || !(itemstack.getItem() instanceof ItemBlock))) { + return false; + } else { + this.setCurrentItemOrArmor(j, itemstack); + return true; + } + } + + /**+ + * Returns whether the entity is in a server world + */ + public boolean isServerWorld() { + return super.isServerWorld() && !this.isAIDisabled(); + } + + /**+ + * Set whether this Entity's AI is disabled + */ + public void setNoAI(boolean disable) { + this.dataWatcher.updateObject(15, Byte.valueOf((byte) (disable ? 1 : 0))); + } + + /**+ + * Get whether this Entity's AI is disabled + */ + public boolean isAIDisabled() { + return this.dataWatcher.getWatchableObjectByte(15) != 0; + } + + public static enum SpawnPlacementType { + ON_GROUND, IN_AIR, IN_WATER; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLivingBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLivingBase.java new file mode 100644 index 0000000..93224ac --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLivingBase.java @@ -0,0 +1,1890 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Maps; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityTracker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagShort; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0BPacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0DPacketCollectItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.CombatTracker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityLivingBase extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityLivingBase"); + } + + private static final EaglercraftUUID sprintingSpeedBoostModifierUUID = EaglercraftUUID + .fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); + private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier( + sprintingSpeedBoostModifierUUID, "Sprinting speed boost", 0.30000001192092896D, 2)).setSaved(false); + private BaseAttributeMap attributeMap; + private final CombatTracker _combatTracker = new CombatTracker(this); + private final Map activePotionsMap = Maps.newHashMap(); + /**+ + * The equipment this mob was previously wearing, used for + * syncing. + */ + private final ItemStack[] previousEquipment = new ItemStack[5]; + public boolean isSwingInProgress; + public int swingProgressInt; + public int arrowHitTimer; + public int hurtTime; + public int maxHurtTime; + public float attackedAtYaw; + public int deathTime; + public float prevSwingProgress; + public float swingProgress; + public float prevLimbSwingAmount; + public float limbSwingAmount; + public float limbSwing; + public int maxHurtResistantTime = 20; + public float prevCameraPitch; + public float cameraPitch; + public float field_70769_ao; + public float field_70770_ap; + public float renderYawOffset; + public float prevRenderYawOffset; + public float rotationYawHead; + public float prevRotationYawHead; + /**+ + * A factor used to determine how far this entity will move each + * tick if it is jumping or falling. + */ + public float jumpMovementFactor = 0.02F; + protected EntityPlayer attackingPlayer; + protected int recentlyHit; + protected boolean dead; + protected int entityAge; + protected float prevOnGroundSpeedFactor; + protected float onGroundSpeedFactor; + protected float movedDistance; + protected float prevMovedDistance; + protected float field_70741_aB; + protected int scoreValue; + protected float lastDamage; + protected boolean isJumping; + public float moveStrafing; + public float moveForward; + protected float randomYawVelocity; + protected int newPosRotationIncrements; + protected double newPosX; + protected double newPosY; + protected double newPosZ; + protected double newRotationYaw; + protected double newRotationPitch; + /**+ + * Whether the DataWatcher needs to be updated with the active + * potions + */ + private boolean potionsNeedUpdate = true; + private EntityLivingBase entityLivingToAttack; + private int revengeTimer; + private EntityLivingBase lastAttacker; + private int lastAttackerTime; + private float landMovementFactor; + private int jumpTicks; + private float absorptionAmount; + + /**+ + * Called by the /kill command. + */ + public void onKillCommand() { + this.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); + } + + public EntityLivingBase(World worldIn) { + super(worldIn); + this.applyEntityAttributes(); + this.setHealth(this.getMaxHealth()); + this.preventEntitySpawning = true; + this.field_70770_ap = (float) ((Math.random() + 1.0D) * 0.009999999776482582D); + this.setPosition(this.posX, this.posY, this.posZ); + this.field_70769_ao = (float) Math.random() * 12398.0F; + this.rotationYaw = (float) (Math.random() * 3.1415927410125732D * 2.0D); + this.rotationYawHead = this.rotationYaw; + this.stepHeight = 0.6F; + } + + protected void entityInit() { + this.dataWatcher.addObject(7, Integer.valueOf(0)); + this.dataWatcher.addObject(8, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(9, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(6, Float.valueOf(1.0F)); + } + + protected void applyEntityAttributes() { + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed); + } + + protected void updateFallState(double d0, boolean flag, Block block, BlockPos blockpos) { + if (!this.isInWater()) { + this.handleWaterMovement(); + } + + if (this.fallDistance > 3.0F && flag) { + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block1 = iblockstate.getBlock(); + float f = (float) MathHelper.ceiling_float_int(this.fallDistance - 3.0F); + if (block1.getMaterial() != Material.air) { + double d1 = (double) Math.min(0.2F + f / 15.0F, 10.0F); + if (d1 > 2.5D) { + d1 = 2.5D; + } + + int i = (int) (150.0D * d1); + ((WorldServer) this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY, + this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, + new int[] { Block.getStateId(iblockstate) }); + } + } + + super.updateFallState(d0, flag, block, blockpos); + } + + public boolean canBreatheUnderwater() { + return false; + } + + /**+ + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + this.prevSwingProgress = this.swingProgress; + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("livingEntityBaseTick"); + boolean flag = this instanceof EntityPlayer; + if (this.isEntityAlive()) { + if (this.isEntityInsideOpaqueBlock()) { + this.attackEntityFrom(DamageSource.inWall, 1.0F); + } else if (flag && !this.worldObj.getWorldBorder().contains(this.getEntityBoundingBox())) { + double d0 = this.worldObj.getWorldBorder().getClosestDistance(this) + + this.worldObj.getWorldBorder().getDamageBuffer(); + if (d0 < 0.0D) { + this.attackEntityFrom(DamageSource.inWall, (float) Math.max(1, + MathHelper.floor_double(-d0 * this.worldObj.getWorldBorder().getDamageAmount()))); + } + } + } + + if (this.isImmuneToFire()) { + this.extinguish(); + } + + boolean flag1 = flag && ((EntityPlayer) this).capabilities.disableDamage; + if (this.isEntityAlive()) { + if (this.isInsideOfMaterial(Material.water)) { + if (!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !flag1) { + this.setAir(this.decreaseAirSupply(this.getAir())); + if (this.getAir() == -20) { + this.setAir(0); + + for (int i = 0; i < 8; ++i) { + float f = this.rand.nextFloat() - this.rand.nextFloat(); + float f1 = this.rand.nextFloat() - this.rand.nextFloat(); + float f2 = this.rand.nextFloat() - this.rand.nextFloat(); + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (double) f, + this.posY + (double) f1, this.posZ + (double) f2, this.motionX, this.motionY, + this.motionZ, new int[0]); + } + + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } + + if (this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { + this.mountEntity((Entity) null); + } + } else { + this.setAir(300); + } + } + + if (this.isEntityAlive() && this.isWet()) { + this.extinguish(); + } + + this.prevCameraPitch = this.cameraPitch; + if (this.hurtTime > 0) { + --this.hurtTime; + } + + if (this.hurtResistantTime > 0 && !(this instanceof EntityPlayerMP)) { + --this.hurtResistantTime; + } + + if (this.getHealth() <= 0.0F) { + this.onDeathUpdate(); + } + + if (this.recentlyHit > 0) { + --this.recentlyHit; + } else { + this.attackingPlayer = null; + } + + if (this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) { + this.lastAttacker = null; + } + + if (this.entityLivingToAttack != null) { + if (!this.entityLivingToAttack.isEntityAlive()) { + this.setRevengeTarget((EntityLivingBase) null); + } else if (this.ticksExisted - this.revengeTimer > 100) { + this.setRevengeTarget((EntityLivingBase) null); + } + } + + this.updatePotionEffects(); + this.prevMovedDistance = this.movedDistance; + this.prevRenderYawOffset = this.renderYawOffset; + this.prevRotationYawHead = this.rotationYawHead; + this.prevRotationYaw = this.rotationYaw; + this.prevRotationPitch = this.rotationPitch; + this.worldObj.theProfiler.endSection(); + } + + /**+ + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return false; + } + + /**+ + * handles entity death timer, experience orb and particle + * creation + */ + protected void onDeathUpdate() { + ++this.deathTime; + if (this.deathTime == 20) { + if ((this.recentlyHit > 0 || this.isPlayer()) && this.canDropLoot() + && this.worldObj.getGameRules().getBoolean("doMobLoot")) { + int i = this.getExperiencePoints(this.attackingPlayer); + + while (i > 0) { + int j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj + .spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + } + + this.setDead(); + + for (int k = 0; k < 20; ++k) { + double d2 = this.rand.nextGaussian() * 0.02D; + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d2, d0, + d1, new int[0]); + } + } + + } + + /**+ + * Entity won't drop items or experience points if this returns + * false + */ + protected boolean canDropLoot() { + return !this.isChild(); + } + + /**+ + * Decrements the entity's air supply when underwater + */ + protected int decreaseAirSupply(int parInt1) { + int i = EnchantmentHelper.getRespiration(this); + return i > 0 && this.rand.nextInt(i + 1) > 0 ? parInt1 : parInt1 - 1; + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer player) { + return 0; + } + + /**+ + * Only use is to identify if class is an instance of player for + * experience dropping + */ + protected boolean isPlayer() { + return false; + } + + public EaglercraftRandom getRNG() { + return this.rand; + } + + public EntityLivingBase getAITarget() { + return this.entityLivingToAttack; + } + + public int getRevengeTimer() { + return this.revengeTimer; + } + + public void setRevengeTarget(EntityLivingBase livingBase) { + this.entityLivingToAttack = livingBase; + this.revengeTimer = this.ticksExisted; + } + + public EntityLivingBase getLastAttacker() { + return this.lastAttacker; + } + + public int getLastAttackerTime() { + return this.lastAttackerTime; + } + + public void setLastAttacker(Entity entityIn) { + if (entityIn instanceof EntityLivingBase) { + this.lastAttacker = (EntityLivingBase) entityIn; + } else { + this.lastAttacker = null; + } + + this.lastAttackerTime = this.ticksExisted; + } + + public int getAge() { + return this.entityAge; + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setFloat("HealF", this.getHealth()); + nbttagcompound.setShort("Health", (short) ((int) Math.ceil((double) this.getHealth()))); + nbttagcompound.setShort("HurtTime", (short) this.hurtTime); + nbttagcompound.setInteger("HurtByTimestamp", this.revengeTimer); + nbttagcompound.setShort("DeathTime", (short) this.deathTime); + nbttagcompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); + + for (ItemStack itemstack : this.getInventory()) { + if (itemstack != null) { + this.attributeMap.removeAttributeModifiers(itemstack.getAttributeModifiers()); + } + } + + nbttagcompound.setTag("Attributes", SharedMonsterAttributes.writeBaseAttributeMapToNBT(this.getAttributeMap())); + + for (ItemStack itemstack1 : this.getInventory()) { + if (itemstack1 != null) { + this.attributeMap.applyAttributeModifiers(itemstack1.getAttributeModifiers()); + } + } + + if (!this.activePotionsMap.isEmpty()) { + NBTTagList nbttaglist = new NBTTagList(); + + for (PotionEffect potioneffect : this.activePotionsMap.values()) { + nbttaglist.appendTag(potioneffect.writeCustomPotionEffectToNBT(new NBTTagCompound())); + } + + nbttagcompound.setTag("ActiveEffects", nbttaglist); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.setAbsorptionAmount(nbttagcompound.getFloat("AbsorptionAmount")); + if (nbttagcompound.hasKey("Attributes", 9) && this.worldObj != null) { + SharedMonsterAttributes.func_151475_a(this.getAttributeMap(), nbttagcompound.getTagList("Attributes", 10)); + } + + if (nbttagcompound.hasKey("ActiveEffects", 9)) { + NBTTagList nbttaglist = nbttagcompound.getTagList("ActiveEffects", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound1); + if (potioneffect != null) { + this.activePotionsMap.put(Integer.valueOf(potioneffect.getPotionID()), potioneffect); + } + } + } + + if (nbttagcompound.hasKey("HealF", 99)) { + this.setHealth(nbttagcompound.getFloat("HealF")); + } else { + NBTBase nbtbase = nbttagcompound.getTag("Health"); + if (nbtbase == null) { + this.setHealth(this.getMaxHealth()); + } else if (nbtbase.getId() == 5) { + this.setHealth(((NBTTagFloat) nbtbase).getFloat()); + } else if (nbtbase.getId() == 2) { + this.setHealth((float) ((NBTTagShort) nbtbase).getShort()); + } + } + + this.hurtTime = nbttagcompound.getShort("HurtTime"); + this.deathTime = nbttagcompound.getShort("DeathTime"); + this.revengeTimer = nbttagcompound.getInteger("HurtByTimestamp"); + } + + protected void updatePotionEffects() { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) { + Integer integer = (Integer) iterator.next(); + PotionEffect potioneffect = (PotionEffect) this.activePotionsMap.get(integer); + if (!potioneffect.onUpdate(this)) { + { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } else if (potioneffect.getDuration() % 600 == 0) { + this.onChangedPotionEffect(potioneffect, false); + } + } + + if (this.potionsNeedUpdate) { + { + this.updatePotionMetadata(); + } + + this.potionsNeedUpdate = false; + } + + int i = this.dataWatcher.getWatchableObjectInt(7); + boolean flag1 = this.dataWatcher.getWatchableObjectByte(8) > 0; + if (i > 0) { + boolean flag = false; + if (!this.isInvisible()) { + flag = this.rand.nextBoolean(); + } else { + flag = this.rand.nextInt(15) == 0; + } + + if (flag1) { + flag &= this.rand.nextInt(5) == 0; + } + + if (flag && i > 0) { + double d0 = (double) (i >> 16 & 255) / 255.0D; + double d1 = (double) (i >> 8 & 255) / 255.0D; + double d2 = (double) (i >> 0 & 255) / 255.0D; + this.worldObj.spawnParticle(flag1 ? EnumParticleTypes.SPELL_MOB_AMBIENT : EnumParticleTypes.SPELL_MOB, + this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, + this.posY + this.rand.nextDouble() * (double) this.height, + this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, d0, d1, d2, new int[0]); + } + } + + } + + /**+ + * Clears potion metadata values if the entity has no potion + * effects. Otherwise, updates potion effect color, ambience, + * and invisibility metadata values + */ + protected void updatePotionMetadata() { + if (this.activePotionsMap.isEmpty()) { + this.resetPotionEffectMetadata(); + this.setInvisible(false); + } else { + int i = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values()); + this.dataWatcher.updateObject(8, + Byte.valueOf((byte) (PotionHelper.getAreAmbient(this.activePotionsMap.values()) ? 1 : 0))); + this.dataWatcher.updateObject(7, Integer.valueOf(i)); + this.setInvisible(this.isPotionActive(Potion.invisibility.id)); + } + + } + + /**+ + * Resets the potion effect color and ambience metadata values + */ + protected void resetPotionEffectMetadata() { + this.dataWatcher.updateObject(8, Byte.valueOf((byte) 0)); + this.dataWatcher.updateObject(7, Integer.valueOf(0)); + } + + public void clearActivePotions() { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) { + Integer integer = (Integer) iterator.next(); + PotionEffect potioneffect = (PotionEffect) this.activePotionsMap.get(integer); + { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } + + } + + public Collection getActivePotionEffects() { + return this.activePotionsMap.values(); + } + + public boolean isPotionActive(int potionId) { + return this.activePotionsMap.containsKey(Integer.valueOf(potionId)); + } + + public boolean isPotionActive(Potion potionIn) { + return this.activePotionsMap.containsKey(Integer.valueOf(potionIn.id)); + } + + /**+ + * returns the PotionEffect for the supplied Potion if it is + * active, null otherwise. + */ + public PotionEffect getActivePotionEffect(Potion potionIn) { + return (PotionEffect) this.activePotionsMap.get(Integer.valueOf(potionIn.id)); + } + + /**+ + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect potioneffectIn) { + if (this.isPotionApplicable(potioneffectIn)) { + if (this.activePotionsMap.containsKey(Integer.valueOf(potioneffectIn.getPotionID()))) { + ((PotionEffect) this.activePotionsMap.get(Integer.valueOf(potioneffectIn.getPotionID()))) + .combine(potioneffectIn); + this.onChangedPotionEffect( + (PotionEffect) this.activePotionsMap.get(Integer.valueOf(potioneffectIn.getPotionID())), true); + } else { + this.activePotionsMap.put(Integer.valueOf(potioneffectIn.getPotionID()), potioneffectIn); + this.onNewPotionEffect(potioneffectIn); + } + + } + } + + public boolean isPotionApplicable(PotionEffect potioneffectIn) { + if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { + int i = potioneffectIn.getPotionID(); + if (i == Potion.regeneration.id || i == Potion.poison.id) { + return false; + } + } + + return true; + } + + /**+ + * Returns true if this entity is undead. + */ + public boolean isEntityUndead() { + return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + } + + /**+ + * Remove the speified potion effect from this entity. + */ + public void removePotionEffectClient(int potionId) { + this.activePotionsMap.remove(Integer.valueOf(potionId)); + } + + /**+ + * Remove the specified potion effect from this entity. + */ + public void removePotionEffect(int potionId) { + PotionEffect potioneffect = (PotionEffect) this.activePotionsMap.remove(Integer.valueOf(potionId)); + if (potioneffect != null) { + this.onFinishedPotionEffect(potioneffect); + } + + } + + protected void onNewPotionEffect(PotionEffect potioneffect) { + this.potionsNeedUpdate = true; + { + Potion.potionTypes[potioneffect.getPotionID()].applyAttributesModifiersToEntity(this, + this.getAttributeMap(), potioneffect.getAmplifier()); + } + + } + + protected void onChangedPotionEffect(PotionEffect potioneffect, boolean flag) { + this.potionsNeedUpdate = true; + if (flag) { + Potion.potionTypes[potioneffect.getPotionID()].removeAttributesModifiersFromEntity(this, + this.getAttributeMap(), potioneffect.getAmplifier()); + Potion.potionTypes[potioneffect.getPotionID()].applyAttributesModifiersToEntity(this, + this.getAttributeMap(), potioneffect.getAmplifier()); + } + + } + + protected void onFinishedPotionEffect(PotionEffect potioneffect) { + this.potionsNeedUpdate = true; + { + Potion.potionTypes[potioneffect.getPotionID()].removeAttributesModifiersFromEntity(this, + this.getAttributeMap(), potioneffect.getAmplifier()); + } + + } + + /**+ + * Heal living entity (param: amount of half-hearts) + */ + public void heal(float f) { + float f1 = this.getHealth(); + if (f1 > 0.0F) { + this.setHealth(f1 + f); + } + + } + + public final float getHealth() { + return this.dataWatcher.getWatchableObjectFloat(6); + } + + public void setHealth(float health) { + this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(health, 0.0F, this.getMaxHealth()))); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.entityAge = 0; + if (this.getHealth() <= 0.0F) { + return false; + } else if (damagesource.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { + return false; + } else { + if ((damagesource == DamageSource.anvil || damagesource == DamageSource.fallingBlock) + && this.getEquipmentInSlot(4) != null) { + this.getEquipmentInSlot(4).damageItem((int) (f * 4.0F + this.rand.nextFloat() * f * 2.0F), this); + f *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean flag = true; + if ((float) this.hurtResistantTime > (float) this.maxHurtResistantTime / 2.0F) { + if (f <= this.lastDamage) { + return false; + } + + this.damageEntity(damagesource, f - this.lastDamage); + this.lastDamage = f; + flag = false; + } else { + this.lastDamage = f; + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(damagesource, f); + this.hurtTime = this.maxHurtTime = 10; + } + + this.attackedAtYaw = 0.0F; + Entity entity = damagesource.getEntity(); + if (entity != null) { + if (entity instanceof EntityLivingBase) { + this.setRevengeTarget((EntityLivingBase) entity); + } + + if (entity instanceof EntityPlayer) { + this.recentlyHit = 100; + this.attackingPlayer = (EntityPlayer) entity; + } else if (entity instanceof EntityWolf) { + EntityWolf entitywolf = (EntityWolf) entity; + if (entitywolf.isTamed()) { + this.recentlyHit = 100; + this.attackingPlayer = null; + } + } + } + + if (flag) { + this.worldObj.setEntityState(this, (byte) 2); + if (damagesource != DamageSource.drown) { + this.setBeenAttacked(); + } + + if (entity != null) { + double d1 = entity.posX - this.posX; + + double d0; + for (d0 = entity.posZ - this.posZ; d1 * d1 + + d0 * d0 < 1.0E-4D; d0 = (Math.random() - Math.random()) * 0.01D) { + d1 = (Math.random() - Math.random()) * 0.01D; + } + + this.attackedAtYaw = (float) (MathHelper.func_181159_b(d0, d1) * 180.0D / 3.1415927410125732D + - (double) this.rotationYaw); + this.knockBack(entity, f, d1, d0); + } else { + this.attackedAtYaw = (float) ((int) (Math.random() * 2.0D) * 180); + } + } + + if (this.getHealth() <= 0.0F) { + String s = this.getDeathSound(); + if (flag && s != null) { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + + this.onDeath(damagesource); + } else { + String s1 = this.getHurtSound(); + if (flag && s1 != null) { + this.playSound(s1, this.getSoundVolume(), this.getSoundPitch()); + } + } + + return true; + } + } + } + + /**+ + * Renders broken item particles using the given ItemStack + */ + public void renderBrokenItemStack(ItemStack stack) { + this.playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); + + for (int i = 0; i < 5; ++i) { + Vec3 vec3 = new Vec3(((double) this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + vec3 = vec3.rotatePitch(-this.rotationPitch * 3.1415927F / 180.0F); + vec3 = vec3.rotateYaw(-this.rotationYaw * 3.1415927F / 180.0F); + double d0 = (double) (-this.rand.nextFloat()) * 0.6D - 0.3D; + Vec3 vec31 = new Vec3(((double) this.rand.nextFloat() - 0.5D) * 0.3D, d0, 0.6D); + vec31 = vec31.rotatePitch(-this.rotationPitch * 3.1415927F / 180.0F); + vec31 = vec31.rotateYaw(-this.rotationYaw * 3.1415927F / 180.0F); + vec31 = vec31.addVector(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, + vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, new int[] { Item.getIdFromItem(stack.getItem()) }); + } + + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + Entity entity = damagesource.getEntity(); + EntityLivingBase entitylivingbase = this.func_94060_bK(); + if (this.scoreValue >= 0 && entitylivingbase != null) { + entitylivingbase.addToPlayerScore(this, this.scoreValue); + } + + if (entity != null) { + entity.onKillEntity(this); + } + + this.dead = true; + this.getCombatTracker().reset(); + { + int i = 0; + if (entity instanceof EntityPlayer) { + i = EnchantmentHelper.getLootingModifier((EntityLivingBase) entity); + } + + if (this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) { + this.dropFewItems(this.recentlyHit > 0, i); + this.dropEquipment(this.recentlyHit > 0, i); + if (this.recentlyHit > 0 && this.rand.nextFloat() < 0.025F + (float) i * 0.01F) { + this.addRandomDrop(); + } + } + } + + this.worldObj.setEntityState(this, (byte) 3); + } + + /**+ + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean parFlag, int parInt1) { + } + + /**+ + * knocks back this entity + */ + public void knockBack(Entity entityIn, float parFloat1, double parDouble1, double parDouble2) { + if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance) + .getAttributeValue()) { + this.isAirBorne = true; + float f = MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble2 * parDouble2); + float f1 = 0.4F; + this.motionX /= 2.0D; + this.motionY /= 2.0D; + this.motionZ /= 2.0D; + this.motionX -= parDouble1 / (double) f * (double) f1; + this.motionY += (double) f1; + this.motionZ -= parDouble2 / (double) f * (double) f1; + if (this.motionY > 0.4000000059604645D) { + this.motionY = 0.4000000059604645D; + } + + } + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "game.neutral.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "game.neutral.die"; + } + + /**+ + * Causes this Entity to drop a random item. + */ + protected void addRandomDrop() { + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean parFlag, int parInt1) { + } + + /**+ + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock(); + return (block == Blocks.ladder || block == Blocks.vine) + && (!(this instanceof EntityPlayer) || !((EntityPlayer) this).isSpectator()); + } + + /**+ + * Checks whether target entity is alive. + */ + public boolean isEntityAlive() { + return !this.isDead && this.getHealth() > 0.0F; + } + + public void fall(float f, float f1) { + super.fall(f, f1); + PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); + float f2 = potioneffect != null ? (float) (potioneffect.getAmplifier() + 1) : 0.0F; + int i = MathHelper.ceiling_float_int((f - 3.0F - f2) * f1); + if (i > 0) { + this.playSound(this.getFallSoundString(i), 1.0F, 1.0F); + this.attackEntityFrom(DamageSource.fall, (float) i); + int j = MathHelper.floor_double(this.posX); + int k = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int l = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlockState(new BlockPos(j, k, l)).getBlock(); + if (block.getMaterial() != Material.air) { + Block.SoundType block$soundtype = block.stepSound; + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F, + block$soundtype.getFrequency() * 0.75F); + } + } + + } + + protected String getFallSoundString(int damageValue) { + return damageValue > 4 ? "game.neutral.hurt.fall.big" : "game.neutral.hurt.fall.small"; + } + + /**+ + * Setups the entity to do the hurt animation. Only used by + * packets in multiplayer. + */ + public void performHurtAnimation() { + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + int i = 0; + + for (ItemStack itemstack : this.getInventory()) { + if (itemstack != null && itemstack.getItem() instanceof ItemArmor) { + int j = ((ItemArmor) itemstack.getItem()).damageReduceAmount; + i += j; + } + } + + return i; + } + + protected void damageArmor(float parFloat1) { + } + + /**+ + * Reduces damage, depending on armor + */ + protected float applyArmorCalculations(DamageSource source, float damage) { + if (!source.isUnblockable()) { + int i = 25 - this.getTotalArmorValue(); + float f = damage * (float) i; + this.damageArmor(damage); + damage = f / 25.0F; + } + + return damage; + } + + /**+ + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource source, float damage) { + if (source.isDamageAbsolute()) { + return damage; + } else { + if (this.isPotionActive(Potion.resistance) && source != DamageSource.outOfWorld) { + int i = (this.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5; + int j = 25 - i; + float f = damage * (float) j; + damage = f / 25.0F; + } + + if (damage <= 0.0F) { + return 0.0F; + } else { + int k = EnchantmentHelper.getEnchantmentModifierDamage(this.getInventory(), source); + if (k > 20) { + k = 20; + } + + if (k > 0 && k <= 20) { + int l = 25 - k; + float f1 = damage * (float) l; + damage = f1 / 25.0F; + } + + return damage; + } + } + } + + /**+ + * Deals damage to the entity. If its a EntityPlayer then will + * take damage from the armor first and then health second with + * the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource damagesource, float f) { + if (!this.isEntityInvulnerable(damagesource)) { + f = this.applyArmorCalculations(damagesource, f); + f = this.applyPotionDamageCalculations(damagesource, f); + float f1 = f; + f = Math.max(f - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (f1 - f)); + if (f != 0.0F) { + float f2 = this.getHealth(); + this.setHealth(f2 - f); + this.getCombatTracker().trackDamage(damagesource, f2, f); + this.setAbsorptionAmount(this.getAbsorptionAmount() - f); + } + } + } + + public CombatTracker getCombatTracker() { + return this._combatTracker; + } + + public EntityLivingBase func_94060_bK() { + return (EntityLivingBase) (this._combatTracker.func_94550_c() != null ? this._combatTracker.func_94550_c() + : (this.attackingPlayer != null ? this.attackingPlayer + : (this.entityLivingToAttack != null ? this.entityLivingToAttack : null))); + } + + public final float getMaxHealth() { + return (float) this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); + } + + /**+ + * counts the amount of arrows stuck in the entity. getting hit + * by arrows increases this, used in rendering + */ + public final int getArrowCountInEntity() { + return this.dataWatcher.getWatchableObjectByte(9); + } + + /**+ + * sets the amount of arrows stuck in the entity. used for + * rendering those + */ + public final void setArrowCountInEntity(int count) { + this.dataWatcher.updateObject(9, Byte.valueOf((byte) count)); + } + + /**+ + * Returns an integer indicating the end point of the swing + * animation, used by {@link #swingProgress} to provide a + * progress indicator. Takes dig speed enchantments into + * account. + */ + private int getArmSwingAnimationEnd() { + return this.isPotionActive(Potion.digSpeed) + ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 + : (this.isPotionActive(Potion.digSlowdown) + ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 + : 6); + } + + /**+ + * Swings the item the player is holding. + */ + public void swingItem() { + if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 + || this.swingProgressInt < 0) { + this.swingProgressInt = -1; + this.isSwingInProgress = true; + if (this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S0BPacketAnimation(this, 0)); + } + } + + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 2) { + this.limbSwingAmount = 1.5F; + this.hurtResistantTime = this.maxHurtResistantTime; + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + String s = this.getHurtSound(); + if (s != null) { + this.playSound(this.getHurtSound(), this.getSoundVolume(), + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.attackEntityFrom(DamageSource.generic, 0.0F); + } else if (b0 == 3) { + String s1 = this.getDeathSound(); + if (s1 != null) { + this.playSound(this.getDeathSound(), this.getSoundVolume(), + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.setHealth(0.0F); + this.onDeath(DamageSource.generic); + } else { + super.handleStatusUpdate(b0); + } + + } + + /**+ + * sets the dead flag. Used when you fall off the bottom of the + * world. + */ + protected void kill() { + this.attackEntityFrom(DamageSource.outOfWorld, 4.0F); + } + + /**+ + * Updates the arm swing progress counters and animation + * progress + */ + protected void updateArmSwingProgress() { + int i = this.getArmSwingAnimationEnd(); + if (this.isSwingInProgress) { + ++this.swingProgressInt; + if (this.swingProgressInt >= i) { + this.swingProgressInt = 0; + this.isSwingInProgress = false; + } + } else { + this.swingProgressInt = 0; + } + + this.swingProgress = (float) this.swingProgressInt / (float) i; + } + + public IAttributeInstance getEntityAttribute(IAttribute attribute) { + return this.getAttributeMap().getAttributeInstance(attribute); + } + + public BaseAttributeMap getAttributeMap() { + if (this.attributeMap == null) { + this.attributeMap = new ServersideAttributeMap(); + } + + return this.attributeMap; + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEFINED; + } + + public abstract ItemStack getHeldItem(); + + public abstract ItemStack getEquipmentInSlot(int var1); + + public abstract ItemStack getCurrentArmor(int var1); + + public abstract void setCurrentItemOrArmor(int var1, ItemStack var2); + + /**+ + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean flag) { + super.setSprinting(flag); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + if (iattributeinstance.getModifier(sprintingSpeedBoostModifierUUID) != null) { + iattributeinstance.removeModifier(sprintingSpeedBoostModifier); + } + + if (flag) { + iattributeinstance.applyModifier(sprintingSpeedBoostModifier); + } + + } + + public abstract ItemStack[] getInventory(); + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 1.0F; + } + + /**+ + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() { + return this.isChild() ? (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F + : (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F; + } + + /**+ + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() { + return this.getHealth() <= 0.0F; + } + + /**+ + * Moves the entity to a position out of the way of its mount. + */ + public void dismountEntity(Entity parEntity) { + double d0 = parEntity.posX; + double d1 = parEntity.getEntityBoundingBox().minY + (double) parEntity.height; + double d2 = parEntity.posZ; + byte b0 = 1; + + for (int i = -b0; i <= b0; ++i) { + for (int j = -b0; j < b0; ++j) { + if (i != 0 || j != 0) { + int k = (int) (this.posX + (double) i); + int l = (int) (this.posZ + (double) j); + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().offset((double) i, 1.0D, (double) j); + if (this.worldObj.func_147461_a(axisalignedbb).isEmpty()) { + if (World.doesBlockHaveSolidTopSurface(this.worldObj, new BlockPos(k, (int) this.posY, l))) { + this.setPositionAndUpdate(this.posX + (double) i, this.posY + 1.0D, this.posZ + (double) j); + return; + } + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, new BlockPos(k, (int) this.posY - 1, l)) + || this.worldObj.getBlockState(new BlockPos(k, (int) this.posY - 1, l)).getBlock() + .getMaterial() == Material.water) { + d0 = this.posX + (double) i; + d1 = this.posY + 1.0D; + d2 = this.posZ + (double) j; + } + } + } + } + } + + this.setPositionAndUpdate(d0, d1, d2); + } + + public boolean getAlwaysRenderNameTagForRender() { + return false; + } + + protected float getJumpUpwardsMotion() { + return 0.42F; + } + + /**+ + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() { + this.motionY = (double) this.getJumpUpwardsMotion(); + if (this.isPotionActive(Potion.jump)) { + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + if (this.isSprinting()) { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double) (MathHelper.sin(f) * 0.2F); + this.motionZ += (double) (MathHelper.cos(f) * 0.2F); + } + + this.isAirBorne = true; + } + + /**+ + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() { + this.motionY += 0.03999999910593033D; + } + + protected void handleJumpLava() { + this.motionY += 0.03999999910593033D; + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float f, float f1) { + if (this.isServerWorld()) { + if (!this.isInWater() || this instanceof EntityPlayer && ((EntityPlayer) this).capabilities.isFlying) { + if (!this.isInLava() || this instanceof EntityPlayer && ((EntityPlayer) this).capabilities.isFlying) { + float f6 = 0.91F; + if (this.onGround) { + f6 = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, + MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + float f2 = 0.16277136F / (f6 * f6 * f6); + float f7; + if (this.onGround) { + f7 = this.getAIMoveSpeed() * f2; + } else { + f7 = this.jumpMovementFactor; + } + + this.moveFlying(f, f1, f7); + f6 = 0.91F; + if (this.onGround) { + f6 = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, + MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + if (this.isOnLadder()) { + float f8 = 0.15F; + this.motionX = MathHelper.clamp_double(this.motionX, (double) (-f8), (double) f8); + this.motionZ = MathHelper.clamp_double(this.motionZ, (double) (-f8), (double) f8); + this.fallDistance = 0.0F; + if (this.motionY < -0.15D) { + this.motionY = -0.15D; + } + + boolean flag = this.isSneaking() && this instanceof EntityPlayer; + if (flag && this.motionY < 0.0D) { + this.motionY = 0.0D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + if (this.isCollidedHorizontally && this.isOnLadder()) { + this.motionY = 0.2D; + } + + this.motionY -= 0.08D; + this.motionY *= 0.9800000190734863D; + this.motionX *= (double) f6; + this.motionZ *= (double) f6; + } else { + double d1 = this.posY; + this.moveFlying(f, f1, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + this.motionY -= 0.02D; + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, + this.motionY + 0.6000000238418579D - this.posY + d1, this.motionZ)) { + this.motionY = 0.30000001192092896D; + } + } + } else { + double d0 = this.posY; + float f3 = 0.8F; + float f4 = 0.02F; + float f5 = (float) EnchantmentHelper.getDepthStriderModifier(this); + if (f5 > 3.0F) { + f5 = 3.0F; + } + + if (!this.onGround) { + f5 *= 0.5F; + } + + if (f5 > 0.0F) { + f3 += (0.54600006F - f3) * f5 / 3.0F; + f4 += (this.getAIMoveSpeed() * 1.0F - f4) * f5 / 3.0F; + } + + this.moveFlying(f, f1, f4); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= (double) f3; + this.motionY *= 0.800000011920929D; + this.motionZ *= (double) f3; + this.motionY -= 0.02D; + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, + this.motionY + 0.6000000238418579D - this.posY + d0, this.motionZ)) { + this.motionY = 0.30000001192092896D; + } + } + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d2 = this.posX - this.prevPosX; + double d3 = this.posZ - this.prevPosZ; + float f9 = MathHelper.sqrt_double(d2 * d2 + d3 * d3) * 4.0F; + if (f9 > 1.0F) { + f9 = 1.0F; + } + + this.limbSwingAmount += (f9 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + /**+ + * the movespeed used for the new AI system + */ + public float getAIMoveSpeed() { + return this.landMovementFactor; + } + + /**+ + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float speedIn) { + this.landMovementFactor = speedIn; + } + + public boolean attackEntityAsMob(Entity entityIn) { + this.setLastAttacker(entityIn); + return false; + } + + /**+ + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() { + return false; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + { + int i = this.getArrowCountInEntity(); + if (i > 0) { + if (this.arrowHitTimer <= 0) { + this.arrowHitTimer = 20 * (30 - i); + } + + --this.arrowHitTimer; + if (this.arrowHitTimer <= 0) { + this.setArrowCountInEntity(i - 1); + } + } + + for (int j = 0; j < 5; ++j) { + ItemStack itemstack = this.previousEquipment[j]; + ItemStack itemstack1 = this.getEquipmentInSlot(j); + if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S04PacketEntityEquipment(this.getEntityId(), j, itemstack1)); + if (itemstack != null) { + this.attributeMap.removeAttributeModifiers(itemstack.getAttributeModifiers()); + } + + if (itemstack1 != null) { + this.attributeMap.applyAttributeModifiers(itemstack1.getAttributeModifiers()); + } + + this.previousEquipment[j] = itemstack1 == null ? null : itemstack1.copy(); + } + } + + if (this.ticksExisted % 20 == 0) { + this.getCombatTracker().reset(); + } + } + + this.onLivingUpdate(); + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f = (float) (d0 * d0 + d1 * d1); + float f1 = this.renderYawOffset; + float f2 = 0.0F; + this.prevOnGroundSpeedFactor = this.onGroundSpeedFactor; + float f3 = 0.0F; + if (f > 0.0025000002F) { + f3 = 1.0F; + f2 = (float) Math.sqrt((double) f) * 3.0F; + f1 = (float) MathHelper.func_181159_b(d1, d0) * 180.0F / 3.1415927F - 90.0F; + } + + if (this.swingProgress > 0.0F) { + f1 = this.rotationYaw; + } + + if (!this.onGround) { + f3 = 0.0F; + } + + this.onGroundSpeedFactor += (f3 - this.onGroundSpeedFactor) * 0.3F; + this.worldObj.theProfiler.startSection("headTurn"); + f2 = this.func_110146_f(f1, f2); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rangeChecks"); + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset < -180.0F) { + this.prevRenderYawOffset -= 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) { + this.prevRenderYawOffset += 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch < -180.0F) { + this.prevRotationPitch -= 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead < -180.0F) { + this.prevRotationYawHead -= 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead >= 180.0F) { + this.prevRotationYawHead += 360.0F; + } + + this.worldObj.theProfiler.endSection(); + this.movedDistance += f2; + } + + protected float func_110146_f(float parFloat1, float parFloat2) { + float f = MathHelper.wrapAngleTo180_float(parFloat1 - this.renderYawOffset); + this.renderYawOffset += f * 0.3F; + float f1 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.renderYawOffset); + boolean flag = f1 < -90.0F || f1 >= 90.0F; + if (f1 < -75.0F) { + f1 = -75.0F; + } + + if (f1 >= 75.0F) { + f1 = 75.0F; + } + + this.renderYawOffset = this.rotationYaw - f1; + if (f1 * f1 > 2500.0F) { + this.renderYawOffset += f1 * 0.2F; + } + + if (flag) { + parFloat2 *= -1.0F; + } + + return parFloat2; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.jumpTicks > 0) { + --this.jumpTicks; + } + + if (this.newPosRotationIncrements > 0) { + double d0 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements; + double d1 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements; + double d2 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements; + double d3 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw); + this.rotationYaw = (float) ((double) this.rotationYaw + d3 / (double) this.newPosRotationIncrements); + this.rotationPitch = (float) ((double) this.rotationPitch + + (this.newRotationPitch - (double) this.rotationPitch) / (double) this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(d0, d1, d2); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else if (!this.isServerWorld()) { + this.motionX *= 0.98D; + this.motionY *= 0.98D; + this.motionZ *= 0.98D; + } + + if (Math.abs(this.motionX) < 0.005D) { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) < 0.005D) { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) < 0.005D) { + this.motionZ = 0.0D; + } + + this.worldObj.theProfiler.startSection("ai"); + if (this.isMovementBlocked()) { + this.isJumping = false; + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.randomYawVelocity = 0.0F; + } else if (this.isServerWorld()) { + this.worldObj.theProfiler.startSection("newAi"); + this.updateEntityActionState(); + this.worldObj.theProfiler.endSection(); + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("jump"); + if (this.isJumping) { + if (this.isInWater()) { + this.updateAITick(); + } else if (this.isInLava()) { + this.handleJumpLava(); + } else if (this.onGround && this.jumpTicks == 0) { + this.jump(); + this.jumpTicks = 10; + } + } else { + this.jumpTicks = 0; + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("travel"); + this.moveStrafing *= 0.98F; + this.moveForward *= 0.98F; + this.randomYawVelocity *= 0.9F; + this.moveEntityWithHeading(this.moveStrafing, this.moveForward); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("push"); + this.collideWithNearbyEntities(); + + this.worldObj.theProfiler.endSection(); + } + + protected void updateEntityActionState() { + } + + protected void collideWithNearbyEntities() { + List list = this.worldObj.getEntitiesInAABBexcluding(this, + this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D), + Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate() { + public boolean apply(Entity entity1) { + return entity1.canBePushed(); + } + })); + if (!list.isEmpty()) { + for (int i = 0; i < list.size(); ++i) { + Entity entity = (Entity) list.get(i); + this.collideWithEntity(entity); + } + } + + } + + protected void collideWithEntity(Entity parEntity) { + parEntity.applyEntityCollision(this); + } + + /**+ + * Called when a player mounts an entity. e.g. mounts a pig, + * mounts a boat. + */ + public void mountEntity(Entity entity) { + if (this.ridingEntity != null && entity == null) { + this.dismountEntity(this.ridingEntity); + if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { + super.mountEntity(entity); + } + } + + /**+ + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + super.updateRidden(); + this.prevOnGroundSpeedFactor = this.onGroundSpeedFactor; + this.onGroundSpeedFactor = 0.0F; + this.fallDistance = 0.0F; + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int i, boolean var10) { + this.newPosX = d0; + this.newPosY = d1; + this.newPosZ = d2; + this.newRotationYaw = (double) f; + this.newRotationPitch = (double) f1; + this.newPosRotationIncrements = i; + } + + public void setJumping(boolean parFlag) { + this.isJumping = parFlag; + } + + /**+ + * Called whenever an item is picked up from walking over it. + * Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity entity, int var2) { + if (!entity.isDead) { + EntityTracker entitytracker = ((WorldServer) this.worldObj).getEntityTracker(); + if (entity instanceof EntityItem) { + entitytracker.sendToAllTrackingEntity(entity, + new S0DPacketCollectItem(entity.getEntityId(), this.getEntityId())); + } + + if (entity instanceof EntityArrow) { + entitytracker.sendToAllTrackingEntity(entity, + new S0DPacketCollectItem(entity.getEntityId(), this.getEntityId())); + } + + if (entity instanceof EntityXPOrb) { + entitytracker.sendToAllTrackingEntity(entity, + new S0DPacketCollectItem(entity.getEntityId(), this.getEntityId())); + } + } + + } + + /**+ + * returns true if the entity provided in the argument can be + * seen. (Raytrace) + */ + public boolean canEntityBeSeen(Entity entityIn) { + return this.worldObj.rayTraceBlocks(new Vec3(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ), + new Vec3(entityIn.posX, entityIn.posY + (double) entityIn.getEyeHeight(), entityIn.posZ)) == null; + } + + /**+ + * returns a (normalized) vector of where this entity is looking + */ + public Vec3 getLookVec() { + return this.getLook(1.0F); + } + + /**+ + * interpolated look vector + */ + public Vec3 getLook(float f) { + if (f == 1.0F) { + return this.getVectorForRotation(this.rotationPitch, this.rotationYawHead); + } else { + float f1 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * f; + float f2 = this.prevRotationYawHead + (this.rotationYawHead - this.prevRotationYawHead) * f; + return this.getVectorForRotation(f1, f2); + } + } + + /**+ + * Returns where in the swing animation the living entity is + * (from 0 to 1). Args: partialTickTime + */ + public float getSwingProgress(float partialTickTime) { + float f = this.swingProgress - this.prevSwingProgress; + if (f < 0.0F) { + ++f; + } + + return this.prevSwingProgress + f * partialTickTime; + } + + /**+ + * Returns whether the entity is in a server world + */ + public boolean isServerWorld() { + return true; + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return !this.isDead; + } + + /**+ + * Sets that this entity has been attacked. + */ + protected void setBeenAttacked() { + this.velocityChanged = this.rand.nextDouble() >= this + .getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + } + + public float getRotationYawHead() { + return this.rotationYawHead; + } + + /**+ + * Sets the head's yaw rotation of the entity. + */ + public void setRotationYawHead(float f) { + this.rotationYawHead = f; + } + + public void func_181013_g(float f) { + this.renderYawOffset = f; + } + + public float getAbsorptionAmount() { + return this.absorptionAmount; + } + + public void setAbsorptionAmount(float amount) { + if (amount < 0.0F) { + amount = 0.0F; + } + + this.absorptionAmount = amount; + } + + public Team getTeam() { + return this.worldObj.getScoreboard().getPlayersTeam(this.getUniqueID().toString()); + } + + public boolean isOnSameTeam(EntityLivingBase otherEntity) { + return this.isOnTeam(otherEntity.getTeam()); + } + + /**+ + * Returns true if the entity is on a specific team. + */ + public boolean isOnTeam(Team parTeam) { + return this.getTeam() != null ? this.getTeam().isSameTeam(parTeam) : false; + } + + /**+ + * Sends an ENTER_COMBAT packet to the client + */ + public void sendEnterCombat() { + } + + /**+ + * Sends an END_COMBAT packet to the client + */ + public void sendEndCombat() { + } + + protected void markPotionsDirty() { + this.potionsNeedUpdate = true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityMinecartCommandBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityMinecartCommandBlock.java new file mode 100644 index 0000000..42d8ae1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityMinecartCommandBlock.java @@ -0,0 +1,163 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBlockLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartCommandBlock extends EntityMinecart { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityMinecartCommandBlock"); + } + + private final CommandBlockLogic commandBlockLogic = new CommandBlockLogic() { + public void updateCommand() { + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(23, this.getCommand()); + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(24, + IChatComponent.Serializer.componentToJson(this.getLastOutput())); + } + + public int func_145751_f() { + return 1; + } + + public void func_145757_a(ByteBuf bytebuf) { + bytebuf.writeInt(EntityMinecartCommandBlock.this.getEntityId()); + } + + public BlockPos getPosition() { + return new BlockPos(EntityMinecartCommandBlock.this.posX, EntityMinecartCommandBlock.this.posY + 0.5D, + EntityMinecartCommandBlock.this.posZ); + } + + public Vec3 getPositionVector() { + return new Vec3(EntityMinecartCommandBlock.this.posX, EntityMinecartCommandBlock.this.posY, + EntityMinecartCommandBlock.this.posZ); + } + + public World getEntityWorld() { + return EntityMinecartCommandBlock.this.worldObj; + } + + public Entity getCommandSenderEntity() { + return EntityMinecartCommandBlock.this; + } + }; + /**+ + * Cooldown before command block logic runs again in ticks + */ + private int activatorRailCooldown = 0; + + public EntityMinecartCommandBlock(World worldIn) { + super(worldIn); + } + + public EntityMinecartCommandBlock(World worldIn, double x, double y, double z) { + super(worldIn, x, y, z); + } + + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(23, ""); + this.getDataWatcher().addObject(24, ""); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.commandBlockLogic.readDataFromNBT(nbttagcompound); + this.getDataWatcher().updateObject(23, this.getCommandBlockLogic().getCommand()); + this.getDataWatcher().updateObject(24, + IChatComponent.Serializer.componentToJson(this.getCommandBlockLogic().getLastOutput())); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + this.commandBlockLogic.writeDataToNBT(nbttagcompound); + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.COMMAND_BLOCK; + } + + public IBlockState getDefaultDisplayTile() { + return Blocks.command_block.getDefaultState(); + } + + public CommandBlockLogic getCommandBlockLogic() { + return this.commandBlockLogic; + } + + /**+ + * Called every tick the minecart is on an activator rail. Args: + * x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int var1, int var2, int var3, boolean flag) { + if (flag && this.ticksExisted - this.activatorRailCooldown >= 4) { + this.getCommandBlockLogic().trigger(this.worldObj); + this.activatorRailCooldown = this.ticksExisted; + } + + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + this.commandBlockLogic.tryOpenEditCommandBlock(entityplayer); + return false; + } + + public void onDataWatcherUpdate(int i) { + super.onDataWatcherUpdate(i); + if (i == 24) { + try { + this.commandBlockLogic.setLastOutput( + IChatComponent.Serializer.jsonToComponent(this.getDataWatcher().getWatchableObjectString(24))); + } catch (Throwable var3) { + ; + } + } else if (i == 23) { + this.commandBlockLogic.setCommand(this.getDataWatcher().getWatchableObjectString(23)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntitySpawnPlacementRegistry.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntitySpawnPlacementRegistry.java new file mode 100644 index 0000000..f4109b8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntitySpawnPlacementRegistry.java @@ -0,0 +1,107 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import com.google.common.collect.Maps; +import java.util.HashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityWither; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityBlaze; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCaveSpider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEnderman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEndermite; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGhast; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGiantZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGuardian; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMagmaCube; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityPigZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySlime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySnowman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySpider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityWitch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityBat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityCow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityMooshroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityOcelot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityPig; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityRabbit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySpawnPlacementRegistry { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntitySpawnPlacementRegistry"); + } + + private static final HashMap ENTITY_PLACEMENTS = Maps.newHashMap(); + + public static EntityLiving.SpawnPlacementType getPlacementForEntity(Class entityClass) { + return (EntityLiving.SpawnPlacementType) ENTITY_PLACEMENTS.get(entityClass); + } + + static { + ENTITY_PLACEMENTS.put(EntityBat.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityChicken.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityCow.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityHorse.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityMooshroom.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityOcelot.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityPig.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityRabbit.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySheep.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySnowman.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySquid.class, EntityLiving.SpawnPlacementType.IN_WATER); + ENTITY_PLACEMENTS.put(EntityIronGolem.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityWolf.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityVillager.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityDragon.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityWither.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityBlaze.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityCaveSpider.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityCreeper.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityEnderman.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityEndermite.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityGhast.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityGiantZombie.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityGuardian.class, EntityLiving.SpawnPlacementType.IN_WATER); + ENTITY_PLACEMENTS.put(EntityMagmaCube.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityPigZombie.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySilverfish.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySkeleton.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySlime.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySpider.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityWitch.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityZombie.class, EntityLiving.SpawnPlacementType.ON_GROUND); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTracker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTracker.java new file mode 100644 index 0000000..3893e28 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTracker.java @@ -0,0 +1,296 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityHanging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityTrackerEntry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityWither; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderCrystal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderEye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderPearl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityExpBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFallingBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFireworkRocket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityTNTPrimed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityBat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFishHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySmallFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IntHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +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.Chunk; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityTracker { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityTracker"); + } + + private static final Logger logger = LogManager.getLogger(); + private final WorldServer theWorld; + /**+ + * List of tracked entities, used for iteration operations on + * tracked entities. + */ + private Set trackedEntities = Sets.newHashSet(); + /**+ + * Used for identity lookup of tracked entities. + */ + private IntHashMap trackedEntityHashTable = new IntHashMap(); + private int maxTrackingDistanceThreshold; + + public EntityTracker(WorldServer theWorldIn) { + this.theWorld = theWorldIn; + this.maxTrackingDistanceThreshold = theWorldIn.getMinecraftServer().getConfigurationManager() + .getEntityViewDistance(); + } + + public void trackEntity(Entity parEntity) { + if (parEntity instanceof EntityPlayerMP) { + this.trackEntity(parEntity, 512, 2); + EntityPlayerMP entityplayermp = (EntityPlayerMP) parEntity; + + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) { + if (entitytrackerentry.trackedEntity != entityplayermp) { + entitytrackerentry.updatePlayerEntity(entityplayermp); + } + } + } else if (parEntity instanceof EntityFishHook) { + this.addEntityToTracker(parEntity, 64, 5, true); + } else if (parEntity instanceof EntityArrow) { + this.addEntityToTracker(parEntity, 64, 20, false); + } else if (parEntity instanceof EntitySmallFireball) { + this.addEntityToTracker(parEntity, 64, 10, false); + } else if (parEntity instanceof EntityFireball) { + this.addEntityToTracker(parEntity, 64, 10, false); + } else if (parEntity instanceof EntitySnowball) { + this.addEntityToTracker(parEntity, 64, 10, true); + } else if (parEntity instanceof EntityEnderPearl) { + this.addEntityToTracker(parEntity, 64, 10, true); + } else if (parEntity instanceof EntityEnderEye) { + this.addEntityToTracker(parEntity, 64, 4, true); + } else if (parEntity instanceof EntityEgg) { + this.addEntityToTracker(parEntity, 64, 10, true); + } else if (parEntity instanceof EntityPotion) { + this.addEntityToTracker(parEntity, 64, 10, true); + } else if (parEntity instanceof EntityExpBottle) { + this.addEntityToTracker(parEntity, 64, 10, true); + } else if (parEntity instanceof EntityFireworkRocket) { + this.addEntityToTracker(parEntity, 64, 10, true); + } else if (parEntity instanceof EntityItem) { + this.addEntityToTracker(parEntity, 64, 20, true); + } else if (parEntity instanceof EntityMinecart) { + this.addEntityToTracker(parEntity, 80, 3, true); + } else if (parEntity instanceof EntityBoat) { + this.addEntityToTracker(parEntity, 80, 3, true); + } else if (parEntity instanceof EntitySquid) { + this.addEntityToTracker(parEntity, 64, 3, true); + } else if (parEntity instanceof EntityWither) { + this.addEntityToTracker(parEntity, 80, 3, false); + } else if (parEntity instanceof EntityBat) { + this.addEntityToTracker(parEntity, 80, 3, false); + } else if (parEntity instanceof EntityDragon) { + this.addEntityToTracker(parEntity, 160, 3, true); + } else if (parEntity instanceof IAnimals) { + this.addEntityToTracker(parEntity, 80, 3, true); + } else if (parEntity instanceof EntityTNTPrimed) { + this.addEntityToTracker(parEntity, 160, 10, true); + } else if (parEntity instanceof EntityFallingBlock) { + this.addEntityToTracker(parEntity, 160, 20, true); + } else if (parEntity instanceof EntityHanging) { + this.addEntityToTracker(parEntity, 160, Integer.MAX_VALUE, false); + } else if (parEntity instanceof EntityArmorStand) { + this.addEntityToTracker(parEntity, 160, 3, true); + } else if (parEntity instanceof EntityXPOrb) { + this.addEntityToTracker(parEntity, 160, 20, true); + } else if (parEntity instanceof EntityEnderCrystal) { + this.addEntityToTracker(parEntity, 256, Integer.MAX_VALUE, false); + } + + } + + public void trackEntity(Entity entityIn, int trackingRange, int updateFrequency) { + this.addEntityToTracker(entityIn, trackingRange, updateFrequency, false); + } + + /**+ + * Args : Entity, trackingRange, updateFrequency, + * sendVelocityUpdates + */ + public void addEntityToTracker(Entity entityIn, int trackingRange, final int updateFrequency, + boolean sendVelocityUpdates) { + if (trackingRange > this.maxTrackingDistanceThreshold) { + trackingRange = this.maxTrackingDistanceThreshold; + } + + try { + if (this.trackedEntityHashTable.containsItem(entityIn.getEntityId())) { + throw new IllegalStateException("Entity is already tracked!"); + } + + EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entityIn, trackingRange, updateFrequency, + sendVelocityUpdates); + this.trackedEntities.add(entitytrackerentry); + this.trackedEntityHashTable.addKey(entityIn.getEntityId(), entitytrackerentry); + entitytrackerentry.updatePlayerEntities(this.theWorld.playerEntities); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding entity to track"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity To Track"); + crashreportcategory.addCrashSection("Tracking range", trackingRange + " blocks"); + crashreportcategory.addCrashSectionCallable("Update interval", new Callable() { + public String call() throws Exception { + String s = "Once per " + updateFrequency + " ticks"; + if (updateFrequency == Integer.MAX_VALUE) { + s = "Maximum (" + s + ")"; + } + + return s; + } + }); + entityIn.addEntityCrashInfo(crashreportcategory); + CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Entity That Is Already Tracked"); + ((EntityTrackerEntry) this.trackedEntityHashTable.lookup(entityIn.getEntityId())).trackedEntity + .addEntityCrashInfo(crashreportcategory1); + + try { + throw new ReportedException(crashreport); + } catch (ReportedException reportedexception) { + logger.error("\"Silently\" catching entity tracking error.", reportedexception); + } + } + + } + + public void untrackEntity(Entity entityIn) { + if (entityIn instanceof EntityPlayerMP) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entityIn; + + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) { + entitytrackerentry.removeFromTrackedPlayers(entityplayermp); + } + } + + EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) this.trackedEntityHashTable + .removeObject(entityIn.getEntityId()); + if (entitytrackerentry1 != null) { + this.trackedEntities.remove(entitytrackerentry1); + entitytrackerentry1.sendDestroyEntityPacketToTrackedPlayers(); + } + + } + + public void updateTrackedEntities() { + ArrayList arraylist = Lists.newArrayList(); + + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) { + entitytrackerentry.updatePlayerList(this.theWorld.playerEntities); + if (entitytrackerentry.playerEntitiesUpdated + && entitytrackerentry.trackedEntity instanceof EntityPlayerMP) { + arraylist.add((EntityPlayerMP) entitytrackerentry.trackedEntity); + } + } + + for (int i = 0; i < arraylist.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) arraylist.get(i); + + for (EntityTrackerEntry entitytrackerentry1 : this.trackedEntities) { + if (entitytrackerentry1.trackedEntity != entityplayermp) { + entitytrackerentry1.updatePlayerEntity(entityplayermp); + } + } + } + + } + + public void func_180245_a(EntityPlayerMP parEntityPlayerMP) { + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) { + if (entitytrackerentry.trackedEntity == parEntityPlayerMP) { + entitytrackerentry.updatePlayerEntities(this.theWorld.playerEntities); + } else { + entitytrackerentry.updatePlayerEntity(parEntityPlayerMP); + } + } + + } + + public void sendToAllTrackingEntity(Entity entityIn, Packet parPacket) { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.trackedEntityHashTable + .lookup(entityIn.getEntityId()); + if (entitytrackerentry != null) { + entitytrackerentry.sendPacketToTrackedPlayers(parPacket); + } + + } + + public void func_151248_b(Entity entityIn, Packet parPacket) { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.trackedEntityHashTable + .lookup(entityIn.getEntityId()); + if (entitytrackerentry != null) { + entitytrackerentry.func_151261_b(parPacket); + } + + } + + public void removePlayerFromTrackers(EntityPlayerMP parEntityPlayerMP) { + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) { + entitytrackerentry.removeTrackedPlayerSymmetric(parEntityPlayerMP); + } + + } + + public void func_85172_a(EntityPlayerMP parEntityPlayerMP, Chunk parChunk) { + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) { + if (entitytrackerentry.trackedEntity != parEntityPlayerMP + && entitytrackerentry.trackedEntity.chunkCoordX == parChunk.xPosition + && entitytrackerentry.trackedEntity.chunkCoordZ == parChunk.zPosition) { + entitytrackerentry.updatePlayerEntity(parEntityPlayerMP); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTrackerEntry.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTrackerEntry.java new file mode 100644 index 0000000..02d9596 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTrackerEntry.java @@ -0,0 +1,567 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.DataWatcher; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLeashKnot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderCrystal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderEye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderPearl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityExpBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFallingBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFireworkRocket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityTNTPrimed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFishHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySmallFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityWitherSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0APacketUseBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S14PacketEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S20PacketEntityProperties; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.MapData; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityTrackerEntry { + + static { + __checkIntegratedContextValid("net/minecraft/entity/EntityTrackerEntry"); + } + + private static final Logger logger = LogManager.getLogger(); + public Entity trackedEntity; + public int trackingDistanceThreshold; + public int updateFrequency; + public int encodedPosX; + public int encodedPosY; + public int encodedPosZ; + public int encodedRotationYaw; + public int encodedRotationPitch; + public int lastHeadMotion; + public double lastTrackedEntityMotionX; + public double lastTrackedEntityMotionY; + public double motionZ; + public int updateCounter; + private double lastTrackedEntityPosX; + private double lastTrackedEntityPosY; + private double lastTrackedEntityPosZ; + private boolean firstUpdateDone; + private boolean sendVelocityUpdates; + private int ticksSinceLastForcedTeleport; + private Entity field_85178_v; + private boolean ridingEntity; + private boolean onGround; + public boolean playerEntitiesUpdated; + /**+ + * Holds references to all the players that are currently + * receiving position updates for this entity. + */ + public Set trackingPlayers = Sets.newHashSet(); + + public EntityTrackerEntry(Entity trackedEntityIn, int trackingDistanceThresholdIn, int updateFrequencyIn, + boolean sendVelocityUpdatesIn) { + this.trackedEntity = trackedEntityIn; + this.trackingDistanceThreshold = trackingDistanceThresholdIn; + this.updateFrequency = updateFrequencyIn; + this.sendVelocityUpdates = sendVelocityUpdatesIn; + this.encodedPosX = MathHelper.floor_double(trackedEntityIn.posX * 32.0D); + this.encodedPosY = MathHelper.floor_double(trackedEntityIn.posY * 32.0D); + this.encodedPosZ = MathHelper.floor_double(trackedEntityIn.posZ * 32.0D); + this.encodedRotationYaw = MathHelper.floor_float(trackedEntityIn.rotationYaw * 256.0F / 360.0F); + this.encodedRotationPitch = MathHelper.floor_float(trackedEntityIn.rotationPitch * 256.0F / 360.0F); + this.lastHeadMotion = MathHelper.floor_float(trackedEntityIn.getRotationYawHead() * 256.0F / 360.0F); + this.onGround = trackedEntityIn.onGround; + } + + public boolean equals(Object object) { + return object instanceof EntityTrackerEntry + ? ((EntityTrackerEntry) object).trackedEntity.getEntityId() == this.trackedEntity.getEntityId() + : false; + } + + public int hashCode() { + return this.trackedEntity.getEntityId(); + } + + public void updatePlayerList(List parList) { + this.playerEntitiesUpdated = false; + if (!this.firstUpdateDone || this.trackedEntity.getDistanceSq(this.lastTrackedEntityPosX, + this.lastTrackedEntityPosY, this.lastTrackedEntityPosZ) > 16.0D) { + this.lastTrackedEntityPosX = this.trackedEntity.posX; + this.lastTrackedEntityPosY = this.trackedEntity.posY; + this.lastTrackedEntityPosZ = this.trackedEntity.posZ; + this.firstUpdateDone = true; + this.playerEntitiesUpdated = true; + this.updatePlayerEntities(parList); + } + + if (this.field_85178_v != this.trackedEntity.ridingEntity + || this.trackedEntity.ridingEntity != null && this.updateCounter % 60 == 0) { + this.field_85178_v = this.trackedEntity.ridingEntity; + this.sendPacketToTrackedPlayers( + new S1BPacketEntityAttach(0, this.trackedEntity, this.trackedEntity.ridingEntity)); + } + + if (this.trackedEntity instanceof EntityItemFrame && this.updateCounter % 10 == 0) { + EntityItemFrame entityitemframe = (EntityItemFrame) this.trackedEntity; + ItemStack itemstack = entityitemframe.getDisplayedItem(); + if (itemstack != null && itemstack.getItem() instanceof ItemMap) { + MapData mapdata = Items.filled_map.getMapData(itemstack, this.trackedEntity.worldObj); + + for (EntityPlayer entityplayer : parList) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entityplayer; + mapdata.updateVisiblePlayers(entityplayermp, itemstack); + Packet packet = Items.filled_map.createMapDataPacket(itemstack, this.trackedEntity.worldObj, + entityplayermp); + if (packet != null) { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + } + + this.sendMetadataToAllAssociatedPlayers(); + } + + if (this.updateCounter % this.updateFrequency == 0 || this.trackedEntity.isAirBorne + || this.trackedEntity.getDataWatcher().hasObjectChanged()) { + if (this.trackedEntity.ridingEntity == null) { + ++this.ticksSinceLastForcedTeleport; + int k = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); + int j1 = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); + int k1 = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); + int l1 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); + int i2 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); + int j2 = k - this.encodedPosX; + int k2 = j1 - this.encodedPosY; + int i = k1 - this.encodedPosZ; + Object object = null; + boolean flag = Math.abs(j2) >= 4 || Math.abs(k2) >= 4 || Math.abs(i) >= 4 + || this.updateCounter % 60 == 0; + boolean flag1 = Math.abs(l1 - this.encodedRotationYaw) >= 4 + || Math.abs(i2 - this.encodedRotationPitch) >= 4; + if (this.updateCounter > 0 || this.trackedEntity instanceof EntityArrow) { + if (j2 >= -128 && j2 < 128 && k2 >= -128 && k2 < 128 && i >= -128 && i < 128 + && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity + && this.onGround == this.trackedEntity.onGround) { + if ((!flag || !flag1) && !(this.trackedEntity instanceof EntityArrow)) { + if (flag) { + object = new S14PacketEntity.S15PacketEntityRelMove(this.trackedEntity.getEntityId(), + (byte) j2, (byte) k2, (byte) i, this.trackedEntity.onGround); + } else if (flag1) { + object = new S14PacketEntity.S16PacketEntityLook(this.trackedEntity.getEntityId(), + (byte) l1, (byte) i2, this.trackedEntity.onGround); + } + } else { + object = new S14PacketEntity.S17PacketEntityLookMove(this.trackedEntity.getEntityId(), + (byte) j2, (byte) k2, (byte) i, (byte) l1, (byte) i2, this.trackedEntity.onGround); + } + } else { + this.onGround = this.trackedEntity.onGround; + this.ticksSinceLastForcedTeleport = 0; + object = new S18PacketEntityTeleport(this.trackedEntity.getEntityId(), k, j1, k1, (byte) l1, + (byte) i2, this.trackedEntity.onGround); + } + } + + if (this.sendVelocityUpdates) { + double d0 = this.trackedEntity.motionX - this.lastTrackedEntityMotionX; + double d1 = this.trackedEntity.motionY - this.lastTrackedEntityMotionY; + double d2 = this.trackedEntity.motionZ - this.motionZ; + double d3 = 0.02D; + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + if (d4 > d3 * d3 || d4 > 0.0D && this.trackedEntity.motionX == 0.0D + && this.trackedEntity.motionY == 0.0D && this.trackedEntity.motionZ == 0.0D) { + this.lastTrackedEntityMotionX = this.trackedEntity.motionX; + this.lastTrackedEntityMotionY = this.trackedEntity.motionY; + this.motionZ = this.trackedEntity.motionZ; + this.sendPacketToTrackedPlayers(new S12PacketEntityVelocity(this.trackedEntity.getEntityId(), + this.lastTrackedEntityMotionX, this.lastTrackedEntityMotionY, this.motionZ)); + } + } + + if (object != null) { + this.sendPacketToTrackedPlayers((Packet) object); + } + + this.sendMetadataToAllAssociatedPlayers(); + if (flag) { + this.encodedPosX = k; + this.encodedPosY = j1; + this.encodedPosZ = k1; + } + + if (flag1) { + this.encodedRotationYaw = l1; + this.encodedRotationPitch = i2; + } + + this.ridingEntity = false; + } else { + int j = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); + int i1 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); + boolean flag2 = Math.abs(j - this.encodedRotationYaw) >= 4 + || Math.abs(i1 - this.encodedRotationPitch) >= 4; + if (flag2) { + this.sendPacketToTrackedPlayers(new S14PacketEntity.S16PacketEntityLook( + this.trackedEntity.getEntityId(), (byte) j, (byte) i1, this.trackedEntity.onGround)); + this.encodedRotationYaw = j; + this.encodedRotationPitch = i1; + } + + this.encodedPosX = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); + this.encodedPosY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); + this.encodedPosZ = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); + this.sendMetadataToAllAssociatedPlayers(); + this.ridingEntity = true; + } + + int l = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); + if (Math.abs(l - this.lastHeadMotion) >= 4) { + this.sendPacketToTrackedPlayers(new S19PacketEntityHeadLook(this.trackedEntity, (byte) l)); + this.lastHeadMotion = l; + } + + this.trackedEntity.isAirBorne = false; + } + + ++this.updateCounter; + if (this.trackedEntity.velocityChanged) { + this.func_151261_b(new S12PacketEntityVelocity(this.trackedEntity)); + this.trackedEntity.velocityChanged = false; + } + + } + + /**+ + * Sends the entity metadata (DataWatcher) and attributes to all + * players tracking this entity, including the entity itself if + * a player. + */ + private void sendMetadataToAllAssociatedPlayers() { + DataWatcher datawatcher = this.trackedEntity.getDataWatcher(); + if (datawatcher.hasObjectChanged()) { + this.func_151261_b(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), datawatcher, false)); + } + + if (this.trackedEntity instanceof EntityLivingBase) { + ServersideAttributeMap serversideattributemap = (ServersideAttributeMap) ((EntityLivingBase) this.trackedEntity) + .getAttributeMap(); + Set set = serversideattributemap.getAttributeInstanceSet(); + if (!set.isEmpty()) { + this.func_151261_b(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), set)); + } + + set.clear(); + } + + } + + /**+ + * Send the given packet to all players tracking this entity. + */ + public void sendPacketToTrackedPlayers(Packet packetIn) { + for (EntityPlayerMP entityplayermp : this.trackingPlayers) { + entityplayermp.playerNetServerHandler.sendPacket(packetIn); + } + + } + + public void func_151261_b(Packet packetIn) { + this.sendPacketToTrackedPlayers(packetIn); + if (this.trackedEntity instanceof EntityPlayerMP) { + ((EntityPlayerMP) this.trackedEntity).playerNetServerHandler.sendPacket(packetIn); + } + + } + + public void sendDestroyEntityPacketToTrackedPlayers() { + for (EntityPlayerMP entityplayermp : this.trackingPlayers) { + entityplayermp.removeEntity(this.trackedEntity); + } + + } + + public void removeFromTrackedPlayers(EntityPlayerMP playerMP) { + if (this.trackingPlayers.contains(playerMP)) { + playerMP.removeEntity(this.trackedEntity); + this.trackingPlayers.remove(playerMP); + } + + } + + public void updatePlayerEntity(EntityPlayerMP playerMP) { + if (playerMP != this.trackedEntity) { + if (this.func_180233_c(playerMP)) { + if (!this.trackingPlayers.contains(playerMP) + && (this.isPlayerWatchingThisChunk(playerMP) || this.trackedEntity.forceSpawn)) { + this.trackingPlayers.add(playerMP); + Packet packet = this.func_151260_c(); + playerMP.playerNetServerHandler.sendPacket(packet); + if (!this.trackedEntity.getDataWatcher().getIsBlank()) { + playerMP.playerNetServerHandler.sendPacket(new S1CPacketEntityMetadata( + this.trackedEntity.getEntityId(), this.trackedEntity.getDataWatcher(), true)); + } + + NBTTagCompound nbttagcompound = this.trackedEntity.getNBTTagCompound(); + if (nbttagcompound != null) { + playerMP.playerNetServerHandler.sendPacket( + new S49PacketUpdateEntityNBT(this.trackedEntity.getEntityId(), nbttagcompound)); + } + + if (this.trackedEntity instanceof EntityLivingBase) { + ServersideAttributeMap serversideattributemap = (ServersideAttributeMap) ((EntityLivingBase) this.trackedEntity) + .getAttributeMap(); + Collection collection = serversideattributemap.getWatchedAttributes(); + if (!collection.isEmpty()) { + playerMP.playerNetServerHandler.sendPacket( + new S20PacketEntityProperties(this.trackedEntity.getEntityId(), collection)); + } + } + + this.lastTrackedEntityMotionX = this.trackedEntity.motionX; + this.lastTrackedEntityMotionY = this.trackedEntity.motionY; + this.motionZ = this.trackedEntity.motionZ; + if (this.sendVelocityUpdates && !(packet instanceof S0FPacketSpawnMob)) { + playerMP.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity( + this.trackedEntity.getEntityId(), this.trackedEntity.motionX, + this.trackedEntity.motionY, this.trackedEntity.motionZ)); + } + + if (this.trackedEntity.ridingEntity != null) { + playerMP.playerNetServerHandler.sendPacket( + new S1BPacketEntityAttach(0, this.trackedEntity, this.trackedEntity.ridingEntity)); + } + + if (this.trackedEntity instanceof EntityLiving + && ((EntityLiving) this.trackedEntity).getLeashedToEntity() != null) { + playerMP.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this.trackedEntity, + ((EntityLiving) this.trackedEntity).getLeashedToEntity())); + } + + if (this.trackedEntity instanceof EntityLivingBase) { + for (int i = 0; i < 5; ++i) { + ItemStack itemstack = ((EntityLivingBase) this.trackedEntity).getEquipmentInSlot(i); + if (itemstack != null) { + playerMP.playerNetServerHandler.sendPacket( + new S04PacketEntityEquipment(this.trackedEntity.getEntityId(), i, itemstack)); + } + } + } + + if (this.trackedEntity instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) this.trackedEntity; + if (entityplayer.isPlayerSleeping()) { + playerMP.playerNetServerHandler + .sendPacket(new S0APacketUseBed(entityplayer, new BlockPos(this.trackedEntity))); + } + } + + if (this.trackedEntity instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) this.trackedEntity; + + for (PotionEffect potioneffect : entitylivingbase.getActivePotionEffects()) { + playerMP.playerNetServerHandler.sendPacket( + new S1DPacketEntityEffect(this.trackedEntity.getEntityId(), potioneffect)); + } + } + } + } else if (this.trackingPlayers.contains(playerMP)) { + this.trackingPlayers.remove(playerMP); + playerMP.removeEntity(this.trackedEntity); + } + + } + } + + public boolean func_180233_c(EntityPlayerMP playerMP) { + double d0 = playerMP.posX - (double) (this.encodedPosX / 32); + double d1 = playerMP.posZ - (double) (this.encodedPosZ / 32); + return d0 >= (double) (-this.trackingDistanceThreshold) && d0 <= (double) this.trackingDistanceThreshold + && d1 >= (double) (-this.trackingDistanceThreshold) && d1 <= (double) this.trackingDistanceThreshold + && this.trackedEntity.isSpectatedByPlayer(playerMP); + } + + private boolean isPlayerWatchingThisChunk(EntityPlayerMP playerMP) { + return playerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(playerMP, + this.trackedEntity.chunkCoordX, this.trackedEntity.chunkCoordZ); + } + + public void updatePlayerEntities(List parList) { + for (int i = 0; i < parList.size(); ++i) { + this.updatePlayerEntity((EntityPlayerMP) parList.get(i)); + } + + } + + private Packet func_151260_c() { + if (this.trackedEntity.isDead) { + logger.warn("Fetching addPacket for removed entity"); + } + + if (this.trackedEntity instanceof EntityItem) { + return new S0EPacketSpawnObject(this.trackedEntity, 2, 1); + } else if (this.trackedEntity instanceof EntityPlayerMP) { + return new S0CPacketSpawnPlayer((EntityPlayer) this.trackedEntity); + } else if (this.trackedEntity instanceof EntityMinecart) { + EntityMinecart entityminecart = (EntityMinecart) this.trackedEntity; + return new S0EPacketSpawnObject(this.trackedEntity, 10, entityminecart.getMinecartType().getNetworkID()); + } else if (this.trackedEntity instanceof EntityBoat) { + return new S0EPacketSpawnObject(this.trackedEntity, 1); + } else if (this.trackedEntity instanceof IAnimals) { + this.lastHeadMotion = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); + return new S0FPacketSpawnMob((EntityLivingBase) this.trackedEntity); + } else if (this.trackedEntity instanceof EntityFishHook) { + EntityPlayer entityplayer = ((EntityFishHook) this.trackedEntity).angler; + return new S0EPacketSpawnObject(this.trackedEntity, 90, + entityplayer != null ? entityplayer.getEntityId() : this.trackedEntity.getEntityId()); + } else if (this.trackedEntity instanceof EntityArrow) { + Entity entity = ((EntityArrow) this.trackedEntity).shootingEntity; + return new S0EPacketSpawnObject(this.trackedEntity, 60, + entity != null ? entity.getEntityId() : this.trackedEntity.getEntityId()); + } else if (this.trackedEntity instanceof EntitySnowball) { + return new S0EPacketSpawnObject(this.trackedEntity, 61); + } else if (this.trackedEntity instanceof EntityPotion) { + return new S0EPacketSpawnObject(this.trackedEntity, 73, + ((EntityPotion) this.trackedEntity).getPotionDamage()); + } else if (this.trackedEntity instanceof EntityExpBottle) { + return new S0EPacketSpawnObject(this.trackedEntity, 75); + } else if (this.trackedEntity instanceof EntityEnderPearl) { + return new S0EPacketSpawnObject(this.trackedEntity, 65); + } else if (this.trackedEntity instanceof EntityEnderEye) { + return new S0EPacketSpawnObject(this.trackedEntity, 72); + } else if (this.trackedEntity instanceof EntityFireworkRocket) { + return new S0EPacketSpawnObject(this.trackedEntity, 76); + } else if (this.trackedEntity instanceof EntityFireball) { + EntityFireball entityfireball = (EntityFireball) this.trackedEntity; + S0EPacketSpawnObject s0epacketspawnobject2 = null; + byte b0 = 63; + if (this.trackedEntity instanceof EntitySmallFireball) { + b0 = 64; + } else if (this.trackedEntity instanceof EntityWitherSkull) { + b0 = 66; + } + + if (entityfireball.shootingEntity != null) { + s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, b0, + ((EntityFireball) this.trackedEntity).shootingEntity.getEntityId()); + } else { + s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, b0, 0); + } + + s0epacketspawnobject2.setSpeedX((int) (entityfireball.accelerationX * 8000.0D)); + s0epacketspawnobject2.setSpeedY((int) (entityfireball.accelerationY * 8000.0D)); + s0epacketspawnobject2.setSpeedZ((int) (entityfireball.accelerationZ * 8000.0D)); + return s0epacketspawnobject2; + } else if (this.trackedEntity instanceof EntityEgg) { + return new S0EPacketSpawnObject(this.trackedEntity, 62); + } else if (this.trackedEntity instanceof EntityTNTPrimed) { + return new S0EPacketSpawnObject(this.trackedEntity, 50); + } else if (this.trackedEntity instanceof EntityEnderCrystal) { + return new S0EPacketSpawnObject(this.trackedEntity, 51); + } else if (this.trackedEntity instanceof EntityFallingBlock) { + EntityFallingBlock entityfallingblock = (EntityFallingBlock) this.trackedEntity; + return new S0EPacketSpawnObject(this.trackedEntity, 70, Block.getStateId(entityfallingblock.getBlock())); + } else if (this.trackedEntity instanceof EntityArmorStand) { + return new S0EPacketSpawnObject(this.trackedEntity, 78); + } else if (this.trackedEntity instanceof EntityPainting) { + return new S10PacketSpawnPainting((EntityPainting) this.trackedEntity); + } else if (this.trackedEntity instanceof EntityItemFrame) { + EntityItemFrame entityitemframe = (EntityItemFrame) this.trackedEntity; + S0EPacketSpawnObject s0epacketspawnobject1 = new S0EPacketSpawnObject(this.trackedEntity, 71, + entityitemframe.facingDirection.getHorizontalIndex()); + BlockPos blockpos1 = entityitemframe.getHangingPosition(); + s0epacketspawnobject1.setX(MathHelper.floor_float((float) (blockpos1.getX() * 32))); + s0epacketspawnobject1.setY(MathHelper.floor_float((float) (blockpos1.getY() * 32))); + s0epacketspawnobject1.setZ(MathHelper.floor_float((float) (blockpos1.getZ() * 32))); + return s0epacketspawnobject1; + } else if (this.trackedEntity instanceof EntityLeashKnot) { + EntityLeashKnot entityleashknot = (EntityLeashKnot) this.trackedEntity; + S0EPacketSpawnObject s0epacketspawnobject = new S0EPacketSpawnObject(this.trackedEntity, 77); + BlockPos blockpos = entityleashknot.getHangingPosition(); + s0epacketspawnobject.setX(MathHelper.floor_float((float) (blockpos.getX() * 32))); + s0epacketspawnobject.setY(MathHelper.floor_float((float) (blockpos.getY() * 32))); + s0epacketspawnobject.setZ(MathHelper.floor_float((float) (blockpos.getZ() * 32))); + return s0epacketspawnobject; + } else if (this.trackedEntity instanceof EntityXPOrb) { + return new S11PacketSpawnExperienceOrb((EntityXPOrb) this.trackedEntity); + } else { + throw new IllegalArgumentException("Don\'t know how to add " + this.trackedEntity.getClass() + "!"); + } + } + + /**+ + * Remove a tracked player from our list and tell the tracked + * player to destroy us from their world. + */ + public void removeTrackedPlayerSymmetric(EntityPlayerMP playerMP) { + if (this.trackingPlayers.contains(playerMP)) { + this.trackingPlayers.remove(playerMP); + playerMP.removeEntity(this.trackedEntity); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureAttribute.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureAttribute.java new file mode 100644 index 0000000..61f8e8e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureAttribute.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumCreatureAttribute { + UNDEFINED, UNDEAD, ARTHROPOD; + + static { + __checkIntegratedContextValid("net/minecraft/entity/EnumCreatureAttribute"); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureType.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureType.java new file mode 100644 index 0000000..e81e10e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureType.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAmbientCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWaterMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumCreatureType { + MONSTER(IMob.class, 70, Material.air, false, false), CREATURE(EntityAnimal.class, 10, Material.air, true, true), + AMBIENT(EntityAmbientCreature.class, 15, Material.air, true, false), + WATER_CREATURE(EntityWaterMob.class, 5, Material.water, true, false); + + static { + __checkIntegratedContextValid("net/minecraft/entity/EnumCreatureType"); + } + + private final Class creatureClass; + private final int maxNumberOfCreature; + private final Material creatureMaterial; + private final boolean isPeacefulCreature; + private final boolean isAnimal; + + private EnumCreatureType(Class creatureClassIn, int maxNumberOfCreatureIn, + Material creatureMaterialIn, boolean isPeacefulCreatureIn, boolean isAnimalIn) { + this.creatureClass = creatureClassIn; + this.maxNumberOfCreature = maxNumberOfCreatureIn; + this.creatureMaterial = creatureMaterialIn; + this.isPeacefulCreature = isPeacefulCreatureIn; + this.isAnimal = isAnimalIn; + } + + public Class getCreatureClass() { + return this.creatureClass; + } + + public int getMaxNumberOfCreature() { + return this.maxNumberOfCreature; + } + + /**+ + * Gets whether or not this creature type is peaceful. + */ + public boolean getPeacefulCreature() { + return this.isPeacefulCreature; + } + + /**+ + * Return whether this creature type is an animal. + */ + public boolean getAnimal() { + return this.isAnimal; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityLivingData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityLivingData.java new file mode 100644 index 0000000..ae31798 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityLivingData.java @@ -0,0 +1,24 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IEntityLivingData { +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityMultiPart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityMultiPart.java new file mode 100644 index 0000000..4c4e50f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityMultiPart.java @@ -0,0 +1,31 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragonPart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IEntityMultiPart { + World getWorld(); + + boolean attackEntityFromPart(EntityDragonPart var1, DamageSource var2, float var3); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityOwnable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityOwnable.java new file mode 100644 index 0000000..d93a06b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityOwnable.java @@ -0,0 +1,29 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IEntityOwnable { + String getOwnerId(); + + Entity getOwner(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IMerchant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IMerchant.java new file mode 100644 index 0000000..b703541 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IMerchant.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipeList; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IMerchant { + void setCustomer(EntityPlayer var1); + + EntityPlayer getCustomer(); + + MerchantRecipeList getRecipes(EntityPlayer var1); + + void setRecipes(MerchantRecipeList var1); + + void useRecipe(MerchantRecipe var1); + + /**+ + * Notifies the merchant of a possible merchantrecipe being + * fulfilled or not. Usually, this is just a sound byte being + * played depending if the suggested itemstack is not null. + */ + void verifySellingItem(ItemStack var1); + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + IChatComponent getDisplayName(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/INpc.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/INpc.java new file mode 100644 index 0000000..2841f20 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/INpc.java @@ -0,0 +1,26 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INpc extends IAnimals { +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IProjectile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IProjectile.java new file mode 100644 index 0000000..06b3a23 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IProjectile.java @@ -0,0 +1,29 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IProjectile { + /**+ + * Similar to setArrowHeading, it's point the throwable entity + * to a x, y, z direction. + */ + void setThrowableHeading(double var1, double var3, double var5, float var7, float var8); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IRangedAttackMob.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IRangedAttackMob.java new file mode 100644 index 0000000..91ccd1a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IRangedAttackMob.java @@ -0,0 +1,30 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IRangedAttackMob { + /**+ + * Attack the specified entity using a ranged attack. + */ + void attackEntityWithRangedAttack(EntityLivingBase var1, float var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/NpcMerchant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/NpcMerchant.java new file mode 100644 index 0000000..64987d7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/NpcMerchant.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipeList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NpcMerchant implements IMerchant { + + static { + __checkIntegratedContextValid("net/minecraft/entity/NpcMerchant"); + } + + private InventoryMerchant theMerchantInventory; + private EntityPlayer customer; + private MerchantRecipeList recipeList; + private IChatComponent field_175548_d; + + public NpcMerchant(EntityPlayer parEntityPlayer, IChatComponent parIChatComponent) { + this.customer = parEntityPlayer; + this.field_175548_d = parIChatComponent; + this.theMerchantInventory = new InventoryMerchant(parEntityPlayer, this); + } + + public EntityPlayer getCustomer() { + return this.customer; + } + + public void setCustomer(EntityPlayer var1) { + } + + public MerchantRecipeList getRecipes(EntityPlayer var1) { + return this.recipeList; + } + + public void setRecipes(MerchantRecipeList merchantrecipelist) { + this.recipeList = merchantrecipelist; + } + + public void useRecipe(MerchantRecipe merchantrecipe) { + merchantrecipe.incrementToolUses(); + } + + /**+ + * Notifies the merchant of a possible merchantrecipe being + * fulfilled or not. Usually, this is just a sound byte being + * played depending if the suggested itemstack is not null. + */ + public void verifySellingItem(ItemStack var1) { + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.field_175548_d != null ? this.field_175548_d + : new ChatComponentTranslation("entity.Villager.name", new Object[0])); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/SharedMonsterAttributes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/SharedMonsterAttributes.java new file mode 100644 index 0000000..c750c75 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/SharedMonsterAttributes.java @@ -0,0 +1,157 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; + +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SharedMonsterAttributes { + + static { + __checkIntegratedContextValid("net/minecraft/entity/SharedMonsterAttributes"); + } + + private static final Logger logger = LogManager.getLogger(); + public static final IAttribute maxHealth = (new RangedAttribute((IAttribute) null, "generic.maxHealth", 20.0D, 0.0D, + 1024.0D)).setDescription("Max Health").setShouldWatch(true); + public static final IAttribute followRange = (new RangedAttribute((IAttribute) null, "generic.followRange", 32.0D, + 0.0D, 2048.0D)).setDescription("Follow Range"); + public static final IAttribute knockbackResistance = (new RangedAttribute((IAttribute) null, + "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).setDescription("Knockback Resistance"); + public static final IAttribute movementSpeed = (new RangedAttribute((IAttribute) null, "generic.movementSpeed", + 0.699999988079071D, 0.0D, 1024.0D)).setDescription("Movement Speed").setShouldWatch(true); + public static final IAttribute attackDamage = new RangedAttribute((IAttribute) null, "generic.attackDamage", 2.0D, + 0.0D, 2048.0D); + + /**+ + * Creates an NBTTagList from a BaseAttributeMap, including all + * its AttributeInstances + */ + public static NBTTagList writeBaseAttributeMapToNBT(BaseAttributeMap parBaseAttributeMap) { + NBTTagList nbttaglist = new NBTTagList(); + + for (IAttributeInstance iattributeinstance : parBaseAttributeMap.getAllAttributes()) { + nbttaglist.appendTag(writeAttributeInstanceToNBT(iattributeinstance)); + } + + return nbttaglist; + } + + /**+ + * Creates an NBTTagCompound from an AttributeInstance, + * including its AttributeModifiers + */ + private static NBTTagCompound writeAttributeInstanceToNBT(IAttributeInstance parIAttributeInstance) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + IAttribute iattribute = parIAttributeInstance.getAttribute(); + nbttagcompound.setString("Name", iattribute.getAttributeUnlocalizedName()); + nbttagcompound.setDouble("Base", parIAttributeInstance.getBaseValue()); + Collection collection = parIAttributeInstance.func_111122_c(); + if (collection != null && !collection.isEmpty()) { + NBTTagList nbttaglist = new NBTTagList(); + + for (AttributeModifier attributemodifier : (Collection) collection) { + if (attributemodifier.isSaved()) { + nbttaglist.appendTag(writeAttributeModifierToNBT(attributemodifier)); + } + } + + nbttagcompound.setTag("Modifiers", nbttaglist); + } + + return nbttagcompound; + } + + /**+ + * Creates an NBTTagCompound from an AttributeModifier + */ + private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier parAttributeModifier) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", parAttributeModifier.getName()); + nbttagcompound.setDouble("Amount", parAttributeModifier.getAmount()); + nbttagcompound.setInteger("Operation", parAttributeModifier.getOperation()); + nbttagcompound.setLong("UUIDMost", parAttributeModifier.getID().getMostSignificantBits()); + nbttagcompound.setLong("UUIDLeast", parAttributeModifier.getID().getLeastSignificantBits()); + return nbttagcompound; + } + + public static void func_151475_a(BaseAttributeMap parBaseAttributeMap, NBTTagList parNBTTagList) { + for (int i = 0; i < parNBTTagList.tagCount(); ++i) { + NBTTagCompound nbttagcompound = parNBTTagList.getCompoundTagAt(i); + IAttributeInstance iattributeinstance = parBaseAttributeMap + .getAttributeInstanceByName(nbttagcompound.getString("Name")); + if (iattributeinstance != null) { + applyModifiersToAttributeInstance(iattributeinstance, nbttagcompound); + } else { + logger.warn("Ignoring unknown attribute \'" + nbttagcompound.getString("Name") + "\'"); + } + } + + } + + private static void applyModifiersToAttributeInstance(IAttributeInstance parIAttributeInstance, + NBTTagCompound parNBTTagCompound) { + parIAttributeInstance.setBaseValue(parNBTTagCompound.getDouble("Base")); + if (parNBTTagCompound.hasKey("Modifiers", 9)) { + NBTTagList nbttaglist = parNBTTagCompound.getTagList("Modifiers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + AttributeModifier attributemodifier = readAttributeModifierFromNBT(nbttaglist.getCompoundTagAt(i)); + if (attributemodifier != null) { + AttributeModifier attributemodifier1 = parIAttributeInstance.getModifier(attributemodifier.getID()); + if (attributemodifier1 != null) { + parIAttributeInstance.removeModifier(attributemodifier1); + } + + parIAttributeInstance.applyModifier(attributemodifier); + } + } + } + + } + + /**+ + * Creates an AttributeModifier from an NBTTagCompound + */ + public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound parNBTTagCompound) { + EaglercraftUUID uuid = new EaglercraftUUID(parNBTTagCompound.getLong("UUIDMost"), + parNBTTagCompound.getLong("UUIDLeast")); + + try { + return new AttributeModifier(uuid, parNBTTagCompound.getString("Name"), + parNBTTagCompound.getDouble("Amount"), parNBTTagCompound.getInteger("Operation")); + } catch (Exception exception) { + logger.warn("Unable to create attribute: " + exception.getMessage()); + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIArrowAttack.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIArrowAttack.java new file mode 100644 index 0000000..a990971 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIArrowAttack.java @@ -0,0 +1,136 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IRangedAttackMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIArrowAttack extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIArrowAttack"); + } + + private final EntityLiving entityHost; + private final IRangedAttackMob rangedAttackEntityHost; + private EntityLivingBase attackTarget; + private int rangedAttackTime; + private double entityMoveSpeed; + private int field_75318_f; + private int field_96561_g; + private int maxRangedAttackTime; + private float field_96562_i; + private float maxAttackDistance; + + public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int parInt1, float parFloat1) { + this(attacker, movespeed, parInt1, parInt1, parFloat1); + } + + public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int parInt1, int maxAttackTime, + float maxAttackDistanceIn) { + this.rangedAttackTime = -1; + if (!(attacker instanceof EntityLivingBase)) { + throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); + } else { + this.rangedAttackEntityHost = attacker; + this.entityHost = (EntityLiving) attacker; + this.entityMoveSpeed = movespeed; + this.field_96561_g = parInt1; + this.maxRangedAttackTime = maxAttackTime; + this.field_96562_i = maxAttackDistanceIn; + this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn; + this.setMutexBits(3); + } + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.entityHost.getAttackTarget(); + if (entitylivingbase == null) { + return false; + } else { + this.attackTarget = entitylivingbase; + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.shouldExecute() || !this.entityHost.getNavigator().noPath(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.attackTarget = null; + this.field_75318_f = 0; + this.rangedAttackTime = -1; + } + + /**+ + * Updates the task + */ + public void updateTask() { + double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.getEntityBoundingBox().minY, + this.attackTarget.posZ); + boolean flag = this.entityHost.getEntitySenses().canSee(this.attackTarget); + if (flag) { + ++this.field_75318_f; + } else { + this.field_75318_f = 0; + } + + if (d0 <= (double) this.maxAttackDistance && this.field_75318_f >= 20) { + this.entityHost.getNavigator().clearPathEntity(); + } else { + this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed); + } + + this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F); + if (--this.rangedAttackTime == 0) { + if (d0 > (double) this.maxAttackDistance || !flag) { + return; + } + + float f = MathHelper.sqrt_double(d0) / this.field_96562_i; + float f1 = MathHelper.clamp_float(f, 0.1F, 1.0F); + this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, f1); + this.rangedAttackTime = MathHelper.floor_float( + f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g); + } else if (this.rangedAttackTime < 0) { + float f2 = MathHelper.sqrt_double(d0) / this.field_96562_i; + this.rangedAttackTime = MathHelper.floor_float( + f2 * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAttackOnCollide.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAttackOnCollide.java new file mode 100644 index 0000000..865f917 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAttackOnCollide.java @@ -0,0 +1,153 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIAttackOnCollide extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIAttackOnCollide"); + } + + World worldObj; + protected EntityCreature attacker; + int attackTick; + double speedTowardsTarget; + boolean longMemory; + PathEntity entityPathEntity; + Class classTarget; + private int delayCounter; + private double targetX; + private double targetY; + private double targetZ; + + public EntityAIAttackOnCollide(EntityCreature creature, Class targetClass, double speedIn, + boolean useLongMemory) { + this(creature, speedIn, useLongMemory); + this.classTarget = targetClass; + } + + public EntityAIAttackOnCollide(EntityCreature creature, double speedIn, boolean useLongMemory) { + this.attacker = creature; + this.worldObj = creature.worldObj; + this.speedTowardsTarget = speedIn; + this.longMemory = useLongMemory; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + if (entitylivingbase == null) { + return false; + } else if (!entitylivingbase.isEntityAlive()) { + return false; + } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) { + return false; + } else { + this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); + return this.entityPathEntity != null; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + return entitylivingbase == null ? false + : (!entitylivingbase.isEntityAlive() ? false + : (!this.longMemory ? !this.attacker.getNavigator().noPath() + : this.attacker.isWithinHomeDistanceFromPosition(new BlockPos(entitylivingbase)))); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); + this.delayCounter = 0; + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.attacker.getNavigator().clearPathEntity(); + } + + /**+ + * Updates the task + */ + public void updateTask() { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); + double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.getEntityBoundingBox().minY, + entitylivingbase.posZ); + double d1 = this.func_179512_a(entitylivingbase); + --this.delayCounter; + if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.delayCounter <= 0 + && (this.targetX == 0.0D && this.targetY == 0.0D && this.targetZ == 0.0D + || entitylivingbase.getDistanceSq(this.targetX, this.targetY, this.targetZ) >= 1.0D + || this.attacker.getRNG().nextFloat() < 0.05F)) { + this.targetX = entitylivingbase.posX; + this.targetY = entitylivingbase.getEntityBoundingBox().minY; + this.targetZ = entitylivingbase.posZ; + this.delayCounter = 4 + this.attacker.getRNG().nextInt(7); + if (d0 > 1024.0D) { + this.delayCounter += 10; + } else if (d0 > 256.0D) { + this.delayCounter += 5; + } + + if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) { + this.delayCounter += 15; + } + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + if (d0 <= d1 && this.attackTick <= 0) { + this.attackTick = 20; + if (this.attacker.getHeldItem() != null) { + this.attacker.swingItem(); + } + + this.attacker.attackEntityAsMob(entitylivingbase); + } + + } + + protected double func_179512_a(EntityLivingBase attackTarget) { + return (double) (this.attacker.width * 2.0F * this.attacker.width * 2.0F + attackTarget.width); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAvoidEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAvoidEntity.java new file mode 100644 index 0000000..a0b28b6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAvoidEntity.java @@ -0,0 +1,136 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIAvoidEntity extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIAvoidEntity"); + } + + private final Predicate canBeSeenSelector; + protected EntityCreature theEntity; + private double farSpeed; + private double nearSpeed; + protected T closestLivingEntity; + private float avoidDistance; + private PathEntity entityPathEntity; + private PathNavigate entityPathNavigate; + private Class field_181064_i; + private Predicate avoidTargetSelector; + + public EntityAIAvoidEntity(EntityCreature parEntityCreature, Class parClass1, float parFloat1, double parDouble1, + double parDouble2) { + this(parEntityCreature, parClass1, Predicates.alwaysTrue(), parFloat1, parDouble1, parDouble2); + } + + public EntityAIAvoidEntity(EntityCreature parEntityCreature, Class parClass1, Predicate parPredicate, + float parFloat1, double parDouble1, double parDouble2) { + this.canBeSeenSelector = new Predicate() { + public boolean apply(Entity entity) { + return entity.isEntityAlive() && EntityAIAvoidEntity.this.theEntity.getEntitySenses().canSee(entity); + } + }; + this.theEntity = parEntityCreature; + this.field_181064_i = parClass1; + this.avoidTargetSelector = parPredicate; + this.avoidDistance = parFloat1; + this.farSpeed = parDouble1; + this.nearSpeed = parDouble2; + this.entityPathNavigate = parEntityCreature.getNavigator(); + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + List list = this.theEntity.worldObj.getEntitiesWithinAABB(this.field_181064_i, + this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, + (double) this.avoidDistance), + Predicates.and(new Predicate[] { EntitySelectors.NOT_SPECTATING, this.canBeSeenSelector, + this.avoidTargetSelector })); + if (list.isEmpty()) { + return false; + } else { + this.closestLivingEntity = (T) list.get(0); + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.theEntity, 16, 7, new Vec3( + this.closestLivingEntity.posX, this.closestLivingEntity.posY, this.closestLivingEntity.posZ)); + if (vec3 == null) { + return false; + } else if (this.closestLivingEntity.getDistanceSq(vec3.xCoord, vec3.yCoord, + vec3.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) { + return false; + } else { + this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord); + return this.entityPathEntity == null ? false : this.entityPathEntity.isDestinationSame(vec3); + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.entityPathNavigate.noPath(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.closestLivingEntity = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + if (this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) { + this.theEntity.getNavigator().setSpeed(this.nearSpeed); + } else { + this.theEntity.getNavigator().setSpeed(this.farSpeed); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBase.java new file mode 100644 index 0000000..022a673 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBase.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIBase"); + } + + private int mutexBits; + + public abstract boolean shouldExecute(); + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.shouldExecute(); + } + + /**+ + * Determine if this AI Task is interruptible by a higher (= + * lower value) priority task. All vanilla AITask have this + * value set to true. + */ + public boolean isInterruptible() { + return true; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + } + + /**+ + * Resets the task + */ + public void resetTask() { + } + + /**+ + * Updates the task + */ + public void updateTask() { + } + + /**+ + * Sets a bitmask telling which other tasks may not run + * concurrently. The test is a simple bitwise AND - if it yields + * zero, the two tasks may run concurrently, if not - they must + * run exclusively from each other. + */ + public void setMutexBits(int mutexBitsIn) { + this.mutexBits = mutexBitsIn; + } + + /**+ + * Get a bitmask telling which other tasks may not run + * concurrently. The test is a simple bitwise AND - if it yields + * zero, the two tasks may run concurrently, if not - they must + * run exclusively from each other. + */ + public int getMutexBits() { + return this.mutexBits; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBeg.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBeg.java new file mode 100644 index 0000000..a16bfaf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBeg.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIBeg extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIBeg"); + } + + private EntityWolf theWolf; + private EntityPlayer thePlayer; + private World worldObject; + private float minPlayerDistance; + private int timeoutCounter; + + public EntityAIBeg(EntityWolf wolf, float minDistance) { + this.theWolf = wolf; + this.worldObject = wolf.worldObj; + this.minPlayerDistance = minDistance; + this.setMutexBits(2); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.thePlayer = this.worldObject.getClosestPlayerToEntity(this.theWolf, (double) this.minPlayerDistance); + return this.thePlayer == null ? false : this.hasPlayerGotBoneInHand(this.thePlayer); + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.thePlayer.isEntityAlive() ? false + : (this.theWolf.getDistanceSqToEntity( + this.thePlayer) > (double) (this.minPlayerDistance * this.minPlayerDistance) ? false + : this.timeoutCounter > 0 && this.hasPlayerGotBoneInHand(this.thePlayer)); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theWolf.setBegging(true); + this.timeoutCounter = 40 + this.theWolf.getRNG().nextInt(40); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.theWolf.setBegging(false); + this.thePlayer = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.theWolf.getLookHelper().setLookPosition(this.thePlayer.posX, + this.thePlayer.posY + (double) this.thePlayer.getEyeHeight(), this.thePlayer.posZ, 10.0F, + (float) this.theWolf.getVerticalFaceSpeed()); + --this.timeoutCounter; + } + + /**+ + * Gets if the Player has the Bone in the hand. + */ + private boolean hasPlayerGotBoneInHand(EntityPlayer player) { + ItemStack itemstack = player.inventory.getCurrentItem(); + return itemstack == null ? false + : (!this.theWolf.isTamed() && itemstack.getItem() == Items.bone ? true + : this.theWolf.isBreedingItem(itemstack)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBreakDoor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBreakDoor.java new file mode 100644 index 0000000..4eb7c8c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBreakDoor.java @@ -0,0 +1,116 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIDoorInteract; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIBreakDoor extends EntityAIDoorInteract { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIBreakDoor"); + } + + private int breakingTime; + private int previousBreakProgress = -1; + + public EntityAIBreakDoor(EntityLiving entityIn) { + super(entityIn); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!super.shouldExecute()) { + return false; + } else if (!this.theEntity.worldObj.getGameRules().getBoolean("mobGriefing")) { + return false; + } else { + BlockDoor blockdoor = this.doorBlock; + return !BlockDoor.isOpen(this.theEntity.worldObj, this.doorPosition); + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + super.startExecuting(); + this.breakingTime = 0; + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + double d0 = this.theEntity.getDistanceSq(this.doorPosition); + boolean flag; + if (this.breakingTime <= 240) { + BlockDoor blockdoor = this.doorBlock; + if (!BlockDoor.isOpen(this.theEntity.worldObj, this.doorPosition) && d0 < 4.0D) { + flag = true; + return flag; + } + } + + flag = false; + return flag; + } + + /**+ + * Resets the task + */ + public void resetTask() { + super.resetTask(); + this.theEntity.worldObj.sendBlockBreakProgress(this.theEntity.getEntityId(), this.doorPosition, -1); + } + + /**+ + * Updates the task + */ + public void updateTask() { + super.updateTask(); + if (this.theEntity.getRNG().nextInt(20) == 0) { + this.theEntity.worldObj.playAuxSFX(1010, this.doorPosition, 0); + } + + ++this.breakingTime; + int i = (int) ((float) this.breakingTime / 240.0F * 10.0F); + if (i != this.previousBreakProgress) { + this.theEntity.worldObj.sendBlockBreakProgress(this.theEntity.getEntityId(), this.doorPosition, i); + this.previousBreakProgress = i; + } + + if (this.breakingTime == 240 && this.theEntity.worldObj.getDifficulty() == EnumDifficulty.HARD) { + this.theEntity.worldObj.setBlockToAir(this.doorPosition); + this.theEntity.worldObj.playAuxSFX(1012, this.doorPosition, 0); + this.theEntity.worldObj.playAuxSFX(2001, this.doorPosition, Block.getIdFromBlock(this.doorBlock)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIControlledByPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIControlledByPlayer.java new file mode 100644 index 0000000..90a868d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIControlledByPlayer.java @@ -0,0 +1,221 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStairs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder.WalkNodeProcessor; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIControlledByPlayer extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIControlledByPlayer"); + } + + private final EntityLiving thisEntity; + private final float maxSpeed; + private float currentSpeed; + private boolean speedBoosted; + private int speedBoostTime; + private int maxSpeedBoostTime; + + public EntityAIControlledByPlayer(EntityLiving entitylivingIn, float maxspeed) { + this.thisEntity = entitylivingIn; + this.maxSpeed = maxspeed; + this.setMutexBits(7); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.currentSpeed = 0.0F; + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.speedBoosted = false; + this.currentSpeed = 0.0F; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null + && this.thisEntity.riddenByEntity instanceof EntityPlayer + && (this.speedBoosted || this.thisEntity.canBeSteered()); + } + + /**+ + * Updates the task + */ + public void updateTask() { + EntityPlayer entityplayer = (EntityPlayer) this.thisEntity.riddenByEntity; + EntityCreature entitycreature = (EntityCreature) this.thisEntity; + float f = MathHelper.wrapAngleTo180_float(entityplayer.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; + if (f > 5.0F) { + f = 5.0F; + } + + if (f < -5.0F) { + f = -5.0F; + } + + this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + f); + if (this.currentSpeed < this.maxSpeed) { + this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; + } + + if (this.currentSpeed > this.maxSpeed) { + this.currentSpeed = this.maxSpeed; + } + + int i = MathHelper.floor_double(this.thisEntity.posX); + int j = MathHelper.floor_double(this.thisEntity.posY); + int k = MathHelper.floor_double(this.thisEntity.posZ); + float f1 = this.currentSpeed; + if (this.speedBoosted) { + if (this.speedBoostTime++ > this.maxSpeedBoostTime) { + this.speedBoosted = false; + } + + f1 += f1 * 1.15F + * MathHelper.sin((float) this.speedBoostTime / (float) this.maxSpeedBoostTime * 3.1415927F); + } + + float f2 = 0.91F; + if (this.thisEntity.onGround) { + f2 = this.thisEntity.worldObj + .getBlockState(new BlockPos(MathHelper.floor_float((float) i), + MathHelper.floor_float((float) j) - 1, MathHelper.floor_float((float) k))) + .getBlock().slipperiness * 0.91F; + } + + float f3 = 0.16277136F / (f2 * f2 * f2); + float f4 = MathHelper.sin(entitycreature.rotationYaw * 3.1415927F / 180.0F); + float f5 = MathHelper.cos(entitycreature.rotationYaw * 3.1415927F / 180.0F); + float f6 = entitycreature.getAIMoveSpeed() * f3; + float f7 = Math.max(f1, 1.0F); + f7 = f6 / f7; + float f8 = f1 * f7; + float f9 = -(f8 * f4); + float f10 = f8 * f5; + if (MathHelper.abs(f9) > MathHelper.abs(f10)) { + if (f9 < 0.0F) { + f9 -= this.thisEntity.width / 2.0F; + } + + if (f9 > 0.0F) { + f9 += this.thisEntity.width / 2.0F; + } + + f10 = 0.0F; + } else { + f9 = 0.0F; + if (f10 < 0.0F) { + f10 -= this.thisEntity.width / 2.0F; + } + + if (f10 > 0.0F) { + f10 += this.thisEntity.width / 2.0F; + } + } + + int l = MathHelper.floor_double(this.thisEntity.posX + (double) f9); + int i1 = MathHelper.floor_double(this.thisEntity.posZ + (double) f10); + int j1 = MathHelper.floor_float(this.thisEntity.width + 1.0F); + int k1 = MathHelper.floor_float(this.thisEntity.height + entityplayer.height + 1.0F); + int l1 = MathHelper.floor_float(this.thisEntity.width + 1.0F); + if (i != l || k != i1) { + Block block = this.thisEntity.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock(); + boolean flag = !this.isStairOrSlab(block) && (block.getMaterial() != Material.air || !this + .isStairOrSlab(this.thisEntity.worldObj.getBlockState(new BlockPos(i, j - 1, k)).getBlock())); + if (flag && 0 == WalkNodeProcessor.func_176170_a(this.thisEntity.worldObj, this.thisEntity, l, j, i1, j1, + k1, l1, false, false, true) + && 1 == WalkNodeProcessor.func_176170_a(this.thisEntity.worldObj, this.thisEntity, i, j + 1, k, j1, + k1, l1, false, false, true) + && 1 == WalkNodeProcessor.func_176170_a(this.thisEntity.worldObj, this.thisEntity, l, j + 1, i1, j1, + k1, l1, false, false, true)) { + entitycreature.getJumpHelper().setJumping(); + } + } + + if (!entityplayer.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F + && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { + ItemStack itemstack = entityplayer.getHeldItem(); + if (itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick) { + itemstack.damageItem(1, entityplayer); + if (itemstack.stackSize == 0) { + ItemStack itemstack1 = new ItemStack(Items.fishing_rod); + itemstack1.setTagCompound(itemstack.getTagCompound()); + entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = itemstack1; + } + } + } + + this.thisEntity.moveEntityWithHeading(0.0F, f1); + } + + /**+ + * True if the block is a stair block or a slab block + */ + private boolean isStairOrSlab(Block blockIn) { + return blockIn instanceof BlockStairs || blockIn instanceof BlockSlab; + } + + /**+ + * Return whether the entity's speed is boosted. + */ + public boolean isSpeedBoosted() { + return this.speedBoosted; + } + + /**+ + * Boost the entity's movement speed. + */ + public void boostSpeed() { + this.speedBoosted = true; + this.speedBoostTime = 0; + this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; + } + + /**+ + * Return whether the entity is being controlled by a player. + */ + public boolean isControlledByPlayer() { + return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAICreeperSwell.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAICreeperSwell.java new file mode 100644 index 0000000..ea34210 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAICreeperSwell.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAICreeperSwell extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAICreeperSwell"); + } + + EntityCreeper swellingCreeper; + EntityLivingBase creeperAttackTarget; + + public EntityAICreeperSwell(EntityCreeper entitycreeperIn) { + this.swellingCreeper = entitycreeperIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 + || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.swellingCreeper.getNavigator().clearPathEntity(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.creeperAttackTarget = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + if (this.creeperAttackTarget == null) { + this.swellingCreeper.setCreeperState(-1); + } else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) { + this.swellingCreeper.setCreeperState(-1); + } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) { + this.swellingCreeper.setCreeperState(-1); + } else { + this.swellingCreeper.setCreeperState(1); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDefendVillage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDefendVillage.java new file mode 100644 index 0000000..2bff714 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDefendVillage.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIDefendVillage extends EntityAITarget { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIDefendVillage"); + } + + EntityIronGolem irongolem; + EntityLivingBase villageAgressorTarget; + + public EntityAIDefendVillage(EntityIronGolem ironGolemIn) { + super(ironGolemIn, false, true); + this.irongolem = ironGolemIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + Village village = this.irongolem.getVillage(); + if (village == null) { + return false; + } else { + this.villageAgressorTarget = village.findNearestVillageAggressor(this.irongolem); + if (this.villageAgressorTarget instanceof EntityCreeper) { + return false; + } else if (!this.isSuitableTarget(this.villageAgressorTarget, false)) { + if (this.taskOwner.getRNG().nextInt(20) == 0) { + this.villageAgressorTarget = village.getNearestTargetPlayer(this.irongolem); + return this.isSuitableTarget(this.villageAgressorTarget, false); + } else { + return false; + } + } else { + return true; + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.irongolem.setAttackTarget(this.villageAgressorTarget); + super.startExecuting(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDoorInteract.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDoorInteract.java new file mode 100644 index 0000000..ddd2b8d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDoorInteract.java @@ -0,0 +1,121 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAIDoorInteract extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIDoorInteract"); + } + + protected EntityLiving theEntity; + protected BlockPos doorPosition = BlockPos.ORIGIN; + protected BlockDoor doorBlock; + boolean hasStoppedDoorInteraction; + float entityPositionX; + float entityPositionZ; + + public EntityAIDoorInteract(EntityLiving entityIn) { + this.theEntity = entityIn; + if (!(entityIn.getNavigator() instanceof PathNavigateGround)) { + throw new IllegalArgumentException("Unsupported mob type for DoorInteractGoal"); + } + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theEntity.isCollidedHorizontally) { + return false; + } else { + PathNavigateGround pathnavigateground = (PathNavigateGround) this.theEntity.getNavigator(); + PathEntity pathentity = pathnavigateground.getPath(); + if (pathentity != null && !pathentity.isFinished() && pathnavigateground.getEnterDoors()) { + for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, + pathentity.getCurrentPathLength()); ++i) { + PathPoint pathpoint = pathentity.getPathPointFromIndex(i); + this.doorPosition = new BlockPos(pathpoint.xCoord, pathpoint.yCoord + 1, pathpoint.zCoord); + if (this.theEntity.getDistanceSq((double) this.doorPosition.getX(), this.theEntity.posY, + (double) this.doorPosition.getZ()) <= 2.25D) { + this.doorBlock = this.getBlockDoor(this.doorPosition); + if (this.doorBlock != null) { + return true; + } + } + } + + this.doorPosition = (new BlockPos(this.theEntity)).up(); + this.doorBlock = this.getBlockDoor(this.doorPosition); + return this.doorBlock != null; + } else { + return false; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.hasStoppedDoorInteraction; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.hasStoppedDoorInteraction = false; + this.entityPositionX = (float) ((double) ((float) this.doorPosition.getX() + 0.5F) - this.theEntity.posX); + this.entityPositionZ = (float) ((double) ((float) this.doorPosition.getZ() + 0.5F) - this.theEntity.posZ); + } + + /**+ + * Updates the task + */ + public void updateTask() { + float f = (float) ((double) ((float) this.doorPosition.getX() + 0.5F) - this.theEntity.posX); + float f1 = (float) ((double) ((float) this.doorPosition.getZ() + 0.5F) - this.theEntity.posZ); + float f2 = this.entityPositionX * f + this.entityPositionZ * f1; + if (f2 < 0.0F) { + this.hasStoppedDoorInteraction = true; + } + + } + + private BlockDoor getBlockDoor(BlockPos pos) { + Block block = this.theEntity.worldObj.getBlockState(pos).getBlock(); + return block instanceof BlockDoor && block.getMaterial() == Material.wood ? (BlockDoor) block : null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIEatGrass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIEatGrass.java new file mode 100644 index 0000000..527045b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIEatGrass.java @@ -0,0 +1,128 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockStateHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIEatGrass extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIEatGrass"); + } + + private static final Predicate field_179505_b = BlockStateHelper.forBlock(Blocks.tallgrass) + .where(BlockTallGrass.TYPE, Predicates.equalTo(BlockTallGrass.EnumType.GRASS)); + private EntityLiving grassEaterEntity; + private World entityWorld; + int eatingGrassTimer; + + public EntityAIEatGrass(EntityLiving grassEaterEntityIn) { + this.grassEaterEntity = grassEaterEntityIn; + this.entityWorld = grassEaterEntityIn.worldObj; + this.setMutexBits(7); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.grassEaterEntity.getRNG().nextInt(this.grassEaterEntity.isChild() ? 50 : 1000) != 0) { + return false; + } else { + BlockPos blockpos = new BlockPos(this.grassEaterEntity.posX, this.grassEaterEntity.posY, + this.grassEaterEntity.posZ); + return field_179505_b.apply(this.entityWorld.getBlockState(blockpos)) ? true + : this.entityWorld.getBlockState(blockpos.down()).getBlock() == Blocks.grass; + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.eatingGrassTimer = 40; + this.entityWorld.setEntityState(this.grassEaterEntity, (byte) 10); + this.grassEaterEntity.getNavigator().clearPathEntity(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.eatingGrassTimer = 0; + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.eatingGrassTimer > 0; + } + + /**+ + * Number of ticks since the entity started to eat grass + */ + public int getEatingGrassTimer() { + return this.eatingGrassTimer; + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.eatingGrassTimer = Math.max(0, this.eatingGrassTimer - 1); + if (this.eatingGrassTimer == 4) { + BlockPos blockpos = new BlockPos(this.grassEaterEntity.posX, this.grassEaterEntity.posY, + this.grassEaterEntity.posZ); + if (field_179505_b.apply(this.entityWorld.getBlockState(blockpos))) { + if (this.entityWorld.getGameRules().getBoolean("mobGriefing")) { + this.entityWorld.destroyBlock(blockpos, false); + } + + this.grassEaterEntity.eatGrassBonus(); + } else { + BlockPos blockpos1 = blockpos.down(); + if (this.entityWorld.getBlockState(blockpos1).getBlock() == Blocks.grass) { + if (this.entityWorld.getGameRules().getBoolean("mobGriefing")) { + this.entityWorld.playAuxSFX(2001, blockpos1, Block.getIdFromBlock(Blocks.grass)); + this.entityWorld.setBlockState(blockpos1, Blocks.dirt.getDefaultState(), 2); + } + + this.grassEaterEntity.eatGrassBonus(); + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearest.java new file mode 100644 index 0000000..9ecf868 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearest.java @@ -0,0 +1,132 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import java.util.Collections; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIFindEntityNearest extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFindEntityNearest"); + } + + private static final Logger field_179444_a = LogManager.getLogger(); + private EntityLiving field_179442_b; + private final Predicate field_179443_c; + private final EntityAINearestAttackableTarget.Sorter field_179440_d; + private EntityLivingBase field_179441_e; + private Class field_179439_f; + + public EntityAIFindEntityNearest(EntityLiving parEntityLiving, Class parClass1) { + this.field_179442_b = parEntityLiving; + this.field_179439_f = parClass1; + if (parEntityLiving instanceof EntityCreature) { + field_179444_a.warn("Use NearestAttackableTargetGoal.class for PathfinerMob mobs!"); + } + + this.field_179443_c = new Predicate() { + public boolean apply(EntityLivingBase entitylivingbase) { + double d0 = EntityAIFindEntityNearest.this.func_179438_f(); + if (entitylivingbase.isSneaking()) { + d0 *= 0.800000011920929D; + } + + return entitylivingbase.isInvisible() ? false + : ((double) entitylivingbase + .getDistanceToEntity(EntityAIFindEntityNearest.this.field_179442_b) > d0 ? false + : EntityAITarget.isSuitableTarget(EntityAIFindEntityNearest.this.field_179442_b, + entitylivingbase, false, true)); + } + }; + this.field_179440_d = new EntityAINearestAttackableTarget.Sorter(parEntityLiving); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + double d0 = this.func_179438_f(); + List list = this.field_179442_b.worldObj.getEntitiesWithinAABB(this.field_179439_f, + this.field_179442_b.getEntityBoundingBox().expand(d0, 4.0D, d0), this.field_179443_c); + Collections.sort(list, this.field_179440_d); + if (list.isEmpty()) { + return false; + } else { + this.field_179441_e = (EntityLivingBase) list.get(0); + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + EntityLivingBase entitylivingbase = this.field_179442_b.getAttackTarget(); + if (entitylivingbase == null) { + return false; + } else if (!entitylivingbase.isEntityAlive()) { + return false; + } else { + double d0 = this.func_179438_f(); + return this.field_179442_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false + : !(entitylivingbase instanceof EntityPlayerMP) + || !((EntityPlayerMP) entitylivingbase).theItemInWorldManager.isCreative(); + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_179442_b.setAttackTarget(this.field_179441_e); + super.startExecuting(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.field_179442_b.setAttackTarget((EntityLivingBase) null); + super.startExecuting(); + } + + protected double func_179438_f() { + IAttributeInstance iattributeinstance = this.field_179442_b + .getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java new file mode 100644 index 0000000..6ec9bc6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java @@ -0,0 +1,156 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import java.util.Collections; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIFindEntityNearestPlayer extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer"); + } + + private static final Logger field_179436_a = LogManager.getLogger(); + private EntityLiving field_179434_b; + private final Predicate field_179435_c; + private final EntityAINearestAttackableTarget.Sorter field_179432_d; + private EntityLivingBase field_179433_e; + + public EntityAIFindEntityNearestPlayer(EntityLiving parEntityLiving) { + this.field_179434_b = parEntityLiving; + if (parEntityLiving instanceof EntityCreature) { + field_179436_a.warn("Use NearestAttackableTargetGoal.class for PathfinerMob mobs!"); + } + + this.field_179435_c = new Predicate() { + public boolean apply(Entity entity) { + if (!(entity instanceof EntityPlayer)) { + return false; + } else if (((EntityPlayer) entity).capabilities.disableDamage) { + return false; + } else { + double d0 = EntityAIFindEntityNearestPlayer.this.func_179431_f(); + if (entity.isSneaking()) { + d0 *= 0.800000011920929D; + } + + if (entity.isInvisible()) { + float f = ((EntityPlayer) entity).getArmorVisibility(); + if (f < 0.1F) { + f = 0.1F; + } + + d0 *= (double) (0.7F * f); + } + + return (double) entity.getDistanceToEntity(EntityAIFindEntityNearestPlayer.this.field_179434_b) > d0 + ? false + : EntityAITarget.isSuitableTarget(EntityAIFindEntityNearestPlayer.this.field_179434_b, + (EntityLivingBase) entity, false, true); + } + } + }; + this.field_179432_d = new EntityAINearestAttackableTarget.Sorter(parEntityLiving); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + double d0 = this.func_179431_f(); + List list = this.field_179434_b.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + this.field_179434_b.getEntityBoundingBox().expand(d0, 4.0D, d0), this.field_179435_c); + Collections.sort(list, this.field_179432_d); + if (list.isEmpty()) { + return false; + } else { + this.field_179433_e = (EntityLivingBase) list.get(0); + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + EntityLivingBase entitylivingbase = this.field_179434_b.getAttackTarget(); + if (entitylivingbase == null) { + return false; + } else if (!entitylivingbase.isEntityAlive()) { + return false; + } else if (entitylivingbase instanceof EntityPlayer + && ((EntityPlayer) entitylivingbase).capabilities.disableDamage) { + return false; + } else { + Team team = this.field_179434_b.getTeam(); + Team team1 = entitylivingbase.getTeam(); + if (team != null && team1 == team) { + return false; + } else { + double d0 = this.func_179431_f(); + return this.field_179434_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false + : !(entitylivingbase instanceof EntityPlayerMP) + || !((EntityPlayerMP) entitylivingbase).theItemInWorldManager.isCreative(); + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_179434_b.setAttackTarget(this.field_179433_e); + super.startExecuting(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.field_179434_b.setAttackTarget((EntityLivingBase) null); + super.startExecuting(); + } + + protected double func_179431_f() { + IAttributeInstance iattributeinstance = this.field_179434_b + .getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFleeSun.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFleeSun.java new file mode 100644 index 0000000..9d7708c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFleeSun.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIFleeSun extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFleeSun"); + } + + private EntityCreature theCreature; + private double shelterX; + private double shelterY; + private double shelterZ; + private double movementSpeed; + private World theWorld; + + public EntityAIFleeSun(EntityCreature theCreatureIn, double movementSpeedIn) { + this.theCreature = theCreatureIn; + this.movementSpeed = movementSpeedIn; + this.theWorld = theCreatureIn.worldObj; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theWorld.isDaytime()) { + return false; + } else if (!this.theCreature.isBurning()) { + return false; + } else if (!this.theWorld.canSeeSky(new BlockPos(this.theCreature.posX, + this.theCreature.getEntityBoundingBox().minY, this.theCreature.posZ))) { + return false; + } else { + Vec3 vec3 = this.findPossibleShelter(); + if (vec3 == null) { + return false; + } else { + this.shelterX = vec3.xCoord; + this.shelterY = vec3.yCoord; + this.shelterZ = vec3.zCoord; + return true; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.theCreature.getNavigator().noPath(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, this.movementSpeed); + } + + private Vec3 findPossibleShelter() { + EaglercraftRandom random = this.theCreature.getRNG(); + BlockPos blockpos = new BlockPos(this.theCreature.posX, this.theCreature.getEntityBoundingBox().minY, + this.theCreature.posZ); + + for (int i = 0; i < 10; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(20) - 10, random.nextInt(6) - 3, random.nextInt(20) - 10); + if (!this.theWorld.canSeeSky(blockpos1) && this.theCreature.getBlockPathWeight(blockpos1) < 0.0F) { + return new Vec3((double) blockpos1.getX(), (double) blockpos1.getY(), (double) blockpos1.getZ()); + } + } + + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowGolem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowGolem.java new file mode 100644 index 0000000..f2e37a0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowGolem.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIFollowGolem extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFollowGolem"); + } + + private EntityVillager theVillager; + private EntityIronGolem theGolem; + private int takeGolemRoseTick; + private boolean tookGolemRose; + + public EntityAIFollowGolem(EntityVillager theVillagerIn) { + this.theVillager = theVillagerIn; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theVillager.getGrowingAge() >= 0) { + return false; + } else if (!this.theVillager.worldObj.isDaytime()) { + return false; + } else { + List list = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, + this.theVillager.getEntityBoundingBox().expand(6.0D, 2.0D, 6.0D)); + if (list.isEmpty()) { + return false; + } else { + for (EntityIronGolem entityirongolem : (List) list) { + if (entityirongolem.getHoldRoseTick() > 0) { + this.theGolem = entityirongolem; + break; + } + } + + return this.theGolem != null; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.theGolem.getHoldRoseTick() > 0; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.takeGolemRoseTick = this.theVillager.getRNG().nextInt(320); + this.tookGolemRose = false; + this.theGolem.getNavigator().clearPathEntity(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.theGolem = null; + this.theVillager.getNavigator().clearPathEntity(); + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.theVillager.getLookHelper().setLookPositionWithEntity(this.theGolem, 30.0F, 30.0F); + if (this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) { + this.theVillager.getNavigator().tryMoveToEntityLiving(this.theGolem, 0.5D); + this.tookGolemRose = true; + } + + if (this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) { + this.theGolem.setHoldingRose(false); + this.theVillager.getNavigator().clearPathEntity(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowOwner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowOwner.java new file mode 100644 index 0000000..8c07945 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowOwner.java @@ -0,0 +1,158 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIFollowOwner extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFollowOwner"); + } + + private EntityTameable thePet; + private EntityLivingBase theOwner; + World theWorld; + private double followSpeed; + private PathNavigate petPathfinder; + private int field_75343_h; + float maxDist; + float minDist; + private boolean field_75344_i; + + public EntityAIFollowOwner(EntityTameable thePetIn, double followSpeedIn, float minDistIn, float maxDistIn) { + this.thePet = thePetIn; + this.theWorld = thePetIn.worldObj; + this.followSpeed = followSpeedIn; + this.petPathfinder = thePetIn.getNavigator(); + this.minDist = minDistIn; + this.maxDist = maxDistIn; + this.setMutexBits(3); + if (!(thePetIn.getNavigator() instanceof PathNavigateGround)) { + throw new IllegalArgumentException("Unsupported mob type for FollowOwnerGoal"); + } + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.thePet.getOwner(); + if (entitylivingbase == null) { + return false; + } else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer) entitylivingbase).isSpectator()) { + return false; + } else if (this.thePet.isSitting()) { + return false; + } else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double) (this.minDist * this.minDist)) { + return false; + } else { + this.theOwner = entitylivingbase; + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.petPathfinder.noPath() + && this.thePet.getDistanceSqToEntity(this.theOwner) > (double) (this.maxDist * this.maxDist) + && !this.thePet.isSitting(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_75343_h = 0; + this.field_75344_i = ((PathNavigateGround) this.thePet.getNavigator()).getAvoidsWater(); + ((PathNavigateGround) this.thePet.getNavigator()).setAvoidsWater(false); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.theOwner = null; + this.petPathfinder.clearPathEntity(); + ((PathNavigateGround) this.thePet.getNavigator()).setAvoidsWater(true); + } + + private boolean func_181065_a(BlockPos parBlockPos) { + IBlockState iblockstate = this.theWorld.getBlockState(parBlockPos); + Block block = iblockstate.getBlock(); + return block == Blocks.air ? true : !block.isFullCube(); + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, + (float) this.thePet.getVerticalFaceSpeed()); + if (!this.thePet.isSitting()) { + if (--this.field_75343_h <= 0) { + this.field_75343_h = 10; + if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.followSpeed)) { + if (!this.thePet.getLeashed()) { + if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { + int i = MathHelper.floor_double(this.theOwner.posX) - 2; + int j = MathHelper.floor_double(this.theOwner.posZ) - 2; + int k = MathHelper.floor_double(this.theOwner.getEntityBoundingBox().minY); + + for (int l = 0; l <= 4; ++l) { + for (int i1 = 0; i1 <= 4; ++i1) { + if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) + && World.doesBlockHaveSolidTopSurface(this.theWorld, + new BlockPos(i + l, k - 1, j + i1)) + && this.func_181065_a(new BlockPos(i + l, k, j + i1)) + && this.func_181065_a(new BlockPos(i + l, k + 1, j + i1))) { + this.thePet.setLocationAndAngles((double) ((float) (i + l) + 0.5F), (double) k, + (double) ((float) (j + i1) + 0.5F), this.thePet.rotationYaw, + this.thePet.rotationPitch); + this.petPathfinder.clearPathEntity(); + return; + } + } + } + + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowParent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowParent.java new file mode 100644 index 0000000..c211d78 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowParent.java @@ -0,0 +1,116 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIFollowParent extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFollowParent"); + } + + EntityAnimal childAnimal; + EntityAnimal parentAnimal; + double moveSpeed; + private int delayCounter; + + public EntityAIFollowParent(EntityAnimal animal, double speed) { + this.childAnimal = animal; + this.moveSpeed = speed; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.childAnimal.getGrowingAge() >= 0) { + return false; + } else { + List list = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), + this.childAnimal.getEntityBoundingBox().expand(8.0D, 4.0D, 8.0D)); + EntityAnimal entityanimal = null; + double d0 = Double.MAX_VALUE; + + for (EntityAnimal entityanimal1 : (List) list) { + if (entityanimal1.getGrowingAge() >= 0) { + double d1 = this.childAnimal.getDistanceSqToEntity(entityanimal1); + if (d1 <= d0) { + d0 = d1; + entityanimal = entityanimal1; + } + } + } + + if (entityanimal == null) { + return false; + } else if (d0 < 9.0D) { + return false; + } else { + this.parentAnimal = entityanimal; + return true; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + if (this.childAnimal.getGrowingAge() >= 0) { + return false; + } else if (!this.parentAnimal.isEntityAlive()) { + return false; + } else { + double d0 = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); + return d0 >= 9.0D && d0 <= 256.0D; + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.delayCounter = 0; + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.parentAnimal = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + if (--this.delayCounter <= 0) { + this.delayCounter = 10; + this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.moveSpeed); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHarvestFarmland.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHarvestFarmland.java new file mode 100644 index 0000000..3239122 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHarvestFarmland.java @@ -0,0 +1,166 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCrops; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIHarvestFarmland extends EntityAIMoveToBlock { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIHarvestFarmland"); + } + + private final EntityVillager theVillager; + private boolean hasFarmItem; + private boolean field_179503_e; + private int field_179501_f; + + public EntityAIHarvestFarmland(EntityVillager theVillagerIn, double speedIn) { + super(theVillagerIn, speedIn, 16); + this.theVillager = theVillagerIn; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.runDelay <= 0) { + if (!this.theVillager.worldObj.getGameRules().getBoolean("mobGriefing")) { + return false; + } + + this.field_179501_f = -1; + this.hasFarmItem = this.theVillager.isFarmItemInInventory(); + this.field_179503_e = this.theVillager.func_175557_cr(); + } + + return super.shouldExecute(); + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.field_179501_f >= 0 && super.continueExecuting(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + super.startExecuting(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + super.resetTask(); + } + + /**+ + * Updates the task + */ + public void updateTask() { + super.updateTask(); + this.theVillager.getLookHelper().setLookPosition((double) this.destinationBlock.getX() + 0.5D, + (double) (this.destinationBlock.getY() + 1), (double) this.destinationBlock.getZ() + 0.5D, 10.0F, + (float) this.theVillager.getVerticalFaceSpeed()); + if (this.getIsAboveDestination()) { + World world = this.theVillager.worldObj; + BlockPos blockpos = this.destinationBlock.up(); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (this.field_179501_f == 0 && block instanceof BlockCrops + && ((Integer) iblockstate.getValue(BlockCrops.AGE)).intValue() == 7) { + world.destroyBlock(blockpos, true); + } else if (this.field_179501_f == 1 && block == Blocks.air) { + InventoryBasic inventorybasic = this.theVillager.getVillagerInventory(); + + for (int i = 0; i < inventorybasic.getSizeInventory(); ++i) { + ItemStack itemstack = inventorybasic.getStackInSlot(i); + boolean flag = false; + if (itemstack != null) { + if (itemstack.getItem() == Items.wheat_seeds) { + world.setBlockState(blockpos, Blocks.wheat.getDefaultState(), 3); + flag = true; + } else if (itemstack.getItem() == Items.potato) { + world.setBlockState(blockpos, Blocks.potatoes.getDefaultState(), 3); + flag = true; + } else if (itemstack.getItem() == Items.carrot) { + world.setBlockState(blockpos, Blocks.carrots.getDefaultState(), 3); + flag = true; + } + } + + if (flag) { + --itemstack.stackSize; + if (itemstack.stackSize <= 0) { + inventorybasic.setInventorySlotContents(i, (ItemStack) null); + } + break; + } + } + } + + this.field_179501_f = -1; + this.runDelay = 10; + } + + } + + /**+ + * Return true to set given position as destination + */ + protected boolean shouldMoveTo(World worldIn, BlockPos pos) { + Block block = worldIn.getBlockState(pos).getBlock(); + if (block == Blocks.farmland) { + pos = pos.up(); + IBlockState iblockstate = worldIn.getBlockState(pos); + block = iblockstate.getBlock(); + if (block instanceof BlockCrops && ((Integer) iblockstate.getValue(BlockCrops.AGE)).intValue() == 7 + && this.field_179503_e && (this.field_179501_f == 0 || this.field_179501_f < 0)) { + this.field_179501_f = 0; + return true; + } + + if (block == Blocks.air && this.hasFarmItem && (this.field_179501_f == 1 || this.field_179501_f < 0)) { + this.field_179501_f = 1; + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHurtByTarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHurtByTarget.java new file mode 100644 index 0000000..498eb51 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHurtByTarget.java @@ -0,0 +1,93 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIHurtByTarget extends EntityAITarget { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIHurtByTarget"); + } + + private boolean entityCallsForHelp; + private int revengeTimerOld; + private final Class[] targetClasses; + + public EntityAIHurtByTarget(EntityCreature creatureIn, boolean entityCallsForHelpIn, Class... targetClassesIn) { + super(creatureIn, false); + this.entityCallsForHelp = entityCallsForHelpIn; + this.targetClasses = targetClassesIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + int i = this.taskOwner.getRevengeTimer(); + return i != this.revengeTimerOld && this.isSuitableTarget(this.taskOwner.getAITarget(), false); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); + this.revengeTimerOld = this.taskOwner.getRevengeTimer(); + if (this.entityCallsForHelp) { + double d0 = this.getTargetDistance(); + + for (EntityCreature entitycreature : this.taskOwner.worldObj.getEntitiesWithinAABB( + this.taskOwner.getClass(), + (new AxisAlignedBB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, + this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D)) + .expand(d0, 10.0D, d0))) { + if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null + && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) { + boolean flag = false; + + for (Class oclass : this.targetClasses) { + if (entitycreature.getClass() == oclass) { + flag = true; + break; + } + } + + if (!flag) { + this.setEntityAttackTarget(entitycreature, this.taskOwner.getAITarget()); + } + } + } + } + + super.startExecuting(); + } + + protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) { + creatureIn.setAttackTarget(entityLivingBaseIn); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILeapAtTarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILeapAtTarget.java new file mode 100644 index 0000000..7cb8cdd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILeapAtTarget.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAILeapAtTarget extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILeapAtTarget"); + } + + EntityLiving leaper; + EntityLivingBase leapTarget; + float leapMotionY; + + public EntityAILeapAtTarget(EntityLiving leapingEntity, float leapMotionYIn) { + this.leaper = leapingEntity; + this.leapMotionY = leapMotionYIn; + this.setMutexBits(5); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.leapTarget = this.leaper.getAttackTarget(); + if (this.leapTarget == null) { + return false; + } else { + double d0 = this.leaper.getDistanceSqToEntity(this.leapTarget); + return d0 >= 4.0D && d0 <= 16.0D ? (!this.leaper.onGround ? false : this.leaper.getRNG().nextInt(5) == 0) + : false; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.leaper.onGround; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + double d0 = this.leapTarget.posX - this.leaper.posX; + double d1 = this.leapTarget.posZ - this.leaper.posZ; + float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1); + this.leaper.motionX += d0 / (double) f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; + this.leaper.motionZ += d1 / (double) f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; + this.leaper.motionY = (double) this.leapMotionY; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java new file mode 100644 index 0000000..c2650ea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java @@ -0,0 +1,53 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAILookAtTradePlayer extends EntityAIWatchClosest { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILookAtTradePlayer"); + } + + private final EntityVillager theMerchant; + + public EntityAILookAtTradePlayer(EntityVillager theMerchantIn) { + super(theMerchantIn, EntityPlayer.class, 8.0F); + this.theMerchant = theMerchantIn; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theMerchant.isTrading()) { + this.closestEntity = this.theMerchant.getCustomer(); + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtVillager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtVillager.java new file mode 100644 index 0000000..4103381 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtVillager.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAILookAtVillager extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILookAtVillager"); + } + + private EntityIronGolem theGolem; + private EntityVillager theVillager; + private int lookTime; + + public EntityAILookAtVillager(EntityIronGolem theGolemIn) { + this.theGolem = theGolemIn; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theGolem.worldObj.isDaytime()) { + return false; + } else if (this.theGolem.getRNG().nextInt(8000) != 0) { + return false; + } else { + this.theVillager = (EntityVillager) this.theGolem.worldObj.findNearestEntityWithinAABB(EntityVillager.class, + this.theGolem.getEntityBoundingBox().expand(6.0D, 2.0D, 6.0D), this.theGolem); + return this.theVillager != null; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.lookTime > 0; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.lookTime = 400; + this.theGolem.setHoldingRose(true); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.theGolem.setHoldingRose(false); + this.theVillager = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.theGolem.getLookHelper().setLookPositionWithEntity(this.theVillager, 30.0F, 30.0F); + --this.lookTime; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookIdle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookIdle.java new file mode 100644 index 0000000..0ff0f00 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookIdle.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAILookIdle extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILookIdle"); + } + + private EntityLiving idleEntity; + private double lookX; + private double lookZ; + private int idleTime; + + public EntityAILookIdle(EntityLiving entitylivingIn) { + this.idleEntity = entitylivingIn; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.idleEntity.getRNG().nextFloat() < 0.02F; + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.idleTime >= 0; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + double d0 = 6.283185307179586D * this.idleEntity.getRNG().nextDouble(); + this.lookX = Math.cos(d0); + this.lookZ = Math.sin(d0); + this.idleTime = 20 + this.idleEntity.getRNG().nextInt(20); + } + + /**+ + * Updates the task + */ + public void updateTask() { + --this.idleTime; + this.idleEntity.getLookHelper().setLookPosition(this.idleEntity.posX + this.lookX, + this.idleEntity.posY + (double) this.idleEntity.getEyeHeight(), this.idleEntity.posZ + this.lookZ, + 10.0F, (float) this.idleEntity.getVerticalFaceSpeed()); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMate.java new file mode 100644 index 0000000..bee009f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMate.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityCow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIMate extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMate"); + } + + private EntityAnimal theAnimal; + World theWorld; + private EntityAnimal targetMate; + int spawnBabyDelay; + double moveSpeed; + + public EntityAIMate(EntityAnimal animal, double speedIn) { + this.theAnimal = animal; + this.theWorld = animal.worldObj; + this.moveSpeed = speedIn; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theAnimal.isInLove()) { + return false; + } else { + this.targetMate = this.getNearbyMate(); + return this.targetMate != null; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.targetMate = null; + this.spawnBabyDelay = 0; + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, + (float) this.theAnimal.getVerticalFaceSpeed()); + this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); + ++this.spawnBabyDelay; + if (this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) { + this.spawnBaby(); + } + + } + + /**+ + * Loops through nearby animals and finds another animal of the + * same type that can be mated with. Returns the first valid + * mate found. + */ + private EntityAnimal getNearbyMate() { + float f = 8.0F; + List list = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), + this.theAnimal.getEntityBoundingBox().expand((double) f, (double) f, (double) f)); + double d0 = Double.MAX_VALUE; + EntityAnimal entityanimal = null; + + for (EntityAnimal entityanimal1 : (List) list) { + if (this.theAnimal.canMateWith(entityanimal1) && this.theAnimal.getDistanceSqToEntity(entityanimal1) < d0) { + entityanimal = entityanimal1; + d0 = this.theAnimal.getDistanceSqToEntity(entityanimal1); + } + } + + return entityanimal; + } + + /**+ + * Spawns a baby animal of the same type. + */ + private void spawnBaby() { + EntityAgeable entityageable = this.theAnimal.createChild(this.targetMate); + if (entityageable != null) { + EntityPlayer entityplayer = this.theAnimal.getPlayerInLove(); + if (entityplayer == null && this.targetMate.getPlayerInLove() != null) { + entityplayer = this.targetMate.getPlayerInLove(); + } + + if (entityplayer != null) { + entityplayer.triggerAchievement(StatList.animalsBredStat); + if (this.theAnimal instanceof EntityCow) { + entityplayer.triggerAchievement(AchievementList.breedCow); + } + } + + this.theAnimal.setGrowingAge(6000); + this.targetMate.setGrowingAge(6000); + this.theAnimal.resetInLove(); + this.targetMate.resetInLove(); + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, + 0.0F); + this.theWorld.spawnEntityInWorld(entityageable); + EaglercraftRandom random = this.theAnimal.getRNG(); + + for (int i = 0; i < 7; ++i) { + double d0 = random.nextGaussian() * 0.02D; + double d1 = random.nextGaussian() * 0.02D; + double d2 = random.nextGaussian() * 0.02D; + double d3 = random.nextDouble() * (double) this.theAnimal.width * 2.0D - (double) this.theAnimal.width; + double d4 = 0.5D + random.nextDouble() * (double) this.theAnimal.height; + double d5 = random.nextDouble() * (double) this.theAnimal.width * 2.0D - (double) this.theAnimal.width; + this.theWorld.spawnParticle(EnumParticleTypes.HEART, this.theAnimal.posX + d3, this.theAnimal.posY + d4, + this.theAnimal.posZ + d5, d0, d1, d2, new int[0]); + } + + if (this.theWorld.getGameRules().getBoolean("doMobLoot")) { + this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, + this.theAnimal.posY, this.theAnimal.posZ, random.nextInt(7) + 1)); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveIndoors.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveIndoors.java new file mode 100644 index 0000000..f902f2a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveIndoors.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageDoorInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIMoveIndoors extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveIndoors"); + } + + private EntityCreature entityObj; + private VillageDoorInfo doorInfo; + private int insidePosX = -1; + private int insidePosZ = -1; + + public EntityAIMoveIndoors(EntityCreature entityObjIn) { + this.entityObj = entityObjIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + BlockPos blockpos = new BlockPos(this.entityObj); + if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() + && !this.entityObj.worldObj.getBiomeGenForCoords(blockpos).canSpawnLightningBolt()) + && !this.entityObj.worldObj.provider.getHasNoSky()) { + if (this.entityObj.getRNG().nextInt(50) != 0) { + return false; + } else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double) this.insidePosX, + this.entityObj.posY, (double) this.insidePosZ) < 4.0D) { + return false; + } else { + Village village = this.entityObj.worldObj.getVillageCollection().getNearestVillage(blockpos, 14); + if (village == null) { + return false; + } else { + this.doorInfo = village.getDoorInfo(blockpos); + return this.doorInfo != null; + } + } + } else { + return false; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.entityObj.getNavigator().noPath(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.insidePosX = -1; + BlockPos blockpos = this.doorInfo.getInsideBlockPos(); + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + if (this.entityObj.getDistanceSq(blockpos) > 256.0D) { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityObj, 14, 3, + new Vec3((double) i + 0.5D, (double) j, (double) k + 0.5D)); + if (vec3 != null) { + this.entityObj.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, 1.0D); + } + } else { + this.entityObj.getNavigator().tryMoveToXYZ((double) i + 0.5D, (double) j, (double) k + 0.5D, 1.0D); + } + + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.insidePosX = this.doorInfo.getInsideBlockPos().getX(); + this.insidePosZ = this.doorInfo.getInsideBlockPos().getZ(); + this.doorInfo = null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java new file mode 100644 index 0000000..c5710a1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java @@ -0,0 +1,168 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageDoorInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIMoveThroughVillage extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveThroughVillage"); + } + + private EntityCreature theEntity; + private double movementSpeed; + private PathEntity entityPathNavigate; + private VillageDoorInfo doorInfo; + private boolean isNocturnal; + private List doorList = Lists.newArrayList(); + + public EntityAIMoveThroughVillage(EntityCreature theEntityIn, double movementSpeedIn, boolean isNocturnalIn) { + this.theEntity = theEntityIn; + this.movementSpeed = movementSpeedIn; + this.isNocturnal = isNocturnalIn; + this.setMutexBits(1); + if (!(theEntityIn.getNavigator() instanceof PathNavigateGround)) { + throw new IllegalArgumentException("Unsupported mob for MoveThroughVillageGoal"); + } + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.resizeDoorList(); + if (this.isNocturnal && this.theEntity.worldObj.isDaytime()) { + return false; + } else { + Village village = this.theEntity.worldObj.getVillageCollection() + .getNearestVillage(new BlockPos(this.theEntity), 0); + if (village == null) { + return false; + } else { + this.doorInfo = this.findNearestDoor(village); + if (this.doorInfo == null) { + return false; + } else { + PathNavigateGround pathnavigateground = (PathNavigateGround) this.theEntity.getNavigator(); + boolean flag = pathnavigateground.getEnterDoors(); + pathnavigateground.setBreakDoors(false); + this.entityPathNavigate = pathnavigateground.getPathToPos(this.doorInfo.getDoorBlockPos()); + pathnavigateground.setBreakDoors(flag); + if (this.entityPathNavigate != null) { + return true; + } else { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 10, 7, + new Vec3((double) this.doorInfo.getDoorBlockPos().getX(), + (double) this.doorInfo.getDoorBlockPos().getY(), + (double) this.doorInfo.getDoorBlockPos().getZ())); + if (vec3 == null) { + return false; + } else { + pathnavigateground.setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ(vec3.xCoord, + vec3.yCoord, vec3.zCoord); + pathnavigateground.setBreakDoors(flag); + return this.entityPathNavigate != null; + } + } + } + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + if (this.theEntity.getNavigator().noPath()) { + return false; + } else { + float f = this.theEntity.width + 4.0F; + return this.theEntity.getDistanceSq(this.doorInfo.getDoorBlockPos()) > (double) (f * f); + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().setPath(this.entityPathNavigate, this.movementSpeed); + } + + /**+ + * Resets the task + */ + public void resetTask() { + if (this.theEntity.getNavigator().noPath() + || this.theEntity.getDistanceSq(this.doorInfo.getDoorBlockPos()) < 16.0D) { + this.doorList.add(this.doorInfo); + } + + } + + private VillageDoorInfo findNearestDoor(Village villageIn) { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + + for (VillageDoorInfo villagedoorinfo1 : villageIn.getVillageDoorInfoList()) { + int j = villagedoorinfo1.getDistanceSquared(MathHelper.floor_double(this.theEntity.posX), + MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ)); + if (j < i && !this.doesDoorListContain(villagedoorinfo1)) { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + private boolean doesDoorListContain(VillageDoorInfo doorInfoIn) { + for (VillageDoorInfo villagedoorinfo : this.doorList) { + if (doorInfoIn.getDoorBlockPos().equals(villagedoorinfo.getDoorBlockPos())) { + return true; + } + } + + return false; + } + + private void resizeDoorList() { + if (this.doorList.size() > 15) { + this.doorList.remove(0); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveToBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveToBlock.java new file mode 100644 index 0000000..aef05de --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveToBlock.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAIMoveToBlock extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveToBlock"); + } + + private final EntityCreature theEntity; + private final double movementSpeed; + protected int runDelay; + private int timeoutCounter; + private int field_179490_f; + /**+ + * Block to move to + */ + protected BlockPos destinationBlock = BlockPos.ORIGIN; + private boolean isAboveDestination; + private int searchLength; + + public EntityAIMoveToBlock(EntityCreature creature, double speedIn, int length) { + this.theEntity = creature; + this.movementSpeed = speedIn; + this.searchLength = length; + this.setMutexBits(5); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.runDelay > 0) { + --this.runDelay; + return false; + } else { + this.runDelay = 200 + this.theEntity.getRNG().nextInt(200); + return this.searchForDestination(); + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.timeoutCounter >= -this.field_179490_f && this.timeoutCounter <= 1200 + && this.shouldMoveTo(this.theEntity.worldObj, this.destinationBlock); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ((double) ((float) this.destinationBlock.getX()) + 0.5D, + (double) (this.destinationBlock.getY() + 1), (double) ((float) this.destinationBlock.getZ()) + 0.5D, + this.movementSpeed); + this.timeoutCounter = 0; + this.field_179490_f = this.theEntity.getRNG().nextInt(this.theEntity.getRNG().nextInt(1200) + 1200) + 1200; + } + + /**+ + * Resets the task + */ + public void resetTask() { + } + + /**+ + * Updates the task + */ + public void updateTask() { + if (this.theEntity.getDistanceSqToCenter(this.destinationBlock.up()) > 1.0D) { + this.isAboveDestination = false; + ++this.timeoutCounter; + if (this.timeoutCounter % 40 == 0) { + this.theEntity.getNavigator().tryMoveToXYZ((double) ((float) this.destinationBlock.getX()) + 0.5D, + (double) (this.destinationBlock.getY() + 1), + (double) ((float) this.destinationBlock.getZ()) + 0.5D, this.movementSpeed); + } + } else { + this.isAboveDestination = true; + --this.timeoutCounter; + } + + } + + protected boolean getIsAboveDestination() { + return this.isAboveDestination; + } + + /**+ + * Searches and sets new destination block and returns true if a + * suitable block (specified in {@link + * net.minecraft.entity.ai.EntityAIMoveToBlock#shouldMoveTo(World, + * BlockPos) EntityAIMoveToBlock#shouldMoveTo(World, BlockPos)}) + * can be found. + */ + private boolean searchForDestination() { + int i = this.searchLength; + boolean flag = true; + BlockPos blockpos = new BlockPos(this.theEntity); + + for (int j = 0; j <= 1; j = j > 0 ? -j : 1 - j) { + for (int k = 0; k < i; ++k) { + for (int l = 0; l <= k; l = l > 0 ? -l : 1 - l) { + for (int i1 = l < k && l > -k ? k : 0; i1 <= k; i1 = i1 > 0 ? -i1 : 1 - i1) { + BlockPos blockpos1 = blockpos.add(l, j - 1, i1); + if (this.theEntity.isWithinHomeDistanceFromPosition(blockpos1) + && this.shouldMoveTo(this.theEntity.worldObj, blockpos1)) { + this.destinationBlock = blockpos1; + return true; + } + } + } + } + } + + return false; + } + + protected abstract boolean shouldMoveTo(World var1, BlockPos var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java new file mode 100644 index 0000000..a26490f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIMoveTowardsRestriction extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveTowardsRestriction"); + } + + private EntityCreature theEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private double movementSpeed; + + public EntityAIMoveTowardsRestriction(EntityCreature creatureIn, double speedIn) { + this.theEntity = creatureIn; + this.movementSpeed = speedIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theEntity.isWithinHomeDistanceCurrentPosition()) { + return false; + } else { + BlockPos blockpos = this.theEntity.getHomePosition(); + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, + new Vec3((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ())); + if (vec3 == null) { + return false; + } else { + this.movePosX = vec3.xCoord; + this.movePosY = vec3.yCoord; + this.movePosZ = vec3.zCoord; + return true; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.theEntity.getNavigator().noPath(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java new file mode 100644 index 0000000..359afe6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java @@ -0,0 +1,98 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIMoveTowardsTarget extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveTowardsTarget"); + } + + private EntityCreature theEntity; + private EntityLivingBase targetEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private double speed; + private float maxTargetDistance; + + public EntityAIMoveTowardsTarget(EntityCreature creature, double speedIn, float targetMaxDistance) { + this.theEntity = creature; + this.speed = speedIn; + this.maxTargetDistance = targetMaxDistance; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.targetEntity = this.theEntity.getAttackTarget(); + if (this.targetEntity == null) { + return false; + } else if (this.targetEntity + .getDistanceSqToEntity(this.theEntity) > (double) (this.maxTargetDistance * this.maxTargetDistance)) { + return false; + } else { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, + new Vec3(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); + if (vec3 == null) { + return false; + } else { + this.movePosX = vec3.xCoord; + this.movePosY = vec3.yCoord; + this.movePosZ = vec3.zCoord; + return true; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity + .getDistanceSqToEntity(this.theEntity) < (double) (this.maxTargetDistance * this.maxTargetDistance); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.targetEntity = null; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java new file mode 100644 index 0000000..b91bb64 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java @@ -0,0 +1,139 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAINearestAttackableTarget extends EntityAITarget { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAINearestAttackableTarget"); + } + + protected final Class targetClass; + private final int targetChance; + protected final EntityAINearestAttackableTarget.Sorter theNearestAttackableTargetSorter; + protected Predicate targetEntitySelector; + protected EntityLivingBase targetEntity; + + public EntityAINearestAttackableTarget(EntityCreature creature, Class classTarget, boolean checkSight) { + this(creature, classTarget, checkSight, false); + } + + public EntityAINearestAttackableTarget(EntityCreature creature, Class classTarget, boolean checkSight, + boolean onlyNearby) { + this(creature, classTarget, 10, checkSight, onlyNearby, (Predicate) null); + } + + public EntityAINearestAttackableTarget(EntityCreature creature, Class classTarget, int chance, + boolean checkSight, boolean onlyNearby, final Predicate targetSelector) { + super(creature, checkSight, onlyNearby); + this.targetClass = classTarget; + this.targetChance = chance; + this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(creature); + this.setMutexBits(1); + this.targetEntitySelector = new Predicate() { + public boolean apply(T entitylivingbase) { + if (targetSelector != null && !targetSelector.apply(entitylivingbase)) { + return false; + } else { + if (entitylivingbase instanceof EntityPlayer) { + double d0 = EntityAINearestAttackableTarget.this.getTargetDistance(); + if (entitylivingbase.isSneaking()) { + d0 *= 0.800000011920929D; + } + + if (entitylivingbase.isInvisible()) { + float f = ((EntityPlayer) entitylivingbase).getArmorVisibility(); + if (f < 0.1F) { + f = 0.1F; + } + + d0 *= (double) (0.7F * f); + } + + if ((double) entitylivingbase + .getDistanceToEntity(EntityAINearestAttackableTarget.this.taskOwner) > d0) { + return false; + } + } + + return EntityAINearestAttackableTarget.this.isSuitableTarget(entitylivingbase, false); + } + } + }; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { + return false; + } else { + double d0 = this.getTargetDistance(); + List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.targetClass, + this.taskOwner.getEntityBoundingBox().expand(d0, 4.0D, d0), + Predicates.and(this.targetEntitySelector, EntitySelectors.NOT_SPECTATING)); + Collections.sort(list, this.theNearestAttackableTargetSorter); + if (list.isEmpty()) { + return false; + } else { + this.targetEntity = (EntityLivingBase) list.get(0); + return true; + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.targetEntity); + super.startExecuting(); + } + + public static class Sorter implements Comparator { + private final Entity theEntity; + + public Sorter(Entity theEntityIn) { + this.theEntity = theEntityIn; + } + + public int compare(Entity entity, Entity entity1) { + double d0 = this.theEntity.getDistanceSqToEntity(entity); + double d1 = this.theEntity.getDistanceSqToEntity(entity1); + return d0 < d1 ? -1 : (d0 > d1 ? 1 : 0); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotAttack.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotAttack.java new file mode 100644 index 0000000..e168638 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotAttack.java @@ -0,0 +1,102 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIOcelotAttack extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOcelotAttack"); + } + + World theWorld; + EntityLiving theEntity; + EntityLivingBase theVictim; + int attackCountdown; + + public EntityAIOcelotAttack(EntityLiving theEntityIn) { + this.theEntity = theEntityIn; + this.theWorld = theEntityIn.worldObj; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + if (entitylivingbase == null) { + return false; + } else { + this.theVictim = entitylivingbase; + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.theVictim.isEntityAlive() ? false + : (this.theEntity.getDistanceSqToEntity(this.theVictim) > 225.0D ? false + : !this.theEntity.getNavigator().noPath() || this.shouldExecute()); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.theVictim = null; + this.theEntity.getNavigator().clearPathEntity(); + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theVictim, 30.0F, 30.0F); + double d0 = (double) (this.theEntity.width * 2.0F * this.theEntity.width * 2.0F); + double d1 = this.theEntity.getDistanceSq(this.theVictim.posX, this.theVictim.getEntityBoundingBox().minY, + this.theVictim.posZ); + double d2 = 0.8D; + if (d1 > d0 && d1 < 16.0D) { + d2 = 1.33D; + } else if (d1 < 225.0D) { + d2 = 0.6D; + } + + this.theEntity.getNavigator().tryMoveToEntityLiving(this.theVictim, d2); + this.attackCountdown = Math.max(this.attackCountdown - 1, 0); + if (d1 <= d0) { + if (this.attackCountdown <= 0) { + this.attackCountdown = 20; + this.theEntity.attackEntityAsMob(this.theVictim); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotSit.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotSit.java new file mode 100644 index 0000000..79887a4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotSit.java @@ -0,0 +1,121 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityOcelot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIOcelotSit extends EntityAIMoveToBlock { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOcelotSit"); + } + + private final EntityOcelot field_151493_a; + + public EntityAIOcelotSit(EntityOcelot parEntityOcelot, double parDouble1) { + super(parEntityOcelot, parDouble1, 8); + this.field_151493_a = parEntityOcelot; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.field_151493_a.isTamed() && !this.field_151493_a.isSitting() && super.shouldExecute(); + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return super.continueExecuting(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + super.startExecuting(); + this.field_151493_a.getAISit().setSitting(false); + } + + /**+ + * Resets the task + */ + public void resetTask() { + super.resetTask(); + this.field_151493_a.setSitting(false); + } + + /**+ + * Updates the task + */ + public void updateTask() { + super.updateTask(); + this.field_151493_a.getAISit().setSitting(false); + if (!this.getIsAboveDestination()) { + this.field_151493_a.setSitting(false); + } else if (!this.field_151493_a.isSitting()) { + this.field_151493_a.setSitting(true); + } + + } + + /**+ + * Return true to set given position as destination + */ + protected boolean shouldMoveTo(World world, BlockPos blockpos) { + if (!world.isAirBlock(blockpos.up())) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (block == Blocks.chest) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityChest && ((TileEntityChest) tileentity).numPlayersUsing < 1) { + return true; + } + } else { + if (block == Blocks.lit_furnace) { + return true; + } + + if (block == Blocks.bed && iblockstate.getValue(BlockBed.PART) != BlockBed.EnumPartType.HEAD) { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOpenDoor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOpenDoor.java new file mode 100644 index 0000000..de09a4f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOpenDoor.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIDoorInteract; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIOpenDoor extends EntityAIDoorInteract { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOpenDoor"); + } + + boolean closeDoor; + int closeDoorTemporisation; + + public EntityAIOpenDoor(EntityLiving entitylivingIn, boolean shouldClose) { + super(entitylivingIn); + this.theEntity = entitylivingIn; + this.closeDoor = shouldClose; + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.closeDoor && this.closeDoorTemporisation > 0 && super.continueExecuting(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.closeDoorTemporisation = 20; + this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, true); + } + + /**+ + * Resets the task + */ + public void resetTask() { + if (this.closeDoor) { + this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, false); + } + + } + + /**+ + * Updates the task + */ + public void updateTask() { + --this.closeDoorTemporisation; + super.updateTask(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java new file mode 100644 index 0000000..0d97ff9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIOwnerHurtByTarget extends EntityAITarget { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOwnerHurtByTarget"); + } + + EntityTameable theDefendingTameable; + EntityLivingBase theOwnerAttacker; + private int field_142051_e; + + public EntityAIOwnerHurtByTarget(EntityTameable theDefendingTameableIn) { + super(theDefendingTameableIn, false); + this.theDefendingTameable = theDefendingTameableIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theDefendingTameable.isTamed()) { + return false; + } else { + EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner(); + if (entitylivingbase == null) { + return false; + } else { + this.theOwnerAttacker = entitylivingbase.getAITarget(); + int i = entitylivingbase.getRevengeTimer(); + return i != this.field_142051_e && this.isSuitableTarget(this.theOwnerAttacker, false) + && this.theDefendingTameable.shouldAttackEntity(this.theOwnerAttacker, entitylivingbase); + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.theOwnerAttacker); + EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner(); + if (entitylivingbase != null) { + this.field_142051_e = entitylivingbase.getRevengeTimer(); + } + + super.startExecuting(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java new file mode 100644 index 0000000..fdb53ce --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIOwnerHurtTarget extends EntityAITarget { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOwnerHurtTarget"); + } + + EntityTameable theEntityTameable; + EntityLivingBase theTarget; + private int field_142050_e; + + public EntityAIOwnerHurtTarget(EntityTameable theEntityTameableIn) { + super(theEntityTameableIn, false); + this.theEntityTameable = theEntityTameableIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theEntityTameable.isTamed()) { + return false; + } else { + EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner(); + if (entitylivingbase == null) { + return false; + } else { + this.theTarget = entitylivingbase.getLastAttacker(); + int i = entitylivingbase.getLastAttackerTime(); + return i != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) + && this.theEntityTameable.shouldAttackEntity(this.theTarget, entitylivingbase); + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.theTarget); + EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner(); + if (entitylivingbase != null) { + this.field_142050_e = entitylivingbase.getLastAttackerTime(); + } + + super.startExecuting(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPanic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPanic.java new file mode 100644 index 0000000..50a2858 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPanic.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIPanic extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIPanic"); + } + + private EntityCreature theEntityCreature; + protected double speed; + private double randPosX; + private double randPosY; + private double randPosZ; + + public EntityAIPanic(EntityCreature creature, double speedIn) { + this.theEntityCreature = creature; + this.speed = speedIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) { + return false; + } else { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); + if (vec3 == null) { + return false; + } else { + this.randPosX = vec3.xCoord; + this.randPosY = vec3.yCoord; + this.randPosZ = vec3.zCoord; + return true; + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.theEntityCreature.getNavigator().noPath(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPlay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPlay.java new file mode 100644 index 0000000..66a3ab9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPlay.java @@ -0,0 +1,130 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIPlay extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIPlay"); + } + + private EntityVillager villagerObj; + private EntityLivingBase targetVillager; + private double speed; + private int playTime; + + public EntityAIPlay(EntityVillager villagerObjIn, double speedIn) { + this.villagerObj = villagerObjIn; + this.speed = speedIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.villagerObj.getGrowingAge() >= 0) { + return false; + } else if (this.villagerObj.getRNG().nextInt(400) != 0) { + return false; + } else { + List list = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, + this.villagerObj.getEntityBoundingBox().expand(6.0D, 3.0D, 6.0D)); + double d0 = Double.MAX_VALUE; + + for (EntityVillager entityvillager : (List) list) { + if (entityvillager != this.villagerObj && !entityvillager.isPlaying() + && entityvillager.getGrowingAge() < 0) { + double d1 = entityvillager.getDistanceSqToEntity(this.villagerObj); + if (d1 <= d0) { + d0 = d1; + this.targetVillager = entityvillager; + } + } + } + + if (this.targetVillager == null) { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + if (vec3 == null) { + return false; + } + } + + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.playTime > 0; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + if (this.targetVillager != null) { + this.villagerObj.setPlaying(true); + } + + this.playTime = 1000; + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.villagerObj.setPlaying(false); + this.targetVillager = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + --this.playTime; + if (this.targetVillager != null) { + if (this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.targetVillager, this.speed); + } + } else if (this.villagerObj.getNavigator().noPath()) { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + if (vec3 == null) { + return; + } + + this.villagerObj.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.speed); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java new file mode 100644 index 0000000..015dd7a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java @@ -0,0 +1,100 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageDoorInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIRestrictOpenDoor extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIRestrictOpenDoor"); + } + + private EntityCreature entityObj; + private VillageDoorInfo frontDoor; + + public EntityAIRestrictOpenDoor(EntityCreature creatureIn) { + this.entityObj = creatureIn; + if (!(creatureIn.getNavigator() instanceof PathNavigateGround)) { + throw new IllegalArgumentException("Unsupported mob type for RestrictOpenDoorGoal"); + } + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.entityObj.worldObj.isDaytime()) { + return false; + } else { + BlockPos blockpos = new BlockPos(this.entityObj); + Village village = this.entityObj.worldObj.getVillageCollection().getNearestVillage(blockpos, 16); + if (village == null) { + return false; + } else { + this.frontDoor = village.getNearestDoor(blockpos); + return this.frontDoor == null ? false + : (double) this.frontDoor.getDistanceToInsideBlockSq(blockpos) < 2.25D; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.entityObj.worldObj.isDaytime() ? false + : !this.frontDoor.getIsDetachedFromVillageFlag() + && this.frontDoor.func_179850_c(new BlockPos(this.entityObj)); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + ((PathNavigateGround) this.entityObj.getNavigator()).setBreakDoors(false); + ((PathNavigateGround) this.entityObj.getNavigator()).setEnterDoors(false); + } + + /**+ + * Resets the task + */ + public void resetTask() { + ((PathNavigateGround) this.entityObj.getNavigator()).setBreakDoors(true); + ((PathNavigateGround) this.entityObj.getNavigator()).setEnterDoors(true); + this.frontDoor = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.frontDoor.incrementDoorOpeningRestrictionCounter(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictSun.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictSun.java new file mode 100644 index 0000000..5ee1112 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictSun.java @@ -0,0 +1,61 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIRestrictSun extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIRestrictSun"); + } + + private EntityCreature theEntity; + + public EntityAIRestrictSun(EntityCreature parEntityCreature) { + this.theEntity = parEntityCreature; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.theEntity.worldObj.isDaytime(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + ((PathNavigateGround) this.theEntity.getNavigator()).setAvoidSun(true); + } + + /**+ + * Resets the task + */ + public void resetTask() { + ((PathNavigateGround) this.theEntity.getNavigator()).setAvoidSun(false); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java new file mode 100644 index 0000000..4170e15 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIRunAroundLikeCrazy extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy"); + } + + private EntityHorse horseHost; + private double speed; + private double targetX; + private double targetY; + private double targetZ; + + public EntityAIRunAroundLikeCrazy(EntityHorse horse, double speedIn) { + this.horseHost = horse; + this.speed = speedIn; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.horseHost, 5, 4); + if (vec3 == null) { + return false; + } else { + this.targetX = vec3.xCoord; + this.targetY = vec3.yCoord; + this.targetZ = vec3.zCoord; + return true; + } + } else { + return false; + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.horseHost.getNavigator().tryMoveToXYZ(this.targetX, this.targetY, this.targetZ, this.speed); + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.horseHost.getNavigator().noPath() && this.horseHost.riddenByEntity != null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + if (this.horseHost.getRNG().nextInt(50) == 0) { + if (this.horseHost.riddenByEntity instanceof EntityPlayer) { + int i = this.horseHost.getTemper(); + int j = this.horseHost.getMaxTemper(); + if (j > 0 && this.horseHost.getRNG().nextInt(j) < i) { + this.horseHost.setTamedBy((EntityPlayer) this.horseHost.riddenByEntity); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte) 7); + return; + } + + this.horseHost.increaseTemper(5); + } + + this.horseHost.riddenByEntity.mountEntity((Entity) null); + this.horseHost.riddenByEntity = null; + this.horseHost.makeHorseRearWithSound(); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte) 6); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISit.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISit.java new file mode 100644 index 0000000..545a5b2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISit.java @@ -0,0 +1,82 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAISit extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAISit"); + } + + private EntityTameable theEntity; + private boolean isSitting; + + public EntityAISit(EntityTameable entityIn) { + this.theEntity = entityIn; + this.setMutexBits(5); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theEntity.isTamed()) { + return false; + } else if (this.theEntity.isInWater()) { + return false; + } else if (!this.theEntity.onGround) { + return false; + } else { + EntityLivingBase entitylivingbase = this.theEntity.getOwner(); + return entitylivingbase == null ? true + : (this.theEntity.getDistanceSqToEntity(entitylivingbase) < 144.0D + && entitylivingbase.getAITarget() != null ? false : this.isSitting); + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.setSitting(true); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.theEntity.setSitting(false); + } + + /**+ + * Sets the sitting flag. + */ + public void setSitting(boolean sitting) { + this.isSitting = sitting; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISwimming.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISwimming.java new file mode 100644 index 0000000..91b9b08 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISwimming.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAISwimming extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAISwimming"); + } + + private EntityLiving theEntity; + + public EntityAISwimming(EntityLiving entitylivingIn) { + this.theEntity = entitylivingIn; + this.setMutexBits(4); + ((PathNavigateGround) entitylivingIn.getNavigator()).setCanSwim(true); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.theEntity.isInWater() || this.theEntity.isInLava(); + } + + /**+ + * Updates the task + */ + public void updateTask() { + if (this.theEntity.getRNG().nextFloat() < 0.8F) { + this.theEntity.getJumpHelper().setJumping(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITarget.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITarget.java new file mode 100644 index 0000000..9c9c623 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITarget.java @@ -0,0 +1,210 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityOwnable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import org.apache.commons.lang3.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAITarget extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITarget"); + } + + protected final EntityCreature taskOwner; + protected boolean shouldCheckSight; + private boolean nearbyOnly; + private int targetSearchStatus; + private int targetSearchDelay; + private int targetUnseenTicks; + + public EntityAITarget(EntityCreature creature, boolean checkSight) { + this(creature, checkSight, false); + } + + public EntityAITarget(EntityCreature creature, boolean checkSight, boolean onlyNearby) { + this.taskOwner = creature; + this.shouldCheckSight = checkSight; + this.nearbyOnly = onlyNearby; + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget(); + if (entitylivingbase == null) { + return false; + } else if (!entitylivingbase.isEntityAlive()) { + return false; + } else { + Team team = this.taskOwner.getTeam(); + Team team1 = entitylivingbase.getTeam(); + if (team != null && team1 == team) { + return false; + } else { + double d0 = this.getTargetDistance(); + if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0) { + return false; + } else { + if (this.shouldCheckSight) { + if (this.taskOwner.getEntitySenses().canSee(entitylivingbase)) { + this.targetUnseenTicks = 0; + } else if (++this.targetUnseenTicks > 60) { + return false; + } + } + + return !(entitylivingbase instanceof EntityPlayer) + || !((EntityPlayer) entitylivingbase).capabilities.disableDamage; + } + } + } + } + + protected double getTargetDistance() { + IAttributeInstance iattributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.targetSearchStatus = 0; + this.targetSearchDelay = 0; + this.targetUnseenTicks = 0; + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.taskOwner.setAttackTarget((EntityLivingBase) null); + } + + /**+ + * A method used to see if an entity is a suitable target + * through a number of checks. Args : entity, + * canTargetInvinciblePlayer + */ + public static boolean isSuitableTarget(EntityLiving attacker, EntityLivingBase target, boolean includeInvincibles, + boolean checkSight) { + if (target == null) { + return false; + } else if (target == attacker) { + return false; + } else if (!target.isEntityAlive()) { + return false; + } else if (!attacker.canAttackClass(target.getClass())) { + return false; + } else { + Team team = attacker.getTeam(); + Team team1 = target.getTeam(); + if (team != null && team1 == team) { + return false; + } else { + if (attacker instanceof IEntityOwnable + && StringUtils.isNotEmpty(((IEntityOwnable) attacker).getOwnerId())) { + if (target instanceof IEntityOwnable && ((IEntityOwnable) attacker).getOwnerId() + .equals(((IEntityOwnable) target).getOwnerId())) { + return false; + } + + if (target == ((IEntityOwnable) attacker).getOwner()) { + return false; + } + } else if (target instanceof EntityPlayer && !includeInvincibles + && ((EntityPlayer) target).capabilities.disableDamage) { + return false; + } + + return !checkSight || attacker.getEntitySenses().canSee(target); + } + } + } + + /**+ + * A method used to see if an entity is a suitable target + * through a number of checks. Args : entity, + * canTargetInvinciblePlayer + */ + protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) { + if (!isSuitableTarget(this.taskOwner, target, includeInvincibles, this.shouldCheckSight)) { + return false; + } else if (!this.taskOwner.isWithinHomeDistanceFromPosition(new BlockPos(target))) { + return false; + } else { + if (this.nearbyOnly) { + if (--this.targetSearchDelay <= 0) { + this.targetSearchStatus = 0; + } + + if (this.targetSearchStatus == 0) { + this.targetSearchStatus = this.canEasilyReach(target) ? 1 : 2; + } + + if (this.targetSearchStatus == 2) { + return false; + } + } + + return true; + } + } + + /**+ + * Checks to see if this entity can find a short path to the + * given target. + */ + private boolean canEasilyReach(EntityLivingBase parEntityLivingBase) { + this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5); + PathEntity pathentity = this.taskOwner.getNavigator().getPathToEntityLiving(parEntityLivingBase); + if (pathentity == null) { + return false; + } else { + PathPoint pathpoint = pathentity.getFinalPathPoint(); + if (pathpoint == null) { + return false; + } else { + int i = pathpoint.xCoord - MathHelper.floor_double(parEntityLivingBase.posX); + int j = pathpoint.zCoord - MathHelper.floor_double(parEntityLivingBase.posZ); + return (double) (i * i + j * j) <= 2.25D; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITargetNonTamed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITargetNonTamed.java new file mode 100644 index 0000000..d842051 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITargetNonTamed.java @@ -0,0 +1,50 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAITargetNonTamed extends EntityAINearestAttackableTarget { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITargetNonTamed"); + } + + private EntityTameable theTameable; + + public EntityAITargetNonTamed(EntityTameable entityIn, Class classTarget, boolean checkSight, + Predicate targetSelector) { + super(entityIn, classTarget, 10, checkSight, false, targetSelector); + this.theTameable = entityIn; + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return !this.theTameable.isTamed() && super.shouldExecute(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITasks.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITasks.java new file mode 100644 index 0000000..b677c8f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITasks.java @@ -0,0 +1,192 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.profiler.Profiler; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAITasks { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITasks"); + } + + private static final Logger logger = LogManager.getLogger(); + /**+ + * A list of EntityAITaskEntrys in EntityAITasks. + */ + private List taskEntries = Lists.newArrayList(); + /**+ + * A list of EntityAITaskEntrys that are currently being + * executed. + */ + private List executingTaskEntries = Lists.newArrayList(); + private final Profiler theProfiler; + private int tickCount; + private int tickRate = 3; + + public EntityAITasks(Profiler profilerIn) { + this.theProfiler = profilerIn; + } + + /**+ + * Add a now AITask. Args : priority, task + */ + public void addTask(int priority, EntityAIBase task) { + this.taskEntries.add(new EntityAITasks.EntityAITaskEntry(priority, task)); + } + + /**+ + * removes the indicated task from the entity's AI tasks. + */ + public void removeTask(EntityAIBase task) { + Iterator iterator = this.taskEntries.iterator(); + + while (iterator.hasNext()) { + EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry = (EntityAITasks.EntityAITaskEntry) iterator + .next(); + EntityAIBase entityaibase = entityaitasks$entityaitaskentry.action; + if (entityaibase == task) { + if (this.executingTaskEntries.contains(entityaitasks$entityaitaskentry)) { + entityaibase.resetTask(); + this.executingTaskEntries.remove(entityaitasks$entityaitaskentry); + } + + iterator.remove(); + } + } + + } + + public void onUpdateTasks() { + this.theProfiler.startSection("goalSetup"); + if (this.tickCount++ % this.tickRate == 0) { + Iterator iterator = this.taskEntries.iterator(); + + label38: while (true) { + EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry; + while (true) { + if (!iterator.hasNext()) { + break label38; + } + + entityaitasks$entityaitaskentry = (EntityAITasks.EntityAITaskEntry) iterator.next(); + boolean flag = this.executingTaskEntries.contains(entityaitasks$entityaitaskentry); + if (!flag) { + break; + } + + if (!this.canUse(entityaitasks$entityaitaskentry) + || !this.canContinue(entityaitasks$entityaitaskentry)) { + entityaitasks$entityaitaskentry.action.resetTask(); + this.executingTaskEntries.remove(entityaitasks$entityaitaskentry); + break; + } + } + + if (this.canUse(entityaitasks$entityaitaskentry) + && entityaitasks$entityaitaskentry.action.shouldExecute()) { + entityaitasks$entityaitaskentry.action.startExecuting(); + this.executingTaskEntries.add(entityaitasks$entityaitaskentry); + } + } + } else { + Iterator iterator1 = this.executingTaskEntries.iterator(); + + while (iterator1.hasNext()) { + EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry1 = (EntityAITasks.EntityAITaskEntry) iterator1 + .next(); + if (!this.canContinue(entityaitasks$entityaitaskentry1)) { + entityaitasks$entityaitaskentry1.action.resetTask(); + iterator1.remove(); + } + } + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("goalTick"); + + for (EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry2 : this.executingTaskEntries) { + entityaitasks$entityaitaskentry2.action.updateTask(); + } + + this.theProfiler.endSection(); + } + + /**+ + * Determine if a specific AI Task should continue being + * executed. + */ + private boolean canContinue(EntityAITasks.EntityAITaskEntry taskEntry) { + boolean flag = taskEntry.action.continueExecuting(); + return flag; + } + + /**+ + * Determine if a specific AI Task can be executed, which means + * that all running higher (= lower int value) priority tasks + * are compatible with it or all lower priority tasks can be + * interrupted. + */ + private boolean canUse(EntityAITasks.EntityAITaskEntry taskEntry) { + for (EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry : this.taskEntries) { + if (entityaitasks$entityaitaskentry != taskEntry) { + if (taskEntry.priority >= entityaitasks$entityaitaskentry.priority) { + if (!this.areTasksCompatible(taskEntry, entityaitasks$entityaitaskentry) + && this.executingTaskEntries.contains(entityaitasks$entityaitaskentry)) { + return false; + } + } else if (!entityaitasks$entityaitaskentry.action.isInterruptible() + && this.executingTaskEntries.contains(entityaitasks$entityaitaskentry)) { + return false; + } + } + } + + return true; + } + + /**+ + * Returns whether two EntityAITaskEntries can be executed + * concurrently + */ + private boolean areTasksCompatible(EntityAITasks.EntityAITaskEntry taskEntry1, + EntityAITasks.EntityAITaskEntry taskEntry2) { + return (taskEntry1.action.getMutexBits() & taskEntry2.action.getMutexBits()) == 0; + } + + class EntityAITaskEntry { + public EntityAIBase action; + public int priority; + + public EntityAITaskEntry(int priorityIn, EntityAIBase task) { + this.priority = priorityIn; + this.action = task; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITempt.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITempt.java new file mode 100644 index 0000000..32fa655 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITempt.java @@ -0,0 +1,154 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAITempt extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITempt"); + } + + private EntityCreature temptedEntity; + private double speed; + private double targetX; + private double targetY; + private double targetZ; + private double pitch; + private double yaw; + private EntityPlayer temptingPlayer; + private int delayTemptCounter; + private boolean isRunning; + private Item temptItem; + private boolean scaredByPlayerMovement; + private boolean avoidWater; + + public EntityAITempt(EntityCreature temptedEntityIn, double speedIn, Item temptItemIn, + boolean scaredByPlayerMovementIn) { + this.temptedEntity = temptedEntityIn; + this.speed = speedIn; + this.temptItem = temptItemIn; + this.scaredByPlayerMovement = scaredByPlayerMovementIn; + this.setMutexBits(3); + if (!(temptedEntityIn.getNavigator() instanceof PathNavigateGround)) { + throw new IllegalArgumentException("Unsupported mob type for TemptGoal"); + } + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.delayTemptCounter > 0) { + --this.delayTemptCounter; + return false; + } else { + this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); + if (this.temptingPlayer == null) { + return false; + } else { + ItemStack itemstack = this.temptingPlayer.getCurrentEquippedItem(); + return itemstack == null ? false : itemstack.getItem() == this.temptItem; + } + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + if (this.scaredByPlayerMovement) { + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { + if (this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, + this.targetZ) > 0.010000000000000002D) { + return false; + } + + if (Math.abs((double) this.temptingPlayer.rotationPitch - this.pitch) > 5.0D + || Math.abs((double) this.temptingPlayer.rotationYaw - this.yaw) > 5.0D) { + return false; + } + } else { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + } + + this.pitch = (double) this.temptingPlayer.rotationPitch; + this.yaw = (double) this.temptingPlayer.rotationYaw; + } + + return this.shouldExecute(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + this.isRunning = true; + this.avoidWater = ((PathNavigateGround) this.temptedEntity.getNavigator()).getAvoidsWater(); + ((PathNavigateGround) this.temptedEntity.getNavigator()).setAvoidsWater(false); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.temptingPlayer = null; + this.temptedEntity.getNavigator().clearPathEntity(); + this.delayTemptCounter = 100; + this.isRunning = false; + ((PathNavigateGround) this.temptedEntity.getNavigator()).setAvoidsWater(this.avoidWater); + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, + (float) this.temptedEntity.getVerticalFaceSpeed()); + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { + this.temptedEntity.getNavigator().clearPathEntity(); + } else { + this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); + } + + } + + /**+ + * @see #isRunning + */ + public boolean isRunning() { + return this.isRunning; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITradePlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITradePlayer.java new file mode 100644 index 0000000..76d6d77 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITradePlayer.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAITradePlayer extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITradePlayer"); + } + + private EntityVillager villager; + + public EntityAITradePlayer(EntityVillager villagerIn) { + this.villager = villagerIn; + this.setMutexBits(5); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.villager.isEntityAlive()) { + return false; + } else if (this.villager.isInWater()) { + return false; + } else if (!this.villager.onGround) { + return false; + } else if (this.villager.velocityChanged) { + return false; + } else { + EntityPlayer entityplayer = this.villager.getCustomer(); + return entityplayer == null ? false + : (this.villager.getDistanceSqToEntity(entityplayer) > 16.0D ? false + : entityplayer.openContainer instanceof Container); + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.villager.getNavigator().clearPathEntity(); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.villager.setCustomer((EntityPlayer) null); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerInteract.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerInteract.java new file mode 100644 index 0000000..49e9ab3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerInteract.java @@ -0,0 +1,115 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIVillagerInteract extends EntityAIWatchClosest2 { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIVillagerInteract"); + } + + private int interactionDelay; + private EntityVillager villager; + + public EntityAIVillagerInteract(EntityVillager villagerIn) { + super(villagerIn, EntityVillager.class, 3.0F, 0.02F); + this.villager = villagerIn; + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + super.startExecuting(); + if (this.villager.canAbondonItems() && this.closestEntity instanceof EntityVillager + && ((EntityVillager) this.closestEntity).func_175557_cr()) { + this.interactionDelay = 10; + } else { + this.interactionDelay = 0; + } + + } + + /**+ + * Updates the task + */ + public void updateTask() { + super.updateTask(); + if (this.interactionDelay > 0) { + --this.interactionDelay; + if (this.interactionDelay == 0) { + InventoryBasic inventorybasic = this.villager.getVillagerInventory(); + + for (int i = 0; i < inventorybasic.getSizeInventory(); ++i) { + ItemStack itemstack = inventorybasic.getStackInSlot(i); + ItemStack itemstack1 = null; + if (itemstack != null) { + Item item = itemstack.getItem(); + if ((item == Items.bread || item == Items.potato || item == Items.carrot) + && itemstack.stackSize > 3) { + int l = itemstack.stackSize / 2; + itemstack.stackSize -= l; + itemstack1 = new ItemStack(item, l, itemstack.getMetadata()); + } else if (item == Items.wheat && itemstack.stackSize > 5) { + int j = itemstack.stackSize / 2 / 3 * 3; + int k = j / 3; + itemstack.stackSize -= j; + itemstack1 = new ItemStack(Items.bread, k, 0); + } + + if (itemstack.stackSize <= 0) { + inventorybasic.setInventorySlotContents(i, (ItemStack) null); + } + } + + if (itemstack1 != null) { + double d0 = this.villager.posY - 0.30000001192092896D + (double) this.villager.getEyeHeight(); + EntityItem entityitem = new EntityItem(this.villager.worldObj, this.villager.posX, d0, + this.villager.posZ, itemstack1); + float f = 0.3F; + float f1 = this.villager.rotationYawHead; + float f2 = this.villager.rotationPitch; + entityitem.motionX = (double) (-MathHelper.sin(f1 / 180.0F * 3.1415927F) + * MathHelper.cos(f2 / 180.0F * 3.1415927F) * f); + entityitem.motionZ = (double) (MathHelper.cos(f1 / 180.0F * 3.1415927F) + * MathHelper.cos(f2 / 180.0F * 3.1415927F) * f); + entityitem.motionY = (double) (-MathHelper.sin(f2 / 180.0F * 3.1415927F) * f + 0.1F); + entityitem.setDefaultPickupDelay(); + this.villager.worldObj.spawnEntityInWorld(entityitem); + break; + } + } + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerMate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerMate.java new file mode 100644 index 0000000..06a257f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerMate.java @@ -0,0 +1,142 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIVillagerMate extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIVillagerMate"); + } + + private EntityVillager villagerObj; + private EntityVillager mate; + private World worldObj; + private int matingTimeout; + Village villageObj; + + public EntityAIVillagerMate(EntityVillager villagerIn) { + this.villagerObj = villagerIn; + this.worldObj = villagerIn.worldObj; + this.setMutexBits(3); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.villagerObj.getGrowingAge() != 0) { + return false; + } else if (this.villagerObj.getRNG().nextInt(500) != 0) { + return false; + } else { + this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(this.villagerObj), 0); + if (this.villageObj == null) { + return false; + } else if (this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getIsWillingToMate(true)) { + Entity entity = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, + this.villagerObj.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.villagerObj); + if (entity == null) { + return false; + } else { + this.mate = (EntityVillager) entity; + return this.mate.getGrowingAge() == 0 && this.mate.getIsWillingToMate(true); + } + } else { + return false; + } + } + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.matingTimeout = 300; + this.villagerObj.setMating(true); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.villageObj = null; + this.mate = null; + this.villagerObj.setMating(false); + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() + && this.villagerObj.getGrowingAge() == 0 && this.villagerObj.getIsWillingToMate(false); + } + + /**+ + * Updates the task + */ + public void updateTask() { + --this.matingTimeout; + this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F); + if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D); + } else if (this.matingTimeout == 0 && this.mate.isMating()) { + this.giveBirth(); + } + + if (this.villagerObj.getRNG().nextInt(35) == 0) { + this.worldObj.setEntityState(this.villagerObj, (byte) 12); + } + + } + + private boolean checkSufficientDoorsPresentForNewVillager() { + if (!this.villageObj.isMatingSeason()) { + return false; + } else { + int i = (int) ((double) ((float) this.villageObj.getNumVillageDoors()) * 0.35D); + return this.villageObj.getNumVillagers() < i; + } + } + + private void giveBirth() { + EntityVillager entityvillager = this.villagerObj.createChild(this.mate); + this.mate.setGrowingAge(6000); + this.villagerObj.setGrowingAge(6000); + this.mate.setIsWillingToMate(false); + this.villagerObj.setIsWillingToMate(false); + entityvillager.setGrowingAge(-24000); + entityvillager.setLocationAndAngles(this.villagerObj.posX, this.villagerObj.posY, this.villagerObj.posZ, 0.0F, + 0.0F); + this.worldObj.spawnEntityInWorld(entityvillager); + this.worldObj.setEntityState(entityvillager, (byte) 12); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWander.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWander.java new file mode 100644 index 0000000..bc014b4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWander.java @@ -0,0 +1,109 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.RandomPositionGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIWander extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIWander"); + } + + private EntityCreature entity; + private double xPosition; + private double yPosition; + private double zPosition; + private double speed; + private int executionChance; + private boolean mustUpdate; + + public EntityAIWander(EntityCreature creatureIn, double speedIn) { + this(creatureIn, speedIn, 120); + } + + public EntityAIWander(EntityCreature creatureIn, double speedIn, int chance) { + this.entity = creatureIn; + this.speed = speedIn; + this.executionChance = chance; + this.setMutexBits(1); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.mustUpdate) { + if (this.entity.getAge() >= 100) { + return false; + } + + if (this.entity.getRNG().nextInt(this.executionChance) != 0) { + return false; + } + } + + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); + if (vec3 == null) { + return false; + } else { + this.xPosition = vec3.xCoord; + this.yPosition = vec3.yCoord; + this.zPosition = vec3.zCoord; + this.mustUpdate = false; + return true; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.entity.getNavigator().noPath(); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); + } + + /**+ + * Makes task to bypass chance + */ + public void makeUpdate() { + this.mustUpdate = true; + } + + /**+ + * Changes task random possibility for execution + */ + public void setExecutionChance(int newchance) { + this.executionChance = newchance; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest.java new file mode 100644 index 0000000..2f9e9cc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest.java @@ -0,0 +1,120 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIWatchClosest extends EntityAIBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIWatchClosest"); + } + + protected EntityLiving theWatcher; + protected Entity closestEntity; + protected float maxDistanceForPlayer; + private int lookTime; + private float chance; + protected Class watchedClass; + + public EntityAIWatchClosest(EntityLiving entitylivingIn, Class watchTargetClass, + float maxDistance) { + this.theWatcher = entitylivingIn; + this.watchedClass = watchTargetClass; + this.maxDistanceForPlayer = maxDistance; + this.chance = 0.02F; + this.setMutexBits(2); + } + + public EntityAIWatchClosest(EntityLiving entitylivingIn, Class watchTargetClass, + float maxDistance, float chanceIn) { + this.theWatcher = entitylivingIn; + this.watchedClass = watchTargetClass; + this.maxDistanceForPlayer = maxDistance; + this.chance = chanceIn; + this.setMutexBits(2); + } + + /**+ + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theWatcher.getRNG().nextFloat() >= this.chance) { + return false; + } else { + if (this.theWatcher.getAttackTarget() != null) { + this.closestEntity = this.theWatcher.getAttackTarget(); + } + + if (this.watchedClass == EntityPlayer.class) { + this.closestEntity = this.theWatcher.worldObj.getClosestPlayerToEntity(this.theWatcher, + (double) this.maxDistanceForPlayer); + } else { + this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB( + this.watchedClass, this.theWatcher.getEntityBoundingBox() + .expand((double) this.maxDistanceForPlayer, 3.0D, (double) this.maxDistanceForPlayer), + this.theWatcher); + } + + return this.closestEntity != null; + } + } + + /**+ + * Returns whether an in-progress EntityAIBase should continue + * executing + */ + public boolean continueExecuting() { + return !this.closestEntity.isEntityAlive() ? false + : (this.theWatcher.getDistanceSqToEntity( + this.closestEntity) > (double) (this.maxDistanceForPlayer * this.maxDistanceForPlayer) ? false + : this.lookTime > 0); + } + + /**+ + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.lookTime = 40 + this.theWatcher.getRNG().nextInt(40); + } + + /**+ + * Resets the task + */ + public void resetTask() { + this.closestEntity = null; + } + + /**+ + * Updates the task + */ + public void updateTask() { + this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, + this.closestEntity.posY + (double) this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, + (float) this.theWatcher.getVerticalFaceSpeed()); + --this.lookTime; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest2.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest2.java new file mode 100644 index 0000000..dc18ce1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest2.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityAIWatchClosest2 extends EntityAIWatchClosest { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIWatchClosest2"); + } + + public EntityAIWatchClosest2(EntityLiving entitylivingIn, Class watchTargetClass, + float maxDistance, float chanceIn) { + super(entitylivingIn, watchTargetClass, maxDistance, chanceIn); + this.setMutexBits(3); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityJumpHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityJumpHelper.java new file mode 100644 index 0000000..c30926f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityJumpHelper.java @@ -0,0 +1,51 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityJumpHelper { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityJumpHelper"); + } + + private EntityLiving entity; + protected boolean isJumping; + + public EntityJumpHelper(EntityLiving entityIn) { + this.entity = entityIn; + } + + public void setJumping() { + this.isJumping = true; + } + + /**+ + * Called to actually make the entity jump if isJumping is true. + */ + public void doJump() { + this.entity.setJumping(this.isJumping); + this.isJumping = false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityLookHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityLookHelper.java new file mode 100644 index 0000000..5e64cf4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityLookHelper.java @@ -0,0 +1,138 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityLookHelper { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityLookHelper"); + } + + private EntityLiving entity; + private float deltaLookYaw; + private float deltaLookPitch; + private boolean isLooking; + private double posX; + private double posY; + private double posZ; + + public EntityLookHelper(EntityLiving entitylivingIn) { + this.entity = entitylivingIn; + } + + /**+ + * Sets position to look at using entity + */ + public void setLookPositionWithEntity(Entity entityIn, float deltaYaw, float deltaPitch) { + this.posX = entityIn.posX; + if (entityIn instanceof EntityLivingBase) { + this.posY = entityIn.posY + (double) entityIn.getEyeHeight(); + } else { + this.posY = (entityIn.getEntityBoundingBox().minY + entityIn.getEntityBoundingBox().maxY) / 2.0D; + } + + this.posZ = entityIn.posZ; + this.deltaLookYaw = deltaYaw; + this.deltaLookPitch = deltaPitch; + this.isLooking = true; + } + + /**+ + * Sets position to look at + */ + public void setLookPosition(double x, double y, double z, float deltaYaw, float deltaPitch) { + this.posX = x; + this.posY = y; + this.posZ = z; + this.deltaLookYaw = deltaYaw; + this.deltaLookPitch = deltaPitch; + this.isLooking = true; + } + + /**+ + * Updates look + */ + public void onUpdateLook() { + this.entity.rotationPitch = 0.0F; + if (this.isLooking) { + this.isLooking = false; + double d0 = this.posX - this.entity.posX; + double d1 = this.posY - (this.entity.posY + (double) this.entity.getEyeHeight()); + double d2 = this.posZ - this.entity.posZ; + double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + float f = (float) (MathHelper.func_181159_b(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F; + float f1 = (float) (-(MathHelper.func_181159_b(d1, d3) * 180.0D / 3.1415927410125732D)); + this.entity.rotationPitch = this.updateRotation(this.entity.rotationPitch, f1, this.deltaLookPitch); + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, f, this.deltaLookYaw); + } else { + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, this.entity.renderYawOffset, + 10.0F); + } + + float f2 = MathHelper.wrapAngleTo180_float(this.entity.rotationYawHead - this.entity.renderYawOffset); + if (!this.entity.getNavigator().noPath()) { + if (f2 < -75.0F) { + this.entity.rotationYawHead = this.entity.renderYawOffset - 75.0F; + } + + if (f2 > 75.0F) { + this.entity.rotationYawHead = this.entity.renderYawOffset + 75.0F; + } + } + + } + + private float updateRotation(float parFloat1, float parFloat2, float parFloat3) { + float f = MathHelper.wrapAngleTo180_float(parFloat2 - parFloat1); + if (f > parFloat3) { + f = parFloat3; + } + + if (f < -parFloat3) { + f = -parFloat3; + } + + return parFloat1 + f; + } + + public boolean getIsLooking() { + return this.isLooking; + } + + public double getLookPosX() { + return this.posX; + } + + public double getLookPosY() { + return this.posY; + } + + public double getLookPosZ() { + return this.posZ; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMinecartMobSpawner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMinecartMobSpawner.java new file mode 100644 index 0000000..ac2068c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMinecartMobSpawner.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartMobSpawner extends EntityMinecart { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityMinecartMobSpawner"); + } + + /**+ + * Mob spawner logic for this spawner minecart. + */ + private final MobSpawnerBaseLogic mobSpawnerLogic = new MobSpawnerBaseLogic() { + public void func_98267_a(int i) { + EntityMinecartMobSpawner.this.worldObj.setEntityState(EntityMinecartMobSpawner.this, (byte) i); + } + + public World getSpawnerWorld() { + return EntityMinecartMobSpawner.this.worldObj; + } + + public BlockPos getSpawnerPosition() { + return new BlockPos(EntityMinecartMobSpawner.this); + } + }; + + public EntityMinecartMobSpawner(World worldIn) { + super(worldIn); + } + + public EntityMinecartMobSpawner(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.SPAWNER; + } + + public IBlockState getDefaultDisplayTile() { + return Blocks.mob_spawner.getDefaultState(); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.mobSpawnerLogic.readFromNBT(nbttagcompound); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + this.mobSpawnerLogic.writeToNBT(nbttagcompound); + } + + public void handleStatusUpdate(byte b0) { + this.mobSpawnerLogic.setDelayToMin(b0); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + this.mobSpawnerLogic.updateSpawner(); + } + + public MobSpawnerBaseLogic func_98039_d() { + return this.mobSpawnerLogic; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMoveHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMoveHelper.java new file mode 100644 index 0000000..0ea2551 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMoveHelper.java @@ -0,0 +1,124 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMoveHelper { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntityMoveHelper"); + } + + protected EntityLiving entity; + protected double posX; + protected double posY; + protected double posZ; + protected double speed; + protected boolean update; + + public EntityMoveHelper(EntityLiving entitylivingIn) { + this.entity = entitylivingIn; + this.posX = entitylivingIn.posX; + this.posY = entitylivingIn.posY; + this.posZ = entitylivingIn.posZ; + } + + public boolean isUpdating() { + return this.update; + } + + public double getSpeed() { + return this.speed; + } + + /**+ + * Sets the speed and location to move to + */ + public void setMoveTo(double x, double y, double z, double speedIn) { + this.posX = x; + this.posY = y; + this.posZ = z; + this.speed = speedIn; + this.update = true; + } + + public void onUpdateMoveHelper() { + this.entity.setMoveForward(0.0F); + if (this.update) { + this.update = false; + int i = MathHelper.floor_double(this.entity.getEntityBoundingBox().minY + 0.5D); + double d0 = this.posX - this.entity.posX; + double d1 = this.posZ - this.entity.posZ; + double d2 = this.posY - (double) i; + double d3 = d0 * d0 + d2 * d2 + d1 * d1; + if (d3 >= 2.500000277905201E-7D) { + float f = (float) (MathHelper.func_181159_b(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F; + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, f, 30.0F); + this.entity.setAIMoveSpeed((float) (this.speed + * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) { + this.entity.getJumpHelper().setJumping(); + } + + } + } + } + + /**+ + * Limits the given angle to a upper and lower limit. + */ + protected float limitAngle(float parFloat1, float parFloat2, float parFloat3) { + float f = MathHelper.wrapAngleTo180_float(parFloat2 - parFloat1); + if (f > parFloat3) { + f = parFloat3; + } + + if (f < -parFloat3) { + f = -parFloat3; + } + + float f1 = parFloat1 + f; + if (f1 < 0.0F) { + f1 += 360.0F; + } else if (f1 > 360.0F) { + f1 -= 360.0F; + } + + return f1; + } + + public double getX() { + return this.posX; + } + + public double getY() { + return this.posY; + } + + public double getZ() { + return this.posZ; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntitySenses.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntitySenses.java new file mode 100644 index 0000000..9f48144 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntitySenses.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySenses { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/EntitySenses"); + } + + EntityLiving entityObj; + List seenEntities = Lists.newArrayList(); + List unseenEntities = Lists.newArrayList(); + + public EntitySenses(EntityLiving entityObjIn) { + this.entityObj = entityObjIn; + } + + /**+ + * Clears canSeeCachePositive and canSeeCacheNegative. + */ + public void clearSensingCache() { + this.seenEntities.clear(); + this.unseenEntities.clear(); + } + + /**+ + * Checks, whether 'our' entity can see the entity given as + * argument (true) or not (false), caching the result. + */ + public boolean canSee(Entity entityIn) { + if (this.seenEntities.contains(entityIn)) { + return true; + } else if (this.unseenEntities.contains(entityIn)) { + return false; + } else { + this.entityObj.worldObj.theProfiler.startSection("canSee"); + boolean flag = this.entityObj.canEntityBeSeen(entityIn); + this.entityObj.worldObj.theProfiler.endSection(); + if (flag) { + this.seenEntities.add(entityIn); + } else { + this.unseenEntities.add(entityIn); + } + + return flag; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/RandomPositionGenerator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/RandomPositionGenerator.java new file mode 100644 index 0000000..484a69d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/RandomPositionGenerator.java @@ -0,0 +1,156 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RandomPositionGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/RandomPositionGenerator"); + } + + /**+ + * used to store a driection when the user passes a point to + * move towards or away from. WARNING: NEVER THREAD SAFE. + * MULTIPLE findTowards and findAway calls, will share this var + */ + private static Vec3 staticVector = new Vec3(0.0D, 0.0D, 0.0D); + + /**+ + * finds a random target within par1(x,z) and par2 (y) blocks + */ + public static Vec3 findRandomTarget(EntityCreature entitycreatureIn, int xz, int y) { + /**+ + * searches 10 blocks at random in a within par1(x,z) and par2 + * (y) distance, ignores those not in the direction of par3Vec3, + * then points to the tile for which creature.getBlockPathWeight + * returns the highest number + */ + return findRandomTargetBlock(entitycreatureIn, xz, y, (Vec3) null); + } + + /**+ + * finds a random target within par1(x,z) and par2 (y) blocks in + * the direction of the point par3 + */ + public static Vec3 findRandomTargetBlockTowards(EntityCreature entitycreatureIn, int xz, int y, Vec3 targetVec3) { + staticVector = targetVec3.subtract(entitycreatureIn.posX, entitycreatureIn.posY, entitycreatureIn.posZ); + /**+ + * searches 10 blocks at random in a within par1(x,z) and par2 + * (y) distance, ignores those not in the direction of par3Vec3, + * then points to the tile for which creature.getBlockPathWeight + * returns the highest number + */ + return findRandomTargetBlock(entitycreatureIn, xz, y, staticVector); + } + + /**+ + * finds a random target within par1(x,z) and par2 (y) blocks in + * the reverse direction of the point par3 + */ + public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature entitycreatureIn, int xz, int y, Vec3 targetVec3) { + staticVector = (new Vec3(entitycreatureIn.posX, entitycreatureIn.posY, entitycreatureIn.posZ)) + .subtract(targetVec3); + /**+ + * searches 10 blocks at random in a within par1(x,z) and par2 + * (y) distance, ignores those not in the direction of par3Vec3, + * then points to the tile for which creature.getBlockPathWeight + * returns the highest number + */ + return findRandomTargetBlock(entitycreatureIn, xz, y, staticVector); + } + + /**+ + * searches 10 blocks at random in a within par1(x,z) and par2 + * (y) distance, ignores those not in the direction of par3Vec3, + * then points to the tile for which creature.getBlockPathWeight + * returns the highest number + */ + private static Vec3 findRandomTargetBlock(EntityCreature entitycreatureIn, int xz, int y, Vec3 targetVec3) { + EaglercraftRandom random = entitycreatureIn.getRNG(); + boolean flag = false; + int i = 0; + int j = 0; + int k = 0; + float f = -99999.0F; + boolean flag1; + if (entitycreatureIn.hasHome()) { + double d0 = entitycreatureIn.getHomePosition().distanceSq( + (double) MathHelper.floor_double(entitycreatureIn.posX), + (double) MathHelper.floor_double(entitycreatureIn.posY), + (double) MathHelper.floor_double(entitycreatureIn.posZ)) + 4.0D; + double d1 = (double) (entitycreatureIn.getMaximumHomeDistance() + (float) xz); + flag1 = d0 < d1 * d1; + } else { + flag1 = false; + } + + for (int j1 = 0; j1 < 10; ++j1) { + int l = random.nextInt(2 * xz + 1) - xz; + int k1 = random.nextInt(2 * y + 1) - y; + int i1 = random.nextInt(2 * xz + 1) - xz; + if (targetVec3 == null || (double) l * targetVec3.xCoord + (double) i1 * targetVec3.zCoord >= 0.0D) { + if (entitycreatureIn.hasHome() && xz > 1) { + BlockPos blockpos = entitycreatureIn.getHomePosition(); + if (entitycreatureIn.posX > (double) blockpos.getX()) { + l -= random.nextInt(xz / 2); + } else { + l += random.nextInt(xz / 2); + } + + if (entitycreatureIn.posZ > (double) blockpos.getZ()) { + i1 -= random.nextInt(xz / 2); + } else { + i1 += random.nextInt(xz / 2); + } + } + + l = l + MathHelper.floor_double(entitycreatureIn.posX); + k1 = k1 + MathHelper.floor_double(entitycreatureIn.posY); + i1 = i1 + MathHelper.floor_double(entitycreatureIn.posZ); + BlockPos blockpos1 = new BlockPos(l, k1, i1); + if (!flag1 || entitycreatureIn.isWithinHomeDistanceFromPosition(blockpos1)) { + float f1 = entitycreatureIn.getBlockPathWeight(blockpos1); + if (f1 > f) { + f = f1; + i = l; + j = k1; + k = i1; + flag = true; + } + } + } + } + + if (flag) { + return new Vec3((double) i, (double) j, (double) k); + } else { + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/AttributeModifier.java new file mode 100644 index 0000000..8fe9d4d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/AttributeModifier.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import org.apache.commons.lang3.Validate; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 AttributeModifier { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/attributes/AttributeModifier"); + } + + private final double amount; + private final int operation; + private final String name; + private final EaglercraftUUID id; + private boolean isSaved; + + public AttributeModifier(String nameIn, double amountIn, int operationIn) { + this(MathHelper.getRandomUuid(ThreadLocalRandom.current()), nameIn, amountIn, operationIn); + } + + public AttributeModifier(EaglercraftUUID idIn, String nameIn, double amountIn, int operationIn) { + this.isSaved = true; + this.id = idIn; + this.name = nameIn; + this.amount = amountIn; + this.operation = operationIn; + Validate.notEmpty(nameIn, "Modifier name cannot be empty", new Object[0]); + Validate.inclusiveBetween(0L, 2L, (long) operationIn, "Invalid operation"); + } + + public EaglercraftUUID getID() { + return this.id; + } + + public String getName() { + return this.name; + } + + public int getOperation() { + return this.operation; + } + + public double getAmount() { + return this.amount; + } + + /**+ + * @see #isSaved + */ + public boolean isSaved() { + return this.isSaved; + } + + /**+ + * @see #isSaved + */ + public AttributeModifier setSaved(boolean saved) { + this.isSaved = saved; + return this; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + AttributeModifier attributemodifier = (AttributeModifier) object; + if (this.id != null) { + if (!this.id.equals(attributemodifier.id)) { + return false; + } + } else if (attributemodifier.id != null) { + return false; + } + + return true; + } else { + return false; + } + } + + public int hashCode() { + return this.id != null ? this.id.hashCode() : 0; + } + + public String toString() { + return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.name + + '\'' + ", id=" + this.id + ", serialize=" + this.isSaved + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttribute.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttribute.java new file mode 100644 index 0000000..e56ffb9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttribute.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BaseAttribute implements IAttribute { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/attributes/BaseAttribute"); + } + + private final IAttribute field_180373_a; + private final String unlocalizedName; + private final double defaultValue; + private boolean shouldWatch; + + protected BaseAttribute(IAttribute parIAttribute, String unlocalizedNameIn, double defaultValueIn) { + this.field_180373_a = parIAttribute; + this.unlocalizedName = unlocalizedNameIn; + this.defaultValue = defaultValueIn; + if (unlocalizedNameIn == null) { + throw new IllegalArgumentException("Name cannot be null!"); + } + } + + public String getAttributeUnlocalizedName() { + return this.unlocalizedName; + } + + public double getDefaultValue() { + return this.defaultValue; + } + + public boolean getShouldWatch() { + return this.shouldWatch; + } + + public BaseAttribute setShouldWatch(boolean shouldWatchIn) { + this.shouldWatch = shouldWatchIn; + return this; + } + + public IAttribute func_180372_d() { + return this.field_180373_a; + } + + public int hashCode() { + return this.unlocalizedName.hashCode(); + } + + public boolean equals(Object object) { + return object instanceof IAttribute + && this.unlocalizedName.equals(((IAttribute) object).getAttributeUnlocalizedName()); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttributeMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttributeMap.java new file mode 100644 index 0000000..b7c6f98 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttributeMap.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; + +import java.util.Collection; +import java.util.Map; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.LowerStringMap; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BaseAttributeMap { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/attributes/BaseAttributeMap"); + } + + protected final Map attributes = Maps.newHashMap(); + protected final Map attributesByName = new LowerStringMap(); + protected final Multimap field_180377_c = HashMultimap.create(); + + public IAttributeInstance getAttributeInstance(IAttribute attribute) { + return (IAttributeInstance) this.attributes.get(attribute); + } + + public IAttributeInstance getAttributeInstanceByName(String attributeName) { + return (IAttributeInstance) this.attributesByName.get(attributeName); + } + + /**+ + * Registers an attribute with this AttributeMap, returns a + * modifiable AttributeInstance associated with this map + */ + public IAttributeInstance registerAttribute(IAttribute attribute) { + if (this.attributesByName.containsKey(attribute.getAttributeUnlocalizedName())) { + throw new IllegalArgumentException("Attribute is already registered!"); + } else { + IAttributeInstance iattributeinstance = this.func_180376_c(attribute); + this.attributesByName.put(attribute.getAttributeUnlocalizedName(), iattributeinstance); + this.attributes.put(attribute, iattributeinstance); + + for (IAttribute iattribute = attribute.func_180372_d(); iattribute != null; iattribute = iattribute + .func_180372_d()) { + this.field_180377_c.put(iattribute, attribute); + } + + return iattributeinstance; + } + } + + protected abstract IAttributeInstance func_180376_c(IAttribute var1); + + public Collection getAllAttributes() { + return this.attributesByName.values(); + } + + public void func_180794_a(IAttributeInstance parIAttributeInstance) { + } + + public void removeAttributeModifiers(Multimap parMultimap) { + for (Entry entry : parMultimap.entries()) { + IAttributeInstance iattributeinstance = this.getAttributeInstanceByName((String) entry.getKey()); + if (iattributeinstance != null) { + iattributeinstance.removeModifier((AttributeModifier) entry.getValue()); + } + } + + } + + public void applyAttributeModifiers(Multimap parMultimap) { + for (Entry entry : parMultimap.entries()) { + IAttributeInstance iattributeinstance = this.getAttributeInstanceByName((String) entry.getKey()); + if (iattributeinstance != null) { + iattributeinstance.removeModifier((AttributeModifier) entry.getValue()); + iattributeinstance.applyModifier((AttributeModifier) entry.getValue()); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttribute.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttribute.java new file mode 100644 index 0000000..2381b66 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttribute.java @@ -0,0 +1,33 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IAttribute { + String getAttributeUnlocalizedName(); + + double clampValue(double var1); + + double getDefaultValue(); + + boolean getShouldWatch(); + + IAttribute func_180372_d(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttributeInstance.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttributeInstance.java new file mode 100644 index 0000000..452ad70 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttributeInstance.java @@ -0,0 +1,56 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IAttributeInstance { + /**+ + * Get the Attribute this is an instance of + */ + IAttribute getAttribute(); + + double getBaseValue(); + + void setBaseValue(double var1); + + Collection getModifiersByOperation(int var1); + + Collection func_111122_c(); + + boolean hasModifier(AttributeModifier var1); + + /**+ + * Returns attribute modifier, if any, by the given UUID + */ + AttributeModifier getModifier(EaglercraftUUID var1); + + void applyModifier(AttributeModifier var1); + + void removeModifier(AttributeModifier var1); + + void removeAllModifiers(); + + double getAttributeValue(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java new file mode 100644 index 0000000..97ea034 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java @@ -0,0 +1,198 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ModifiableAttributeInstance implements IAttributeInstance { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/attributes/ModifiableAttributeInstance"); + } + + private final BaseAttributeMap attributeMap; + private final IAttribute genericAttribute; + private final Map> mapByOperation = Maps.newHashMap(); + private final Map> mapByName = Maps.newHashMap(); + private final Map mapByUUID = Maps.newHashMap(); + private double baseValue; + private boolean needsUpdate = true; + private double cachedValue; + + public ModifiableAttributeInstance(BaseAttributeMap attributeMapIn, IAttribute genericAttributeIn) { + this.attributeMap = attributeMapIn; + this.genericAttribute = genericAttributeIn; + this.baseValue = genericAttributeIn.getDefaultValue(); + + for (int i = 0; i < 3; ++i) { + this.mapByOperation.put(Integer.valueOf(i), Sets.newHashSet()); + } + + } + + /**+ + * Get the Attribute this is an instance of + */ + public IAttribute getAttribute() { + return this.genericAttribute; + } + + public double getBaseValue() { + return this.baseValue; + } + + public void setBaseValue(double d0) { + if (d0 != this.getBaseValue()) { + this.baseValue = d0; + this.flagForUpdate(); + } + } + + public Collection getModifiersByOperation(int i) { + return (Collection) this.mapByOperation.get(Integer.valueOf(i)); + } + + public Collection func_111122_c() { + HashSet hashset = Sets.newHashSet(); + + for (int i = 0; i < 3; ++i) { + hashset.addAll(this.getModifiersByOperation(i)); + } + + return hashset; + } + + /**+ + * Returns attribute modifier, if any, by the given UUID + */ + public AttributeModifier getModifier(EaglercraftUUID uuid) { + return (AttributeModifier) this.mapByUUID.get(uuid); + } + + public boolean hasModifier(AttributeModifier attributemodifier) { + return this.mapByUUID.get(attributemodifier.getID()) != null; + } + + public void applyModifier(AttributeModifier attributemodifier) { + if (this.getModifier(attributemodifier.getID()) != null) { + throw new IllegalArgumentException("Modifier is already applied on this attribute!"); + } else { + Object object = (Set) this.mapByName.get(attributemodifier.getName()); + if (object == null) { + object = Sets.newHashSet(); + this.mapByName.put(attributemodifier.getName(), (Set) object); + } + + ((Set) this.mapByOperation.get(Integer.valueOf(attributemodifier.getOperation()))).add(attributemodifier); + ((Set) object).add(attributemodifier); + this.mapByUUID.put(attributemodifier.getID(), attributemodifier); + this.flagForUpdate(); + } + } + + protected void flagForUpdate() { + this.needsUpdate = true; + this.attributeMap.func_180794_a(this); + } + + public void removeModifier(AttributeModifier attributemodifier) { + for (int i = 0; i < 3; ++i) { + Set set = (Set) this.mapByOperation.get(Integer.valueOf(i)); + set.remove(attributemodifier); + } + + Set set1 = (Set) this.mapByName.get(attributemodifier.getName()); + if (set1 != null) { + set1.remove(attributemodifier); + if (set1.isEmpty()) { + this.mapByName.remove(attributemodifier.getName()); + } + } + + this.mapByUUID.remove(attributemodifier.getID()); + this.flagForUpdate(); + } + + public void removeAllModifiers() { + Collection collection = this.func_111122_c(); + if (collection != null) { + for (AttributeModifier attributemodifier : (Collection) Lists.newArrayList(collection)) { + this.removeModifier(attributemodifier); + } + } + } + + public double getAttributeValue() { + if (this.needsUpdate) { + this.cachedValue = this.computeValue(); + this.needsUpdate = false; + } + + return this.cachedValue; + } + + private double computeValue() { + double d0 = this.getBaseValue(); + + for (AttributeModifier attributemodifier : this.func_180375_b(0)) { + d0 += attributemodifier.getAmount(); + } + + double d1 = d0; + + for (AttributeModifier attributemodifier1 : this.func_180375_b(1)) { + d1 += d0 * attributemodifier1.getAmount(); + } + + for (AttributeModifier attributemodifier2 : this.func_180375_b(2)) { + d1 *= 1.0D + attributemodifier2.getAmount(); + } + + return this.genericAttribute.clampValue(d1); + } + + private Collection func_180375_b(int parInt1) { + HashSet hashset = Sets.newHashSet(this.getModifiersByOperation(parInt1)); + + for (IAttribute iattribute = this.genericAttribute.func_180372_d(); iattribute != null; iattribute = iattribute + .func_180372_d()) { + IAttributeInstance iattributeinstance = this.attributeMap.getAttributeInstance(iattribute); + if (iattributeinstance != null) { + hashset.addAll(iattributeinstance.getModifiersByOperation(parInt1)); + } + } + + return hashset; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/RangedAttribute.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/RangedAttribute.java new file mode 100644 index 0000000..b3cca11 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/RangedAttribute.java @@ -0,0 +1,66 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RangedAttribute extends BaseAttribute { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/attributes/RangedAttribute"); + } + + private final double minimumValue; + private final double maximumValue; + private String description; + + public RangedAttribute(IAttribute parIAttribute, String unlocalizedNameIn, double defaultValue, + double minimumValueIn, double maximumValueIn) { + super(parIAttribute, unlocalizedNameIn, defaultValue); + this.minimumValue = minimumValueIn; + this.maximumValue = maximumValueIn; + if (minimumValueIn > maximumValueIn) { + throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); + } else if (defaultValue < minimumValueIn) { + throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); + } else if (defaultValue > maximumValueIn) { + throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); + } + } + + public RangedAttribute setDescription(String descriptionIn) { + this.description = descriptionIn; + return this; + } + + public String getDescription() { + return this.description; + } + + public double clampValue(double d0) { + d0 = MathHelper.clamp_double(d0, this.minimumValue, this.maximumValue); + return d0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java new file mode 100644 index 0000000..136ce81 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java @@ -0,0 +1,106 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.ModifiableAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.RangedAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.LowerStringMap; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ServersideAttributeMap extends BaseAttributeMap { + + static { + __checkIntegratedContextValid("net/minecraft/entity/ai/attributes/ServersideAttributeMap"); + } + + private final Set attributeInstanceSet = Sets.newHashSet(); + protected final Map descriptionToAttributeInstanceMap = new LowerStringMap(); + + public ModifiableAttributeInstance getAttributeInstance(IAttribute iattribute) { + return (ModifiableAttributeInstance) super.getAttributeInstance(iattribute); + } + + public ModifiableAttributeInstance getAttributeInstanceByName(String s) { + IAttributeInstance iattributeinstance = super.getAttributeInstanceByName(s); + if (iattributeinstance == null) { + iattributeinstance = (IAttributeInstance) this.descriptionToAttributeInstanceMap.get(s); + } + + return (ModifiableAttributeInstance) iattributeinstance; + } + + /**+ + * Registers an attribute with this AttributeMap, returns a + * modifiable AttributeInstance associated with this map + */ + public IAttributeInstance registerAttribute(IAttribute iattribute) { + IAttributeInstance iattributeinstance = super.registerAttribute(iattribute); + if (iattribute instanceof RangedAttribute && ((RangedAttribute) iattribute).getDescription() != null) { + this.descriptionToAttributeInstanceMap.put(((RangedAttribute) iattribute).getDescription(), + iattributeinstance); + } + + return iattributeinstance; + } + + protected IAttributeInstance func_180376_c(IAttribute iattribute) { + return new ModifiableAttributeInstance(this, iattribute); + } + + public void func_180794_a(IAttributeInstance iattributeinstance) { + if (iattributeinstance.getAttribute().getShouldWatch()) { + this.attributeInstanceSet.add(iattributeinstance); + } + + for (IAttribute iattribute : this.field_180377_c.get(iattributeinstance.getAttribute())) { + ModifiableAttributeInstance modifiableattributeinstance = this.getAttributeInstance(iattribute); + if (modifiableattributeinstance != null) { + modifiableattributeinstance.flagForUpdate(); + } + } + + } + + public Set getAttributeInstanceSet() { + return this.attributeInstanceSet; + } + + public Collection getWatchedAttributes() { + HashSet hashset = Sets.newHashSet(); + + for (IAttributeInstance iattributeinstance : this.getAllAttributes()) { + if (iattributeinstance.getAttribute().getShouldWatch()) { + hashset.add(iattributeinstance); + } + } + + return hashset; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/BossStatus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/BossStatus.java new file mode 100644 index 0000000..52963af --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/BossStatus.java @@ -0,0 +1,44 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.IBossDisplayData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class BossStatus { + + static { + __checkIntegratedContextValid("net/minecraft/entity/boss/BossStatus"); + } + + public static float healthScale; + public static int statusBarTime; + public static String bossName; + public static boolean hasColorModifier; + + public static void setBossStatus(IBossDisplayData displayData, boolean hasColorModifierIn) { + healthScale = displayData.getHealth() / displayData.getMaxHealth(); + statusBarTime = 100; + bossName = displayData.getDisplayName().getFormattedText(); + hasColorModifier = hasColorModifierIn; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragon.java new file mode 100644 index 0000000..2bd27bb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragon.java @@ -0,0 +1,698 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTorch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityMultiPart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragonPart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.IBossDisplayData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderCrystal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/boss/EntityDragon"); + } + + public double targetX; + public double targetY; + public double targetZ; + /**+ + * Ring buffer array for the last 64 Y-positions and yaw + * rotations. Used to calculate offsets for the animations. + */ + public double[][] ringBuffer = new double[64][3]; + /**+ + * Index into the ring buffer. Incremented once per tick and + * restarts at 0 once it reaches the end of the buffer. + */ + public int ringBufferIndex = -1; + public EntityDragonPart[] dragonPartArray; + public EntityDragonPart dragonPartHead; + public EntityDragonPart dragonPartBody; + public EntityDragonPart dragonPartTail1; + public EntityDragonPart dragonPartTail2; + public EntityDragonPart dragonPartTail3; + public EntityDragonPart dragonPartWing1; + public EntityDragonPart dragonPartWing2; + public float prevAnimTime; + public float animTime; + public boolean forceNewTarget; + public boolean slowed; + private Entity target; + public int deathTicks; + public EntityEnderCrystal healingEnderCrystal; + + public EntityDragon(World worldIn) { + super(worldIn); + this.dragonPartArray = new EntityDragonPart[] { + this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), + this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), + this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), + this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), + this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), + this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), + this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F) }; + this.setHealth(this.getMaxHealth()); + this.setSize(16.0F, 8.0F); + this.noClip = true; + this.isImmuneToFire = true; + this.targetY = 100.0D; + this.ignoreFrustumCheck = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); + } + + protected void entityInit() { + super.entityInit(); + } + + /**+ + * Returns a double[3] array with movement offsets, used to + * calculate trailing tail/neck positions. [0] = yaw offset, [1] + * = y offset, [2] = unused, always 0. Parameters: buffer index + * offset, partial ticks. + */ + public double[] getMovementOffsets(int parInt1, float parFloat1) { + if (this.getHealth() <= 0.0F) { + parFloat1 = 0.0F; + } + + parFloat1 = 1.0F - parFloat1; + int i = this.ringBufferIndex - parInt1 * 1 & 63; + int j = this.ringBufferIndex - parInt1 * 1 - 1 & 63; + double[] adouble = new double[3]; + double d0 = this.ringBuffer[i][0]; + double d1 = MathHelper.wrapAngleTo180_double(this.ringBuffer[j][0] - d0); + adouble[0] = d0 + d1 * (double) parFloat1; + d0 = this.ringBuffer[i][1]; + d1 = this.ringBuffer[j][1] - d0; + adouble[1] = d0 + d1 * (double) parFloat1; + adouble[2] = this.ringBuffer[i][2] + (this.ringBuffer[j][2] - this.ringBuffer[i][2]) * (double) parFloat1; + return adouble; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + this.prevAnimTime = this.animTime; + if (this.getHealth() <= 0.0F) { + float f11 = (this.rand.nextFloat() - 0.5F) * 8.0F; + float f13 = (this.rand.nextFloat() - 0.5F) * 4.0F; + float f14 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX + (double) f11, + this.posY + 2.0D + (double) f13, this.posZ + (double) f14, 0.0D, 0.0D, 0.0D, new int[0]); + } else { + this.updateDragonEnderCrystal(); + float f10 = 0.2F + / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + + 1.0F); + f10 = f10 * (float) Math.pow(2.0D, this.motionY); + if (this.slowed) { + this.animTime += f10 * 0.5F; + } else { + this.animTime += f10; + } + + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + if (this.isAIDisabled()) { + this.animTime = 0.5F; + } else { + if (this.ringBufferIndex < 0) { + for (int i = 0; i < this.ringBuffer.length; ++i) { + this.ringBuffer[i][0] = (double) this.rotationYaw; + this.ringBuffer[i][1] = this.posY; + } + } + + if (++this.ringBufferIndex == this.ringBuffer.length) { + this.ringBufferIndex = 0; + } + + this.ringBuffer[this.ringBufferIndex][0] = (double) this.rotationYaw; + this.ringBuffer[this.ringBufferIndex][1] = this.posY; + { + double d11 = this.targetX - this.posX; + double d12 = this.targetY - this.posY; + double d13 = this.targetZ - this.posZ; + double d14 = d11 * d11 + d12 * d12 + d13 * d13; + if (this.target != null) { + this.targetX = this.target.posX; + this.targetZ = this.target.posZ; + double d3 = this.targetX - this.posX; + double d5 = this.targetZ - this.posZ; + double d7 = Math.sqrt(d3 * d3 + d5 * d5); + double d8 = 0.4000000059604645D + d7 / 80.0D - 1.0D; + if (d8 > 10.0D) { + d8 = 10.0D; + } + + this.targetY = this.target.getEntityBoundingBox().minY + d8; + } else { + this.targetX += this.rand.nextGaussian() * 2.0D; + this.targetZ += this.rand.nextGaussian() * 2.0D; + } + + if (this.forceNewTarget || d14 < 100.0D || d14 > 22500.0D || this.isCollidedHorizontally + || this.isCollidedVertically) { + this.setNewTarget(); + } + + d12 = d12 / (double) MathHelper.sqrt_double(d11 * d11 + d13 * d13); + float f17 = 0.6F; + d12 = MathHelper.clamp_double(d12, (double) (-f17), (double) f17); + this.motionY += d12 * 0.10000000149011612D; + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + double d4 = 180.0D - MathHelper.func_181159_b(d11, d13) * 180.0D / 3.1415927410125732D; + double d6 = MathHelper.wrapAngleTo180_double(d4 - (double) this.rotationYaw); + if (d6 > 50.0D) { + d6 = 50.0D; + } + + if (d6 < -50.0D) { + d6 = -50.0D; + } + + Vec3 vec3 = (new Vec3(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ)) + .normalize(); + double d15 = (double) (-MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F)); + Vec3 vec31 = (new Vec3((double) MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F), + this.motionY, d15)).normalize(); + float f5 = ((float) vec31.dotProduct(vec3) + 0.5F) / 1.5F; + if (f5 < 0.0F) { + f5 = 0.0F; + } + + this.randomYawVelocity *= 0.8F; + float f6 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + + 1.0F; + double d9 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D; + if (d9 > 40.0D) { + d9 = 40.0D; + } + + this.randomYawVelocity = (float) ((double) this.randomYawVelocity + + d6 * (0.699999988079071D / d9 / (double) f6)); + this.rotationYaw += this.randomYawVelocity * 0.1F; + float f7 = (float) (2.0D / (d9 + 1.0D)); + float f8 = 0.06F; + this.moveFlying(0.0F, -1.0F, f8 * (f5 * f7 + (1.0F - f7))); + if (this.slowed) { + this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, + this.motionZ * 0.800000011920929D); + } else { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + Vec3 vec32 = (new Vec3(this.motionX, this.motionY, this.motionZ)).normalize(); + float f9 = ((float) vec32.dotProduct(vec31) + 1.0F) / 2.0F; + f9 = 0.8F + 0.15F * f9; + this.motionX *= (double) f9; + this.motionZ *= (double) f9; + this.motionY *= 0.9100000262260437D; + } + + this.renderYawOffset = this.rotationYaw; + this.dragonPartHead.width = this.dragonPartHead.height = 3.0F; + this.dragonPartTail1.width = this.dragonPartTail1.height = 2.0F; + this.dragonPartTail2.width = this.dragonPartTail2.height = 2.0F; + this.dragonPartTail3.width = this.dragonPartTail3.height = 2.0F; + this.dragonPartBody.height = 3.0F; + this.dragonPartBody.width = 5.0F; + this.dragonPartWing1.height = 2.0F; + this.dragonPartWing1.width = 4.0F; + this.dragonPartWing2.height = 3.0F; + this.dragonPartWing2.width = 4.0F; + float f12 = (float) (this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F + / 180.0F * 3.1415927F; + float f2 = MathHelper.cos(f12); + float f15 = -MathHelper.sin(f12); + float f3 = this.rotationYaw * 3.1415927F / 180.0F; + float f16 = MathHelper.sin(f3); + float f4 = MathHelper.cos(f3); + this.dragonPartBody.onUpdate(); + this.dragonPartBody.setLocationAndAngles(this.posX + (double) (f16 * 0.5F), this.posY, + this.posZ - (double) (f4 * 0.5F), 0.0F, 0.0F); + this.dragonPartWing1.onUpdate(); + this.dragonPartWing1.setLocationAndAngles(this.posX + (double) (f4 * 4.5F), this.posY + 2.0D, + this.posZ + (double) (f16 * 4.5F), 0.0F, 0.0F); + this.dragonPartWing2.onUpdate(); + this.dragonPartWing2.setLocationAndAngles(this.posX - (double) (f4 * 4.5F), this.posY + 2.0D, + this.posZ - (double) (f16 * 4.5F), 0.0F, 0.0F); + if (this.hurtTime == 0) { + this.collideWithEntities( + this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1 + .getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.collideWithEntities( + this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2 + .getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, + this.dragonPartHead.getEntityBoundingBox().expand(1.0D, 1.0D, 1.0D))); + } + + double[] adouble1 = this.getMovementOffsets(5, 1.0F); + double[] adouble = this.getMovementOffsets(0, 1.0F); + float f18 = MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F - this.randomYawVelocity * 0.01F); + float f19 = MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F - this.randomYawVelocity * 0.01F); + this.dragonPartHead.onUpdate(); + this.dragonPartHead.setLocationAndAngles(this.posX + (double) (f18 * 5.5F * f2), + this.posY + (adouble[1] - adouble1[1]) * 1.0D + (double) (f15 * 5.5F), + this.posZ - (double) (f19 * 5.5F * f2), 0.0F, 0.0F); + + for (int j = 0; j < 3; ++j) { + EntityDragonPart entitydragonpart = null; + if (j == 0) { + entitydragonpart = this.dragonPartTail1; + } + + if (j == 1) { + entitydragonpart = this.dragonPartTail2; + } + + if (j == 2) { + entitydragonpart = this.dragonPartTail3; + } + + double[] adouble2 = this.getMovementOffsets(12 + j * 2, 1.0F); + float f20 = this.rotationYaw * 3.1415927F / 180.0F + + this.simplifyAngle(adouble2[0] - adouble1[0]) * 3.1415927F / 180.0F * 1.0F; + float f21 = MathHelper.sin(f20); + float f22 = MathHelper.cos(f20); + float f23 = 1.5F; + float f24 = (float) (j + 1) * 2.0F; + entitydragonpart.onUpdate(); + entitydragonpart.setLocationAndAngles(this.posX - (double) ((f16 * f23 + f21 * f24) * f2), + this.posY + (adouble2[1] - adouble1[1]) * 1.0D - (double) ((f24 + f23) * f15) + 1.5D, + this.posZ + (double) ((f4 * f23 + f22 * f24) * f2), 0.0F, 0.0F); + } + + { + this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.getEntityBoundingBox()) + | this.destroyBlocksInAABB(this.dragonPartBody.getEntityBoundingBox()); + } + } + } + } + + /**+ + * Updates the state of the enderdragon's current endercrystal. + */ + private void updateDragonEnderCrystal() { + if (this.healingEnderCrystal != null) { + if (this.healingEnderCrystal.isDead) { + { + this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion) null), + 10.0F); + } + this.healingEnderCrystal = null; + } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { + this.setHealth(this.getHealth() + 1.0F); + } + } + + if (this.rand.nextInt(10) == 0) { + float f = 32.0F; + List list = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, + this.getEntityBoundingBox().expand((double) f, (double) f, (double) f)); + EntityEnderCrystal entityendercrystal = null; + double d0 = Double.MAX_VALUE; + + for (EntityEnderCrystal entityendercrystal1 : (List) list) { + double d1 = entityendercrystal1.getDistanceSqToEntity(this); + if (d1 < d0) { + d0 = d1; + entityendercrystal = entityendercrystal1; + } + } + + this.healingEnderCrystal = entityendercrystal; + } + + } + + /**+ + * Pushes all entities inside the list away from the + * enderdragon. + */ + private void collideWithEntities(List parList) { + double d0 = (this.dragonPartBody.getEntityBoundingBox().minX + this.dragonPartBody.getEntityBoundingBox().maxX) + / 2.0D; + double d1 = (this.dragonPartBody.getEntityBoundingBox().minZ + this.dragonPartBody.getEntityBoundingBox().maxZ) + / 2.0D; + + for (Entity entity : parList) { + if (entity instanceof EntityLivingBase) { + double d2 = entity.posX - d0; + double d3 = entity.posZ - d1; + double d4 = d2 * d2 + d3 * d3; + entity.addVelocity(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D); + } + } + + } + + /**+ + * Attacks all entities inside this list, dealing 5 hearts of + * damage. + */ + private void attackEntitiesInList(List parList) { + for (int i = 0; i < parList.size(); ++i) { + Entity entity = (Entity) parList.get(i); + if (entity instanceof EntityLivingBase) { + entity.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F); + this.applyEnchantments(this, entity); + } + } + + } + + /**+ + * Sets a new target for the flight AI. It can be a random + * coordinate or a nearby player. + */ + private void setNewTarget() { + this.forceNewTarget = false; + ArrayList arraylist = Lists.newArrayList(this.worldObj.playerEntities); + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) { + if (((EntityPlayer) iterator.next()).isSpectator()) { + iterator.remove(); + } + } + + if (this.rand.nextInt(2) == 0 && !arraylist.isEmpty()) { + this.target = (Entity) arraylist.get(this.rand.nextInt(arraylist.size())); + } else { + while (true) { + this.targetX = 0.0D; + this.targetY = (double) (70.0F + this.rand.nextFloat() * 50.0F); + this.targetZ = 0.0D; + this.targetX += (double) (this.rand.nextFloat() * 120.0F - 60.0F); + this.targetZ += (double) (this.rand.nextFloat() * 120.0F - 60.0F); + double d0 = this.posX - this.targetX; + double d1 = this.posY - this.targetY; + double d2 = this.posZ - this.targetZ; + boolean flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D; + if (flag) { + break; + } + } + + this.target = null; + } + + } + + /**+ + * Simplifies the value of a number by adding/subtracting 180 to + * the point that the number is between -180 and 180. + */ + private float simplifyAngle(double parDouble1) { + return (float) MathHelper.wrapAngleTo180_double(parDouble1); + } + + /**+ + * Destroys all blocks that aren't associated with 'The End' + * inside the given bounding box. + */ + private boolean destroyBlocksInAABB(AxisAlignedBB parAxisAlignedBB) { + int i = MathHelper.floor_double(parAxisAlignedBB.minX); + int j = MathHelper.floor_double(parAxisAlignedBB.minY); + int k = MathHelper.floor_double(parAxisAlignedBB.minZ); + int l = MathHelper.floor_double(parAxisAlignedBB.maxX); + int i1 = MathHelper.floor_double(parAxisAlignedBB.maxY); + int j1 = MathHelper.floor_double(parAxisAlignedBB.maxZ); + boolean flag = false; + boolean flag1 = false; + + for (int k1 = i; k1 <= l; ++k1) { + for (int l1 = j; l1 <= i1; ++l1) { + for (int i2 = k; i2 <= j1; ++i2) { + BlockPos blockpos = new BlockPos(k1, l1, i2); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + if (block.getMaterial() != Material.air) { + if (block != Blocks.barrier && block != Blocks.obsidian && block != Blocks.end_stone + && block != Blocks.bedrock && block != Blocks.command_block + && this.worldObj.getGameRules().getBoolean("mobGriefing")) { + flag1 = this.worldObj.setBlockToAir(blockpos) || flag1; + } else { + flag = true; + } + } + } + } + } + + if (flag1) { + double d0 = parAxisAlignedBB.minX + + (parAxisAlignedBB.maxX - parAxisAlignedBB.minX) * (double) this.rand.nextFloat(); + double d1 = parAxisAlignedBB.minY + + (parAxisAlignedBB.maxY - parAxisAlignedBB.minY) * (double) this.rand.nextFloat(); + double d2 = parAxisAlignedBB.minZ + + (parAxisAlignedBB.maxZ - parAxisAlignedBB.minZ) * (double) this.rand.nextFloat(); + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + return flag; + } + + public boolean attackEntityFromPart(EntityDragonPart entitydragonpart, DamageSource damagesource, float f) { + if (entitydragonpart != this.dragonPartHead) { + f = f / 4.0F + 1.0F; + } + + float f1 = this.rotationYaw * 3.1415927F / 180.0F; + float f2 = MathHelper.sin(f1); + float f3 = MathHelper.cos(f1); + this.targetX = this.posX + (double) (f2 * 5.0F) + (double) ((this.rand.nextFloat() - 0.5F) * 2.0F); + this.targetY = this.posY + (double) (this.rand.nextFloat() * 3.0F) + 1.0D; + this.targetZ = this.posZ - (double) (f3 * 5.0F) + (double) ((this.rand.nextFloat() - 0.5F) * 2.0F); + this.target = null; + if (damagesource.getEntity() instanceof EntityPlayer || damagesource.isExplosion()) { + this.attackDragonFrom(damagesource, f); + } + + return true; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (damagesource instanceof EntityDamageSource && ((EntityDamageSource) damagesource).getIsThornsDamage()) { + this.attackDragonFrom(damagesource, f); + } + + return false; + } + + /**+ + * Provides a way to cause damage to an ender dragon. + */ + protected boolean attackDragonFrom(DamageSource source, float amount) { + return super.attackEntityFrom(source, amount); + } + + /**+ + * Called by the /kill command. + */ + public void onKillCommand() { + this.setDead(); + } + + /**+ + * handles entity death timer, experience orb and particle + * creation + */ + protected void onDeathUpdate() { + ++this.deathTicks; + if (this.deathTicks >= 180 && this.deathTicks <= 200) { + float f = (this.rand.nextFloat() - 0.5F) * 8.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 4.0F; + float f2 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX + (double) f, + this.posY + 2.0D + (double) f1, this.posZ + (double) f2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + boolean flag = this.worldObj.getGameRules().getBoolean("doMobLoot"); + { + if (this.deathTicks > 150 && this.deathTicks % 5 == 0 && flag) { + int i = 1000; + + while (i > 0) { + int k = EntityXPOrb.getXPSplit(i); + i -= k; + this.worldObj + .spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, k)); + } + } + + if (this.deathTicks == 1) { + this.worldObj.playBroadcastSound(1018, new BlockPos(this), 0); + } + } + + this.moveEntity(0.0D, 0.10000000149011612D, 0.0D); + this.renderYawOffset = this.rotationYaw += 20.0F; + if (this.deathTicks == 200) { + if (flag) { + int j = 2000; + + while (j > 0) { + int l = EntityXPOrb.getXPSplit(j); + j -= l; + this.worldObj + .spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, l)); + } + } + + this.generatePortal(new BlockPos(this.posX, 64.0D, this.posZ)); + this.setDead(); + } + + } + + /**+ + * Generate the portal when the dragon dies + */ + private void generatePortal(BlockPos pos) { + boolean flag = true; + double d0 = 12.25D; + double d1 = 6.25D; + + for (int i = -1; i <= 32; ++i) { + for (int j = -4; j <= 4; ++j) { + for (int k = -4; k <= 4; ++k) { + double d2 = (double) (j * j + k * k); + if (d2 <= 12.25D) { + BlockPos blockpos = pos.add(j, i, k); + if (i < 0) { + if (d2 <= 6.25D) { + this.worldObj.setBlockState(blockpos, Blocks.bedrock.getDefaultState()); + } + } else if (i > 0) { + this.worldObj.setBlockState(blockpos, Blocks.air.getDefaultState()); + } else if (d2 > 6.25D) { + this.worldObj.setBlockState(blockpos, Blocks.bedrock.getDefaultState()); + } else { + this.worldObj.setBlockState(blockpos, Blocks.end_portal.getDefaultState()); + } + } + } + } + } + + this.worldObj.setBlockState(pos, Blocks.bedrock.getDefaultState()); + this.worldObj.setBlockState(pos.up(), Blocks.bedrock.getDefaultState()); + BlockPos blockpos1 = pos.up(2); + this.worldObj.setBlockState(blockpos1, Blocks.bedrock.getDefaultState()); + this.worldObj.setBlockState(blockpos1.west(), + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.EAST)); + this.worldObj.setBlockState(blockpos1.east(), + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.WEST)); + this.worldObj.setBlockState(blockpos1.north(), + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.SOUTH)); + this.worldObj.setBlockState(blockpos1.south(), + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.NORTH)); + this.worldObj.setBlockState(pos.up(3), Blocks.bedrock.getDefaultState()); + this.worldObj.setBlockState(pos.up(4), Blocks.dragon_egg.getDefaultState()); + } + + /**+ + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() { + } + + /**+ + * Return the Entity parts making up this Entity (currently only + * for dragons) + */ + public Entity[] getParts() { + return this.dragonPartArray; + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + public World getWorld() { + return this.worldObj; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.enderdragon.growl"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.enderdragon.hit"; + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 5.0F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragonPart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragonPart.java new file mode 100644 index 0000000..21c995b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragonPart.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityMultiPart; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityDragonPart extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/boss/EntityDragonPart"); + } + + public final IEntityMultiPart entityDragonObj; + public final String partName; + + public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight) { + super(parent.getWorld()); + this.setSize(base, sizeHeight); + this.entityDragonObj = parent; + this.partName = partName; + } + + protected void entityInit() { + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound var1) { + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound var1) { + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + return this.isEntityInvulnerable(damagesource) ? false + : this.entityDragonObj.attackEntityFromPart(this, damagesource, f); + } + + /**+ + * Returns true if Entity argument is equal to this Entity + */ + public boolean isEntityEqual(Entity entity) { + return this == entity || this.entityDragonObj == entity; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityWither.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityWither.java new file mode 100644 index 0000000..0272e9f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityWither.java @@ -0,0 +1,600 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IRangedAttackMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIArrowAttack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.IBossDisplayData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityWitherSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/boss/EntityWither"); + } + + private float[] field_82220_d = new float[2]; + private float[] field_82221_e = new float[2]; + private float[] field_82217_f = new float[2]; + private float[] field_82218_g = new float[2]; + private int[] field_82223_h = new int[2]; + private int[] field_82224_i = new int[2]; + private int blockBreakCounter; + /**+ + * Selector used to determine the entities a wither boss should + * attack. + */ + private static final Predicate attackEntitySelector = new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof EntityLivingBase + && ((EntityLivingBase) entity).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; + } + }; + + public EntityWither(World worldIn) { + super(worldIn); + this.setHealth(this.getMaxHealth()); + this.setSize(0.9F, 3.5F); + this.isImmuneToFire = true; + ((PathNavigateGround) this.getNavigator()).setCanSwim(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 40, 20.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, + new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, attackEntitySelector)); + this.experienceValue = 50; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(0)); + this.dataWatcher.addObject(19, new Integer(0)); + this.dataWatcher.addObject(20, new Integer(0)); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("Invul", this.getInvulTime()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setInvulTime(nbttagcompound.getInteger("Invul")); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.wither.idle"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.wither.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.wither.death"; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + this.motionY *= 0.6000000238418579D; + if (this.getWatchedTargetId(0) > 0) { + Entity entity = this.worldObj.getEntityByID(this.getWatchedTargetId(0)); + if (entity != null) { + if (this.posY < entity.posY || !this.isArmored() && this.posY < entity.posY + 5.0D) { + if (this.motionY < 0.0D) { + this.motionY = 0.0D; + } + + this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; + } + + double d0 = entity.posX - this.posX; + double d1 = entity.posZ - this.posZ; + double d3 = d0 * d0 + d1 * d1; + if (d3 > 9.0D) { + double d5 = (double) MathHelper.sqrt_double(d3); + this.motionX += (d0 / d5 * 0.5D - this.motionX) * 0.6000000238418579D; + this.motionZ += (d1 / d5 * 0.5D - this.motionZ) * 0.6000000238418579D; + } + } + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) { + this.rotationYaw = (float) MathHelper.func_181159_b(this.motionZ, this.motionX) * 57.295776F - 90.0F; + } + + super.onLivingUpdate(); + + for (int i = 0; i < 2; ++i) { + this.field_82218_g[i] = this.field_82221_e[i]; + this.field_82217_f[i] = this.field_82220_d[i]; + } + + for (int j = 0; j < 2; ++j) { + int k = this.getWatchedTargetId(j + 1); + Entity entity1 = null; + if (k > 0) { + entity1 = this.worldObj.getEntityByID(k); + } + + if (entity1 != null) { + double d11 = this.func_82214_u(j + 1); + double d12 = this.func_82208_v(j + 1); + double d13 = this.func_82213_w(j + 1); + double d6 = entity1.posX - d11; + double d7 = entity1.posY + (double) entity1.getEyeHeight() - d12; + double d8 = entity1.posZ - d13; + double d9 = (double) MathHelper.sqrt_double(d6 * d6 + d8 * d8); + float f = (float) (MathHelper.func_181159_b(d8, d6) * 180.0D / 3.1415927410125732D) - 90.0F; + float f1 = (float) (-(MathHelper.func_181159_b(d7, d9) * 180.0D / 3.1415927410125732D)); + this.field_82220_d[j] = this.func_82204_b(this.field_82220_d[j], f1, 40.0F); + this.field_82221_e[j] = this.func_82204_b(this.field_82221_e[j], f, 10.0F); + } else { + this.field_82221_e[j] = this.func_82204_b(this.field_82221_e[j], this.renderYawOffset, 10.0F); + } + } + + boolean flag = this.isArmored(); + + for (int l = 0; l < 3; ++l) { + double d10 = this.func_82214_u(l); + double d2 = this.func_82208_v(l); + double d4 = this.func_82213_w(l); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, + d10 + this.rand.nextGaussian() * 0.30000001192092896D, + d2 + this.rand.nextGaussian() * 0.30000001192092896D, + d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D, new int[0]); + if (flag && this.worldObj.rand.nextInt(4) == 0) { + this.worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB, + d10 + this.rand.nextGaussian() * 0.30000001192092896D, + d2 + this.rand.nextGaussian() * 0.30000001192092896D, + d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, + 0.5D, new int[0]); + } + } + + if (this.getInvulTime() > 0) { + for (int i1 = 0; i1 < 3; ++i1) { + this.worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB, this.posX + this.rand.nextGaussian() * 1.0D, + this.posY + (double) (this.rand.nextFloat() * 3.3F), + this.posZ + this.rand.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, + 0.8999999761581421D, new int[0]); + } + } + + } + + protected void updateAITasks() { + if (this.getInvulTime() > 0) { + int j1 = this.getInvulTime() - 1; + if (j1 <= 0) { + this.worldObj.newExplosion(this, this.posX, this.posY + (double) this.getEyeHeight(), this.posZ, 7.0F, + false, this.worldObj.getGameRules().getBoolean("mobGriefing")); + this.worldObj.playBroadcastSound(1013, new BlockPos(this), 0); + } + + this.setInvulTime(j1); + if (this.ticksExisted % 10 == 0) { + this.heal(10.0F); + } + + } else { + super.updateAITasks(); + + for (int i = 1; i < 3; ++i) { + if (this.ticksExisted >= this.field_82223_h[i - 1]) { + this.field_82223_h[i - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); + if (this.worldObj.getDifficulty() == EnumDifficulty.NORMAL + || this.worldObj.getDifficulty() == EnumDifficulty.HARD) { + int j3 = i - 1; + int k3 = this.field_82224_i[i - 1]; + this.field_82224_i[j3] = this.field_82224_i[i - 1] + 1; + if (k3 > 15) { + float f = 10.0F; + float f1 = 5.0F; + double d0 = MathHelper.getRandomDoubleInRange(this.rand, this.posX - (double) f, + this.posX + (double) f); + double d1 = MathHelper.getRandomDoubleInRange(this.rand, this.posY - (double) f1, + this.posY + (double) f1); + double d2 = MathHelper.getRandomDoubleInRange(this.rand, this.posZ - (double) f, + this.posZ + (double) f); + this.launchWitherSkullToCoords(i + 1, d0, d1, d2, true); + this.field_82224_i[i - 1] = 0; + } + } + + int k1 = this.getWatchedTargetId(i); + if (k1 > 0) { + Entity entity = this.worldObj.getEntityByID(k1); + if (entity != null && entity.isEntityAlive() && this.getDistanceSqToEntity(entity) <= 900.0D + && this.canEntityBeSeen(entity)) { + if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.disableDamage) { + this.updateWatchedTargetId(i, 0); + } else { + this.launchWitherSkullToEntity(i + 1, (EntityLivingBase) entity); + this.field_82223_h[i - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); + this.field_82224_i[i - 1] = 0; + } + } else { + this.updateWatchedTargetId(i, 0); + } + } else { + List list = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, + this.getEntityBoundingBox().expand(20.0D, 8.0D, 20.0D), + Predicates.and(attackEntitySelector, EntitySelectors.NOT_SPECTATING)); + + for (int j2 = 0; j2 < 10 && !list.isEmpty(); ++j2) { + EntityLivingBase entitylivingbase = (EntityLivingBase) list + .get(this.rand.nextInt(list.size())); + if (entitylivingbase != this && entitylivingbase.isEntityAlive() + && this.canEntityBeSeen(entitylivingbase)) { + if (entitylivingbase instanceof EntityPlayer) { + if (!((EntityPlayer) entitylivingbase).capabilities.disableDamage) { + this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); + } + } else { + this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); + } + break; + } + + list.remove(entitylivingbase); + } + } + } + } + + if (this.getAttackTarget() != null) { + this.updateWatchedTargetId(0, this.getAttackTarget().getEntityId()); + } else { + this.updateWatchedTargetId(0, 0); + } + + if (this.blockBreakCounter > 0) { + --this.blockBreakCounter; + if (this.blockBreakCounter == 0 && this.worldObj.getGameRules().getBoolean("mobGriefing")) { + int i1 = MathHelper.floor_double(this.posY); + int l1 = MathHelper.floor_double(this.posX); + int i2 = MathHelper.floor_double(this.posZ); + boolean flag = false; + + for (int k2 = -1; k2 <= 1; ++k2) { + for (int l2 = -1; l2 <= 1; ++l2) { + for (int j = 0; j <= 3; ++j) { + int i3 = l1 + k2; + int k = i1 + j; + int l = i2 + l2; + BlockPos blockpos = new BlockPos(i3, k, l); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + if (block.getMaterial() != Material.air && func_181033_a(block)) { + flag = this.worldObj.destroyBlock(blockpos, true) || flag; + } + } + } + } + + if (flag) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1012, new BlockPos(this), 0); + } + } + } + + if (this.ticksExisted % 20 == 0) { + this.heal(1.0F); + } + + } + } + + public static boolean func_181033_a(Block parBlock) { + return parBlock != Blocks.bedrock && parBlock != Blocks.end_portal && parBlock != Blocks.end_portal_frame + && parBlock != Blocks.command_block && parBlock != Blocks.barrier; + } + + public void func_82206_m() { + this.setInvulTime(220); + this.setHealth(this.getMaxHealth() / 3.0F); + } + + /**+ + * Sets the Entity inside a web block. + */ + public void setInWeb() { + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return 4; + } + + private double func_82214_u(int parInt1) { + if (parInt1 <= 0) { + return this.posX; + } else { + float f = (this.renderYawOffset + (float) (180 * (parInt1 - 1))) / 180.0F * 3.1415927F; + float f1 = MathHelper.cos(f); + return this.posX + (double) f1 * 1.3D; + } + } + + private double func_82208_v(int parInt1) { + return parInt1 <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + } + + private double func_82213_w(int parInt1) { + if (parInt1 <= 0) { + return this.posZ; + } else { + float f = (this.renderYawOffset + (float) (180 * (parInt1 - 1))) / 180.0F * 3.1415927F; + float f1 = MathHelper.sin(f); + return this.posZ + (double) f1 * 1.3D; + } + } + + private float func_82204_b(float parFloat1, float parFloat2, float parFloat3) { + float f = MathHelper.wrapAngleTo180_float(parFloat2 - parFloat1); + if (f > parFloat3) { + f = parFloat3; + } + + if (f < -parFloat3) { + f = -parFloat3; + } + + return parFloat1 + f; + } + + private void launchWitherSkullToEntity(int parInt1, EntityLivingBase parEntityLivingBase) { + this.launchWitherSkullToCoords(parInt1, parEntityLivingBase.posX, + parEntityLivingBase.posY + (double) parEntityLivingBase.getEyeHeight() * 0.5D, parEntityLivingBase.posZ, + parInt1 == 0 && this.rand.nextFloat() < 0.001F); + } + + /**+ + * Launches a Wither skull toward (par2, par4, par6) + */ + private void launchWitherSkullToCoords(int x, double y, double z, double invulnerable, boolean parFlag) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1014, new BlockPos(this), 0); + double d0 = this.func_82214_u(x); + double d1 = this.func_82208_v(x); + double d2 = this.func_82213_w(x); + double d3 = y - d0; + double d4 = z - d1; + double d5 = invulnerable - d2; + EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.worldObj, this, d3, d4, d5); + if (parFlag) { + entitywitherskull.setInvulnerable(true); + } + + entitywitherskull.posY = d1; + entitywitherskull.posX = d0; + entitywitherskull.posZ = d2; + this.worldObj.spawnEntityInWorld(entitywitherskull); + } + + /**+ + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float var2) { + this.launchWitherSkullToEntity(0, entitylivingbase); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (damagesource != DamageSource.drown && !(damagesource.getEntity() instanceof EntityWither)) { + if (this.getInvulTime() > 0 && damagesource != DamageSource.outOfWorld) { + return false; + } else { + if (this.isArmored()) { + Entity entity = damagesource.getSourceOfDamage(); + if (entity instanceof EntityArrow) { + return false; + } + } + + Entity entity1 = damagesource.getEntity(); + if (entity1 != null && !(entity1 instanceof EntityPlayer) && entity1 instanceof EntityLivingBase + && ((EntityLivingBase) entity1).getCreatureAttribute() == this.getCreatureAttribute()) { + return false; + } else { + if (this.blockBreakCounter <= 0) { + this.blockBreakCounter = 20; + } + + for (int i = 0; i < this.field_82224_i.length; ++i) { + this.field_82224_i[i] += 3; + } + + return super.attackEntityFrom(damagesource, f); + } + } + } else { + return false; + } + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int var2) { + EntityItem entityitem = this.dropItem(Items.nether_star, 1); + if (entityitem != null) { + entityitem.setNoDespawn(); + } + + { + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + this.getEntityBoundingBox().expand(50.0D, 100.0D, 50.0D))) { + entityplayer.triggerAchievement(AchievementList.killWither); + } + } + + } + + /**+ + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() { + this.entityAge = 0; + } + + public int getBrightnessForRender(float var1) { + return 15728880; + } + + public void fall(float var1, float var2) { + } + + /**+ + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect var1) { + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + } + + public float func_82207_a(int parInt1) { + return this.field_82221_e[parInt1]; + } + + public float func_82210_r(int parInt1) { + return this.field_82220_d[parInt1]; + } + + public int getInvulTime() { + return this.dataWatcher.getWatchableObjectInt(20); + } + + public void setInvulTime(int parInt1) { + this.dataWatcher.updateObject(20, Integer.valueOf(parInt1)); + } + + /**+ + * Returns the target entity ID if present, or -1 if not @param + * par1 The target offset, should be from 0-2 + */ + public int getWatchedTargetId(int parInt1) { + return this.dataWatcher.getWatchableObjectInt(17 + parInt1); + } + + /**+ + * Updates the target entity ID + */ + public void updateWatchedTargetId(int targetOffset, int newId) { + this.dataWatcher.updateObject(17 + targetOffset, Integer.valueOf(newId)); + } + + /**+ + * Returns whether the wither is armored with its boss armor or + * not by checking whether its health is below half of its + * maximum. + */ + public boolean isArmored() { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + /**+ + * Called when a player mounts an entity. e.g. mounts a pig, + * mounts a boat. + */ + public void mountEntity(Entity var1) { + this.ridingEntity = null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/IBossDisplayData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/IBossDisplayData.java new file mode 100644 index 0000000..de88152 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/IBossDisplayData.java @@ -0,0 +1,35 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IBossDisplayData { + float getMaxHealth(); + + float getHealth(); + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + IChatComponent getDisplayName(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityLightningBolt.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityLightningBolt.java new file mode 100644 index 0000000..bee472b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityLightningBolt.java @@ -0,0 +1,133 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityWeatherEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityLightningBolt extends EntityWeatherEffect { + + static { + __checkIntegratedContextValid("net/minecraft/entity/effect/EntityLightningBolt"); + } + + private int lightningState; + public long boltVertex; + private int boltLivingTime; + + public EntityLightningBolt(World worldIn, double posX, double posY, double posZ) { + super(worldIn); + this.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F); + this.lightningState = 2; + this.boltVertex = this.rand.nextLong(); + this.boltLivingTime = this.rand.nextInt(3) + 1; + BlockPos blockpos = new BlockPos(this); + if (worldIn.getGameRules().getBoolean("doFireTick") + && (worldIn.getDifficulty() == EnumDifficulty.NORMAL || worldIn.getDifficulty() == EnumDifficulty.HARD) + && worldIn.isAreaLoaded(blockpos, 10)) { + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air + && Blocks.fire.canPlaceBlockAt(worldIn, blockpos)) { + worldIn.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + + for (int i = 0; i < 4; ++i) { + BlockPos blockpos1 = blockpos.add(this.rand.nextInt(3) - 1, this.rand.nextInt(3) - 1, + this.rand.nextInt(3) - 1); + if (worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air + && Blocks.fire.canPlaceBlockAt(worldIn, blockpos1)) { + worldIn.setBlockState(blockpos1, Blocks.fire.getDefaultState()); + } + } + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.lightningState == 2) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, + 0.8F + this.rand.nextFloat() * 0.2F); + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, + 0.5F + this.rand.nextFloat() * 0.2F); + } + + --this.lightningState; + if (this.lightningState < 0) { + if (this.boltLivingTime == 0) { + this.setDead(); + } else if (this.lightningState < -this.rand.nextInt(10)) { + --this.boltLivingTime; + this.lightningState = 1; + this.boltVertex = this.rand.nextLong(); + BlockPos blockpos = new BlockPos(this); + if (this.worldObj.getGameRules().getBoolean("doFireTick") && this.worldObj.isAreaLoaded(blockpos, 10) + && this.worldObj.getBlockState(blockpos).getBlock().getMaterial() == Material.air + && Blocks.fire.canPlaceBlockAt(this.worldObj, blockpos)) { + this.worldObj.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + } + } + + if (this.lightningState >= 0) { + { + double d0 = 3.0D; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, new AxisAlignedBB(this.posX - d0, + this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0)); + + for (int i = 0; i < list.size(); ++i) { + Entity entity = (Entity) list.get(i); + entity.onStruckByLightning(this); + } + } + } + + } + + protected void entityInit() { + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound var1) { + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound var1) { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityWeatherEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityWeatherEffect.java new file mode 100644 index 0000000..d8488ac --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityWeatherEffect.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityWeatherEffect extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/effect/EntityWeatherEffect"); + } + + public EntityWeatherEffect(World worldIn) { + super(worldIn); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityArmorStand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityArmorStand.java new file mode 100644 index 0000000..e6f3191 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityArmorStand.java @@ -0,0 +1,796 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Rotations; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityArmorStand extends EntityLivingBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityArmorStand"); + } + + private static final Rotations DEFAULT_HEAD_ROTATION = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_BODY_ROTATION = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_LEFTARM_ROTATION = new Rotations(-10.0F, 0.0F, -10.0F); + private static final Rotations DEFAULT_RIGHTARM_ROTATION = new Rotations(-15.0F, 0.0F, 10.0F); + private static final Rotations DEFAULT_LEFTLEG_ROTATION = new Rotations(-1.0F, 0.0F, -1.0F); + private static final Rotations DEFAULT_RIGHTLEG_ROTATION = new Rotations(1.0F, 0.0F, 1.0F); + private final ItemStack[] contents; + private boolean canInteract; + private long punchCooldown; + private int disabledSlots; + private boolean field_181028_bj; + private Rotations headRotation; + private Rotations bodyRotation; + private Rotations leftArmRotation; + private Rotations rightArmRotation; + private Rotations leftLegRotation; + private Rotations rightLegRotation; + + public EntityArmorStand(World worldIn) { + super(worldIn); + this.contents = new ItemStack[5]; + this.headRotation = DEFAULT_HEAD_ROTATION; + this.bodyRotation = DEFAULT_BODY_ROTATION; + this.leftArmRotation = DEFAULT_LEFTARM_ROTATION; + this.rightArmRotation = DEFAULT_RIGHTARM_ROTATION; + this.leftLegRotation = DEFAULT_LEFTLEG_ROTATION; + this.rightLegRotation = DEFAULT_RIGHTLEG_ROTATION; + this.setSilent(true); + this.noClip = this.hasNoGravity(); + this.setSize(0.5F, 1.975F); + } + + public EntityArmorStand(World worldIn, double posX, double posY, double posZ) { + this(worldIn); + this.setPosition(posX, posY, posZ); + } + + /**+ + * Returns whether the entity is in a server world + */ + public boolean isServerWorld() { + return super.isServerWorld() && !this.hasNoGravity(); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(10, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(11, DEFAULT_HEAD_ROTATION); + this.dataWatcher.addObject(12, DEFAULT_BODY_ROTATION); + this.dataWatcher.addObject(13, DEFAULT_LEFTARM_ROTATION); + this.dataWatcher.addObject(14, DEFAULT_RIGHTARM_ROTATION); + this.dataWatcher.addObject(15, DEFAULT_LEFTLEG_ROTATION); + this.dataWatcher.addObject(16, DEFAULT_RIGHTLEG_ROTATION); + } + + /**+ + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() { + return this.contents[0]; + } + + /**+ + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int i) { + return this.contents[i]; + } + + public ItemStack getCurrentArmor(int i) { + return this.contents[i + 1]; + } + + /**+ + * Sets the held item, or an armor slot. Slot 0 is held item. + * Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int i, ItemStack itemstack) { + this.contents[i] = itemstack; + } + + /**+ + * returns the inventory of this entity (only used in + * EntityPlayerMP it seems) + */ + public ItemStack[] getInventory() { + return this.contents; + } + + public boolean replaceItemInInventory(int i, ItemStack itemstack) { + int j; + if (i == 99) { + j = 0; + } else { + j = i - 100 + 1; + if (j < 0 || j >= this.contents.length) { + return false; + } + } + + if (itemstack != null && EntityLiving.getArmorPosition(itemstack) != j + && (j != 4 || !(itemstack.getItem() instanceof ItemBlock))) { + return false; + } else { + this.setCurrentItemOrArmor(j, itemstack); + return true; + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.contents.length; ++i) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + if (this.contents[i] != null) { + this.contents[i].writeToNBT(nbttagcompound1); + } + + nbttaglist.appendTag(nbttagcompound1); + } + + nbttagcompound.setTag("Equipment", nbttaglist); + if (this.getAlwaysRenderNameTag() + && (this.getCustomNameTag() == null || this.getCustomNameTag().length() == 0)) { + nbttagcompound.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); + } + + nbttagcompound.setBoolean("Invisible", this.isInvisible()); + nbttagcompound.setBoolean("Small", this.isSmall()); + nbttagcompound.setBoolean("ShowArms", this.getShowArms()); + nbttagcompound.setInteger("DisabledSlots", this.disabledSlots); + nbttagcompound.setBoolean("NoGravity", this.hasNoGravity()); + nbttagcompound.setBoolean("NoBasePlate", this.hasNoBasePlate()); + if (this.func_181026_s()) { + nbttagcompound.setBoolean("Marker", this.func_181026_s()); + } + + nbttagcompound.setTag("Pose", this.readPoseFromNBT()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("Equipment", 9)) { + NBTTagList nbttaglist = nbttagcompound.getTagList("Equipment", 10); + + for (int i = 0; i < this.contents.length; ++i) { + this.contents[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + } + } + + this.setInvisible(nbttagcompound.getBoolean("Invisible")); + this.setSmall(nbttagcompound.getBoolean("Small")); + this.setShowArms(nbttagcompound.getBoolean("ShowArms")); + this.disabledSlots = nbttagcompound.getInteger("DisabledSlots"); + this.setNoGravity(nbttagcompound.getBoolean("NoGravity")); + this.setNoBasePlate(nbttagcompound.getBoolean("NoBasePlate")); + this.func_181027_m(nbttagcompound.getBoolean("Marker")); + this.field_181028_bj = !this.func_181026_s(); + this.noClip = this.hasNoGravity(); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Pose"); + this.writePoseToNBT(nbttagcompound1); + } + + /**+ + * Saves the pose to an NBTTagCompound. + */ + private void writePoseToNBT(NBTTagCompound tagCompound) { + NBTTagList nbttaglist = tagCompound.getTagList("Head", 5); + if (nbttaglist.tagCount() > 0) { + this.setHeadRotation(new Rotations(nbttaglist)); + } else { + this.setHeadRotation(DEFAULT_HEAD_ROTATION); + } + + NBTTagList nbttaglist1 = tagCompound.getTagList("Body", 5); + if (nbttaglist1.tagCount() > 0) { + this.setBodyRotation(new Rotations(nbttaglist1)); + } else { + this.setBodyRotation(DEFAULT_BODY_ROTATION); + } + + NBTTagList nbttaglist2 = tagCompound.getTagList("LeftArm", 5); + if (nbttaglist2.tagCount() > 0) { + this.setLeftArmRotation(new Rotations(nbttaglist2)); + } else { + this.setLeftArmRotation(DEFAULT_LEFTARM_ROTATION); + } + + NBTTagList nbttaglist3 = tagCompound.getTagList("RightArm", 5); + if (nbttaglist3.tagCount() > 0) { + this.setRightArmRotation(new Rotations(nbttaglist3)); + } else { + this.setRightArmRotation(DEFAULT_RIGHTARM_ROTATION); + } + + NBTTagList nbttaglist4 = tagCompound.getTagList("LeftLeg", 5); + if (nbttaglist4.tagCount() > 0) { + this.setLeftLegRotation(new Rotations(nbttaglist4)); + } else { + this.setLeftLegRotation(DEFAULT_LEFTLEG_ROTATION); + } + + NBTTagList nbttaglist5 = tagCompound.getTagList("RightLeg", 5); + if (nbttaglist5.tagCount() > 0) { + this.setRightLegRotation(new Rotations(nbttaglist5)); + } else { + this.setRightLegRotation(DEFAULT_RIGHTLEG_ROTATION); + } + + } + + private NBTTagCompound readPoseFromNBT() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + if (!DEFAULT_HEAD_ROTATION.equals(this.headRotation)) { + nbttagcompound.setTag("Head", this.headRotation.writeToNBT()); + } + + if (!DEFAULT_BODY_ROTATION.equals(this.bodyRotation)) { + nbttagcompound.setTag("Body", this.bodyRotation.writeToNBT()); + } + + if (!DEFAULT_LEFTARM_ROTATION.equals(this.leftArmRotation)) { + nbttagcompound.setTag("LeftArm", this.leftArmRotation.writeToNBT()); + } + + if (!DEFAULT_RIGHTARM_ROTATION.equals(this.rightArmRotation)) { + nbttagcompound.setTag("RightArm", this.rightArmRotation.writeToNBT()); + } + + if (!DEFAULT_LEFTLEG_ROTATION.equals(this.leftLegRotation)) { + nbttagcompound.setTag("LeftLeg", this.leftLegRotation.writeToNBT()); + } + + if (!DEFAULT_RIGHTLEG_ROTATION.equals(this.rightLegRotation)) { + nbttagcompound.setTag("RightLeg", this.rightLegRotation.writeToNBT()); + } + + return nbttagcompound; + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return false; + } + + protected void collideWithEntity(Entity var1) { + } + + protected void collideWithNearbyEntities() { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()); + if (list != null && !list.isEmpty()) { + for (int i = 0; i < list.size(); ++i) { + Entity entity = (Entity) list.get(i); + if (entity instanceof EntityMinecart + && ((EntityMinecart) entity).getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE + && this.getDistanceSqToEntity(entity) <= 0.2D) { + entity.applyEntityCollision(this); + } + } + } + + } + + /**+ + * New version of interactWith that includes vector information + * on where precisely the player targeted. + */ + public boolean interactAt(EntityPlayer entityplayer, Vec3 vec3) { + if (this.func_181026_s()) { + return false; + } else if (!entityplayer.isSpectator()) { + byte b0 = 0; + ItemStack itemstack = entityplayer.getCurrentEquippedItem(); + boolean flag = itemstack != null; + if (flag && itemstack.getItem() instanceof ItemArmor) { + ItemArmor itemarmor = (ItemArmor) itemstack.getItem(); + if (itemarmor.armorType == 3) { + b0 = 1; + } else if (itemarmor.armorType == 2) { + b0 = 2; + } else if (itemarmor.armorType == 1) { + b0 = 3; + } else if (itemarmor.armorType == 0) { + b0 = 4; + } + } + + if (flag && (itemstack.getItem() == Items.skull + || itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))) { + b0 = 4; + } + + double d4 = 0.1D; + double d0 = 0.9D; + double d1 = 0.4D; + double d2 = 1.6D; + byte b1 = 0; + boolean flag1 = this.isSmall(); + double d3 = flag1 ? vec3.yCoord * 2.0D : vec3.yCoord; + if (d3 >= 0.1D && d3 < 0.1D + (flag1 ? 0.8D : 0.45D) && this.contents[1] != null) { + b1 = 1; + } else if (d3 >= 0.9D + (flag1 ? 0.3D : 0.0D) && d3 < 0.9D + (flag1 ? 1.0D : 0.7D) + && this.contents[3] != null) { + b1 = 3; + } else if (d3 >= 0.4D && d3 < 0.4D + (flag1 ? 1.0D : 0.8D) && this.contents[2] != null) { + b1 = 2; + } else if (d3 >= 1.6D && this.contents[4] != null) { + b1 = 4; + } + + boolean flag2 = this.contents[b1] != null; + if ((this.disabledSlots & 1 << b1) != 0 || (this.disabledSlots & 1 << b0) != 0) { + b1 = b0; + if ((this.disabledSlots & 1 << b0) != 0) { + if ((this.disabledSlots & 1) != 0) { + return true; + } + + b1 = 0; + } + } + + if (flag && b0 == 0 && !this.getShowArms()) { + return true; + } else { + if (flag) { + this.func_175422_a(entityplayer, b0); + } else if (flag2) { + this.func_175422_a(entityplayer, b1); + } + + return true; + } + } else { + return true; + } + } + + private void func_175422_a(EntityPlayer parEntityPlayer, int parInt1) { + ItemStack itemstack = this.contents[parInt1]; + if (itemstack == null || (this.disabledSlots & 1 << parInt1 + 8) == 0) { + if (itemstack != null || (this.disabledSlots & 1 << parInt1 + 16) == 0) { + int i = parEntityPlayer.inventory.currentItem; + ItemStack itemstack1 = parEntityPlayer.inventory.getStackInSlot(i); + if (parEntityPlayer.capabilities.isCreativeMode + && (itemstack == null || itemstack.getItem() == Item.getItemFromBlock(Blocks.air)) + && itemstack1 != null) { + ItemStack itemstack3 = itemstack1.copy(); + itemstack3.stackSize = 1; + this.setCurrentItemOrArmor(parInt1, itemstack3); + } else if (itemstack1 != null && itemstack1.stackSize > 1) { + if (itemstack == null) { + ItemStack itemstack2 = itemstack1.copy(); + itemstack2.stackSize = 1; + this.setCurrentItemOrArmor(parInt1, itemstack2); + --itemstack1.stackSize; + } + } else { + this.setCurrentItemOrArmor(parInt1, itemstack1); + parEntityPlayer.inventory.setInventorySlotContents(i, itemstack); + } + } + } + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float var2) { + if (DamageSource.outOfWorld.equals(damagesource)) { + this.setDead(); + return false; + } else if (!this.isEntityInvulnerable(damagesource) && !this.canInteract && !this.func_181026_s()) { + if (damagesource.isExplosion()) { + this.dropContents(); + this.setDead(); + return false; + } else if (DamageSource.inFire.equals(damagesource)) { + if (!this.isBurning()) { + this.setFire(5); + } else { + this.damageArmorStand(0.15F); + } + + return false; + } else if (DamageSource.onFire.equals(damagesource) && this.getHealth() > 0.5F) { + this.damageArmorStand(4.0F); + return false; + } else { + boolean flag = "arrow".equals(damagesource.getDamageType()); + boolean flag1 = "player".equals(damagesource.getDamageType()); + if (!flag1 && !flag) { + return false; + } else { + if (damagesource.getSourceOfDamage() instanceof EntityArrow) { + damagesource.getSourceOfDamage().setDead(); + } + + if (damagesource.getEntity() instanceof EntityPlayer + && !((EntityPlayer) damagesource.getEntity()).capabilities.allowEdit) { + return false; + } else if (damagesource.isCreativePlayer()) { + this.playParticles(); + this.setDead(); + return false; + } else { + long i = this.worldObj.getTotalWorldTime(); + if (i - this.punchCooldown > 5L && !flag) { + this.punchCooldown = i; + } else { + this.dropBlock(); + this.playParticles(); + this.setDead(); + } + + return false; + } + } + } + } else { + return false; + } + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + if (Double.isNaN(d1) || d1 == 0.0D) { + d1 = 4.0D; + } + + d1 = d1 * 64.0D; + return d0 < d1 * d1; + } + + private void playParticles() { + if (this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, + this.posY + (double) this.height / 1.5D, this.posZ, 10, (double) (this.width / 4.0F), + (double) (this.height / 4.0F), (double) (this.width / 4.0F), 0.05D, + new int[] { Block.getStateId(Blocks.planks.getDefaultState()) }); + } + + } + + private void damageArmorStand(float parFloat1) { + float f = this.getHealth(); + f = f - parFloat1; + if (f <= 0.5F) { + this.dropContents(); + this.setDead(); + } else { + this.setHealth(f); + } + + } + + private void dropBlock() { + Block.spawnAsEntity(this.worldObj, new BlockPos(this), new ItemStack(Items.armor_stand)); + this.dropContents(); + } + + private void dropContents() { + for (int i = 0; i < this.contents.length; ++i) { + if (this.contents[i] != null && this.contents[i].stackSize > 0) { + if (this.contents[i] != null) { + Block.spawnAsEntity(this.worldObj, (new BlockPos(this)).up(), this.contents[i]); + } + + this.contents[i] = null; + } + } + + } + + protected float func_110146_f(float var1, float var2) { + this.prevRenderYawOffset = this.prevRotationYaw; + this.renderYawOffset = this.rotationYaw; + return 0.0F; + } + + public float getEyeHeight() { + return this.isChild() ? this.height * 0.5F : this.height * 0.9F; + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float f, float f1) { + if (!this.hasNoGravity()) { + super.moveEntityWithHeading(f, f1); + } + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + Rotations rotations = this.dataWatcher.getWatchableObjectRotations(11); + if (!this.headRotation.equals(rotations)) { + this.setHeadRotation(rotations); + } + + Rotations rotations1 = this.dataWatcher.getWatchableObjectRotations(12); + if (!this.bodyRotation.equals(rotations1)) { + this.setBodyRotation(rotations1); + } + + Rotations rotations2 = this.dataWatcher.getWatchableObjectRotations(13); + if (!this.leftArmRotation.equals(rotations2)) { + this.setLeftArmRotation(rotations2); + } + + Rotations rotations3 = this.dataWatcher.getWatchableObjectRotations(14); + if (!this.rightArmRotation.equals(rotations3)) { + this.setRightArmRotation(rotations3); + } + + Rotations rotations4 = this.dataWatcher.getWatchableObjectRotations(15); + if (!this.leftLegRotation.equals(rotations4)) { + this.setLeftLegRotation(rotations4); + } + + Rotations rotations5 = this.dataWatcher.getWatchableObjectRotations(16); + if (!this.rightLegRotation.equals(rotations5)) { + this.setRightLegRotation(rotations5); + } + + boolean flag = this.func_181026_s(); + if (!this.field_181028_bj && flag) { + this.func_181550_a(false); + } else { + if (!this.field_181028_bj || flag) { + return; + } + + this.func_181550_a(true); + } + + this.field_181028_bj = flag; + } + + private void func_181550_a(boolean parFlag) { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + if (parFlag) { + this.setSize(0.5F, 1.975F); + } else { + this.setSize(0.0F, 0.0F); + } + + this.setPosition(d0, d1, d2); + } + + /**+ + * Clears potion metadata values if the entity has no potion + * effects. Otherwise, updates potion effect color, ambience, + * and invisibility metadata values + */ + protected void updatePotionMetadata() { + this.setInvisible(this.canInteract); + } + + public void setInvisible(boolean flag) { + this.canInteract = flag; + super.setInvisible(flag); + } + + /**+ + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return this.isSmall(); + } + + /**+ + * Called by the /kill command. + */ + public void onKillCommand() { + this.setDead(); + } + + public boolean isImmuneToExplosions() { + return this.isInvisible(); + } + + private void setSmall(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + if (parFlag) { + b0 = (byte) (b0 | 1); + } else { + b0 = (byte) (b0 & -2); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean isSmall() { + return (this.dataWatcher.getWatchableObjectByte(10) & 1) != 0; + } + + private void setNoGravity(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + if (parFlag) { + b0 = (byte) (b0 | 2); + } else { + b0 = (byte) (b0 & -3); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean hasNoGravity() { + return (this.dataWatcher.getWatchableObjectByte(10) & 2) != 0; + } + + private void setShowArms(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + if (parFlag) { + b0 = (byte) (b0 | 4); + } else { + b0 = (byte) (b0 & -5); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean getShowArms() { + return (this.dataWatcher.getWatchableObjectByte(10) & 4) != 0; + } + + private void setNoBasePlate(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + if (parFlag) { + b0 = (byte) (b0 | 8); + } else { + b0 = (byte) (b0 & -9); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean hasNoBasePlate() { + return (this.dataWatcher.getWatchableObjectByte(10) & 8) != 0; + } + + private void func_181027_m(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + if (parFlag) { + b0 = (byte) (b0 | 16); + } else { + b0 = (byte) (b0 & -17); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean func_181026_s() { + return (this.dataWatcher.getWatchableObjectByte(10) & 16) != 0; + } + + public void setHeadRotation(Rotations parRotations) { + this.headRotation = parRotations; + this.dataWatcher.updateObject(11, parRotations); + } + + public void setBodyRotation(Rotations parRotations) { + this.bodyRotation = parRotations; + this.dataWatcher.updateObject(12, parRotations); + } + + public void setLeftArmRotation(Rotations parRotations) { + this.leftArmRotation = parRotations; + this.dataWatcher.updateObject(13, parRotations); + } + + public void setRightArmRotation(Rotations parRotations) { + this.rightArmRotation = parRotations; + this.dataWatcher.updateObject(14, parRotations); + } + + public void setLeftLegRotation(Rotations parRotations) { + this.leftLegRotation = parRotations; + this.dataWatcher.updateObject(15, parRotations); + } + + public void setRightLegRotation(Rotations parRotations) { + this.rightLegRotation = parRotations; + this.dataWatcher.updateObject(16, parRotations); + } + + public Rotations getHeadRotation() { + return this.headRotation; + } + + public Rotations getBodyRotation() { + return this.bodyRotation; + } + + public Rotations getLeftArmRotation() { + return this.leftArmRotation; + } + + public Rotations getRightArmRotation() { + return this.rightArmRotation; + } + + public Rotations getLeftLegRotation() { + return this.leftLegRotation; + } + + public Rotations getRightLegRotation() { + return this.rightLegRotation; + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return super.canBeCollidedWith() && !this.func_181026_s(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityBoat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityBoat.java new file mode 100644 index 0000000..e7de93e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityBoat.java @@ -0,0 +1,520 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSourceIndirect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityBoat extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityBoat"); + } + + private boolean isBoatEmpty; + private double speedMultiplier; + private int boatPosRotationIncrements; + private double boatX; + private double boatY; + private double boatZ; + private double boatYaw; + private double boatPitch; + private double velocityX; + private double velocityY; + private double velocityZ; + + public EntityBoat(World worldIn) { + super(worldIn); + this.isBoatEmpty = true; + this.speedMultiplier = 0.07D; + this.preventEntitySpawning = true; + this.setSize(1.5F, 0.6F); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + } + + /**+ + * Returns a boundingBox used to collide the entity with other + * entities and blocks. This enables the entity to be pushable + * on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity entity) { + return entity.getEntityBoundingBox(); + } + + /**+ + * Returns the collision bounding box for this entity + */ + public AxisAlignedBB getCollisionBoundingBox() { + return this.getEntityBoundingBox(); + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return true; + } + + public EntityBoat(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + this(worldIn); + this.setPosition(parDouble1, parDouble2, parDouble3); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = parDouble1; + this.prevPosY = parDouble2; + this.prevPosZ = parDouble3; + } + + /**+ + * Returns the Y offset from the entity's position for any + * entity riding this one. + */ + public double getMountedYOffset() { + return -0.3D; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (!this.isDead) { + if (this.riddenByEntity != null && this.riddenByEntity == damagesource.getEntity() + && damagesource instanceof EntityDamageSourceIndirect) { + return false; + } else { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() + f * 10.0F); + this.setBeenAttacked(); + boolean flag = damagesource.getEntity() instanceof EntityPlayer + && ((EntityPlayer) damagesource.getEntity()).capabilities.isCreativeMode; + if (flag || this.getDamageTaken() > 40.0F) { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + + if (!flag && this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.dropItemWithOffset(Items.boat, 1, 0.0F); + } + + this.setDead(); + } + + return true; + } + } else { + return true; + } + } + + /**+ + * Setups the entity to do the hurt animation. Only used by + * packets in multiplayer. + */ + public void performHurtAnimation() { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() * 11.0F); + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int i, boolean flag) { + if (flag && this.riddenByEntity != null) { + this.prevPosX = this.posX = d0; + this.prevPosY = this.posY = d1; + this.prevPosZ = this.posZ = d2; + this.rotationYaw = f; + this.rotationPitch = f1; + this.boatPosRotationIncrements = 0; + this.setPosition(d0, d1, d2); + this.motionX = this.velocityX = 0.0D; + this.motionY = this.velocityY = 0.0D; + this.motionZ = this.velocityZ = 0.0D; + } else { + if (this.isBoatEmpty) { + this.boatPosRotationIncrements = i + 5; + } else { + double d3 = d0 - this.posX; + double d4 = d1 - this.posY; + double d5 = d2 - this.posZ; + double d6 = d3 * d3 + d4 * d4 + d5 * d5; + if (d6 <= 1.0D) { + return; + } + + this.boatPosRotationIncrements = 3; + } + + this.boatX = d0; + this.boatY = d1; + this.boatZ = d2; + this.boatYaw = (double) f; + this.boatPitch = (double) f1; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.velocityX = this.motionX = d0; + this.velocityY = this.motionY = d1; + this.velocityZ = this.motionZ = d2; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.getTimeSinceHit() > 0) { + this.setTimeSinceHit(this.getTimeSinceHit() - 1); + } + + if (this.getDamageTaken() > 0.0F) { + this.setDamageTaken(this.getDamageTaken() - 1.0F); + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + byte b0 = 5; + double d0 = 0.0D; + + for (int i = 0; i < b0; ++i) { + double d1 = this.getEntityBoundingBox().minY + + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double) (i + 0) + / (double) b0 + - 0.125D; + double d3 = this.getEntityBoundingBox().minY + + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double) (i + 1) + / (double) b0 + - 0.125D; + AxisAlignedBB axisalignedbb = new AxisAlignedBB(this.getEntityBoundingBox().minX, d1, + this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().maxX, d3, + this.getEntityBoundingBox().maxZ); + if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.water)) { + d0 += 1.0D / (double) b0; + } + } + + double d9 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d9 > 0.2975D) { + double d2 = Math.cos((double) this.rotationYaw * 3.141592653589793D / 180.0D); + double d4 = Math.sin((double) this.rotationYaw * 3.141592653589793D / 180.0D); + + for (int j = 0; (double) j < 1.0D + d9 * 60.0D; ++j) { + double d5 = (double) (this.rand.nextFloat() * 2.0F - 1.0F); + double d6 = (double) (this.rand.nextInt(2) * 2 - 1) * 0.7D; + if (this.rand.nextBoolean()) { + double d7 = this.posX - d2 * d5 * 0.8D + d4 * d6; + double d8 = this.posZ - d4 * d5 * 0.8D - d2 * d6; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, d7, this.posY - 0.125D, d8, + this.motionX, this.motionY, this.motionZ, new int[0]); + } else { + double d24 = this.posX + d2 + d4 * d5 * 0.7D; + double d25 = this.posZ + d4 - d2 * d5 * 0.7D; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, d24, this.posY - 0.125D, d25, + this.motionX, this.motionY, this.motionZ, new int[0]); + } + } + } + + { + if (d0 < 1.0D) { + double d10 = d0 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * d10; + } else { + if (this.motionY < 0.0D) { + this.motionY /= 2.0D; + } + + this.motionY += 0.007000000216066837D; + } + + if (this.riddenByEntity instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) this.riddenByEntity; + float f = this.riddenByEntity.rotationYaw + -entitylivingbase.moveStrafing * 90.0F; + this.motionX += -Math.sin((double) (f * 3.1415927F / 180.0F)) * this.speedMultiplier + * (double) entitylivingbase.moveForward * 0.05000000074505806D; + this.motionZ += Math.cos((double) (f * 3.1415927F / 180.0F)) * this.speedMultiplier + * (double) entitylivingbase.moveForward * 0.05000000074505806D; + } + + double d11 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d11 > 0.35D) { + double d14 = 0.35D / d11; + this.motionX *= d14; + this.motionZ *= d14; + d11 = 0.35D; + } + + if (d11 > d9 && this.speedMultiplier < 0.35D) { + this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; + if (this.speedMultiplier > 0.35D) { + this.speedMultiplier = 0.35D; + } + } else { + this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; + if (this.speedMultiplier < 0.07D) { + this.speedMultiplier = 0.07D; + } + } + + for (int l = 0; l < 4; ++l) { + int k1 = MathHelper.floor_double(this.posX + ((double) (l % 2) - 0.5D) * 0.8D); + int l1 = MathHelper.floor_double(this.posZ + ((double) (l / 2) - 0.5D) * 0.8D); + + for (int i2 = 0; i2 < 2; ++i2) { + int k = MathHelper.floor_double(this.posY) + i2; + BlockPos blockpos = new BlockPos(k1, k, l1); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + if (block == Blocks.snow_layer) { + this.worldObj.setBlockToAir(blockpos); + this.isCollidedHorizontally = false; + } else if (block == Blocks.waterlily) { + this.worldObj.destroyBlock(blockpos, true); + this.isCollidedHorizontally = false; + } + } + } + + if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + if (this.isCollidedHorizontally && d9 > 0.2975D) { + if (!this.isDead) { + this.setDead(); + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + for (int i1 = 0; i1 < 3; ++i1) { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (int j1 = 0; j1 < 2; ++j1) { + this.dropItemWithOffset(Items.stick, 1, 0.0F); + } + } + } + } else { + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + + this.rotationPitch = 0.0F; + double d15 = (double) this.rotationYaw; + double d18 = this.prevPosX - this.posX; + double d21 = this.prevPosZ - this.posZ; + if (d18 * d18 + d21 * d21 > 0.001D) { + d15 = (double) ((float) (MathHelper.func_181159_b(d21, d18) * 180.0D / 3.141592653589793D)); + } + + double d23 = MathHelper.wrapAngleTo180_double(d15 - (double) this.rotationYaw); + if (d23 > 20.0D) { + d23 = 20.0D; + } + + if (d23 < -20.0D) { + d23 = -20.0D; + } + + this.rotationYaw = (float) ((double) this.rotationYaw + d23); + this.setRotation(this.rotationYaw, this.rotationPitch); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, + this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + if (list != null && !list.isEmpty()) { + for (int j2 = 0; j2 < list.size(); ++j2) { + Entity entity = (Entity) list.get(j2); + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityBoat) { + entity.applyEntityCollision(this); + } + } + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) { + this.riddenByEntity = null; + } + } + + public void updateRiderPosition() { + if (this.riddenByEntity != null) { + double d0 = Math.cos((double) this.rotationYaw * 3.141592653589793D / 180.0D) * 0.4D; + double d1 = Math.sin((double) this.rotationYaw * 3.141592653589793D / 180.0D) * 0.4D; + this.riddenByEntity.setPosition(this.posX + d0, + this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + d1); + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound var1) { + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound var1) { + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer + && this.riddenByEntity != entityplayer) { + return true; + } else { + { + entityplayer.mountEntity(this); + } + return true; + } + } + + protected void updateFallState(double d0, boolean flag, Block var4, BlockPos var5) { + if (flag) { + if (this.fallDistance > 3.0F) { + this.fall(this.fallDistance, 1.0F); + if (!this.isDead) { + this.setDead(); + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + for (int i = 0; i < 3; ++i) { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (int j = 0; j < 2; ++j) { + this.dropItemWithOffset(Items.stick, 1, 0.0F); + } + } + } + + this.fallDistance = 0.0F; + } + } else if (this.worldObj.getBlockState((new BlockPos(this)).down()).getBlock().getMaterial() != Material.water + && d0 < 0.0D) { + this.fallDistance = (float) ((double) this.fallDistance - d0); + } + + } + + /**+ + * Sets the damage taken from the last hit. + */ + public void setDamageTaken(float parFloat1) { + this.dataWatcher.updateObject(19, Float.valueOf(parFloat1)); + } + + /**+ + * Gets the damage taken from the last hit. + */ + public float getDamageTaken() { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + /**+ + * Sets the time to count down from since the last time entity + * was hit. + */ + public void setTimeSinceHit(int parInt1) { + this.dataWatcher.updateObject(17, Integer.valueOf(parInt1)); + } + + /**+ + * Gets the time since the last hit. + */ + public int getTimeSinceHit() { + return this.dataWatcher.getWatchableObjectInt(17); + } + + /**+ + * Sets the forward direction of the entity. + */ + public void setForwardDirection(int parInt1) { + this.dataWatcher.updateObject(18, Integer.valueOf(parInt1)); + } + + /**+ + * Gets the forward direction of the entity. + */ + public int getForwardDirection() { + return this.dataWatcher.getWatchableObjectInt(18); + } + + /**+ + * true if no player in boat + */ + public void setIsBoatEmpty(boolean parFlag) { + this.isBoatEmpty = parFlag; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderCrystal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderCrystal.java new file mode 100644 index 0000000..c0b0184 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderCrystal.java @@ -0,0 +1,128 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProviderEnd; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityEnderCrystal extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityEnderCrystal"); + } + + public int innerRotation; + public int health; + + public EntityEnderCrystal(World worldIn) { + super(worldIn); + this.preventEntitySpawning = true; + this.setSize(2.0F, 2.0F); + this.health = 5; + this.innerRotation = this.rand.nextInt(100000); + } + + public EntityEnderCrystal(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + this(worldIn); + this.setPosition(parDouble1, parDouble2, parDouble3); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(8, Integer.valueOf(this.health)); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.innerRotation; + this.dataWatcher.updateObject(8, Integer.valueOf(this.health)); + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + if (this.worldObj.provider instanceof WorldProviderEnd + && this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock() != Blocks.fire) { + this.worldObj.setBlockState(new BlockPos(i, j, k), Blocks.fire.getDefaultState()); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound var1) { + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound var1) { + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float var2) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + if (!this.isDead) { + this.health = 0; + if (this.health <= 0) { + this.setDead(); + this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, 6.0F, true); + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderEye.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderEye.java new file mode 100644 index 0000000..ed393ed --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderEye.java @@ -0,0 +1,232 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityEnderEye extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityEnderEye"); + } + + private double targetX; + private double targetY; + private double targetZ; + private int despawnTimer; + private boolean shatterOrDrop; + + public EntityEnderEye(World worldIn) { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() { + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + if (Double.isNaN(d1)) { + d1 = 4.0D; + } + + d1 = d1 * 64.0D; + return d0 < d1 * d1; + } + + public EntityEnderEye(World worldIn, double x, double y, double z) { + super(worldIn); + this.despawnTimer = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + } + + public void moveTowards(BlockPos parBlockPos) { + double d0 = (double) parBlockPos.getX(); + int i = parBlockPos.getY(); + double d1 = (double) parBlockPos.getZ(); + double d2 = d0 - this.posX; + double d3 = d1 - this.posZ; + float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3); + if (f > 12.0F) { + this.targetX = this.posX + d2 / (double) f * 12.0D; + this.targetZ = this.posZ + d3 / (double) f * 12.0D; + this.targetY = this.posY + 8.0D; + } else { + this.targetX = d0; + this.targetY = (double) i; + this.targetZ = d1; + } + + this.despawnTimer = 0; + this.shatterOrDrop = this.rand.nextInt(5) > 0; + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.motionX = d0; + this.motionY = d1; + this.motionZ = d2; + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(d0, d2) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(d1, (double) f) * 180.0D + / 3.1415927410125732D); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D + / 3.1415927410125732D); + + for (this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f) * 180.0D + / 3.1415927410125732D); this.rotationPitch + - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + { + double d0 = this.targetX - this.posX; + double d1 = this.targetZ - this.posZ; + float f1 = (float) Math.sqrt(d0 * d0 + d1 * d1); + float f2 = (float) MathHelper.func_181159_b(d1, d0); + double d2 = (double) f + (double) (f1 - f) * 0.0025D; + if (f1 < 1.0F) { + d2 *= 0.8D; + this.motionY *= 0.8D; + } + + this.motionX = Math.cos((double) f2) * d2; + this.motionZ = Math.sin((double) f2) * d2; + if (this.posY < this.targetY) { + this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; + } else { + this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; + } + } + + float f3 = 0.25F; + if (this.isInWater()) { + for (int i = 0; i < 4; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double) f3, + this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, + this.motionY, this.motionZ, new int[0]); + } + } else { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, + this.posX - this.motionX * (double) f3 + this.rand.nextDouble() * 0.6D - 0.3D, + this.posY - this.motionY * (double) f3 - 0.5D, + this.posZ - this.motionZ * (double) f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, + this.motionY, this.motionZ, new int[0]); + } + + { + this.setPosition(this.posX, this.posY, this.posZ); + ++this.despawnTimer; + if (this.despawnTimer > 80) { + this.setDead(); + if (this.shatterOrDrop) { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, + new ItemStack(Items.ender_eye))); + } else { + this.worldObj.playAuxSFX(2003, new BlockPos(this), 0); + } + } + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound var1) { + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound var1) { + } + + /**+ + * Gets how bright this entity is. + */ + public float getBrightness(float var1) { + return 1.0F; + } + + public int getBrightnessForRender(float var1) { + return 15728880; + } + + /**+ + * If returns false, the item will not inflict any damage + * against entities. + */ + public boolean canAttackWithItem() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderPearl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderPearl.java new file mode 100644 index 0000000..1811d62 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderPearl.java @@ -0,0 +1,118 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEndermite; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityThrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityEnderPearl extends EntityThrowable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityEnderPearl"); + } + + private EntityLivingBase field_181555_c; + + public EntityEnderPearl(World parWorld) { + super(parWorld); + } + + public EntityEnderPearl(World worldIn, EntityLivingBase parEntityLivingBase) { + super(worldIn, parEntityLivingBase); + this.field_181555_c = parEntityLivingBase; + } + + public EntityEnderPearl(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + /**+ + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movingobjectposition) { + EntityLivingBase entitylivingbase = this.getThrower(); + if (movingobjectposition.entityHit != null) { + if (movingobjectposition.entityHit == this.field_181555_c) { + return; + } + + movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, entitylivingbase), + 0.0F); + } + + for (int i = 0; i < 32; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX, this.posY + this.rand.nextDouble() * 2.0D, + this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian(), new int[0]); + } + + { + if (entitylivingbase instanceof EntityPlayerMP) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entitylivingbase; + if (entityplayermp.playerNetServerHandler.getNetworkManager().isChannelOpen() + && entityplayermp.worldObj == this.worldObj && !entityplayermp.isPlayerSleeping()) { + if (this.rand.nextFloat() < 0.05F && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { + EntityEndermite entityendermite = new EntityEndermite(this.worldObj); + entityendermite.setSpawnedByPlayer(true); + entityendermite.setLocationAndAngles(entitylivingbase.posX, entitylivingbase.posY, + entitylivingbase.posZ, entitylivingbase.rotationYaw, entitylivingbase.rotationPitch); + this.worldObj.spawnEntityInWorld(entityendermite); + } + + if (entitylivingbase.isRiding()) { + entitylivingbase.mountEntity((Entity) null); + } + + entitylivingbase.setPositionAndUpdate(this.posX, this.posY, this.posZ); + entitylivingbase.fallDistance = 0.0F; + entitylivingbase.attackEntityFrom(DamageSource.fall, 5.0F); + } + } else if (entitylivingbase != null) { + entitylivingbase.setPositionAndUpdate(this.posX, this.posY, this.posZ); + entitylivingbase.fallDistance = 0.0F; + } + + this.setDead(); + } + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + EntityLivingBase entitylivingbase = this.getThrower(); + if (entitylivingbase != null && entitylivingbase instanceof EntityPlayer && !entitylivingbase.isEntityAlive()) { + this.setDead(); + } else { + super.onUpdate(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityExpBottle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityExpBottle.java new file mode 100644 index 0000000..d5746dd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityExpBottle.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityThrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityExpBottle extends EntityThrowable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityExpBottle"); + } + + public EntityExpBottle(World worldIn) { + super(worldIn); + } + + public EntityExpBottle(World worldIn, EntityLivingBase parEntityLivingBase) { + super(worldIn, parEntityLivingBase); + } + + public EntityExpBottle(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + /**+ + * Gets the amount of gravity to apply to the thrown entity with + * each tick. + */ + protected float getGravityVelocity() { + return 0.07F; + } + + protected float getVelocity() { + return 0.7F; + } + + protected float getInaccuracy() { + return -20.0F; + } + + /**+ + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition var1) { + { + this.worldObj.playAuxSFX(2002, new BlockPos(this), 0); + int i = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5); + + while (i > 0) { + int j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + + this.setDead(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFallingBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFallingBlock.java new file mode 100644 index 0000000..6d18ef1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFallingBlock.java @@ -0,0 +1,293 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockAnvil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.ITileEntityProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityFallingBlock extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityFallingBlock"); + } + + private IBlockState fallTile; + public int fallTime; + public boolean shouldDropItem = true; + private boolean canSetAsBlock; + private boolean hurtEntities; + private int fallHurtMax = 40; + private float fallHurtAmount = 2.0F; + public NBTTagCompound tileEntityData; + + public EntityFallingBlock(World worldIn) { + super(worldIn); + } + + public EntityFallingBlock(World worldIn, double x, double y, double z, IBlockState fallingBlockState) { + super(worldIn); + this.fallTile = fallingBlockState; + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.setPosition(x, y, z); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = x; + this.prevPosY = y; + this.prevPosZ = z; + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + Block block = this.fallTile.getBlock(); + if (block.getMaterial() == Material.air) { + this.setDead(); + } else { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + if (this.fallTime++ == 0) { + BlockPos blockpos = new BlockPos(this); + if (this.worldObj.getBlockState(blockpos).getBlock() == block) { + this.worldObj.setBlockToAir(blockpos); + } else { + this.setDead(); + return; + } + } + + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + { + BlockPos blockpos1 = new BlockPos(this); + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + if (this.worldObj.getBlockState(blockpos1).getBlock() != Blocks.piston_extension) { + this.setDead(); + if (!this.canSetAsBlock) { + if (this.worldObj.canBlockBePlaced(block, blockpos1, true, EnumFacing.UP, (Entity) null, + (ItemStack) null) && !BlockFalling.canFallInto(this.worldObj, blockpos1.down()) + && this.worldObj.setBlockState(blockpos1, this.fallTile, 3)) { + if (block instanceof BlockFalling) { + ((BlockFalling) block).onEndFalling(this.worldObj, blockpos1); + } + + if (this.tileEntityData != null && block instanceof ITileEntityProvider) { + TileEntity tileentity = this.worldObj.getTileEntity(blockpos1); + if (tileentity != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + + for (String s : this.tileEntityData.getKeySet()) { + NBTBase nbtbase = this.tileEntityData.getTag(s); + if (!s.equals("x") && !s.equals("y") && !s.equals("z")) { + nbttagcompound.setTag(s, nbtbase.copy()); + } + } + + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + } + } + } else if (this.shouldDropItem + && this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.entityDropItem(new ItemStack(block, 1, block.damageDropped(this.fallTile)), 0.0F); + } + } + } + } else if (this.fallTime > 100 && (blockpos1.getY() < 1 || blockpos1.getY() > 256) + || this.fallTime > 600) { + if (this.shouldDropItem && this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.entityDropItem(new ItemStack(block, 1, block.damageDropped(this.fallTile)), 0.0F); + } + + this.setDead(); + } + } + } + } + + public void fall(float f, float var2) { + Block block = this.fallTile.getBlock(); + if (this.hurtEntities) { + int i = MathHelper.ceiling_float_int(f - 1.0F); + if (i > 0) { + ArrayList arraylist = Lists.newArrayList( + this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox())); + boolean flag = block == Blocks.anvil; + DamageSource damagesource = flag ? DamageSource.anvil : DamageSource.fallingBlock; + + for (Entity entity : (ArrayList) arraylist) { + entity.attackEntityFrom(damagesource, (float) Math + .min(MathHelper.floor_float((float) i * this.fallHurtAmount), this.fallHurtMax)); + } + + if (flag && (double) this.rand.nextFloat() < 0.05000000074505806D + (double) i * 0.05D) { + int j = ((Integer) this.fallTile.getValue(BlockAnvil.DAMAGE)).intValue(); + ++j; + if (j > 2) { + this.canSetAsBlock = true; + } else { + this.fallTile = this.fallTile.withProperty(BlockAnvil.DAMAGE, Integer.valueOf(j)); + } + } + } + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air; + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry.getNameForObject(block); + nbttagcompound.setString("Block", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setByte("Data", (byte) block.getMetaFromState(this.fallTile)); + nbttagcompound.setByte("Time", (byte) this.fallTime); + nbttagcompound.setBoolean("DropItem", this.shouldDropItem); + nbttagcompound.setBoolean("HurtEntities", this.hurtEntities); + nbttagcompound.setFloat("FallHurtAmount", this.fallHurtAmount); + nbttagcompound.setInteger("FallHurtMax", this.fallHurtMax); + if (this.tileEntityData != null) { + nbttagcompound.setTag("TileEntityData", this.tileEntityData); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + int i = nbttagcompound.getByte("Data") & 255; + if (nbttagcompound.hasKey("Block", 8)) { + this.fallTile = Block.getBlockFromName(nbttagcompound.getString("Block")).getStateFromMeta(i); + } else if (nbttagcompound.hasKey("TileID", 99)) { + this.fallTile = Block.getBlockById(nbttagcompound.getInteger("TileID")).getStateFromMeta(i); + } else { + this.fallTile = Block.getBlockById(nbttagcompound.getByte("Tile") & 255).getStateFromMeta(i); + } + + this.fallTime = nbttagcompound.getByte("Time") & 255; + Block block = this.fallTile.getBlock(); + if (nbttagcompound.hasKey("HurtEntities", 99)) { + this.hurtEntities = nbttagcompound.getBoolean("HurtEntities"); + this.fallHurtAmount = nbttagcompound.getFloat("FallHurtAmount"); + this.fallHurtMax = nbttagcompound.getInteger("FallHurtMax"); + } else if (block == Blocks.anvil) { + this.hurtEntities = true; + } + + if (nbttagcompound.hasKey("DropItem", 99)) { + this.shouldDropItem = nbttagcompound.getBoolean("DropItem"); + } + + if (nbttagcompound.hasKey("TileEntityData", 10)) { + this.tileEntityData = nbttagcompound.getCompoundTag("TileEntityData"); + } + + if (block == null || block.getMaterial() == Material.air) { + this.fallTile = Blocks.sand.getDefaultState(); + } + + } + + public World getWorldObj() { + return this.worldObj; + } + + public void setHurtEntities(boolean parFlag) { + this.hurtEntities = parFlag; + } + + /**+ + * Return whether this entity should be rendered as on fire. + */ + public boolean canRenderOnFire() { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory crashreportcategory) { + super.addEntityCrashInfo(crashreportcategory); + if (this.fallTile != null) { + Block block = this.fallTile.getBlock(); + crashreportcategory.addCrashSection("Immitating block ID", Integer.valueOf(Block.getIdFromBlock(block))); + crashreportcategory.addCrashSection("Immitating block data", + Integer.valueOf(block.getMetaFromState(this.fallTile))); + } + + } + + public IBlockState getBlock() { + return this.fallTile; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFireworkRocket.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFireworkRocket.java new file mode 100644 index 0000000..97d9ab0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFireworkRocket.java @@ -0,0 +1,191 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityFireworkRocket extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityFireworkRocket"); + } + + private int fireworkAge; + private int lifetime; + + public EntityFireworkRocket(World worldIn) { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() { + this.dataWatcher.addObjectByDataType(8, 5); + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + return d0 < 4096.0D; + } + + public EntityFireworkRocket(World worldIn, double x, double y, double z, ItemStack givenItem) { + super(worldIn); + this.fireworkAge = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + int i = 1; + if (givenItem != null && givenItem.hasTagCompound()) { + this.dataWatcher.updateObject(8, givenItem); + NBTTagCompound nbttagcompound = givenItem.getTagCompound(); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Fireworks"); + if (nbttagcompound1 != null) { + i += nbttagcompound1.getByte("Flight"); + } + } + + this.motionX = this.rand.nextGaussian() * 0.001D; + this.motionZ = this.rand.nextGaussian() * 0.001D; + this.motionY = 0.05D; + this.lifetime = 10 * i + this.rand.nextInt(6) + this.rand.nextInt(7); + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.motionX = d0; + this.motionY = d1; + this.motionZ = d2; + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(d0, d2) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(d1, (double) f) * 180.0D + / 3.1415927410125732D); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.motionX *= 1.15D; + this.motionZ *= 1.15D; + this.motionY += 0.04D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D + / 3.1415927410125732D); + + for (this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f) * 180.0D + / 3.1415927410125732D); this.rotationPitch + - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + if (this.fireworkAge == 0 && !this.isSilent()) { + this.worldObj.playSoundAtEntity(this, "fireworks.launch", 3.0F, 1.0F); + } + + ++this.fireworkAge; + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setInteger("Life", this.fireworkAge); + nbttagcompound.setInteger("LifeTime", this.lifetime); + ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8); + if (itemstack != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + itemstack.writeToNBT(nbttagcompound1); + nbttagcompound.setTag("FireworksItem", nbttagcompound1); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.fireworkAge = nbttagcompound.getInteger("Life"); + this.lifetime = nbttagcompound.getInteger("LifeTime"); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("FireworksItem"); + if (nbttagcompound1 != null) { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound1); + if (itemstack != null) { + this.dataWatcher.updateObject(8, itemstack); + } + } + + } + + /**+ + * Gets how bright this entity is. + */ + public float getBrightness(float f) { + return super.getBrightness(f); + } + + public int getBrightnessForRender(float f) { + return super.getBrightnessForRender(f); + } + + /**+ + * If returns false, the item will not inflict any damage + * against entities. + */ + public boolean canAttackWithItem() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItem.java new file mode 100644 index 0000000..bfeec1d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItem.java @@ -0,0 +1,466 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityItem extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityItem"); + } + + private static final Logger logger = LogManager.getLogger(); + private int age; + private int delayBeforeCanPickup; + private int health; + private String thrower; + private String owner; + public float hoverStart; + + public EntityItem(World worldIn, double x, double y, double z) { + super(worldIn); + this.health = 5; + this.hoverStart = (float) (Math.random() * 3.141592653589793D * 2.0D); + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + this.rotationYaw = (float) (Math.random() * 360.0D); + this.motionX = (double) ((float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D)); + this.motionY = 0.20000000298023224D; + this.motionZ = (double) ((float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D)); + } + + public EntityItem(World worldIn, double x, double y, double z, ItemStack stack) { + this(worldIn, x, y, z); + this.setEntityItemStack(stack); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public EntityItem(World worldIn) { + super(worldIn); + this.health = 5; + this.hoverStart = (float) (Math.random() * 3.141592653589793D * 2.0D); + this.setSize(0.25F, 0.25F); + this.setEntityItemStack(new ItemStack(Blocks.air, 0)); + } + + protected void entityInit() { + this.getDataWatcher().addObjectByDataType(10, 5); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.getEntityItem() == null) { + this.setDead(); + } else { + super.onUpdate(); + if (this.delayBeforeCanPickup > 0 && this.delayBeforeCanPickup != 32767) { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.noClip = this.pushOutOfBlocks(this.posX, + (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + boolean flag = (int) this.prevPosX != (int) this.posX || (int) this.prevPosY != (int) this.posY + || (int) this.prevPosZ != (int) this.posZ; + if (flag || this.ticksExisted % 25 == 0) { + if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava) { + this.motionY = 0.20000000298023224D; + this.motionX = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + this.searchForOtherItemsNearby(); + } + + float f = 0.98F; + if (this.onGround) { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, + MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.98F; + } + + this.motionX *= (double) f; + this.motionY *= 0.9800000190734863D; + this.motionZ *= (double) f; + if (this.onGround) { + this.motionY *= -0.5D; + } + + if (this.age != -32768) { + ++this.age; + } + + this.handleWaterMovement(); + if (this.age >= 6000) { + this.setDead(); + } + + } + } + + /**+ + * Looks for other itemstacks nearby and tries to stack them + * together + */ + private void searchForOtherItemsNearby() { + for (EntityItem entityitem : this.worldObj.getEntitiesWithinAABB(EntityItem.class, + this.getEntityBoundingBox().expand(0.5D, 0.0D, 0.5D))) { + this.combineItems(entityitem); + } + + } + + /**+ + * Tries to merge this item with the item passed as the + * parameter. Returns true if successful. Either this item or + * the other item will be removed from the world. + */ + private boolean combineItems(EntityItem other) { + if (other == this) { + return false; + } else if (other.isEntityAlive() && this.isEntityAlive()) { + ItemStack itemstack = this.getEntityItem(); + ItemStack itemstack1 = other.getEntityItem(); + if (this.delayBeforeCanPickup != 32767 && other.delayBeforeCanPickup != 32767) { + if (this.age != -32768 && other.age != -32768) { + if (itemstack1.getItem() != itemstack.getItem()) { + return false; + } else if (itemstack1.hasTagCompound() ^ itemstack.hasTagCompound()) { + return false; + } else if (itemstack1.hasTagCompound() + && !itemstack1.getTagCompound().equals(itemstack.getTagCompound())) { + return false; + } else if (itemstack1.getItem() == null) { + return false; + } else if (itemstack1.getItem().getHasSubtypes() + && itemstack1.getMetadata() != itemstack.getMetadata()) { + return false; + } else if (itemstack1.stackSize < itemstack.stackSize) { + return other.combineItems(this); + } else if (itemstack1.stackSize + itemstack.stackSize > itemstack1.getMaxStackSize()) { + return false; + } else { + itemstack1.stackSize += itemstack.stackSize; + other.delayBeforeCanPickup = Math.max(other.delayBeforeCanPickup, this.delayBeforeCanPickup); + other.age = Math.min(other.age, this.age); + other.setEntityItemStack(itemstack1); + this.setDead(); + return true; + } + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + /**+ + * sets the age of the item so that it'll despawn one minute + * after it has been dropped (instead of five). Used when items + * are dropped from players in creative mode + */ + public void setAgeToCreativeDespawnTime() { + this.age = 4800; + } + + /**+ + * Returns if this entity is in water and will end up adding the + * waters velocity to the entity + */ + public boolean handleWaterMovement() { + if (this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this)) { + if (!this.inWater && !this.firstUpdate) { + this.resetHeight(); + } + + this.inWater = true; + } else { + this.inWater = false; + } + + return this.inWater; + } + + /**+ + * Will deal the specified amount of damage to the entity if the + * entity isn't immune to fire damage. Args: amountDamage + */ + protected void dealFireDamage(int i) { + this.attackEntityFrom(DamageSource.inFire, (float) i); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star + && damagesource.isExplosion()) { + return false; + } else { + this.setBeenAttacked(); + this.health = (int) ((float) this.health - f); + if (this.health <= 0) { + this.setDead(); + } + + return false; + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("Health", (short) ((byte) this.health)); + nbttagcompound.setShort("Age", (short) this.age); + nbttagcompound.setShort("PickupDelay", (short) this.delayBeforeCanPickup); + if (this.getThrower() != null) { + nbttagcompound.setString("Thrower", this.thrower); + } + + if (this.getOwner() != null) { + nbttagcompound.setString("Owner", this.owner); + } + + if (this.getEntityItem() != null) { + nbttagcompound.setTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.health = nbttagcompound.getShort("Health") & 255; + this.age = nbttagcompound.getShort("Age"); + if (nbttagcompound.hasKey("PickupDelay")) { + this.delayBeforeCanPickup = nbttagcompound.getShort("PickupDelay"); + } + + if (nbttagcompound.hasKey("Owner")) { + this.owner = nbttagcompound.getString("Owner"); + } + + if (nbttagcompound.hasKey("Thrower")) { + this.thrower = nbttagcompound.getString("Thrower"); + } + + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Item"); + this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound1)); + if (this.getEntityItem() == null) { + this.setDead(); + } + + } + + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) { + { + ItemStack itemstack = this.getEntityItem(); + int i = itemstack.stackSize; + if (this.delayBeforeCanPickup == 0 + && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityplayer.getName())) + && entityplayer.inventory.addItemStackToInventory(itemstack)) { + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) { + entityplayer.triggerAchievement(AchievementList.mineWood); + } + + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log2)) { + entityplayer.triggerAchievement(AchievementList.mineWood); + } + + if (itemstack.getItem() == Items.leather) { + entityplayer.triggerAchievement(AchievementList.killCow); + } + + if (itemstack.getItem() == Items.diamond) { + entityplayer.triggerAchievement(AchievementList.diamonds); + } + + if (itemstack.getItem() == Items.blaze_rod) { + entityplayer.triggerAchievement(AchievementList.blazeRod); + } + + if (itemstack.getItem() == Items.diamond && this.getThrower() != null) { + EntityPlayer entityplayer1 = this.worldObj.getPlayerEntityByName(this.getThrower()); + if (entityplayer1 != null && entityplayer1 != entityplayer) { + entityplayer1.triggerAchievement(AchievementList.diamondsToYou); + } + } + + if (!this.isSilent()) { + this.worldObj.playSoundAtEntity(entityplayer, "random.pop", 0.2F, + ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + + entityplayer.onItemPickup(this, i); + if (itemstack.stackSize <= 0) { + this.setDead(); + } + } + } + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.getCustomNameTag() + : StatCollector.translateToLocal("item." + this.getEntityItem().getUnlocalizedName()); + } + + /**+ + * If returns false, the item will not inflict any damage + * against entities. + */ + public boolean canAttackWithItem() { + return false; + } + + /**+ + * Teleports the entity to another dimension. Params: Dimension + * number to teleport to + */ + public void travelToDimension(int i) { + super.travelToDimension(i); + this.searchForOtherItemsNearby(); + } + + /**+ + * Returns the ItemStack corresponding to the Entity (Note: if + * no item exists, will log an error but still return an + * ItemStack containing Block.stone) + */ + public ItemStack getEntityItem() { + ItemStack itemstack = this.getDataWatcher().getWatchableObjectItemStack(10); + if (itemstack == null) { + if (this.worldObj != null) { + logger.error("Item entity " + this.getEntityId() + " has no item?!"); + } + + return new ItemStack(Blocks.stone); + } else { + return itemstack; + } + } + + /**+ + * Sets the ItemStack for this entity + */ + public void setEntityItemStack(ItemStack stack) { + this.getDataWatcher().updateObject(10, stack); + this.getDataWatcher().setObjectWatched(10); + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getThrower() { + return this.thrower; + } + + public void setThrower(String thrower) { + this.thrower = thrower; + } + + public int getAge() { + return this.age; + } + + public void setDefaultPickupDelay() { + this.delayBeforeCanPickup = 10; + } + + public void setNoPickupDelay() { + this.delayBeforeCanPickup = 0; + } + + public void setInfinitePickupDelay() { + this.delayBeforeCanPickup = 32767; + } + + public void setPickupDelay(int ticks) { + this.delayBeforeCanPickup = ticks; + } + + public boolean cannotPickup() { + return this.delayBeforeCanPickup > 0; + } + + public void setNoDespawn() { + this.age = -6000; + } + + public void func_174870_v() { + this.setInfinitePickupDelay(); + this.age = 5999; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItemFrame.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItemFrame.java new file mode 100644 index 0000000..e658df3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItemFrame.java @@ -0,0 +1,252 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityHanging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.MapData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityItemFrame extends EntityHanging { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityItemFrame"); + } + + /**+ + * Chance for this item frame's item to drop from the frame. + */ + private float itemDropChance = 1.0F; + + public EntityItemFrame(World worldIn) { + super(worldIn); + } + + public EntityItemFrame(World worldIn, BlockPos parBlockPos, EnumFacing parEnumFacing) { + super(worldIn, parBlockPos); + this.updateFacingWithBoundingBox(parEnumFacing); + } + + protected void entityInit() { + this.getDataWatcher().addObjectByDataType(8, 5); + this.getDataWatcher().addObject(9, Byte.valueOf((byte) 0)); + } + + public float getCollisionBorderSize() { + return 0.0F; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (!damagesource.isExplosion() && this.getDisplayedItem() != null) { + { + this.dropItemOrSelf(damagesource.getEntity(), false); + this.setDisplayedItem((ItemStack) null); + } + + return true; + } else { + return super.attackEntityFrom(damagesource, f); + } + } + + public int getWidthPixels() { + return 12; + } + + public int getHeightPixels() { + return 12; + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + double d1 = 16.0D; + d1 = d1 * 64.0D * this.renderDistanceWeight; + return d0 < d1 * d1; + } + + /**+ + * Called when this entity is broken. Entity parameter may be + * null. + */ + public void onBroken(Entity entity) { + this.dropItemOrSelf(entity, true); + } + + public void dropItemOrSelf(Entity parEntity, boolean parFlag) { + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + ItemStack itemstack = this.getDisplayedItem(); + if (parEntity instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) parEntity; + if (entityplayer.capabilities.isCreativeMode) { + this.removeFrameFromMap(itemstack); + return; + } + } + + if (parFlag) { + this.entityDropItem(new ItemStack(Items.item_frame), 0.0F); + } + + if (itemstack != null && this.rand.nextFloat() < this.itemDropChance) { + itemstack = itemstack.copy(); + this.removeFrameFromMap(itemstack); + this.entityDropItem(itemstack, 0.0F); + } + + } + } + + /**+ + * Removes the dot representing this frame's position from the + * map when the item frame is broken. + */ + private void removeFrameFromMap(ItemStack parItemStack) { + if (parItemStack != null) { + if (parItemStack.getItem() == Items.filled_map) { + MapData mapdata = ((ItemMap) parItemStack.getItem()).getMapData(parItemStack, this.worldObj); + mapdata.mapDecorations.remove("frame-" + this.getEntityId()); + } + + parItemStack.setItemFrame((EntityItemFrame) null); + } + } + + public ItemStack getDisplayedItem() { + return this.getDataWatcher().getWatchableObjectItemStack(8); + } + + public void setDisplayedItem(ItemStack parItemStack) { + this.setDisplayedItemWithUpdate(parItemStack, true); + } + + private void setDisplayedItemWithUpdate(ItemStack parItemStack, boolean parFlag) { + if (parItemStack != null) { + parItemStack = parItemStack.copy(); + parItemStack.stackSize = 1; + parItemStack.setItemFrame(this); + } + + this.getDataWatcher().updateObject(8, parItemStack); + this.getDataWatcher().setObjectWatched(8); + if (parFlag && this.hangingPosition != null) { + this.worldObj.updateComparatorOutputLevel(this.hangingPosition, Blocks.air); + } + + } + + /**+ + * Return the rotation of the item currently on this frame. + */ + public int getRotation() { + return this.getDataWatcher().getWatchableObjectByte(9); + } + + public void setItemRotation(int parInt1) { + this.func_174865_a(parInt1, true); + } + + private void func_174865_a(int parInt1, boolean parFlag) { + this.getDataWatcher().updateObject(9, Byte.valueOf((byte) (parInt1 % 8))); + if (parFlag && this.hangingPosition != null) { + this.worldObj.updateComparatorOutputLevel(this.hangingPosition, Blocks.air); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + if (this.getDisplayedItem() != null) { + nbttagcompound.setTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); + nbttagcompound.setByte("ItemRotation", (byte) this.getRotation()); + nbttagcompound.setFloat("ItemDropChance", this.itemDropChance); + } + + super.writeEntityToNBT(nbttagcompound); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Item"); + if (nbttagcompound1 != null && !nbttagcompound1.hasNoTags()) { + this.setDisplayedItemWithUpdate(ItemStack.loadItemStackFromNBT(nbttagcompound1), false); + this.func_174865_a(nbttagcompound.getByte("ItemRotation"), false); + if (nbttagcompound.hasKey("ItemDropChance", 99)) { + this.itemDropChance = nbttagcompound.getFloat("ItemDropChance"); + } + + if (nbttagcompound.hasKey("Direction")) { + this.func_174865_a(this.getRotation() * 2, false); + } + } + + super.readEntityFromNBT(nbttagcompound); + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + if (this.getDisplayedItem() == null) { + ItemStack itemstack = entityplayer.getHeldItem(); + if (itemstack != null) { + this.setDisplayedItem(itemstack); + if (!entityplayer.capabilities.isCreativeMode && --itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + } + } else { + this.setItemRotation(this.getRotation() + 1); + } + + return true; + } + + public int func_174866_q() { + return this.getDisplayedItem() == null ? 0 : this.getRotation() % 8 + 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecart.java new file mode 100644 index 0000000..d57b165 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecart.java @@ -0,0 +1,1006 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import com.google.common.collect.Maps; + +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailPowered; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityMinecartCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartEmpty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartTNT; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IWorldNameable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityMinecart extends Entity implements IWorldNameable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecart"); + } + + private boolean isInReverse; + private String entityName; + /**+ + * Minecart rotational logic matrix + */ + private static final int[][][] matrix = new int[][][] { { { 0, 0, -1 }, { 0, 0, 1 } }, + { { -1, 0, 0 }, { 1, 0, 0 } }, { { -1, -1, 0 }, { 1, 0, 0 } }, { { -1, 0, 0 }, { 1, -1, 0 } }, + { { 0, 0, -1 }, { 0, -1, 1 } }, { { 0, -1, -1 }, { 0, 0, 1 } }, { { 0, 0, 1 }, { 1, 0, 0 } }, + { { 0, 0, 1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { 1, 0, 0 } } }; + private int turnProgress; + private double minecartX; + private double minecartY; + private double minecartZ; + private double minecartYaw; + private double minecartPitch; + private double velocityX; + private double velocityY; + private double velocityZ; + + public EntityMinecart(World worldIn) { + super(worldIn); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.7F); + } + + public static EntityMinecart func_180458_a(World worldIn, double parDouble1, double parDouble2, double parDouble3, + EntityMinecart.EnumMinecartType parEnumMinecartType) { + switch (parEnumMinecartType) { + case CHEST: + return new EntityMinecartChest(worldIn, parDouble1, parDouble2, parDouble3); + case FURNACE: + return new EntityMinecartFurnace(worldIn, parDouble1, parDouble2, parDouble3); + case TNT: + return new EntityMinecartTNT(worldIn, parDouble1, parDouble2, parDouble3); + case SPAWNER: + return new EntityMinecartMobSpawner(worldIn, parDouble1, parDouble2, parDouble3); + case HOPPER: + return new EntityMinecartHopper(worldIn, parDouble1, parDouble2, parDouble3); + case COMMAND_BLOCK: + return new EntityMinecartCommandBlock(worldIn, parDouble1, parDouble2, parDouble3); + default: + return new EntityMinecartEmpty(worldIn, parDouble1, parDouble2, parDouble3); + } + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + this.dataWatcher.addObject(20, new Integer(0)); + this.dataWatcher.addObject(21, new Integer(6)); + this.dataWatcher.addObject(22, Byte.valueOf((byte) 0)); + } + + /**+ + * Returns a boundingBox used to collide the entity with other + * entities and blocks. This enables the entity to be pushable + * on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity entity) { + return entity.canBePushed() ? entity.getEntityBoundingBox() : null; + } + + /**+ + * Returns the collision bounding box for this entity + */ + public AxisAlignedBB getCollisionBoundingBox() { + return null; + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return true; + } + + public EntityMinecart(World worldIn, double x, double y, double z) { + this(worldIn); + this.setPosition(x, y, z); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = x; + this.prevPosY = y; + this.prevPosZ = z; + } + + /**+ + * Returns the Y offset from the entity's position for any + * entity riding this one. + */ + public double getMountedYOffset() { + return 0.0D; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (!this.isDead) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setBeenAttacked(); + this.setDamage(this.getDamage() + f * 10.0F); + boolean flag = damagesource.getEntity() instanceof EntityPlayer + && ((EntityPlayer) damagesource.getEntity()).capabilities.isCreativeMode; + if (flag || this.getDamage() > 40.0F) { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity((Entity) null); + } + + if (flag && !this.hasCustomName()) { + this.setDead(); + } else { + this.killMinecart(damagesource); + } + } + + return true; + } + } else { + return true; + } + } + + public void killMinecart(DamageSource parDamageSource) { + this.setDead(); + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + ItemStack itemstack = new ItemStack(Items.minecart, 1); + if (this.entityName != null) { + itemstack.setStackDisplayName(this.entityName); + } + + this.entityDropItem(itemstack, 0.0F); + } + + } + + /**+ + * Setups the entity to do the hurt animation. Only used by + * packets in multiplayer. + */ + public void performHurtAnimation() { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(this.getDamage() + this.getDamage() * 10.0F); + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + super.setDead(); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.getRollingAmplitude() > 0) { + this.setRollingAmplitude(this.getRollingAmplitude() - 1); + } + + if (this.getDamage() > 0.0F) { + this.setDamage(this.getDamage() - 1.0F); + } + + if (this.posY < -64.0D) { + this.kill(); + } + + if (this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer minecraftserver = ((WorldServer) this.worldObj).getMinecraftServer(); + int i = this.getMaxInPortalTime(); + if (this.inPortal) { + if (minecraftserver.getAllowNether()) { + if (this.ridingEntity == null && this.portalCounter++ >= i) { + this.portalCounter = i; + this.timeUntilPortal = this.getPortalCooldown(); + byte b0; + if (this.worldObj.provider.getDimensionId() == -1) { + b0 = 0; + } else { + b0 = -1; + } + + this.travelToDimension(b0); + } + + this.inPortal = false; + } + } else { + if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + int j = MathHelper.floor_double(this.posX); + int k = MathHelper.floor_double(this.posY); + int l = MathHelper.floor_double(this.posZ); + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(j, k - 1, l))) { + --k; + } + + BlockPos blockpos = new BlockPos(j, k, l); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + if (BlockRailBase.isRailBlock(iblockstate)) { + this.func_180460_a(blockpos, iblockstate); + if (iblockstate.getBlock() == Blocks.activator_rail) { + this.onActivatorRailPass(j, k, l, + ((Boolean) iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue()); + } + } else { + this.moveDerailedMinecart(); + } + + this.doBlockCollisions(); + this.rotationPitch = 0.0F; + double d0 = this.prevPosX - this.posX; + double d2 = this.prevPosZ - this.posZ; + if (d0 * d0 + d2 * d2 > 0.001D) { + this.rotationYaw = (float) (MathHelper.func_181159_b(d2, d0) * 180.0D / 3.141592653589793D); + if (this.isInReverse) { + this.rotationYaw += 180.0F; + } + } + + double d3 = (double) MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); + if (d3 < -170.0D || d3 >= 170.0D) { + this.rotationYaw += 180.0F; + this.isInReverse = !this.isInReverse; + } + + this.setRotation(this.rotationYaw, this.rotationPitch); + + for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, + this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D))) { + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityMinecart) { + entity.applyEntityCollision(this); + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) { + if (this.riddenByEntity.ridingEntity == this) { + this.riddenByEntity.ridingEntity = null; + } + + this.riddenByEntity = null; + } + + this.handleWaterMovement(); + } + } + + /**+ + * Get's the maximum speed for a minecart + */ + protected double getMaximumSpeed() { + return 0.4D; + } + + /**+ + * Called every tick the minecart is on an activator rail. Args: + * x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) { + } + + /**+ + * Moves a minecart that is not attached to a rail + */ + protected void moveDerailedMinecart() { + double d0 = this.getMaximumSpeed(); + this.motionX = MathHelper.clamp_double(this.motionX, -d0, d0); + this.motionZ = MathHelper.clamp_double(this.motionZ, -d0, d0); + if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + if (!this.onGround) { + this.motionX *= 0.949999988079071D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } + + } + + protected void func_180460_a(BlockPos parBlockPos, IBlockState parIBlockState) { + this.fallDistance = 0.0F; + Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ); + this.posY = (double) parBlockPos.getY(); + boolean flag = false; + boolean flag1 = false; + BlockRailBase blockrailbase = (BlockRailBase) parIBlockState.getBlock(); + if (blockrailbase == Blocks.golden_rail) { + flag = ((Boolean) parIBlockState.getValue(BlockRailPowered.POWERED)).booleanValue(); + flag1 = !flag; + } + + double d0 = 0.0078125D; + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) parIBlockState + .getValue(blockrailbase.getShapeProperty()); + switch (blockrailbase$enumraildirection) { + case ASCENDING_EAST: + this.motionX -= 0.0078125D; + ++this.posY; + break; + case ASCENDING_WEST: + this.motionX += 0.0078125D; + ++this.posY; + break; + case ASCENDING_NORTH: + this.motionZ += 0.0078125D; + ++this.posY; + break; + case ASCENDING_SOUTH: + this.motionZ -= 0.0078125D; + ++this.posY; + } + + int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()]; + double d1 = (double) (aint[1][0] - aint[0][0]); + double d2 = (double) (aint[1][2] - aint[0][2]); + double d3 = Math.sqrt(d1 * d1 + d2 * d2); + double d4 = this.motionX * d1 + this.motionZ * d2; + if (d4 < 0.0D) { + d1 = -d1; + d2 = -d2; + } + + double d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d5 > 2.0D) { + d5 = 2.0D; + } + + this.motionX = d5 * d1 / d3; + this.motionZ = d5 * d2 / d3; + if (this.riddenByEntity instanceof EntityLivingBase) { + double d6 = (double) ((EntityLivingBase) this.riddenByEntity).moveForward; + if (d6 > 0.0D) { + double d7 = -Math.sin((double) (this.riddenByEntity.rotationYaw * 3.1415927F / 180.0F)); + double d8 = Math.cos((double) (this.riddenByEntity.rotationYaw * 3.1415927F / 180.0F)); + double d9 = this.motionX * this.motionX + this.motionZ * this.motionZ; + if (d9 < 0.01D) { + this.motionX += d7 * 0.1D; + this.motionZ += d8 * 0.1D; + flag1 = false; + } + } + } + + if (flag1) { + double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d17 < 0.03D) { + this.motionX *= 0.0D; + this.motionY *= 0.0D; + this.motionZ *= 0.0D; + } else { + this.motionX *= 0.5D; + this.motionY *= 0.0D; + this.motionZ *= 0.5D; + } + } + + double d18 = 0.0D; + double d19 = (double) parBlockPos.getX() + 0.5D + (double) aint[0][0] * 0.5D; + double d20 = (double) parBlockPos.getZ() + 0.5D + (double) aint[0][2] * 0.5D; + double d21 = (double) parBlockPos.getX() + 0.5D + (double) aint[1][0] * 0.5D; + double d10 = (double) parBlockPos.getZ() + 0.5D + (double) aint[1][2] * 0.5D; + d1 = d21 - d19; + d2 = d10 - d20; + if (d1 == 0.0D) { + this.posX = (double) parBlockPos.getX() + 0.5D; + d18 = this.posZ - (double) parBlockPos.getZ(); + } else if (d2 == 0.0D) { + this.posZ = (double) parBlockPos.getZ() + 0.5D; + d18 = this.posX - (double) parBlockPos.getX(); + } else { + double d11 = this.posX - d19; + double d12 = this.posZ - d20; + d18 = (d11 * d1 + d12 * d2) * 2.0D; + } + + this.posX = d19 + d1 * d18; + this.posZ = d20 + d2 * d18; + this.setPosition(this.posX, this.posY, this.posZ); + double d22 = this.motionX; + double d23 = this.motionZ; + if (this.riddenByEntity != null) { + d22 *= 0.75D; + d23 *= 0.75D; + } + + double d13 = this.getMaximumSpeed(); + d22 = MathHelper.clamp_double(d22, -d13, d13); + d23 = MathHelper.clamp_double(d23, -d13, d13); + this.moveEntity(d22, 0.0D, d23); + if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - parBlockPos.getX() == aint[0][0] + && MathHelper.floor_double(this.posZ) - parBlockPos.getZ() == aint[0][2]) { + this.setPosition(this.posX, this.posY + (double) aint[0][1], this.posZ); + } else if (aint[1][1] != 0 && MathHelper.floor_double(this.posX) - parBlockPos.getX() == aint[1][0] + && MathHelper.floor_double(this.posZ) - parBlockPos.getZ() == aint[1][2]) { + this.setPosition(this.posX, this.posY + (double) aint[1][1], this.posZ); + } + + this.applyDrag(); + Vec3 vec31 = this.func_70489_a(this.posX, this.posY, this.posZ); + if (vec31 != null && vec3 != null) { + double d14 = (vec3.yCoord - vec31.yCoord) * 0.05D; + d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d5 > 0.0D) { + this.motionX = this.motionX / d5 * (d5 + d14); + this.motionZ = this.motionZ / d5 * (d5 + d14); + } + + this.setPosition(this.posX, vec31.yCoord, this.posZ); + } + + int j = MathHelper.floor_double(this.posX); + int i = MathHelper.floor_double(this.posZ); + if (j != parBlockPos.getX() || i != parBlockPos.getZ()) { + d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.motionX = d5 * (double) (j - parBlockPos.getX()); + this.motionZ = d5 * (double) (i - parBlockPos.getZ()); + } + + if (flag) { + double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d15 > 0.01D) { + double d16 = 0.06D; + this.motionX += this.motionX / d15 * d16; + this.motionZ += this.motionZ / d15 * d16; + } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) { + if (this.worldObj.getBlockState(parBlockPos.west()).getBlock().isNormalCube()) { + this.motionX = 0.02D; + } else if (this.worldObj.getBlockState(parBlockPos.east()).getBlock().isNormalCube()) { + this.motionX = -0.02D; + } + } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) { + if (this.worldObj.getBlockState(parBlockPos.north()).getBlock().isNormalCube()) { + this.motionZ = 0.02D; + } else if (this.worldObj.getBlockState(parBlockPos.south()).getBlock().isNormalCube()) { + this.motionZ = -0.02D; + } + } + } + + } + + protected void applyDrag() { + if (this.riddenByEntity != null) { + this.motionX *= 0.996999979019165D; + this.motionY *= 0.0D; + this.motionZ *= 0.996999979019165D; + } else { + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.0D; + this.motionZ *= 0.9599999785423279D; + } + + } + + /**+ + * Sets the x,y,z of the entity from the given parameters. Also + * seems to set up a bounding box. + */ + public void setPosition(double d0, double d1, double d2) { + this.posX = d0; + this.posY = d1; + this.posZ = d2; + float f = this.width / 2.0F; + float f1 = this.height; + this.setEntityBoundingBox(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, + d1 + (double) f1, d2 + (double) f)); + } + + public Vec3 func_70495_a(double parDouble1, double parDouble2, double parDouble3, double parDouble4) { + int i = MathHelper.floor_double(parDouble1); + int j = MathHelper.floor_double(parDouble2); + int k = MathHelper.floor_double(parDouble3); + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) { + --j; + } + + IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k)); + if (BlockRailBase.isRailBlock(iblockstate)) { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) iblockstate + .getValue(((BlockRailBase) iblockstate.getBlock()).getShapeProperty()); + parDouble2 = (double) j; + if (blockrailbase$enumraildirection.isAscending()) { + parDouble2 = (double) (j + 1); + } + + int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()]; + double d0 = (double) (aint[1][0] - aint[0][0]); + double d1 = (double) (aint[1][2] - aint[0][2]); + double d2 = Math.sqrt(d0 * d0 + d1 * d1); + d0 = d0 / d2; + d1 = d1 / d2; + parDouble1 = parDouble1 + d0 * parDouble4; + parDouble3 = parDouble3 + d1 * parDouble4; + if (aint[0][1] != 0 && MathHelper.floor_double(parDouble1) - i == aint[0][0] + && MathHelper.floor_double(parDouble3) - k == aint[0][2]) { + parDouble2 += (double) aint[0][1]; + } else if (aint[1][1] != 0 && MathHelper.floor_double(parDouble1) - i == aint[1][0] + && MathHelper.floor_double(parDouble3) - k == aint[1][2]) { + parDouble2 += (double) aint[1][1]; + } + + return this.func_70489_a(parDouble1, parDouble2, parDouble3); + } else { + return null; + } + } + + public Vec3 func_70489_a(double parDouble1, double parDouble2, double parDouble3) { + int i = MathHelper.floor_double(parDouble1); + int j = MathHelper.floor_double(parDouble2); + int k = MathHelper.floor_double(parDouble3); + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) { + --j; + } + + IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k)); + if (BlockRailBase.isRailBlock(iblockstate)) { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection) iblockstate + .getValue(((BlockRailBase) iblockstate.getBlock()).getShapeProperty()); + int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()]; + double d0 = 0.0D; + double d1 = (double) i + 0.5D + (double) aint[0][0] * 0.5D; + double d2 = (double) j + 0.0625D + (double) aint[0][1] * 0.5D; + double d3 = (double) k + 0.5D + (double) aint[0][2] * 0.5D; + double d4 = (double) i + 0.5D + (double) aint[1][0] * 0.5D; + double d5 = (double) j + 0.0625D + (double) aint[1][1] * 0.5D; + double d6 = (double) k + 0.5D + (double) aint[1][2] * 0.5D; + double d7 = d4 - d1; + double d8 = (d5 - d2) * 2.0D; + double d9 = d6 - d3; + if (d7 == 0.0D) { + parDouble1 = (double) i + 0.5D; + d0 = parDouble3 - (double) k; + } else if (d9 == 0.0D) { + parDouble3 = (double) k + 0.5D; + d0 = parDouble1 - (double) i; + } else { + double d10 = parDouble1 - d1; + double d11 = parDouble3 - d3; + d0 = (d10 * d7 + d11 * d9) * 2.0D; + } + + parDouble1 = d1 + d7 * d0; + parDouble2 = d2 + d8 * d0; + parDouble3 = d3 + d9 * d0; + if (d8 < 0.0D) { + ++parDouble2; + } + + if (d8 > 0.0D) { + parDouble2 += 0.5D; + } + + return new Vec3(parDouble1, parDouble2, parDouble3); + } else { + return null; + } + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + if (nbttagcompound.getBoolean("CustomDisplayTile")) { + int i = nbttagcompound.getInteger("DisplayData"); + if (nbttagcompound.hasKey("DisplayTile", 8)) { + Block block = Block.getBlockFromName(nbttagcompound.getString("DisplayTile")); + if (block == null) { + this.func_174899_a(Blocks.air.getDefaultState()); + } else { + this.func_174899_a(block.getStateFromMeta(i)); + } + } else { + Block block1 = Block.getBlockById(nbttagcompound.getInteger("DisplayTile")); + if (block1 == null) { + this.func_174899_a(Blocks.air.getDefaultState()); + } else { + this.func_174899_a(block1.getStateFromMeta(i)); + } + } + + this.setDisplayTileOffset(nbttagcompound.getInteger("DisplayOffset")); + } + + if (nbttagcompound.hasKey("CustomName", 8) && nbttagcompound.getString("CustomName").length() > 0) { + this.entityName = nbttagcompound.getString("CustomName"); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + if (this.hasDisplayTile()) { + nbttagcompound.setBoolean("CustomDisplayTile", true); + IBlockState iblockstate = this.getDisplayTile(); + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry + .getNameForObject(iblockstate.getBlock()); + nbttagcompound.setString("DisplayTile", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate)); + nbttagcompound.setInteger("DisplayOffset", this.getDisplayTileOffset()); + } + + if (this.entityName != null && this.entityName.length() > 0) { + nbttagcompound.setString("CustomName", this.entityName); + } + + } + + /**+ + * Applies a velocity to each of the entities pushing them away + * from each other. Args: entity + */ + public void applyEntityCollision(Entity entity) { + { + if (!entity.noClip && !this.noClip) { + if (entity != this.riddenByEntity) { + if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer) + && !(entity instanceof EntityIronGolem) + && this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE + && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D + && this.riddenByEntity == null && entity.ridingEntity == null) { + entity.mountEntity(this); + } + + double d0 = entity.posX - this.posX; + double d1 = entity.posZ - this.posZ; + double d2 = d0 * d0 + d1 * d1; + if (d2 >= 9.999999747378752E-5D) { + d2 = (double) MathHelper.sqrt_double(d2); + d0 = d0 / d2; + d1 = d1 / d2; + double d3 = 1.0D / d2; + if (d3 > 1.0D) { + d3 = 1.0D; + } + + d0 = d0 * d3; + d1 = d1 * d3; + d0 = d0 * 0.10000000149011612D; + d1 = d1 * 0.10000000149011612D; + d0 = d0 * (double) (1.0F - this.entityCollisionReduction); + d1 = d1 * (double) (1.0F - this.entityCollisionReduction); + d0 = d0 * 0.5D; + d1 = d1 * 0.5D; + if (entity instanceof EntityMinecart) { + double d4 = entity.posX - this.posX; + double d5 = entity.posZ - this.posZ; + Vec3 vec3 = (new Vec3(d4, 0.0D, d5)).normalize(); + Vec3 vec31 = (new Vec3((double) MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F), + 0.0D, (double) MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F))).normalize(); + double d6 = Math.abs(vec3.dotProduct(vec31)); + if (d6 < 0.800000011920929D) { + return; + } + + double d7 = entity.motionX + this.motionX; + double d8 = entity.motionZ + this.motionZ; + if (((EntityMinecart) entity).getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE + && this.getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE) { + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(entity.motionX - d0, 0.0D, entity.motionZ - d1); + entity.motionX *= 0.949999988079071D; + entity.motionZ *= 0.949999988079071D; + } else if (((EntityMinecart) entity) + .getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE + && this.getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE) { + entity.motionX *= 0.20000000298023224D; + entity.motionZ *= 0.20000000298023224D; + entity.addVelocity(this.motionX + d0, 0.0D, this.motionZ + d1); + this.motionX *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } else { + d7 = d7 / 2.0D; + d8 = d8 / 2.0D; + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(d7 - d0, 0.0D, d8 - d1); + entity.motionX *= 0.20000000298023224D; + entity.motionZ *= 0.20000000298023224D; + entity.addVelocity(d7 + d0, 0.0D, d8 + d1); + } + } else { + this.addVelocity(-d0, 0.0D, -d1); + entity.addVelocity(d0 / 4.0D, 0.0D, d1 / 4.0D); + } + } + + } + } + } + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int i, boolean var10) { + this.minecartX = d0; + this.minecartY = d1; + this.minecartZ = d2; + this.minecartYaw = (double) f; + this.minecartPitch = (double) f1; + this.turnProgress = i + 2; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.velocityX = this.motionX = d0; + this.velocityY = this.motionY = d1; + this.velocityZ = this.motionZ = d2; + } + + /**+ + * Sets the current amount of damage the minecart has taken. + * Decreases over time. The cart breaks when this is over 40. + */ + public void setDamage(float parFloat1) { + this.dataWatcher.updateObject(19, Float.valueOf(parFloat1)); + } + + /**+ + * Gets the current amount of damage the minecart has taken. + * Decreases over time. The cart breaks when this is over 40. + */ + public float getDamage() { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + /**+ + * Sets the rolling amplitude the cart rolls while being + * attacked. + */ + public void setRollingAmplitude(int parInt1) { + this.dataWatcher.updateObject(17, Integer.valueOf(parInt1)); + } + + /**+ + * Gets the rolling amplitude the cart rolls while being + * attacked. + */ + public int getRollingAmplitude() { + return this.dataWatcher.getWatchableObjectInt(17); + } + + /**+ + * Sets the rolling direction the cart rolls while being + * attacked. Can be 1 or -1. + */ + public void setRollingDirection(int parInt1) { + this.dataWatcher.updateObject(18, Integer.valueOf(parInt1)); + } + + /**+ + * Gets the rolling direction the cart rolls while being + * attacked. Can be 1 or -1. + */ + public int getRollingDirection() { + return this.dataWatcher.getWatchableObjectInt(18); + } + + public abstract EntityMinecart.EnumMinecartType getMinecartType(); + + public IBlockState getDisplayTile() { + return !this.hasDisplayTile() ? this.getDefaultDisplayTile() + : Block.getStateById(this.getDataWatcher().getWatchableObjectInt(20)); + } + + public IBlockState getDefaultDisplayTile() { + return Blocks.air.getDefaultState(); + } + + public int getDisplayTileOffset() { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileOffset() + : this.getDataWatcher().getWatchableObjectInt(21); + } + + public int getDefaultDisplayTileOffset() { + return 6; + } + + public void func_174899_a(IBlockState parIBlockState) { + this.getDataWatcher().updateObject(20, Integer.valueOf(Block.getStateId(parIBlockState))); + this.setHasDisplayTile(true); + } + + public void setDisplayTileOffset(int parInt1) { + this.getDataWatcher().updateObject(21, Integer.valueOf(parInt1)); + this.setHasDisplayTile(true); + } + + public boolean hasDisplayTile() { + return this.getDataWatcher().getWatchableObjectByte(22) == 1; + } + + public void setHasDisplayTile(boolean parFlag) { + this.getDataWatcher().updateObject(22, Byte.valueOf((byte) (parFlag ? 1 : 0))); + } + + /**+ + * Sets the custom name tag for this entity + */ + public void setCustomNameTag(String s) { + this.entityName = s; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.entityName != null ? this.entityName : super.getName(); + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.entityName != null; + } + + public String getCustomNameTag() { + return this.entityName; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + if (this.hasCustomName()) { + ChatComponentText chatcomponenttext = new ChatComponentText(this.entityName); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttext; + } else { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(this.getName(), + new Object[0]); + chatcomponenttranslation.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttranslation.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttranslation; + } + } + + public static enum EnumMinecartType { + RIDEABLE(0, "MinecartRideable"), CHEST(1, "MinecartChest"), FURNACE(2, "MinecartFurnace"), + TNT(3, "MinecartTNT"), SPAWNER(4, "MinecartSpawner"), HOPPER(5, "MinecartHopper"), + COMMAND_BLOCK(6, "MinecartCommandBlock"); + + private static final Map ID_LOOKUP = Maps.newHashMap(); + private final int networkID; + private final String name; + + private EnumMinecartType(int networkID, String name) { + this.networkID = networkID; + this.name = name; + } + + public int getNetworkID() { + return this.networkID; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.name; + } + + public static EntityMinecart.EnumMinecartType byNetworkID(int id) { + EntityMinecart.EnumMinecartType entityminecart$enumminecarttype = (EntityMinecart.EnumMinecartType) ID_LOOKUP + .get(Integer.valueOf(id)); + return entityminecart$enumminecarttype == null ? RIDEABLE : entityminecart$enumminecarttype; + } + + static { + for (EntityMinecart.EnumMinecartType entityminecart$enumminecarttype : values()) { + ID_LOOKUP.put(Integer.valueOf(entityminecart$enumminecarttype.getNetworkID()), + entityminecart$enumminecarttype); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartChest.java new file mode 100644 index 0000000..94bac6a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartChest.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartChest extends EntityMinecartContainer { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecartChest"); + } + + public EntityMinecartChest(World worldIn) { + super(worldIn); + } + + public EntityMinecartChest(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + public void killMinecart(DamageSource damagesource) { + super.killMinecart(damagesource); + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.chest), 1, 0.0F); + } + + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 27; + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.CHEST; + } + + public IBlockState getDefaultDisplayTile() { + return Blocks.chest.getDefaultState().withProperty(BlockChest.FACING, EnumFacing.NORTH); + } + + public int getDefaultDisplayTileOffset() { + return 8; + } + + public String getGuiID() { + return "minecraft:chest"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer) { + return new ContainerChest(inventoryplayer, this, entityplayer); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartContainer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartContainer.java new file mode 100644 index 0000000..2871f5c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartContainer.java @@ -0,0 +1,274 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ILockableContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.LockCode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityMinecartContainer extends EntityMinecart implements ILockableContainer { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecartContainer"); + } + + private ItemStack[] minecartContainerItems = new ItemStack[36]; + /**+ + * When set to true, the minecart will drop all items when + * setDead() is called. When false (such as when travelling + * dimensions) it preserves its contents. + */ + private boolean dropContentsWhenDead = true; + + public EntityMinecartContainer(World worldIn) { + super(worldIn); + } + + public EntityMinecartContainer(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + public void killMinecart(DamageSource damagesource) { + super.killMinecart(damagesource); + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + InventoryHelper.func_180176_a(this.worldObj, this, this); + } + + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return this.minecartContainerItems[i]; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.minecartContainerItems[i] != null) { + if (this.minecartContainerItems[i].stackSize <= j) { + ItemStack itemstack1 = this.minecartContainerItems[i]; + this.minecartContainerItems[i] = null; + return itemstack1; + } else { + ItemStack itemstack = this.minecartContainerItems[i].splitStack(j); + if (this.minecartContainerItems[i].stackSize == 0) { + this.minecartContainerItems[i] = null; + } + + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.minecartContainerItems[i] != null) { + ItemStack itemstack = this.minecartContainerItems[i]; + this.minecartContainerItems[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.minecartContainerItems[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.isDead ? false : entityplayer.getDistanceSqToEntity(this) <= 64.0D; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.getCustomNameTag() : "container.minecart"; + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Teleports the entity to another dimension. Params: Dimension + * number to teleport to + */ + public void travelToDimension(int i) { + this.dropContentsWhenDead = false; + super.travelToDimension(i); + } + + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + if (this.dropContentsWhenDead) { + InventoryHelper.func_180176_a(this.worldObj, this, this); + } + + super.setDead(); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.minecartContainerItems.length; ++i) { + if (this.minecartContainerItems[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.minecartContainerItems[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.minecartContainerItems = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + if (j >= 0 && j < this.minecartContainerItems.length) { + this.minecartContainerItems[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + { + entityplayer.displayGUIChest(this); + } + + return true; + } + + protected void applyDrag() { + int i = 15 - Container.calcRedstoneFromInventory(this); + float f = 0.98F + (float) i * 0.001F; + this.motionX *= (double) f; + this.motionY *= 0.0D; + this.motionZ *= (double) f; + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public boolean isLocked() { + return false; + } + + public void setLockCode(LockCode var1) { + } + + public LockCode getLockCode() { + return LockCode.EMPTY_CODE; + } + + public void clear() { + for (int i = 0; i < this.minecartContainerItems.length; ++i) { + this.minecartContainerItems[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartEmpty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartEmpty.java new file mode 100644 index 0000000..d2bf8d8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartEmpty extends EntityMinecart { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecartEmpty"); + } + + public EntityMinecartEmpty(World worldIn) { + super(worldIn); + } + + public EntityMinecartEmpty(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer + && this.riddenByEntity != entityplayer) { + return true; + } else if (this.riddenByEntity != null && this.riddenByEntity != entityplayer) { + return false; + } else { + { + entityplayer.mountEntity(this); + } + + return true; + } + } + + /**+ + * Called every tick the minecart is on an activator rail. Args: + * x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int var1, int var2, int var3, boolean flag) { + if (flag) { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity((Entity) null); + } + + if (this.getRollingAmplitude() == 0) { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(50.0F); + this.setBeenAttacked(); + } + } + + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.RIDEABLE; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartFurnace.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartFurnace.java new file mode 100644 index 0000000..503cb9d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -0,0 +1,200 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartFurnace extends EntityMinecart { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecartFurnace"); + } + + private int fuel; + public double pushX; + public double pushZ; + + public EntityMinecartFurnace(World worldIn) { + super(worldIn); + } + + public EntityMinecartFurnace(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.FURNACE; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 0)); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.fuel > 0) { + --this.fuel; + } + + if (this.fuel <= 0) { + this.pushX = this.pushZ = 0.0D; + } + + this.setMinecartPowered(this.fuel > 0); + if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) { + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY + 0.8D, this.posZ, 0.0D, + 0.0D, 0.0D, new int[0]); + } + + } + + /**+ + * Get's the maximum speed for a minecart + */ + protected double getMaximumSpeed() { + return 0.2D; + } + + public void killMinecart(DamageSource damagesource) { + super.killMinecart(damagesource); + if (!damagesource.isExplosion() && this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.entityDropItem(new ItemStack(Blocks.furnace, 1), 0.0F); + } + + } + + protected void func_180460_a(BlockPos blockpos, IBlockState iblockstate) { + super.func_180460_a(blockpos, iblockstate); + double d0 = this.pushX * this.pushX + this.pushZ * this.pushZ; + if (d0 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) { + d0 = (double) MathHelper.sqrt_double(d0); + this.pushX /= d0; + this.pushZ /= d0; + if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) { + this.pushX = 0.0D; + this.pushZ = 0.0D; + } else { + double d1 = d0 / this.getMaximumSpeed(); + this.pushX *= d1; + this.pushZ *= d1; + } + } + + } + + protected void applyDrag() { + double d0 = this.pushX * this.pushX + this.pushZ * this.pushZ; + if (d0 > 1.0E-4D) { + d0 = (double) MathHelper.sqrt_double(d0); + this.pushX /= d0; + this.pushZ /= d0; + double d1 = 1.0D; + this.motionX *= 0.800000011920929D; + this.motionY *= 0.0D; + this.motionZ *= 0.800000011920929D; + this.motionX += this.pushX * d1; + this.motionZ += this.pushZ * d1; + } else { + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.0D; + this.motionZ *= 0.9800000190734863D; + } + + super.applyDrag(); + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.coal) { + if (!entityplayer.capabilities.isCreativeMode && --itemstack.stackSize == 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, (ItemStack) null); + } + + this.fuel += 3600; + } + + this.pushX = this.posX - entityplayer.posX; + this.pushZ = this.posZ - entityplayer.posZ; + return true; + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setDouble("PushX", this.pushX); + nbttagcompound.setDouble("PushZ", this.pushZ); + nbttagcompound.setShort("Fuel", (short) this.fuel); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.pushX = nbttagcompound.getDouble("PushX"); + this.pushZ = nbttagcompound.getDouble("PushZ"); + this.fuel = nbttagcompound.getShort("Fuel"); + } + + protected boolean isMinecartPowered() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + protected void setMinecartPowered(boolean parFlag) { + if (parFlag) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (this.dataWatcher.getWatchableObjectByte(16) | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (this.dataWatcher.getWatchableObjectByte(16) & -2))); + } + + } + + public IBlockState getDefaultDisplayTile() { + return (this.isMinecartPowered() ? Blocks.lit_furnace : Blocks.furnace).getDefaultState() + .withProperty(BlockFurnace.FACING, EnumFacing.NORTH); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartHopper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartHopper.java new file mode 100644 index 0000000..5574965 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartHopper.java @@ -0,0 +1,239 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.IHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartHopper extends EntityMinecartContainer implements IHopper { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecartHopper"); + } + + /**+ + * Whether this hopper minecart is being blocked by an activator + * rail. + */ + private boolean isBlocked = true; + private int transferTicker = -1; + private BlockPos field_174900_c = BlockPos.ORIGIN; + + public EntityMinecartHopper(World worldIn) { + super(worldIn); + } + + public EntityMinecartHopper(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.HOPPER; + } + + public IBlockState getDefaultDisplayTile() { + return Blocks.hopper.getDefaultState(); + } + + public int getDefaultDisplayTileOffset() { + return 1; + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 5; + } + + /**+ + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer entityplayer) { + { + entityplayer.displayGUIChest(this); + } + + return true; + } + + /**+ + * Called every tick the minecart is on an activator rail. Args: + * x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int var1, int var2, int var3, boolean flag) { + boolean flag1 = !flag; + if (flag1 != this.getBlocked()) { + this.setBlocked(flag1); + } + + } + + /**+ + * Get whether this hopper minecart is being blocked by an + * activator rail. + */ + public boolean getBlocked() { + return this.isBlocked; + } + + /**+ + * Set whether this hopper minecart is being blocked by an + * activator rail. + */ + public void setBlocked(boolean parFlag) { + this.isBlocked = parFlag; + } + + /**+ + * Returns the worldObj for this tileEntity. + */ + public World getWorld() { + return this.worldObj; + } + + /**+ + * Gets the world X position for this hopper entity. + */ + public double getXPos() { + return this.posX; + } + + /**+ + * Gets the world Y position for this hopper entity. + */ + public double getYPos() { + return this.posY + 0.5D; + } + + /**+ + * Gets the world Z position for this hopper entity. + */ + public double getZPos() { + return this.posZ; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.isEntityAlive() && this.getBlocked()) { + BlockPos blockpos = new BlockPos(this); + if (blockpos.equals(this.field_174900_c)) { + --this.transferTicker; + } else { + this.setTransferTicker(0); + } + + if (!this.canTransfer()) { + this.setTransferTicker(0); + if (this.func_96112_aD()) { + this.setTransferTicker(4); + this.markDirty(); + } + } + } + + } + + public boolean func_96112_aD() { + if (TileEntityHopper.captureDroppedItems(this)) { + return true; + } else { + List list = this.worldObj.getEntitiesWithinAABB(EntityItem.class, + this.getEntityBoundingBox().expand(0.25D, 0.0D, 0.25D), EntitySelectors.selectAnything); + if (list.size() > 0) { + TileEntityHopper.putDropInInventoryAllSlots(this, (EntityItem) list.get(0)); + } + + return false; + } + } + + public void killMinecart(DamageSource damagesource) { + super.killMinecart(damagesource); + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.hopper), 1, 0.0F); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("TransferCooldown", this.transferTicker); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.transferTicker = nbttagcompound.getInteger("TransferCooldown"); + } + + /**+ + * Sets the transfer ticker, used to determine the delay between + * transfers. + */ + public void setTransferTicker(int parInt1) { + this.transferTicker = parInt1; + } + + /**+ + * Returns whether the hopper cart can currently transfer an + * item. + */ + public boolean canTransfer() { + return this.transferTicker > 0; + } + + public String getGuiID() { + return "minecraft:hopper"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer) { + return new ContainerHopper(inventoryplayer, this, entityplayer); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartTNT.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartTNT.java new file mode 100644 index 0000000..77be383 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartTNT.java @@ -0,0 +1,226 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMinecartTNT extends EntityMinecart { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityMinecartTNT"); + } + + private int minecartTNTFuse = -1; + + public EntityMinecartTNT(World worldIn) { + super(worldIn); + } + + public EntityMinecartTNT(World worldIn, double parDouble1, double parDouble2, double parDouble3) { + super(worldIn, parDouble1, parDouble2, parDouble3); + } + + public EntityMinecart.EnumMinecartType getMinecartType() { + return EntityMinecart.EnumMinecartType.TNT; + } + + public IBlockState getDefaultDisplayTile() { + return Blocks.tnt.getDefaultState(); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.minecartTNTFuse > 0) { + --this.minecartTNTFuse; + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, + 0.0D, 0.0D, new int[0]); + } else if (this.minecartTNTFuse == 0) { + this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ); + } + + if (this.isCollidedHorizontally) { + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + if (d0 >= 0.009999999776482582D) { + this.explodeCart(d0); + } + } + + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + Entity entity = damagesource.getSourceOfDamage(); + if (entity instanceof EntityArrow) { + EntityArrow entityarrow = (EntityArrow) entity; + if (entityarrow.isBurning()) { + this.explodeCart(entityarrow.motionX * entityarrow.motionX + entityarrow.motionY * entityarrow.motionY + + entityarrow.motionZ * entityarrow.motionZ); + } + } + + return super.attackEntityFrom(damagesource, f); + } + + public void killMinecart(DamageSource damagesource) { + super.killMinecart(damagesource); + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + if (!damagesource.isExplosion() && this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F); + } + + if (damagesource.isFireDamage() || damagesource.isExplosion() || d0 >= 0.009999999776482582D) { + this.explodeCart(d0); + } + + } + + /**+ + * Makes the minecart explode. + */ + protected void explodeCart(double parDouble1) { + { + double d0 = Math.sqrt(parDouble1); + if (d0 > 5.0D) { + d0 = 5.0D; + } + + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, + (float) (4.0D + this.rand.nextDouble() * 1.5D * d0), true); + this.setDead(); + } + + } + + public void fall(float f, float f1) { + if (f >= 3.0F) { + float f2 = f / 10.0F; + this.explodeCart((double) (f2 * f2)); + } + + super.fall(f, f1); + } + + /**+ + * Called every tick the minecart is on an activator rail. Args: + * x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int var1, int var2, int var3, boolean flag) { + if (flag && this.minecartTNTFuse < 0) { + this.ignite(); + } + + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 10) { + this.ignite(); + } else { + super.handleStatusUpdate(b0); + } + + } + + /**+ + * Ignites this TNT cart. + */ + public void ignite() { + this.minecartTNTFuse = 80; + { + this.worldObj.setEntityState(this, (byte) 10); + if (!this.isSilent()) { + this.worldObj.playSoundAtEntity(this, "game.tnt.primed", 1.0F, 1.0F); + } + } + + } + + /**+ + * Gets the remaining fuse time in ticks. + */ + public int getFuseTicks() { + return this.minecartTNTFuse; + } + + /**+ + * Returns true if the TNT minecart is ignited. + */ + public boolean isIgnited() { + return this.minecartTNTFuse > -1; + } + + /**+ + * Explosion resistance of a block relative to this entity + */ + public float getExplosionResistance(Explosion explosion, World world, BlockPos blockpos, IBlockState iblockstate) { + return !this.isIgnited() + || !BlockRailBase.isRailBlock(iblockstate) && !BlockRailBase.isRailBlock(world, blockpos.up()) + ? super.getExplosionResistance(explosion, world, blockpos, iblockstate) + : 0.0F; + } + + public boolean verifyExplosion(Explosion explosion, World world, BlockPos blockpos, IBlockState iblockstate, + float f) { + return !this.isIgnited() + || !BlockRailBase.isRailBlock(iblockstate) && !BlockRailBase.isRailBlock(world, blockpos.up()) + ? super.verifyExplosion(explosion, world, blockpos, iblockstate, f) + : false; + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("TNTFuse", 99)) { + this.minecartTNTFuse = nbttagcompound.getInteger("TNTFuse"); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("TNTFuse", this.minecartTNTFuse); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityPainting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityPainting.java new file mode 100644 index 0000000..d81741d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityPainting.java @@ -0,0 +1,176 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityHanging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityPainting extends EntityHanging { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityPainting"); + } + + public EntityPainting.EnumArt art; + + public EntityPainting(World worldIn) { + super(worldIn); + } + + public EntityPainting(World worldIn, BlockPos pos, EnumFacing facing) { + super(worldIn, pos); + ArrayList arraylist = Lists.newArrayList(); + + for (EntityPainting.EnumArt entitypainting$enumart : EntityPainting.EnumArt.values()) { + this.art = entitypainting$enumart; + this.updateFacingWithBoundingBox(facing); + if (this.onValidSurface()) { + arraylist.add(entitypainting$enumart); + } + } + + if (!arraylist.isEmpty()) { + this.art = (EntityPainting.EnumArt) arraylist.get(this.rand.nextInt(arraylist.size())); + } + + this.updateFacingWithBoundingBox(facing); + } + + public EntityPainting(World worldIn, BlockPos pos, EnumFacing facing, String title) { + this(worldIn, pos, facing); + + for (EntityPainting.EnumArt entitypainting$enumart : EntityPainting.EnumArt.values()) { + if (entitypainting$enumart.title.equals(title)) { + this.art = entitypainting$enumart; + break; + } + } + + this.updateFacingWithBoundingBox(facing); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setString("Motive", this.art.title); + super.writeEntityToNBT(nbttagcompound); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + String s = nbttagcompound.getString("Motive"); + + for (EntityPainting.EnumArt entitypainting$enumart : EntityPainting.EnumArt.values()) { + if (entitypainting$enumart.title.equals(s)) { + this.art = entitypainting$enumart; + } + } + + if (this.art == null) { + this.art = EntityPainting.EnumArt.KEBAB; + } + + super.readEntityFromNBT(nbttagcompound); + } + + public int getWidthPixels() { + return this.art.sizeX; + } + + public int getHeightPixels() { + return this.art.sizeY; + } + + /**+ + * Called when this entity is broken. Entity parameter may be + * null. + */ + public void onBroken(Entity entity) { + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { + if (entity instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) entity; + if (entityplayer.capabilities.isCreativeMode) { + return; + } + } + + this.entityDropItem(new ItemStack(Items.painting), 0.0F); + } + } + + /**+ + * Sets the location and Yaw/Pitch of an entity in the world + */ + public void setLocationAndAngles(double d0, double d1, double d2, float var7, float var8) { + BlockPos blockpos = this.hangingPosition.add(d0 - this.posX, d1 - this.posY, d2 - this.posZ); + this.setPosition((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ()); + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float var7, float var8, int var9, + boolean var10) { + BlockPos blockpos = this.hangingPosition.add(d0 - this.posX, d1 - this.posY, d2 - this.posZ); + this.setPosition((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ()); + } + + public static enum EnumArt { + KEBAB("Kebab", 16, 16, 0, 0), AZTEC("Aztec", 16, 16, 16, 0), ALBAN("Alban", 16, 16, 32, 0), + AZTEC_2("Aztec2", 16, 16, 48, 0), BOMB("Bomb", 16, 16, 64, 0), PLANT("Plant", 16, 16, 80, 0), + WASTELAND("Wasteland", 16, 16, 96, 0), POOL("Pool", 32, 16, 0, 32), COURBET("Courbet", 32, 16, 32, 32), + SEA("Sea", 32, 16, 64, 32), SUNSET("Sunset", 32, 16, 96, 32), CREEBET("Creebet", 32, 16, 128, 32), + WANDERER("Wanderer", 16, 32, 0, 64), GRAHAM("Graham", 16, 32, 16, 64), MATCH("Match", 32, 32, 0, 128), + BUST("Bust", 32, 32, 32, 128), STAGE("Stage", 32, 32, 64, 128), VOID("Void", 32, 32, 96, 128), + SKULL_AND_ROSES("SkullAndRoses", 32, 32, 128, 128), WITHER("Wither", 32, 32, 160, 128), + FIGHTERS("Fighters", 64, 32, 0, 96), POINTER("Pointer", 64, 64, 0, 192), PIGSCENE("Pigscene", 64, 64, 64, 192), + BURNING_SKULL("BurningSkull", 64, 64, 128, 192), SKELETON("Skeleton", 64, 48, 192, 64), + DONKEY_KONG("DonkeyKong", 64, 48, 192, 112); + + public static final int field_180001_A = "SkullAndRoses".length(); + public final String title; + public final int sizeX; + public final int sizeY; + public final int offsetX; + public final int offsetY; + + private EnumArt(String titleIn, int width, int height, int textureU, int textureV) { + this.title = titleIn; + this.sizeX = width; + this.sizeY = height; + this.offsetX = textureU; + this.offsetY = textureV; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityTNTPrimed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityTNTPrimed.java new file mode 100644 index 0000000..54aaa0c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityTNTPrimed.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityTNTPrimed extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityTNTPrimed"); + } + + public int fuse; + private EntityLivingBase tntPlacedBy; + + public EntityTNTPrimed(World worldIn) { + super(worldIn); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + } + + public EntityTNTPrimed(World worldIn, double parDouble1, double parDouble2, double parDouble3, + EntityLivingBase parEntityLivingBase) { + this(worldIn); + this.setPosition(parDouble1, parDouble2, parDouble3); + float f = (float) (Math.random() * 3.1415927410125732D * 2.0D); + this.motionX = (double) (-((float) Math.sin((double) f)) * 0.02F); + this.motionY = 0.20000000298023224D; + this.motionZ = (double) (-((float) Math.cos((double) f)) * 0.02F); + this.fuse = 80; + this.prevPosX = parDouble1; + this.prevPosY = parDouble2; + this.prevPosZ = parDouble3; + this.tntPlacedBy = parEntityLivingBase; + } + + protected void entityInit() { + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + } + + if (this.fuse-- <= 0) { + this.setDead(); + { + this.explode(); + } + } else { + this.handleWaterMovement(); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, + 0.0D, 0.0D, new int[0]); + } + + } + + private void explode() { + float f = 4.0F; + this.worldObj.createExplosion(this, this.posX, this.posY + (double) (this.height / 16.0F), this.posZ, f, true); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setByte("Fuse", (byte) this.fuse); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.fuse = nbttagcompound.getByte("Fuse"); + } + + /**+ + * returns null or the entityliving it was placed or ignited by + */ + public EntityLivingBase getTntPlacedBy() { + return this.tntPlacedBy; + } + + public float getEyeHeight() { + return 0.0F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityXPOrb.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityXPOrb.java new file mode 100644 index 0000000..a40823d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityXPOrb.java @@ -0,0 +1,284 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityXPOrb extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/item/EntityXPOrb"); + } + + public int xpColor; + public int xpOrbAge; + public int delayBeforeCanPickup; + /**+ + * The health of this XP orb. + */ + private int xpOrbHealth = 5; + private int xpValue; + private EntityPlayer closestPlayer; + private int xpTargetColor; + + public EntityXPOrb(World worldIn, double x, double y, double z, int expValue) { + super(worldIn); + this.setSize(0.5F, 0.5F); + this.setPosition(x, y, z); + this.rotationYaw = (float) (Math.random() * 360.0D); + this.motionX = (double) ((float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.motionY = (double) ((float) (Math.random() * 0.2D) * 2.0F); + this.motionZ = (double) ((float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.xpValue = expValue; + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public EntityXPOrb(World worldIn) { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() { + } + + public int getBrightnessForRender(float f) { + float f1 = 0.5F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + int i = super.getBrightnessForRender(f); + int j = i & 255; + int k = i >> 16 & 255; + j = j + (int) (f1 * 15.0F * 16.0F); + if (j > 240) { + j = 240; + } + + return j | k << 16; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.delayBeforeCanPickup > 0) { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.029999999329447746D; + if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava) { + this.motionY = 0.20000000298023224D; + this.motionX = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, + this.posZ); + double d0 = 8.0D; + if (this.xpTargetColor < this.xpColor - 20 + this.getEntityId() % 100) { + if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > d0 * d0) { + this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, d0); + } + + this.xpTargetColor = this.xpColor; + } + + if (this.closestPlayer != null && this.closestPlayer.isSpectator()) { + this.closestPlayer = null; + } + + if (this.closestPlayer != null) { + double d1 = (this.closestPlayer.posX - this.posX) / d0; + double d2 = (this.closestPlayer.posY + (double) this.closestPlayer.getEyeHeight() - this.posY) / d0; + double d3 = (this.closestPlayer.posZ - this.posZ) / d0; + double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3); + double d5 = 1.0D - d4; + if (d5 > 0.0D) { + d5 = d5 * d5; + this.motionX += d1 / d4 * d5 * 0.1D; + this.motionY += d2 / d4 * d5 * 0.1D; + this.motionZ += d3 / d4 * d5 * 0.1D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f = 0.98F; + if (this.onGround) { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))) + .getBlock().slipperiness * 0.98F; + } + + this.motionX *= (double) f; + this.motionY *= 0.9800000190734863D; + this.motionZ *= (double) f; + if (this.onGround) { + this.motionY *= -0.8999999761581421D; + } + + ++this.xpColor; + ++this.xpOrbAge; + if (this.xpOrbAge >= 6000) { + this.setDead(); + } + + } + + /**+ + * Returns if this entity is in water and will end up adding the + * waters velocity to the entity + */ + public boolean handleWaterMovement() { + return this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this); + } + + /**+ + * Will deal the specified amount of damage to the entity if the + * entity isn't immune to fire damage. Args: amountDamage + */ + protected void dealFireDamage(int i) { + this.attackEntityFrom(DamageSource.inFire, (float) i); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.setBeenAttacked(); + this.xpOrbHealth = (int) ((float) this.xpOrbHealth - f); + if (this.xpOrbHealth <= 0) { + this.setDead(); + } + + return false; + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("Health", (short) ((byte) this.xpOrbHealth)); + nbttagcompound.setShort("Age", (short) this.xpOrbAge); + nbttagcompound.setShort("Value", (short) this.xpValue); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.xpOrbHealth = nbttagcompound.getShort("Health") & 255; + this.xpOrbAge = nbttagcompound.getShort("Age"); + this.xpValue = nbttagcompound.getShort("Value"); + } + + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) { + { + if (this.delayBeforeCanPickup == 0 && entityplayer.xpCooldown == 0) { + entityplayer.xpCooldown = 2; + this.worldObj.playSoundAtEntity(entityplayer, "random.orb", 0.1F, + 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); + entityplayer.onItemPickup(this, 1); + entityplayer.addExperience(this.xpValue); + this.setDead(); + } + + } + } + + /**+ + * Returns the XP value of this XP orb. + */ + public int getXpValue() { + return this.xpValue; + } + + /**+ + * Returns a number from 1 to 10 based on how much XP this orb + * is worth. This is used by RenderXPOrb to determine what + * texture to use. + */ + public int getTextureByXP() { + return this.xpValue >= 2477 ? 10 + : (this.xpValue >= 1237 ? 9 + : (this.xpValue >= 617 ? 8 + : (this.xpValue >= 307 ? 7 + : (this.xpValue >= 149 ? 6 + : (this.xpValue >= 73 ? 5 + : (this.xpValue >= 37 ? 4 + : (this.xpValue >= 17 ? 3 + : (this.xpValue >= 7 ? 2 + : (this.xpValue >= 3 ? 1 : 0))))))))); + } + + /**+ + * Get a fragment of the maximum experience points value for the + * supplied value of experience points value. + */ + public static int getXPSplit(int expValue) { + return expValue >= 2477 ? 2477 + : (expValue >= 1237 ? 1237 + : (expValue >= 617 ? 617 + : (expValue >= 307 ? 307 + : (expValue >= 149 ? 149 + : (expValue >= 73 ? 73 + : (expValue >= 37 ? 37 + : (expValue >= 17 ? 17 + : (expValue >= 7 ? 7 + : (expValue >= 3 ? 3 : 1))))))))); + } + + /**+ + * If returns false, the item will not inflict any damage + * against entities. + */ + public boolean canAttackWithItem() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityBlaze.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityBlaze.java new file mode 100644 index 0000000..1fe3894 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityBlaze.java @@ -0,0 +1,278 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySmallFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityBlaze extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityBlaze"); + } + + /**+ + * Random offset used in floating behaviour + */ + private float heightOffset = 0.5F; + private int heightOffsetUpdateTime; + + public EntityBlaze(World worldIn) { + super(worldIn); + this.isImmuneToFire = true; + this.experienceValue = 10; + this.tasks.addTask(4, new EntityBlaze.AIFireballAttack(this)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(48.0D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 0)); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.blaze.breathe"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.blaze.hit"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.blaze.death"; + } + + public int getBrightnessForRender(float var1) { + return 15728880; + } + + /**+ + * Gets how bright this entity is. + */ + public float getBrightness(float var1) { + return 1.0F; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + super.onLivingUpdate(); + } + + protected void updateAITasks() { + if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + --this.heightOffsetUpdateTime; + if (this.heightOffsetUpdateTime <= 0) { + this.heightOffsetUpdateTime = 100; + this.heightOffset = 0.5F + (float) this.rand.nextGaussian() * 3.0F; + } + + EntityLivingBase entitylivingbase = this.getAttackTarget(); + if (entitylivingbase != null && entitylivingbase.posY + (double) entitylivingbase.getEyeHeight() > this.posY + + (double) this.getEyeHeight() + (double) this.heightOffset) { + this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; + this.isAirBorne = true; + } + + super.updateAITasks(); + } + + public void fall(float var1, float var2) { + } + + protected Item getDropItem() { + return Items.blaze_rod; + } + + /**+ + * Returns true if the entity is on fire. Used by render to add + * the fire effect on rendering. + */ + public boolean isBurning() { + return this.func_70845_n(); + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean flag, int i) { + if (flag) { + int j = this.rand.nextInt(2 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.blaze_rod, 1); + } + } + + } + + public boolean func_70845_n() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setOnFire(boolean onFire) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (onFire) { + b0 = (byte) (b0 | 1); + } else { + b0 = (byte) (b0 & -2); + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + /**+ + * Checks to make sure the light is not too bright where the mob + * is spawning + */ + protected boolean isValidLightLevel() { + return true; + } + + static class AIFireballAttack extends EntityAIBase { + private EntityBlaze blaze; + private int field_179467_b; + private int field_179468_c; + + public AIFireballAttack(EntityBlaze parEntityBlaze) { + this.blaze = parEntityBlaze; + this.setMutexBits(3); + } + + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.blaze.getAttackTarget(); + return entitylivingbase != null && entitylivingbase.isEntityAlive(); + } + + public void startExecuting() { + this.field_179467_b = 0; + } + + public void resetTask() { + this.blaze.setOnFire(false); + } + + public void updateTask() { + --this.field_179468_c; + EntityLivingBase entitylivingbase = this.blaze.getAttackTarget(); + double d0 = this.blaze.getDistanceSqToEntity(entitylivingbase); + if (d0 < 4.0D) { + if (this.field_179468_c <= 0) { + this.field_179468_c = 20; + this.blaze.attackEntityAsMob(entitylivingbase); + } + + this.blaze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY, + entitylivingbase.posZ, 1.0D); + } else if (d0 < 256.0D) { + double d1 = entitylivingbase.posX - this.blaze.posX; + double d2 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) + - (this.blaze.posY + (double) (this.blaze.height / 2.0F)); + double d3 = entitylivingbase.posZ - this.blaze.posZ; + if (this.field_179468_c <= 0) { + ++this.field_179467_b; + if (this.field_179467_b == 1) { + this.field_179468_c = 60; + this.blaze.setOnFire(true); + } else if (this.field_179467_b <= 4) { + this.field_179468_c = 6; + } else { + this.field_179468_c = 100; + this.field_179467_b = 0; + this.blaze.setOnFire(false); + } + + if (this.field_179467_b > 1) { + float f = MathHelper.sqrt_float(MathHelper.sqrt_double(d0)) * 0.5F; + this.blaze.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1009, + new BlockPos((int) this.blaze.posX, (int) this.blaze.posY, (int) this.blaze.posZ), 0); + + for (int i = 0; i < 1; ++i) { + EntitySmallFireball entitysmallfireball = new EntitySmallFireball(this.blaze.worldObj, + this.blaze, d1 + this.blaze.getRNG().nextGaussian() * (double) f, d2, + d3 + this.blaze.getRNG().nextGaussian() * (double) f); + entitysmallfireball.posY = this.blaze.posY + (double) (this.blaze.height / 2.0F) + 0.5D; + this.blaze.worldObj.spawnEntityInWorld(entitysmallfireball); + } + } + } + + this.blaze.getLookHelper().setLookPositionWithEntity(entitylivingbase, 10.0F, 10.0F); + } else { + this.blaze.getNavigator().clearPathEntity(); + this.blaze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY, + entitylivingbase.posZ, 1.0D); + } + + super.updateTask(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCaveSpider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCaveSpider.java new file mode 100644 index 0000000..9c76e99 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCaveSpider.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySpider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityCaveSpider extends EntitySpider { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityCaveSpider"); + } + + public EntityCaveSpider(World worldIn) { + super(worldIn); + this.setSize(0.7F, 0.5F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12.0D); + } + + public boolean attackEntityAsMob(Entity entity) { + if (super.attackEntityAsMob(entity)) { + if (entity instanceof EntityLivingBase) { + byte b0 = 0; + if (this.worldObj.getDifficulty() == EnumDifficulty.NORMAL) { + b0 = 7; + } else if (this.worldObj.getDifficulty() == EnumDifficulty.HARD) { + b0 = 15; + } + + if (b0 > 0) { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, b0 * 20, 0)); + } + } + + return true; + } else { + return false; + } + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance var1, IEntityLivingData ientitylivingdata) { + return ientitylivingdata; + } + + public float getEyeHeight() { + return 0.45F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCreeper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCreeper.java new file mode 100644 index 0000000..97dd604 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCreeper.java @@ -0,0 +1,300 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAICreeperSwell; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityOcelot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityCreeper extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityCreeper"); + } + + private int lastActiveTime; + private int timeSinceIgnited; + private int fuseTime = 30; + /**+ + * Explosion radius for this creeper. + */ + private int explosionRadius = 3; + private int field_175494_bm = 0; + + public EntityCreeper(World worldIn) { + super(worldIn); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAICreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0])); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /**+ + * The maximum height from where the entity is alowed to jump + * (used in pathfinder) + */ + public int getMaxFallHeight() { + return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); + } + + public void fall(float f, float f1) { + super.fall(f, f1); + this.timeSinceIgnited = (int) ((float) this.timeSinceIgnited + f * 1.5F); + if (this.timeSinceIgnited > this.fuseTime - 5) { + this.timeSinceIgnited = this.fuseTime - 5; + } + + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) -1)); + this.dataWatcher.addObject(17, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(18, Byte.valueOf((byte) 0)); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + if (this.dataWatcher.getWatchableObjectByte(17) == 1) { + nbttagcompound.setBoolean("powered", true); + } + + nbttagcompound.setShort("Fuse", (short) this.fuseTime); + nbttagcompound.setByte("ExplosionRadius", (byte) this.explosionRadius); + nbttagcompound.setBoolean("ignited", this.hasIgnited()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.dataWatcher.updateObject(17, Byte.valueOf((byte) (nbttagcompound.getBoolean("powered") ? 1 : 0))); + if (nbttagcompound.hasKey("Fuse", 99)) { + this.fuseTime = nbttagcompound.getShort("Fuse"); + } + + if (nbttagcompound.hasKey("ExplosionRadius", 99)) { + this.explosionRadius = nbttagcompound.getByte("ExplosionRadius"); + } + + if (nbttagcompound.getBoolean("ignited")) { + this.ignite(); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.isEntityAlive()) { + this.lastActiveTime = this.timeSinceIgnited; + if (this.hasIgnited()) { + this.setCreeperState(1); + } + + int i = this.getCreeperState(); + if (i > 0 && this.timeSinceIgnited == 0) { + this.playSound("creeper.primed", 1.0F, 0.5F); + } + + this.timeSinceIgnited += i; + if (this.timeSinceIgnited < 0) { + this.timeSinceIgnited = 0; + } + + if (this.timeSinceIgnited >= this.fuseTime) { + this.timeSinceIgnited = this.fuseTime; + this.explode(); + } + } + + super.onUpdate(); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.creeper.say"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.creeper.death"; + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + if (damagesource.getEntity() instanceof EntitySkeleton) { + int i = Item.getIdFromItem(Items.record_13); + int j = Item.getIdFromItem(Items.record_wait); + int k = i + this.rand.nextInt(j - i + 1); + this.dropItem(Item.getItemById(k), 1); + } else if (damagesource.getEntity() instanceof EntityCreeper && damagesource.getEntity() != this + && ((EntityCreeper) damagesource.getEntity()).getPowered() + && ((EntityCreeper) damagesource.getEntity()).isAIEnabled()) { + ((EntityCreeper) damagesource.getEntity()).func_175493_co(); + this.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F); + } + + } + + public boolean attackEntityAsMob(Entity var1) { + return true; + } + + /**+ + * Returns true if the creeper is powered by a lightning bolt. + */ + public boolean getPowered() { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } + + /**+ + * Params: (Float)Render tick. Returns the intensity of the + * creeper's flash when it is ignited. + */ + public float getCreeperFlashIntensity(float parFloat1) { + return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * parFloat1) + / (float) (this.fuseTime - 2); + } + + protected Item getDropItem() { + return Items.gunpowder; + } + + /**+ + * Returns the current state of creeper, -1 is idle, 1 is 'in + * fuse' + */ + public int getCreeperState() { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /**+ + * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' + */ + public void setCreeperState(int state) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) state)); + } + + /**+ + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt entitylightningbolt) { + super.onStruckByLightning(entitylightningbolt); + this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.flint_and_steel) { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, + this.rand.nextFloat() * 0.4F + 0.8F); + entityplayer.swingItem(); + this.ignite(); + itemstack.damageItem(1, entityplayer); + return true; + } + + return super.interact(entityplayer); + } + + /**+ + * Creates an explosion as determined by this creeper's power + * and explosion radius. + */ + private void explode() { + { + boolean flag = this.worldObj.getGameRules().getBoolean("mobGriefing"); + float f = this.getPowered() ? 2.0F : 1.0F; + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, + flag); + this.setDead(); + } + } + + public boolean hasIgnited() { + return this.dataWatcher.getWatchableObjectByte(18) != 0; + } + + public void ignite() { + this.dataWatcher.updateObject(18, Byte.valueOf((byte) 1)); + } + + /**+ + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return this.field_175494_bm < 1 && this.worldObj.getGameRules().getBoolean("doMobLoot"); + } + + public void func_175493_co() { + ++this.field_175494_bm; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEnderman.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEnderman.java new file mode 100644 index 0000000..86a4c8d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEnderman.java @@ -0,0 +1,556 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import com.google.common.collect.Sets; +import java.util.Collections; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEndermite; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSourceIndirect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityEnderman extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityEnderman"); + } + + private static final EaglercraftUUID attackingSpeedBoostModifierUUID = EaglercraftUUID + .fromString("020E0DFB-87AE-4653-9556-831010E291A0"); + private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier( + attackingSpeedBoostModifierUUID, "Attacking speed boost", 0.15000000596046448D, 0)).setSaved(false); + private static final Set carriableBlocks = Sets.newIdentityHashSet(); + private boolean isAggressive; + + public EntityEnderman(World worldIn) { + super(worldIn); + this.setSize(0.6F, 2.9F); + this.stepHeight = 1.0F; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this)); + this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityEnderman.AIFindPlayer(this)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, + new Predicate() { + public boolean apply(EntityEndermite entityendermite) { + return entityendermite.isSpawnedByPlayer(); + } + })); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(7.0D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(64.0D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Short((short) 0)); + this.dataWatcher.addObject(17, new Byte((byte) 0)); + this.dataWatcher.addObject(18, new Byte((byte) 0)); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + IBlockState iblockstate = this.getHeldBlockState(); + nbttagcompound.setShort("carried", (short) Block.getIdFromBlock(iblockstate.getBlock())); + nbttagcompound.setShort("carriedData", (short) iblockstate.getBlock().getMetaFromState(iblockstate)); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + IBlockState iblockstate; + if (nbttagcompound.hasKey("carried", 8)) { + iblockstate = Block.getBlockFromName(nbttagcompound.getString("carried")) + .getStateFromMeta(nbttagcompound.getShort("carriedData") & '\uffff'); + } else { + iblockstate = Block.getBlockById(nbttagcompound.getShort("carried")) + .getStateFromMeta(nbttagcompound.getShort("carriedData") & '\uffff'); + } + + this.setHeldBlockState(iblockstate); + } + + /**+ + * Checks to see if this enderman should be attacking this + * player + */ + private boolean shouldAttackPlayer(EntityPlayer player) { + ItemStack itemstack = player.inventory.armorInventory[3]; + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) { + return false; + } else { + Vec3 vec3 = player.getLook(1.0F).normalize(); + Vec3 vec31 = new Vec3(this.posX - player.posX, this.getEntityBoundingBox().minY + + (double) (this.height / 2.0F) - (player.posY + (double) player.getEyeHeight()), + this.posZ - player.posZ); + double d0 = vec31.lengthVector(); + vec31 = vec31.normalize(); + double d1 = vec3.dotProduct(vec31); + return d1 > 1.0D - 0.025D / d0 ? player.canEntityBeSeen(this) : false; + } + } + + public float getEyeHeight() { + return 2.55F; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + this.isJumping = false; + super.onLivingUpdate(); + } + + protected void updateAITasks() { + if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) { + this.setScreaming(false); + } + + if (this.worldObj.isDaytime()) { + float f = this.getBrightness(1.0F); + if (f > 0.5F && this.worldObj.canSeeSky(new BlockPos(this)) + && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { + this.setAttackTarget((EntityLivingBase) null); + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + } + + super.updateAITasks(); + } + + /**+ + * Teleport the enderman to a random nearby position + */ + protected boolean teleportRandomly() { + double d0 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; + double d1 = this.posY + (double) (this.rand.nextInt(64) - 32); + double d2 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; + return this.teleportTo(d0, d1, d2); + } + + /**+ + * Teleport the enderman to another entity + */ + protected boolean teleportToEntity(Entity parEntity) { + Vec3 vec3 = new Vec3(this.posX - parEntity.posX, this.getEntityBoundingBox().minY + + (double) (this.height / 2.0F) - parEntity.posY + (double) parEntity.getEyeHeight(), + this.posZ - parEntity.posZ); + vec3 = vec3.normalize(); + double d0 = 16.0D; + double d1 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.xCoord * d0; + double d2 = this.posY + (double) (this.rand.nextInt(16) - 8) - vec3.yCoord * d0; + double d3 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.zCoord * d0; + return this.teleportTo(d1, d2, d3); + } + + /**+ + * Teleport the enderman + */ + protected boolean teleportTo(double x, double y, double z) { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + this.posX = x; + this.posY = y; + this.posZ = z; + boolean flag = false; + BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ); + if (this.worldObj.isBlockLoaded(blockpos)) { + boolean flag1 = false; + + while (!flag1 && blockpos.getY() > 0) { + BlockPos blockpos1 = blockpos.down(); + Block block = this.worldObj.getBlockState(blockpos1).getBlock(); + if (block.getMaterial().blocksMovement()) { + flag1 = true; + } else { + --this.posY; + blockpos = blockpos1; + } + } + + if (flag1) { + super.setPositionAndUpdate(this.posX, this.posY, this.posZ); + if (this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() + && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox())) { + flag = true; + } + } + } + + if (!flag) { + this.setPosition(d0, d1, d2); + return false; + } else { + short short1 = 128; + + for (int i = 0; i < short1; ++i) { + double d6 = (double) i / ((double) short1 - 1.0D); + float f = (this.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (this.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (this.rand.nextFloat() - 0.5F) * 0.2F; + double d3 = d0 + (this.posX - d0) * d6 + (this.rand.nextDouble() - 0.5D) * (double) this.width * 2.0D; + double d4 = d1 + (this.posY - d1) * d6 + this.rand.nextDouble() * (double) this.height; + double d5 = d2 + (this.posZ - d2) * d6 + (this.rand.nextDouble() - 0.5D) * (double) this.width * 2.0D; + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d3, d4, d5, (double) f, (double) f1, (double) f2, + new int[0]); + } + + this.worldObj.playSoundEffect(d0, d1, d2, "mob.endermen.portal", 1.0F, 1.0F); + this.playSound("mob.endermen.portal", 1.0F, 1.0F); + return true; + } + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.endermen.hit"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.endermen.death"; + } + + protected Item getDropItem() { + return Items.ender_pearl; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + Item item = this.getDropItem(); + if (item != null) { + int j = this.rand.nextInt(2 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(item, 1); + } + } + + } + + /**+ + * Sets this enderman's held block state + */ + public void setHeldBlockState(IBlockState state) { + this.dataWatcher.updateObject(16, Short.valueOf((short) (Block.getStateId(state) & '\uffff'))); + } + + /**+ + * Gets this enderman's held block state + */ + public IBlockState getHeldBlockState() { + return Block.getStateById(this.dataWatcher.getWatchableObjectShort(16) & '\uffff'); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + if (damagesource.getEntity() == null || !(damagesource.getEntity() instanceof EntityEndermite)) { + this.setScreaming(true); + + if (damagesource instanceof EntityDamageSource && damagesource.getEntity() instanceof EntityPlayer) { + if (damagesource.getEntity() instanceof EntityPlayerMP + && ((EntityPlayerMP) damagesource.getEntity()).theItemInWorldManager.isCreative()) { + this.setScreaming(false); + } else { + this.isAggressive = true; + } + } + + if (damagesource instanceof EntityDamageSourceIndirect) { + this.isAggressive = false; + + for (int i = 0; i < 64; ++i) { + if (this.teleportRandomly()) { + return true; + } + } + + return false; + } + } + + boolean flag = super.attackEntityFrom(damagesource, f); + if (damagesource.isUnblockable() && this.rand.nextInt(10) != 0) { + this.teleportRandomly(); + } + + return flag; + } + } + + public boolean isScreaming() { + return this.dataWatcher.getWatchableObjectByte(18) > 0; + } + + public void setScreaming(boolean screaming) { + this.dataWatcher.updateObject(18, Byte.valueOf((byte) (screaming ? 1 : 0))); + } + + public static void doBootstrap() { + carriableBlocks.add(Blocks.grass); + carriableBlocks.add(Blocks.dirt); + carriableBlocks.add(Blocks.sand); + carriableBlocks.add(Blocks.gravel); + carriableBlocks.add(Blocks.yellow_flower); + carriableBlocks.add(Blocks.red_flower); + carriableBlocks.add(Blocks.brown_mushroom); + carriableBlocks.add(Blocks.red_mushroom); + carriableBlocks.add(Blocks.tnt); + carriableBlocks.add(Blocks.cactus); + carriableBlocks.add(Blocks.clay); + carriableBlocks.add(Blocks.pumpkin); + carriableBlocks.add(Blocks.melon_block); + carriableBlocks.add(Blocks.mycelium); + } + + static class AIFindPlayer extends EntityAINearestAttackableTarget { + private EntityPlayer player; + private int field_179450_h; + private int field_179451_i; + private EntityEnderman enderman; + + public AIFindPlayer(EntityEnderman parEntityEnderman) { + super(parEntityEnderman, EntityPlayer.class, true); + this.enderman = parEntityEnderman; + } + + public boolean shouldExecute() { + double d0 = this.getTargetDistance(); + List list = this.taskOwner.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + this.taskOwner.getEntityBoundingBox().expand(d0, 4.0D, d0), this.targetEntitySelector); + Collections.sort(list, this.theNearestAttackableTargetSorter); + if (list.isEmpty()) { + return false; + } else { + this.player = (EntityPlayer) list.get(0); + return true; + } + } + + public void startExecuting() { + this.field_179450_h = 5; + this.field_179451_i = 0; + } + + public void resetTask() { + this.player = null; + this.enderman.setScreaming(false); + IAttributeInstance iattributeinstance = this.enderman + .getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(EntityEnderman.attackingSpeedBoostModifier); + super.resetTask(); + } + + public boolean continueExecuting() { + if (this.player != null) { + if (!this.enderman.shouldAttackPlayer(this.player)) { + return false; + } else { + this.enderman.isAggressive = true; + this.enderman.faceEntity(this.player, 10.0F, 10.0F); + return true; + } + } else { + return super.continueExecuting(); + } + } + + public void updateTask() { + if (this.player != null) { + if (--this.field_179450_h <= 0) { + this.targetEntity = this.player; + this.player = null; + super.startExecuting(); + this.enderman.playSound("mob.endermen.stare", 1.0F, 1.0F); + this.enderman.setScreaming(true); + IAttributeInstance iattributeinstance = this.enderman + .getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.applyModifier(EntityEnderman.attackingSpeedBoostModifier); + } + } else { + if (this.targetEntity != null) { + if (this.targetEntity instanceof EntityPlayer + && this.enderman.shouldAttackPlayer((EntityPlayer) this.targetEntity)) { + if (this.targetEntity.getDistanceSqToEntity(this.enderman) < 16.0D) { + this.enderman.teleportRandomly(); + } + + this.field_179451_i = 0; + } else if (this.targetEntity.getDistanceSqToEntity(this.enderman) > 256.0D + && this.field_179451_i++ >= 30 && this.enderman.teleportToEntity(this.targetEntity)) { + this.field_179451_i = 0; + } + } + + super.updateTask(); + } + + } + } + + static class AIPlaceBlock extends EntityAIBase { + private EntityEnderman enderman; + + public AIPlaceBlock(EntityEnderman parEntityEnderman) { + this.enderman = parEntityEnderman; + } + + public boolean shouldExecute() { + return !this.enderman.worldObj.getGameRules().getBoolean("mobGriefing") ? false + : (this.enderman.getHeldBlockState().getBlock().getMaterial() == Material.air ? false + : this.enderman.getRNG().nextInt(2000) == 0); + } + + public void updateTask() { + EaglercraftRandom random = this.enderman.getRNG(); + World world = this.enderman.worldObj; + int i = MathHelper.floor_double(this.enderman.posX - 1.0D + random.nextDouble() * 2.0D); + int j = MathHelper.floor_double(this.enderman.posY + random.nextDouble() * 2.0D); + int k = MathHelper.floor_double(this.enderman.posZ - 1.0D + random.nextDouble() * 2.0D); + BlockPos blockpos = new BlockPos(i, j, k); + Block block = world.getBlockState(blockpos).getBlock(); + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + if (this.func_179474_a(world, blockpos, this.enderman.getHeldBlockState().getBlock(), block, block1)) { + world.setBlockState(blockpos, this.enderman.getHeldBlockState(), 3); + this.enderman.setHeldBlockState(Blocks.air.getDefaultState()); + } + + } + + private boolean func_179474_a(World worldIn, BlockPos parBlockPos, Block parBlock, Block parBlock2, + Block parBlock3) { + return !parBlock.canPlaceBlockAt(worldIn, parBlockPos) ? false + : (parBlock2.getMaterial() != Material.air ? false + : (parBlock3.getMaterial() == Material.air ? false : parBlock3.isFullCube())); + } + } + + static class AITakeBlock extends EntityAIBase { + private EntityEnderman enderman; + + public AITakeBlock(EntityEnderman parEntityEnderman) { + this.enderman = parEntityEnderman; + } + + public boolean shouldExecute() { + return !this.enderman.worldObj.getGameRules().getBoolean("mobGriefing") ? false + : (this.enderman.getHeldBlockState().getBlock().getMaterial() != Material.air ? false + : this.enderman.getRNG().nextInt(20) == 0); + } + + public void updateTask() { + EaglercraftRandom random = this.enderman.getRNG(); + World world = this.enderman.worldObj; + int i = MathHelper.floor_double(this.enderman.posX - 2.0D + random.nextDouble() * 4.0D); + int j = MathHelper.floor_double(this.enderman.posY + random.nextDouble() * 3.0D); + int k = MathHelper.floor_double(this.enderman.posZ - 2.0D + random.nextDouble() * 4.0D); + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (EntityEnderman.carriableBlocks.contains(block)) { + this.enderman.setHeldBlockState(iblockstate); + world.setBlockState(blockpos, Blocks.air.getDefaultState()); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEndermite.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEndermite.java new file mode 100644 index 0000000..92e5e2d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEndermite.java @@ -0,0 +1,198 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityEndermite extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityEndermite"); + } + + private int lifetime = 0; + private boolean playerSpawned = false; + + public EntityEndermite(World worldIn) { + super(worldIn); + this.experienceValue = 3; + this.setSize(0.4F, 0.3F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(3, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + public float getEyeHeight() { + return 0.1F; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.silverfish.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.silverfish.hit"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.silverfish.kill"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + + protected Item getDropItem() { + return null; + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.lifetime = nbttagcompound.getInteger("Lifetime"); + this.playerSpawned = nbttagcompound.getBoolean("PlayerSpawned"); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("Lifetime", this.lifetime); + nbttagcompound.setBoolean("PlayerSpawned", this.playerSpawned); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); + } + + public boolean isSpawnedByPlayer() { + return this.playerSpawned; + } + + /**+ + * Sets if this mob was spawned by a player or not. + */ + public void setSpawnedByPlayer(boolean spawnedByPlayer) { + this.playerSpawned = spawnedByPlayer; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + { + if (!this.isNoDespawnRequired()) { + ++this.lifetime; + } + + if (this.lifetime >= 2400) { + this.setDead(); + } + } + } + + /**+ + * Checks to make sure the light is not too bright where the mob + * is spawning + */ + protected boolean isValidLightLevel() { + return true; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + if (super.getCanSpawnHere()) { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return entityplayer == null; + } else { + return false; + } + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGhast.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGhast.java new file mode 100644 index 0000000..1dfc78f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGhast.java @@ -0,0 +1,378 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityFlying; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMoveHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityLargeFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityGhast extends EntityFlying implements IMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityGhast"); + } + + /**+ + * The explosion radius of spawned fireballs. + */ + private int explosionStrength = 1; + + public EntityGhast(World worldIn) { + super(worldIn); + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + this.moveHelper = new EntityGhast.GhastMoveHelper(this); + this.tasks.addTask(5, new EntityGhast.AIRandomFly(this)); + this.tasks.addTask(7, new EntityGhast.AILookAround(this)); + this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this)); + this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); + } + + public boolean isAttacking() { + return this.dataWatcher.getWatchableObjectByte(16) != 0; + } + + public void setAttacking(boolean parFlag) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (parFlag ? 1 : 0))); + } + + public int getFireballStrength() { + return this.explosionStrength; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if ("fireball".equals(damagesource.getDamageType()) + && damagesource.getEntity() instanceof EntityPlayer) { + super.attackEntityFrom(damagesource, 1000.0F); + ((EntityPlayer) damagesource.getEntity()).triggerAchievement(AchievementList.ghast); + return true; + } else { + return super.attackEntityFrom(damagesource, f); + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.ghast.moan"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.ghast.scream"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.ghast.death"; + } + + protected Item getDropItem() { + return Items.gunpowder; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(2) + this.rand.nextInt(1 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.ghast_tear, 1); + } + + j = this.rand.nextInt(3) + this.rand.nextInt(1 + i); + + for (int l = 0; l < j; ++l) { + this.dropItem(Items.gunpowder, 1); + } + + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 10.0F; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() + && this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL; + } + + /**+ + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 1; + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("ExplosionPower", this.explosionStrength); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("ExplosionPower", 99)) { + this.explosionStrength = nbttagcompound.getInteger("ExplosionPower"); + } + + } + + public float getEyeHeight() { + return 2.6F; + } + + static class AIFireballAttack extends EntityAIBase { + private EntityGhast parentEntity; + public int attackTimer; + + public AIFireballAttack(EntityGhast parEntityGhast) { + this.parentEntity = parEntityGhast; + } + + public boolean shouldExecute() { + return this.parentEntity.getAttackTarget() != null; + } + + public void startExecuting() { + this.attackTimer = 0; + } + + public void resetTask() { + this.parentEntity.setAttacking(false); + } + + public void updateTask() { + EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); + double d0 = 64.0D; + if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < d0 * d0 + && this.parentEntity.canEntityBeSeen(entitylivingbase)) { + World world = this.parentEntity.worldObj; + ++this.attackTimer; + if (this.attackTimer == 10) { + world.playAuxSFXAtEntity((EntityPlayer) null, 1007, new BlockPos(this.parentEntity), 0); + } + + if (this.attackTimer == 20) { + double d1 = 4.0D; + Vec3 vec3 = this.parentEntity.getLook(1.0F); + double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3.xCoord * d1); + double d3 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) + - (0.5D + this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F)); + double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3.zCoord * d1); + world.playAuxSFXAtEntity((EntityPlayer) null, 1008, new BlockPos(this.parentEntity), 0); + EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, + d4); + entitylargefireball.explosionPower = this.parentEntity.getFireballStrength(); + entitylargefireball.posX = this.parentEntity.posX + vec3.xCoord * d1; + entitylargefireball.posY = this.parentEntity.posY + (double) (this.parentEntity.height / 2.0F) + + 0.5D; + entitylargefireball.posZ = this.parentEntity.posZ + vec3.zCoord * d1; + world.spawnEntityInWorld(entitylargefireball); + this.attackTimer = -40; + } + } else if (this.attackTimer > 0) { + --this.attackTimer; + } + + this.parentEntity.setAttacking(this.attackTimer > 10); + } + } + + static class AILookAround extends EntityAIBase { + private EntityGhast parentEntity; + + public AILookAround(EntityGhast parEntityGhast) { + this.parentEntity = parEntityGhast; + this.setMutexBits(2); + } + + public boolean shouldExecute() { + return true; + } + + public void updateTask() { + if (this.parentEntity.getAttackTarget() == null) { + this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw = -((float) MathHelper + .func_181159_b(this.parentEntity.motionX, this.parentEntity.motionZ)) * 180.0F / 3.1415927F; + } else { + EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); + double d0 = 64.0D; + if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < d0 * d0) { + double d1 = entitylivingbase.posX - this.parentEntity.posX; + double d2 = entitylivingbase.posZ - this.parentEntity.posZ; + this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw = -((float) MathHelper + .func_181159_b(d1, d2)) * 180.0F / 3.1415927F; + } + } + + } + } + + static class AIRandomFly extends EntityAIBase { + private EntityGhast parentEntity; + + public AIRandomFly(EntityGhast parEntityGhast) { + this.parentEntity = parEntityGhast; + this.setMutexBits(1); + } + + public boolean shouldExecute() { + EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper(); + if (!entitymovehelper.isUpdating()) { + return true; + } else { + double d0 = entitymovehelper.getX() - this.parentEntity.posX; + double d1 = entitymovehelper.getY() - this.parentEntity.posY; + double d2 = entitymovehelper.getZ() - this.parentEntity.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + return d3 < 1.0D || d3 > 3600.0D; + } + } + + public boolean continueExecuting() { + return false; + } + + public void startExecuting() { + EaglercraftRandom random = this.parentEntity.getRNG(); + double d0 = this.parentEntity.posX + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + double d1 = this.parentEntity.posY + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + double d2 = this.parentEntity.posZ + (double) ((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D); + } + } + + static class GhastMoveHelper extends EntityMoveHelper { + private EntityGhast parentEntity; + private int courseChangeCooldown; + + public GhastMoveHelper(EntityGhast parEntityGhast) { + super(parEntityGhast); + this.parentEntity = parEntityGhast; + } + + public void onUpdateMoveHelper() { + if (this.update) { + double d0 = this.posX - this.parentEntity.posX; + double d1 = this.posY - this.parentEntity.posY; + double d2 = this.posZ - this.parentEntity.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + if (this.courseChangeCooldown-- <= 0) { + this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2; + d3 = (double) MathHelper.sqrt_double(d3); + if (this.isNotColliding(this.posX, this.posY, this.posZ, d3)) { + this.parentEntity.motionX += d0 / d3 * 0.1D; + this.parentEntity.motionY += d1 / d3 * 0.1D; + this.parentEntity.motionZ += d2 / d3 * 0.1D; + } else { + this.update = false; + } + } + + } + } + + private boolean isNotColliding(double parDouble1, double parDouble2, double parDouble3, double parDouble4) { + double d0 = (parDouble1 - this.parentEntity.posX) / parDouble4; + double d1 = (parDouble2 - this.parentEntity.posY) / parDouble4; + double d2 = (parDouble3 - this.parentEntity.posZ) / parDouble4; + AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox(); + + for (int i = 1; (double) i < parDouble4; ++i) { + axisalignedbb = axisalignedbb.offset(d0, d1, d2); + if (!this.parentEntity.worldObj.getCollidingBoundingBoxes(this.parentEntity, axisalignedbb).isEmpty()) { + return false; + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGiantZombie.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGiantZombie.java new file mode 100644 index 0000000..5f6172e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGiantZombie.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityGiantZombie extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityGiantZombie"); + } + + public EntityGiantZombie(World worldIn) { + super(worldIn); + this.setSize(this.width * 6.0F, this.height * 6.0F); + } + + public float getEyeHeight() { + return 10.440001F; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50.0D); + } + + public float getBlockPathWeight(BlockPos blockpos) { + return this.worldObj.getLightBrightness(blockpos) - 0.5F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGolem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGolem.java new file mode 100644 index 0000000..ea6156f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGolem.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityGolem extends EntityCreature implements IAnimals { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityGolem"); + } + + public EntityGolem(World worldIn) { + super(worldIn); + } + + public void fall(float var1, float var2) { + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "none"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "none"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "none"; + } + + /**+ + * Get number of ticks, at least during which the living entity + * will be silent. + */ + public int getTalkInterval() { + return 120; + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGuardian.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGuardian.java new file mode 100644 index 0000000..e264fea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGuardian.java @@ -0,0 +1,589 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityLookHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMoveHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFishHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateSwimmer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomFishable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityGuardian extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityGuardian"); + } + + private float field_175482_b; + private float field_175484_c; + private float field_175483_bk; + private float field_175485_bl; + private float field_175486_bm; + private EntityLivingBase targetedEntity; + private int field_175479_bo; + private boolean field_175480_bp; + private EntityAIWander wander; + + public EntityGuardian(World worldIn) { + super(worldIn); + this.experienceValue = 10; + this.setSize(0.85F, 0.85F); + this.tasks.addTask(4, new EntityGuardian.AIGuardianAttack(this)); + EntityAIMoveTowardsRestriction entityaimovetowardsrestriction; + this.tasks.addTask(5, entityaimovetowardsrestriction = new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, this.wander = new EntityAIWander(this, 1.0D, 80)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityGuardian.class, 12.0F, 0.01F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.wander.setMutexBits(3); + entityaimovetowardsrestriction.setMutexBits(3); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLivingBase.class, 10, true, false, + new EntityGuardian.GuardianTargetSelector(this))); + this.moveHelper = new EntityGuardian.GuardianMoveHelper(this); + this.field_175484_c = this.field_175482_b = this.rand.nextFloat(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setElder(nbttagcompound.getBoolean("Elder")); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("Elder", this.isElder()); + } + + /**+ + * Returns new PathNavigateGround instance + */ + protected PathNavigate getNewNavigator(World world) { + return new PathNavigateSwimmer(this, world); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + this.dataWatcher.addObject(17, Integer.valueOf(0)); + } + + /**+ + * Returns true if given flag is set + */ + private boolean isSyncedFlagSet(int flagId) { + return (this.dataWatcher.getWatchableObjectInt(16) & flagId) != 0; + } + + /**+ + * Sets a flag state "on/off" on both sides (client/server) by + * using DataWatcher + */ + private void setSyncedFlag(int flagId, boolean state) { + int i = this.dataWatcher.getWatchableObjectInt(16); + if (state) { + this.dataWatcher.updateObject(16, Integer.valueOf(i | flagId)); + } else { + this.dataWatcher.updateObject(16, Integer.valueOf(i & ~flagId)); + } + + } + + public boolean func_175472_n() { + return this.isSyncedFlagSet(2); + } + + private void func_175476_l(boolean parFlag) { + this.setSyncedFlag(2, parFlag); + } + + public int func_175464_ck() { + return this.isElder() ? 60 : 80; + } + + public boolean isElder() { + return this.isSyncedFlagSet(4); + } + + /**+ + * Sets this Guardian to be an elder or not. + */ + public void setElder(boolean elder) { + this.setSyncedFlag(4, elder); + if (elder) { + this.setSize(1.9975F, 1.9975F); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(80.0D); + this.enablePersistence(); + this.wander.setExecutionChance(400); + } + + } + + /**+ + * Sets this Guardian to be an elder or not. + */ + public void setElder() { + this.setElder(true); + this.field_175486_bm = this.field_175485_bl = 1.0F; + } + + private void setTargetedEntity(int entityId) { + this.dataWatcher.updateObject(17, Integer.valueOf(entityId)); + } + + public boolean hasTargetedEntity() { + return this.dataWatcher.getWatchableObjectInt(17) != 0; + } + + public EntityLivingBase getTargetedEntity() { + if (!this.hasTargetedEntity()) { + return null; + } else { + return this.getAttackTarget(); + } + } + + public void onDataWatcherUpdate(int i) { + super.onDataWatcherUpdate(i); + if (i == 16) { + if (this.isElder() && this.width < 1.0F) { + this.setSize(1.9975F, 1.9975F); + } + } else if (i == 17) { + this.field_175479_bo = 0; + this.targetedEntity = null; + } + + } + + /**+ + * Get number of ticks, at least during which the living entity + * will be silent. + */ + public int getTalkInterval() { + return 160; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return !this.isInWater() ? "mob.guardian.land.idle" + : (this.isElder() ? "mob.guardian.elder.idle" : "mob.guardian.idle"); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return !this.isInWater() ? "mob.guardian.land.hit" + : (this.isElder() ? "mob.guardian.elder.hit" : "mob.guardian.hit"); + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return !this.isInWater() ? "mob.guardian.land.death" + : (this.isElder() ? "mob.guardian.elder.death" : "mob.guardian.death"); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public float getEyeHeight() { + return this.height * 0.5F; + } + + public float getBlockPathWeight(BlockPos blockpos) { + return this.worldObj.getBlockState(blockpos).getBlock().getMaterial() == Material.water + ? 10.0F + this.worldObj.getLightBrightness(blockpos) - 0.5F + : super.getBlockPathWeight(blockpos); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.inWater) { + this.setAir(300); + } else if (this.onGround) { + this.motionY += 0.5D; + this.motionX += (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 0.4F); + this.motionZ += (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 0.4F); + this.rotationYaw = this.rand.nextFloat() * 360.0F; + this.onGround = false; + this.isAirBorne = true; + } + + if (this.hasTargetedEntity()) { + this.rotationYaw = this.rotationYawHead; + } + + super.onLivingUpdate(); + } + + public float func_175471_a(float parFloat1) { + return this.field_175484_c + (this.field_175482_b - this.field_175484_c) * parFloat1; + } + + public float func_175469_o(float parFloat1) { + return this.field_175486_bm + (this.field_175485_bl - this.field_175486_bm) * parFloat1; + } + + public float func_175477_p(float parFloat1) { + return ((float) this.field_175479_bo + parFloat1) / (float) this.func_175464_ck(); + } + + protected void updateAITasks() { + super.updateAITasks(); + if (this.isElder()) { + boolean flag = true; + boolean flag1 = true; + boolean flag2 = true; + boolean flag3 = true; + if ((this.ticksExisted + this.getEntityId()) % 1200 == 0) { + Potion potion = Potion.digSlowdown; + + for (EntityPlayerMP entityplayermp : this.worldObj.getPlayers(EntityPlayerMP.class, + new Predicate() { + public boolean apply(EntityPlayerMP entityplayermp1) { + return EntityGuardian.this.getDistanceSqToEntity(entityplayermp1) < 2500.0D + && entityplayermp1.theItemInWorldManager.survivalOrAdventure(); + } + })) { + if (!entityplayermp.isPotionActive(potion) + || entityplayermp.getActivePotionEffect(potion).getAmplifier() < 2 + || entityplayermp.getActivePotionEffect(potion).getDuration() < 1200) { + entityplayermp.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(10, 0.0F)); + entityplayermp.addPotionEffect(new PotionEffect(potion.id, 6000, 2)); + } + } + } + + if (!this.hasHome()) { + this.setHomePosAndDistance(new BlockPos(this), 16); + } + } + + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean flag, int i) { + int j = this.rand.nextInt(3) + this.rand.nextInt(i + 1); + if (j > 0) { + this.entityDropItem(new ItemStack(Items.prismarine_shard, j, 0), 1.0F); + } + + if (this.rand.nextInt(3 + i) > 1) { + this.entityDropItem(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.getMetadata()), 1.0F); + } else if (this.rand.nextInt(3 + i) > 1) { + this.entityDropItem(new ItemStack(Items.prismarine_crystals, 1, 0), 1.0F); + } + + if (flag && this.isElder()) { + this.entityDropItem(new ItemStack(Blocks.sponge, 1, 1), 1.0F); + } + + } + + /**+ + * Causes this Entity to drop a random item. + */ + protected void addRandomDrop() { + ItemStack itemstack = ((WeightedRandomFishable) WeightedRandom.getRandomItem(this.rand, + EntityFishHook.func_174855_j())).getItemStack(this.rand); + this.entityDropItem(itemstack, 1.0F); + } + + /**+ + * Checks to make sure the light is not too bright where the mob + * is spawning + */ + protected boolean isValidLightLevel() { + return true; + } + + /**+ + * Checks that the entity is not colliding with any blocks / + * liquids + */ + public boolean isNotColliding() { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) + && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty(); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return (this.rand.nextInt(20) == 0 || !this.worldObj.canBlockSeeSky(new BlockPos(this))) + && super.getCanSpawnHere(); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (!this.func_175472_n() && !damagesource.isMagicDamage() + && damagesource.getSourceOfDamage() instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) damagesource.getSourceOfDamage(); + if (!damagesource.isExplosion()) { + entitylivingbase.attackEntityFrom(DamageSource.causeThornsDamage(this), 2.0F); + entitylivingbase.playSound("damage.thorns", 0.5F, 1.0F); + } + } + + this.wander.makeUpdate(); + return super.attackEntityFrom(damagesource, f); + } + + /**+ + * The speed it takes to move the entityliving's rotationPitch + * through the faceEntity method. This is only currently use in + * wolves. + */ + public int getVerticalFaceSpeed() { + return 180; + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float f, float f1) { + if (this.isServerWorld()) { + if (this.isInWater()) { + this.moveFlying(f, f1, 0.1F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8999999761581421D; + this.motionY *= 0.8999999761581421D; + this.motionZ *= 0.8999999761581421D; + if (!this.func_175472_n() && this.getAttackTarget() == null) { + this.motionY -= 0.005D; + } + } else { + super.moveEntityWithHeading(f, f1); + } + } else { + super.moveEntityWithHeading(f, f1); + } + + } + + static class AIGuardianAttack extends EntityAIBase { + private EntityGuardian theEntity; + private int tickCounter; + + public AIGuardianAttack(EntityGuardian parEntityGuardian) { + this.theEntity = parEntityGuardian; + this.setMutexBits(3); + } + + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + return entitylivingbase != null && entitylivingbase.isEntityAlive(); + } + + public boolean continueExecuting() { + return super.continueExecuting() && (this.theEntity.isElder() + || this.theEntity.getDistanceSqToEntity(this.theEntity.getAttackTarget()) > 9.0D); + } + + public void startExecuting() { + this.tickCounter = -10; + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theEntity.getAttackTarget(), 90.0F, 90.0F); + this.theEntity.isAirBorne = true; + } + + public void resetTask() { + this.theEntity.setTargetedEntity(0); + this.theEntity.setAttackTarget((EntityLivingBase) null); + this.theEntity.wander.makeUpdate(); + } + + public void updateTask() { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 90.0F, 90.0F); + if (!this.theEntity.canEntityBeSeen(entitylivingbase)) { + this.theEntity.setAttackTarget((EntityLivingBase) null); + } else { + ++this.tickCounter; + if (this.tickCounter == 0) { + this.theEntity.setTargetedEntity(this.theEntity.getAttackTarget().getEntityId()); + this.theEntity.worldObj.setEntityState(this.theEntity, (byte) 21); + } else if (this.tickCounter >= this.theEntity.func_175464_ck()) { + float f = 1.0F; + if (this.theEntity.worldObj.getDifficulty() == EnumDifficulty.HARD) { + f += 2.0F; + } + + if (this.theEntity.isElder()) { + f += 2.0F; + } + + entitylivingbase + .attackEntityFrom(DamageSource.causeIndirectMagicDamage(this.theEntity, this.theEntity), f); + entitylivingbase.attackEntityFrom(DamageSource.causeMobDamage(this.theEntity), + (float) this.theEntity.getEntityAttribute(SharedMonsterAttributes.attackDamage) + .getAttributeValue()); + this.theEntity.setAttackTarget((EntityLivingBase) null); + } else if (this.tickCounter >= 60 && this.tickCounter % 20 == 0) { + ; + } + + super.updateTask(); + } + } + } + + static class GuardianMoveHelper extends EntityMoveHelper { + private EntityGuardian entityGuardian; + + public GuardianMoveHelper(EntityGuardian parEntityGuardian) { + super(parEntityGuardian); + this.entityGuardian = parEntityGuardian; + } + + public void onUpdateMoveHelper() { + if (this.update && !this.entityGuardian.getNavigator().noPath()) { + double d0 = this.posX - this.entityGuardian.posX; + double d1 = this.posY - this.entityGuardian.posY; + double d2 = this.posZ - this.entityGuardian.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + d3 = (double) MathHelper.sqrt_double(d3); + d1 = d1 / d3; + float f = (float) (MathHelper.func_181159_b(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F; + this.entityGuardian.rotationYaw = this.limitAngle(this.entityGuardian.rotationYaw, f, 30.0F); + this.entityGuardian.renderYawOffset = this.entityGuardian.rotationYaw; + float f1 = (float) (this.speed * this.entityGuardian + .getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + this.entityGuardian.setAIMoveSpeed( + this.entityGuardian.getAIMoveSpeed() + (f1 - this.entityGuardian.getAIMoveSpeed()) * 0.125F); + double d4 = Math.sin( + (double) (this.entityGuardian.ticksExisted + this.entityGuardian.getEntityId()) * 0.5D) * 0.05D; + double d5 = Math.cos((double) (this.entityGuardian.rotationYaw * 3.1415927F / 180.0F)); + double d6 = Math.sin((double) (this.entityGuardian.rotationYaw * 3.1415927F / 180.0F)); + this.entityGuardian.motionX += d4 * d5; + this.entityGuardian.motionZ += d4 * d6; + d4 = Math.sin((double) (this.entityGuardian.ticksExisted + this.entityGuardian.getEntityId()) * 0.75D) + * 0.05D; + this.entityGuardian.motionY += d4 * (d6 + d5) * 0.25D; + this.entityGuardian.motionY += (double) this.entityGuardian.getAIMoveSpeed() * d1 * 0.1D; + EntityLookHelper entitylookhelper = this.entityGuardian.getLookHelper(); + double d7 = this.entityGuardian.posX + d0 / d3 * 2.0D; + double d8 = (double) this.entityGuardian.getEyeHeight() + this.entityGuardian.posY + d1 / d3 * 1.0D; + double d9 = this.entityGuardian.posZ + d2 / d3 * 2.0D; + double d10 = entitylookhelper.getLookPosX(); + double d11 = entitylookhelper.getLookPosY(); + double d12 = entitylookhelper.getLookPosZ(); + if (!entitylookhelper.getIsLooking()) { + d10 = d7; + d11 = d8; + d12 = d9; + } + + this.entityGuardian.getLookHelper().setLookPosition(d10 + (d7 - d10) * 0.125D, + d11 + (d8 - d11) * 0.125D, d12 + (d9 - d12) * 0.125D, 10.0F, 40.0F); + this.entityGuardian.func_175476_l(true); + } else { + this.entityGuardian.setAIMoveSpeed(0.0F); + this.entityGuardian.func_175476_l(false); + } + } + } + + static class GuardianTargetSelector implements Predicate { + private EntityGuardian parentEntity; + + public GuardianTargetSelector(EntityGuardian parEntityGuardian) { + this.parentEntity = parEntityGuardian; + } + + public boolean apply(EntityLivingBase entitylivingbase) { + return (entitylivingbase instanceof EntityPlayer || entitylivingbase instanceof EntitySquid) + && entitylivingbase.getDistanceSqToEntity(this.parentEntity) > 9.0D; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityIronGolem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityIronGolem.java new file mode 100644 index 0000000..2cb30ad --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityIronGolem.java @@ -0,0 +1,335 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIDefendVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookAtVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityIronGolem extends EntityGolem { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityIronGolem"); + } + + private int homeCheckTimer; + Village villageObj; + private int attackTimer; + private int holdRoseTick; + + public EntityIronGolem(World worldIn) { + super(worldIn); + this.setSize(1.4F, 2.9F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F)); + this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true)); + this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(5, new EntityAILookAtVillager(this)); + this.tasks.addTask(6, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIDefendVillage(this)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(3, new EntityIronGolem.AINearestAttackableTargetNonCreeper(this, EntityLiving.class, + 10, false, true, IMob.VISIBLE_MOB_SELECTOR)); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + protected void updateAITasks() { + if (--this.homeCheckTimer <= 0) { + this.homeCheckTimer = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(this), 32); + if (this.villageObj == null) { + this.detachHome(); + } else { + BlockPos blockpos = this.villageObj.getCenter(); + this.setHomePosAndDistance(blockpos, (int) ((float) this.villageObj.getVillageRadius() * 0.6F)); + } + } + + super.updateAITasks(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /**+ + * Decrements the entity's air supply when underwater + */ + protected int decreaseAirSupply(int i) { + return i; + } + + protected void collideWithEntity(Entity entity) { + if (entity instanceof IMob && !(entity instanceof EntityCreeper) && this.getRNG().nextInt(20) == 0) { + this.setAttackTarget((EntityLivingBase) entity); + } + + super.collideWithEntity(entity); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + if (this.attackTimer > 0) { + --this.attackTimer; + } + + if (this.holdRoseTick > 0) { + --this.holdRoseTick; + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D + && this.rand.nextInt(5) == 0) { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k)); + Block block = iblockstate.getBlock(); + if (block.getMaterial() != Material.air) { + this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, + this.posX + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width, + this.getEntityBoundingBox().minY + 0.1D, + this.posZ + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width, + 4.0D * ((double) this.rand.nextFloat() - 0.5D), 0.5D, + ((double) this.rand.nextFloat() - 0.5D) * 4.0D, new int[] { Block.getStateId(iblockstate) }); + } + } + + } + + /**+ + * Returns true if this entity can attack entities of the + * specified class. + */ + public boolean canAttackClass(Class oclass) { + return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(oclass) ? false + : (oclass == EntityCreeper.class ? false : super.canAttackClass(oclass)); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("PlayerCreated", this.isPlayerCreated()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setPlayerCreated(nbttagcompound.getBoolean("PlayerCreated")); + } + + public boolean attackEntityAsMob(Entity entity) { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte) 4); + boolean flag = entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15))); + if (flag) { + entity.motionY += 0.4000000059604645D; + this.applyEnchantments(this, entity); + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 4) { + this.attackTimer = 10; + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + } else if (b0 == 11) { + this.holdRoseTick = 400; + } else { + super.handleStatusUpdate(b0); + } + + } + + public Village getVillage() { + return this.villageObj; + } + + public int getAttackTimer() { + return this.attackTimer; + } + + public void setHoldingRose(boolean parFlag) { + this.holdRoseTick = parFlag ? 400 : 0; + this.worldObj.setEntityState(this, (byte) 11); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.irongolem.hit"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.irongolem.death"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int var2) { + int i = this.rand.nextInt(3); + + for (int j = 0; j < i; ++j) { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.red_flower), 1, + (float) BlockFlower.EnumFlowerType.POPPY.getMeta()); + } + + int l = 3 + this.rand.nextInt(3); + + for (int k = 0; k < l; ++k) { + this.dropItem(Items.iron_ingot, 1); + } + + } + + public int getHoldRoseTick() { + return this.holdRoseTick; + } + + public boolean isPlayerCreated() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setPlayerCreated(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (parFlag) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -2))); + } + + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) { + this.villageObj.setReputationForPlayer(this.attackingPlayer.getName(), -5); + } + + super.onDeath(damagesource); + } + + static class AINearestAttackableTargetNonCreeper + extends EntityAINearestAttackableTarget { + public AINearestAttackableTargetNonCreeper(final EntityCreature creature, Class classTarget, int chance, + boolean parFlag, boolean parFlag2, final Predicate parPredicate) { + super(creature, classTarget, chance, parFlag, parFlag2, parPredicate); + this.targetEntitySelector = new Predicate() { + public boolean apply(T entitylivingbase) { + if (parPredicate != null && !parPredicate.apply(entitylivingbase)) { + return false; + } else if (entitylivingbase instanceof EntityCreeper) { + return false; + } else { + if (entitylivingbase instanceof EntityPlayer) { + double d0 = AINearestAttackableTargetNonCreeper.this.getTargetDistance(); + if (entitylivingbase.isSneaking()) { + d0 *= 0.800000011920929D; + } + + if (entitylivingbase.isInvisible()) { + float f = ((EntityPlayer) entitylivingbase).getArmorVisibility(); + if (f < 0.1F) { + f = 0.1F; + } + + d0 *= (double) (0.7F * f); + } + + if ((double) entitylivingbase.getDistanceToEntity(creature) > d0) { + return false; + } + } + + return AINearestAttackableTargetNonCreeper.this.isSuitableTarget(entitylivingbase, false); + } + } + }; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMagmaCube.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMagmaCube.java new file mode 100644 index 0000000..a48ffd4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMagmaCube.java @@ -0,0 +1,182 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySlime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMagmaCube extends EntitySlime { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityMagmaCube"); + } + + public EntityMagmaCube(World worldIn) { + super(worldIn); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL; + } + + /**+ + * Checks that the entity is not colliding with any blocks / + * liquids + */ + public boolean isNotColliding() { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) + && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() + && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return this.getSlimeSize() * 3; + } + + public int getBrightnessForRender(float var1) { + return 15728880; + } + + /**+ + * Gets how bright this entity is. + */ + public float getBrightness(float var1) { + return 1.0F; + } + + protected EnumParticleTypes getParticleType() { + return EnumParticleTypes.FLAME; + } + + protected EntitySlime createInstance() { + return new EntityMagmaCube(this.worldObj); + } + + protected Item getDropItem() { + return Items.magma_cream; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + Item item = this.getDropItem(); + if (item != null && this.getSlimeSize() > 1) { + int j = this.rand.nextInt(4) - 2; + if (i > 0) { + j += this.rand.nextInt(i + 1); + } + + for (int k = 0; k < j; ++k) { + this.dropItem(item, 1); + } + } + + } + + /**+ + * Returns true if the entity is on fire. Used by render to add + * the fire effect on rendering. + */ + public boolean isBurning() { + return false; + } + + /**+ + * Gets the amount of time the slime needs to wait between + * jumps. + */ + protected int getJumpDelay() { + return super.getJumpDelay() * 4; + } + + protected void alterSquishAmount() { + this.squishAmount *= 0.9F; + } + + /**+ + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() { + this.motionY = (double) (0.42F + (float) this.getSlimeSize() * 0.1F); + this.isAirBorne = true; + } + + protected void handleJumpLava() { + this.motionY = (double) (0.22F + (float) this.getSlimeSize() * 0.05F); + this.isAirBorne = true; + } + + public void fall(float var1, float var2) { + } + + /**+ + * Indicates weather the slime is able to damage the player + * (based upon the slime's size) + */ + protected boolean canDamagePlayer() { + return true; + } + + /**+ + * Gets the amount of damage dealt to the player when "attacked" + * by the slime. + */ + protected int getAttackStrength() { + return super.getAttackStrength() + 2; + } + + /**+ + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound() { + return this.getSlimeSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; + } + + /**+ + * Returns true if the slime makes a sound when it lands after a + * jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMob.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMob.java new file mode 100644 index 0000000..eacf517 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMob.java @@ -0,0 +1,191 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityMob extends EntityCreature implements IMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityMob"); + } + + public EntityMob(World worldIn) { + super(worldIn); + this.experienceValue = 5; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + this.updateArmSwingProgress(); + float f = this.getBrightness(1.0F); + if (f > 0.5F) { + this.entityAge += 2; + } + + super.onLivingUpdate(); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + + } + + protected String getSwimSound() { + return "game.hostile.swim"; + } + + protected String getSplashSound() { + return "game.hostile.swim.splash"; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (super.attackEntityFrom(damagesource, f)) { + Entity entity = damagesource.getEntity(); + return this.riddenByEntity != entity && this.ridingEntity != entity ? true : true; + } else { + return false; + } + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "game.hostile.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "game.hostile.die"; + } + + protected String getFallSoundString(int i) { + return i > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small"; + } + + public boolean attackEntityAsMob(Entity entity) { + float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + if (entity instanceof EntityLivingBase) { + f += EnchantmentHelper.func_152377_a(this.getHeldItem(), + ((EntityLivingBase) entity).getCreatureAttribute()); + i += EnchantmentHelper.getKnockbackModifier(this); + } + + boolean flag = entity.attackEntityFrom(DamageSource.causeMobDamage(this), f); + if (flag) { + if (i > 0) { + entity.addVelocity( + (double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1D, + (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + } + + int j = EnchantmentHelper.getFireAspectModifier(this); + if (j > 0) { + entity.setFire(j * 4); + } + + this.applyEnchantments(this, entity); + } + + return flag; + } + + public float getBlockPathWeight(BlockPos blockpos) { + return 0.5F - this.worldObj.getLightBrightness(blockpos); + } + + /**+ + * Checks to make sure the light is not too bright where the mob + * is spawning + */ + protected boolean isValidLightLevel() { + BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); + if (this.worldObj.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) { + return false; + } else { + int i = this.worldObj.getLightFromNeighbors(blockpos); + if (this.worldObj.isThundering()) { + int j = this.worldObj.getSkylightSubtracted(); + this.worldObj.setSkylightSubtracted(10); + i = this.worldObj.getLightFromNeighbors(blockpos); + this.worldObj.setSkylightSubtracted(j); + } + + return i <= this.rand.nextInt(8); + } + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && this.isValidLightLevel() + && super.getCanSpawnHere(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); + } + + /**+ + * Entity won't drop items or experience points if this returns + * false + */ + protected boolean canDropLoot() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityPigZombie.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityPigZombie.java new file mode 100644 index 0000000..0711e07 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityPigZombie.java @@ -0,0 +1,302 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityPigZombie extends EntityZombie { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityPigZombie"); + } + + private static final EaglercraftUUID ATTACK_SPEED_BOOST_MODIFIER_UUID = EaglercraftUUID + .fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); + private static final AttributeModifier ATTACK_SPEED_BOOST_MODIFIER = (new AttributeModifier( + ATTACK_SPEED_BOOST_MODIFIER_UUID, "Attacking speed boost", 0.05D, 0)).setSaved(false); + private int angerLevel; + private int randomSoundDelay; + private EaglercraftUUID angerTargetUUID; + + public EntityPigZombie(World worldIn) { + super(worldIn); + this.isImmuneToFire = true; + } + + public void setRevengeTarget(EntityLivingBase entitylivingbase) { + super.setRevengeTarget(entitylivingbase); + if (entitylivingbase != null) { + this.angerTargetUUID = entitylivingbase.getUniqueID(); + } + + } + + protected void applyEntityAI() { + this.targetTasks.addTask(1, new EntityPigZombie.AIHurtByAggressor(this)); + this.targetTasks.addTask(2, new EntityPigZombie.AITargetAggressor(this)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(reinforcementChance).setBaseValue(0.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + } + + protected void updateAITasks() { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + if (this.isAngry()) { + if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) { + iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER); + } + + --this.angerLevel; + } else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) { + iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER); + } + + if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) { + this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, + ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F); + } + + if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getAITarget() == null) { + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByUUID(this.angerTargetUUID); + this.setRevengeTarget(entityplayer); + this.attackingPlayer = entityplayer; + this.recentlyHit = this.getRevengeTimer(); + } + + super.updateAITasks(); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL; + } + + /**+ + * Checks that the entity is not colliding with any blocks / + * liquids + */ + public boolean isNotColliding() { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) + && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() + && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setShort("Anger", (short) this.angerLevel); + if (this.angerTargetUUID != null) { + nbttagcompound.setString("HurtBy", this.angerTargetUUID.toString()); + } else { + nbttagcompound.setString("HurtBy", ""); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.angerLevel = nbttagcompound.getShort("Anger"); + String s = nbttagcompound.getString("HurtBy"); + if (s.length() > 0) { + this.angerTargetUUID = EaglercraftUUID.fromString(s); + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByUUID(this.angerTargetUUID); + this.setRevengeTarget(entityplayer); + if (entityplayer != null) { + this.attackingPlayer = entityplayer; + this.recentlyHit = this.getRevengeTimer(); + } + } + + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + Entity entity = damagesource.getEntity(); + if (entity instanceof EntityPlayer) { + this.becomeAngryAt(entity); + } + + return super.attackEntityFrom(damagesource, f); + } + } + + /**+ + * Causes this PigZombie to become angry at the supplied Entity + * (which will be a player). + */ + private void becomeAngryAt(Entity parEntity) { + this.angerLevel = 400 + this.rand.nextInt(400); + this.randomSoundDelay = this.rand.nextInt(40); + if (parEntity instanceof EntityLivingBase) { + this.setRevengeTarget((EntityLivingBase) parEntity); + } + + } + + public boolean isAngry() { + return this.angerLevel > 0; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.zombiepig.zpig"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.zombiepig.zpighurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.zombiepig.zpigdeath"; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(2 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.rotten_flesh, 1); + } + + j = this.rand.nextInt(2 + i); + + for (int l = 0; l < j; ++l) { + this.dropItem(Items.gold_nugget, 1); + } + + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer var1) { + return false; + } + + /**+ + * Causes this Entity to drop a random item. + */ + protected void addRandomDrop() { + this.dropItem(Items.gold_ingot, 1); + } + + /**+ + * Gives armor or weapon for entity based on given + * DifficultyInstance + */ + protected void setEquipmentBasedOnDifficulty(DifficultyInstance var1) { + this.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + super.onInitialSpawn(difficultyinstance, ientitylivingdata); + this.setVillager(false); + return ientitylivingdata; + } + + static class AIHurtByAggressor extends EntityAIHurtByTarget { + public AIHurtByAggressor(EntityPigZombie parEntityPigZombie) { + super(parEntityPigZombie, true, new Class[0]); + } + + protected void setEntityAttackTarget(EntityCreature entitycreature, EntityLivingBase entitylivingbase) { + super.setEntityAttackTarget(entitycreature, entitylivingbase); + if (entitycreature instanceof EntityPigZombie) { + ((EntityPigZombie) entitycreature).becomeAngryAt(entitylivingbase); + } + + } + } + + static class AITargetAggressor extends EntityAINearestAttackableTarget { + public AITargetAggressor(EntityPigZombie parEntityPigZombie) { + super(parEntityPigZombie, EntityPlayer.class, true); + } + + public boolean shouldExecute() { + return ((EntityPigZombie) this.taskOwner).isAngry() && super.shouldExecute(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySilverfish.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySilverfish.java new file mode 100644 index 0000000..f03f9b4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySilverfish.java @@ -0,0 +1,287 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySilverfish extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntitySilverfish"); + } + + private EntitySilverfish.AISummonSilverfish summonSilverfish; + + public EntitySilverfish(World worldIn) { + super(worldIn); + this.setSize(0.4F, 0.3F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(3, this.summonSilverfish = new EntitySilverfish.AISummonSilverfish(this)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(5, new EntitySilverfish.AIHideInStone(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + /**+ + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return 0.2D; + } + + public float getEyeHeight() { + return 0.1F; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.silverfish.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.silverfish.hit"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.silverfish.kill"; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + if (damagesource instanceof EntityDamageSource || damagesource == DamageSource.magic) { + this.summonSilverfish.func_179462_f(); + } + + return super.attackEntityFrom(damagesource, f); + } + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + + protected Item getDropItem() { + return null; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); + } + + public float getBlockPathWeight(BlockPos blockpos) { + return this.worldObj.getBlockState(blockpos.down()).getBlock() == Blocks.stone ? 10.0F + : super.getBlockPathWeight(blockpos); + } + + /**+ + * Checks to make sure the light is not too bright where the mob + * is spawning + */ + protected boolean isValidLightLevel() { + return true; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + if (super.getCanSpawnHere()) { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return entityplayer == null; + } else { + return false; + } + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } + + static class AIHideInStone extends EntityAIWander { + private final EntitySilverfish field_179485_a; + private EnumFacing facing; + private boolean field_179484_c; + + public AIHideInStone(EntitySilverfish parEntitySilverfish) { + super(parEntitySilverfish, 1.0D, 10); + this.field_179485_a = parEntitySilverfish; + this.setMutexBits(1); + } + + public boolean shouldExecute() { + if (this.field_179485_a.getAttackTarget() != null) { + return false; + } else if (!this.field_179485_a.getNavigator().noPath()) { + return false; + } else { + EaglercraftRandom random = this.field_179485_a.getRNG(); + if (random.nextInt(10) == 0) { + this.facing = EnumFacing.random(random); + BlockPos blockpos = (new BlockPos(this.field_179485_a.posX, this.field_179485_a.posY + 0.5D, + this.field_179485_a.posZ)).offset(this.facing); + IBlockState iblockstate = this.field_179485_a.worldObj.getBlockState(blockpos); + if (BlockSilverfish.canContainSilverfish(iblockstate)) { + this.field_179484_c = true; + return true; + } + } + + this.field_179484_c = false; + return super.shouldExecute(); + } + } + + public boolean continueExecuting() { + return this.field_179484_c ? false : super.continueExecuting(); + } + + public void startExecuting() { + if (!this.field_179484_c) { + super.startExecuting(); + } else { + World world = this.field_179485_a.worldObj; + BlockPos blockpos = (new BlockPos(this.field_179485_a.posX, this.field_179485_a.posY + 0.5D, + this.field_179485_a.posZ)).offset(this.facing); + IBlockState iblockstate = world.getBlockState(blockpos); + if (BlockSilverfish.canContainSilverfish(iblockstate)) { + world.setBlockState(blockpos, Blocks.monster_egg.getDefaultState().withProperty( + BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3); + this.field_179485_a.spawnExplosionParticle(); + this.field_179485_a.setDead(); + } + + } + } + } + + static class AISummonSilverfish extends EntityAIBase { + private EntitySilverfish silverfish; + private int field_179463_b; + + public AISummonSilverfish(EntitySilverfish parEntitySilverfish) { + this.silverfish = parEntitySilverfish; + } + + public void func_179462_f() { + if (this.field_179463_b == 0) { + this.field_179463_b = 20; + } + + } + + public boolean shouldExecute() { + return this.field_179463_b > 0; + } + + public void updateTask() { + --this.field_179463_b; + if (this.field_179463_b <= 0) { + World world = this.silverfish.worldObj; + EaglercraftRandom random = this.silverfish.getRNG(); + BlockPos blockpos = new BlockPos(this.silverfish); + + for (int i = 0; i <= 5 && i >= -5; i = i <= 0 ? 1 - i : 0 - i) { + for (int j = 0; j <= 10 && j >= -10; j = j <= 0 ? 1 - j : 0 - j) { + for (int k = 0; k <= 10 && k >= -10; k = k <= 0 ? 1 - k : 0 - k) { + BlockPos blockpos1 = blockpos.add(j, i, k); + IBlockState iblockstate = world.getBlockState(blockpos1); + if (iblockstate.getBlock() == Blocks.monster_egg) { + if (world.getGameRules().getBoolean("mobGriefing")) { + world.destroyBlock(blockpos1, true); + } else { + world.setBlockState(blockpos1, + ((BlockSilverfish.EnumType) iblockstate.getValue(BlockSilverfish.VARIANT)) + .getModelBlock(), + 3); + } + + if (random.nextBoolean()) { + return; + } + } + } + } + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySkeleton.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySkeleton.java new file mode 100644 index 0000000..47e40fb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySkeleton.java @@ -0,0 +1,406 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import java.util.Calendar; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IRangedAttackMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIArrowAttack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFleeSun; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIRestrictSun; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProviderHell; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySkeleton extends EntityMob implements IRangedAttackMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntitySkeleton"); + } + + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, + false); + + public EntitySkeleton(World worldIn) { + super(worldIn); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIRestrictSun(this)); + this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); + if (worldIn != null) { + this.setCombatTask(); + } + + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(13, new Byte((byte) 0)); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.skeleton.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.skeleton.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.skeleton.death"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.skeleton.step", 0.15F, 1.0F); + } + + public boolean attackEntityAsMob(Entity entity) { + if (super.attackEntityAsMob(entity)) { + if (this.getSkeletonType() == 1 && entity instanceof EntityLivingBase) { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); + } + + return true; + } else { + return false; + } + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.worldObj.isDaytime()) { + float f = this.getBrightness(1.0F); + BlockPos blockpos = new BlockPos(this.posX, (double) Math.round(this.posY), this.posZ); + if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canSeeSky(blockpos)) { + boolean flag = true; + ItemStack itemstack = this.getEquipmentInSlot(4); + if (itemstack != null) { + if (itemstack.isItemStackDamageable()) { + itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2)); + if (itemstack.getItemDamage() >= itemstack.getMaxDamage()) { + this.renderBrokenItemStack(itemstack); + this.setCurrentItemOrArmor(4, (ItemStack) null); + } + } + + flag = false; + } + + if (flag) { + this.setFire(8); + } + } + } + + super.onLivingUpdate(); + } + + /**+ + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + super.updateRidden(); + if (this.ridingEntity instanceof EntityCreature) { + EntityCreature entitycreature = (EntityCreature) this.ridingEntity; + this.renderYawOffset = entitycreature.renderYawOffset; + } + + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + if (damagesource.getSourceOfDamage() instanceof EntityArrow + && damagesource.getEntity() instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) damagesource.getEntity(); + double d0 = entityplayer.posX - this.posX; + double d1 = entityplayer.posZ - this.posZ; + if (d0 * d0 + d1 * d1 >= 2500.0D) { + entityplayer.triggerAchievement(AchievementList.snipeSkeleton); + } + } else if (damagesource.getEntity() instanceof EntityCreeper + && ((EntityCreeper) damagesource.getEntity()).getPowered() + && ((EntityCreeper) damagesource.getEntity()).isAIEnabled()) { + ((EntityCreeper) damagesource.getEntity()).func_175493_co(); + this.entityDropItem(new ItemStack(Items.skull, 1, this.getSkeletonType() == 1 ? 1 : 0), 0.0F); + } + + } + + protected Item getDropItem() { + return Items.arrow; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + if (this.getSkeletonType() == 1) { + int j = this.rand.nextInt(3 + i) - 1; + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.coal, 1); + } + } else { + int l = this.rand.nextInt(3 + i); + + for (int j1 = 0; j1 < l; ++j1) { + this.dropItem(Items.arrow, 1); + } + } + + int i1 = this.rand.nextInt(3 + i); + + for (int k1 = 0; k1 < i1; ++k1) { + this.dropItem(Items.bone, 1); + } + + } + + /**+ + * Causes this Entity to drop a random item. + */ + protected void addRandomDrop() { + if (this.getSkeletonType() == 1) { + this.entityDropItem(new ItemStack(Items.skull, 1, 1), 0.0F); + } + + } + + /**+ + * Gives armor or weapon for entity based on given + * DifficultyInstance + */ + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficultyinstance) { + super.setEquipmentBasedOnDifficulty(difficultyinstance); + this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { + this.tasks.addTask(4, this.aiAttackOnCollide); + this.setSkeletonType(1); + this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); + } else { + this.tasks.addTask(4, this.aiArrowAttack); + this.setEquipmentBasedOnDifficulty(difficultyinstance); + this.setEnchantmentBasedOnDifficulty(difficultyinstance); + } + + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * difficultyinstance.getClampedAdditionalDifficulty()); + if (this.getEquipmentInSlot(4) == null) { + Calendar calendar = this.worldObj.getCurrentDate(); + if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { + this.setCurrentItemOrArmor(4, + new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + return ientitylivingdata; + } + + /**+ + * sets this entity's combat AI. + */ + public void setCombatTask() { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + if (itemstack != null && itemstack.getItem() == Items.bow) { + this.tasks.addTask(4, this.aiArrowAttack); + } else { + this.tasks.addTask(4, this.aiAttackOnCollide); + } + + } + + /**+ + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { + EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entitylivingbase, 1.6F, + (float) (14 - this.worldObj.getDifficulty().getDifficultyId() * 4)); + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + entityarrow.setDamage((double) (f * 2.0F) + this.rand.nextGaussian() * 0.25D + + (double) ((float) this.worldObj.getDifficulty().getDifficultyId() * 0.11F)); + if (i > 0) { + entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D); + } + + if (j > 0) { + entityarrow.setKnockbackStrength(j); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 + || this.getSkeletonType() == 1) { + entityarrow.setFire(100); + } + + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entityarrow); + } + + /**+ + * Return this skeleton's type. + */ + public int getSkeletonType() { + return this.dataWatcher.getWatchableObjectByte(13); + } + + /**+ + * Set this skeleton's type. + */ + public void setSkeletonType(int parInt1) { + this.dataWatcher.updateObject(13, Byte.valueOf((byte) parInt1)); + this.isImmuneToFire = parInt1 == 1; + if (parInt1 == 1) { + this.setSize(0.72F, 2.535F); + } else { + this.setSize(0.6F, 1.95F); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("SkeletonType", 99)) { + byte b0 = nbttagcompound.getByte("SkeletonType"); + this.setSkeletonType(b0); + } + + this.setCombatTask(); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setByte("SkeletonType", (byte) this.getSkeletonType()); + } + + /**+ + * Sets the held item, or an armor slot. Slot 0 is held item. + * Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int i, ItemStack itemstack) { + super.setCurrentItemOrArmor(i, itemstack); + if (i == 0) { + this.setCombatTask(); + } + + } + + public float getEyeHeight() { + return this.getSkeletonType() == 1 ? super.getEyeHeight() : 1.74F; + } + + /**+ + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return this.isChild() ? 0.0D : -0.35D; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySlime.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySlime.java new file mode 100644 index 0000000..a8f77e2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySlime.java @@ -0,0 +1,551 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFindEntityNearest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMoveHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySlime extends EntityLiving implements IMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntitySlime"); + } + + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; + private boolean wasOnGround; + + public EntitySlime(World worldIn) { + super(worldIn); + this.moveHelper = new EntitySlime.SlimeMoveHelper(this); + this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this)); + this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this)); + this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this)); + this.tasks.addTask(5, new EntitySlime.AISlimeHop(this)); + this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); + this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class)); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) 1)); + } + + protected void setSlimeSize(int size) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) size)); + this.setSize(0.51000005F * (float) size, 0.51000005F * (float) size); + this.setPosition(this.posX, this.posY, this.posZ); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue((double) (size * size)); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed) + .setBaseValue((double) (0.2F + 0.1F * (float) size)); + this.setHealth(this.getMaxHealth()); + this.experienceValue = size; + } + + /**+ + * Returns the size of the slime. + */ + public int getSlimeSize() { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("Size", this.getSlimeSize() - 1); + nbttagcompound.setBoolean("wasOnGround", this.wasOnGround); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + int i = nbttagcompound.getInteger("Size"); + if (i < 0) { + i = 0; + } + + this.setSlimeSize(i + 1); + this.wasOnGround = nbttagcompound.getBoolean("wasOnGround"); + } + + protected EnumParticleTypes getParticleType() { + return EnumParticleTypes.SLIME; + } + + /**+ + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL && this.getSlimeSize() > 0) { + this.isDead = true; + } + + this.squishFactor += (this.squishAmount - this.squishFactor) * 0.5F; + this.prevSquishFactor = this.squishFactor; + super.onUpdate(); + if (this.onGround && !this.wasOnGround) { + int i = this.getSlimeSize(); + + for (int j = 0; j < i * 8; ++j) { + float f = this.rand.nextFloat() * 3.1415927F * 2.0F; + float f1 = this.rand.nextFloat() * 0.5F + 0.5F; + float f2 = MathHelper.sin(f) * (float) i * 0.5F * f1; + float f3 = MathHelper.cos(f) * (float) i * 0.5F * f1; + World world = this.worldObj; + EnumParticleTypes enumparticletypes = this.getParticleType(); + double d0 = this.posX + (double) f2; + double d1 = this.posZ + (double) f3; + world.spawnParticle(enumparticletypes, d0, this.getEntityBoundingBox().minY, d1, 0.0D, 0.0D, 0.0D, + new int[0]); + } + + if (this.makesSoundOnLand()) { + this.playSound(this.getJumpSound(), this.getSoundVolume(), + ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } + + this.squishAmount = -0.5F; + } else if (!this.onGround && this.wasOnGround) { + this.squishAmount = 1.0F; + } + + this.wasOnGround = this.onGround; + this.alterSquishAmount(); + } + + protected void alterSquishAmount() { + this.squishAmount *= 0.6F; + } + + /**+ + * Gets the amount of time the slime needs to wait between + * jumps. + */ + protected int getJumpDelay() { + return this.rand.nextInt(20) + 10; + } + + protected EntitySlime createInstance() { + return new EntitySlime(this.worldObj); + } + + public void onDataWatcherUpdate(int i) { + if (i == 16) { + int j = this.getSlimeSize(); + this.setSize(0.51000005F * (float) j, 0.51000005F * (float) j); + this.rotationYaw = this.rotationYawHead; + this.renderYawOffset = this.rotationYawHead; + if (this.isInWater() && this.rand.nextInt(20) == 0) { + this.resetHeight(); + } + } + + super.onDataWatcherUpdate(i); + } + + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + int i = this.getSlimeSize(); + if (i > 1 && this.getHealth() <= 0.0F) { + int j = 2 + this.rand.nextInt(3); + + for (int k = 0; k < j; ++k) { + float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F; + float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F; + EntitySlime entityslime = this.createInstance(); + if (this.hasCustomName()) { + entityslime.setCustomNameTag(this.getCustomNameTag()); + } + + if (this.isNoDespawnRequired()) { + entityslime.enablePersistence(); + } + + entityslime.setSlimeSize(i / 2); + entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, + this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityslime); + } + } + + super.setDead(); + } + + /**+ + * Applies a velocity to each of the entities pushing them away + * from each other. Args: entity + */ + public void applyEntityCollision(Entity entity) { + super.applyEntityCollision(entity); + if (entity instanceof EntityIronGolem && this.canDamagePlayer()) { + this.func_175451_e((EntityLivingBase) entity); + } + + } + + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) { + if (this.canDamagePlayer()) { + this.func_175451_e(entityplayer); + } + + } + + protected void func_175451_e(EntityLivingBase parEntityLivingBase) { + int i = this.getSlimeSize(); + if (this.canEntityBeSeen(parEntityLivingBase) + && this.getDistanceSqToEntity(parEntityLivingBase) < 0.6D * (double) i * 0.6D * (double) i + && parEntityLivingBase.attackEntityFrom(DamageSource.causeMobDamage(this), + (float) this.getAttackStrength())) { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.applyEnchantments(this, parEntityLivingBase); + } + + } + + public float getEyeHeight() { + return 0.625F * this.height; + } + + /**+ + * Indicates weather the slime is able to damage the player + * (based upon the slime's size) + */ + protected boolean canDamagePlayer() { + return this.getSlimeSize() > 1; + } + + /**+ + * Gets the amount of damage dealt to the player when "attacked" + * by the slime. + */ + protected int getAttackStrength() { + return this.getSlimeSize(); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + protected Item getDropItem() { + return this.getSlimeSize() == 1 ? Items.slime_ball : null; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + BlockPos blockpos = new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ)); + Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos); + if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) { + return false; + } else { + if (this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL) { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos); + if (biomegenbase == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D + && this.rand.nextFloat() < 0.5F + && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() + && this.worldObj.getLightFromNeighbors(new BlockPos(this)) <= this.rand.nextInt(8)) { + return super.getCanSpawnHere(); + } + + if (this.rand.nextInt(10) == 0 && chunk.getRandomWithSeed(987234911L).nextInt(10) == 0 + && this.posY < 40.0D) { + return super.getCanSpawnHere(); + } + } + + return false; + } + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F * (float) this.getSlimeSize(); + } + + /**+ + * The speed it takes to move the entityliving's rotationPitch + * through the faceEntity method. This is only currently use in + * wolves. + */ + public int getVerticalFaceSpeed() { + return 0; + } + + /**+ + * Returns true if the slime makes a sound when it jumps (based + * upon the slime's size) + */ + protected boolean makesSoundOnJump() { + return this.getSlimeSize() > 0; + } + + /**+ + * Returns true if the slime makes a sound when it lands after a + * jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand() { + return this.getSlimeSize() > 2; + } + + /**+ + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() { + this.motionY = 0.41999998688697815D; + this.isAirBorne = true; + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + int i = this.rand.nextInt(3); + if (i < 2 && this.rand.nextFloat() < 0.5F * difficultyinstance.getClampedAdditionalDifficulty()) { + ++i; + } + + int j = 1 << i; + this.setSlimeSize(j); + return super.onInitialSpawn(difficultyinstance, ientitylivingdata); + } + + static class AISlimeAttack extends EntityAIBase { + private EntitySlime slime; + private int field_179465_b; + + public AISlimeAttack(EntitySlime parEntitySlime) { + this.slime = parEntitySlime; + this.setMutexBits(2); + } + + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.slime.getAttackTarget(); + return entitylivingbase == null ? false + : (!entitylivingbase.isEntityAlive() ? false + : !(entitylivingbase instanceof EntityPlayer) + || !((EntityPlayer) entitylivingbase).capabilities.disableDamage); + } + + public void startExecuting() { + this.field_179465_b = 300; + super.startExecuting(); + } + + public boolean continueExecuting() { + EntityLivingBase entitylivingbase = this.slime.getAttackTarget(); + return entitylivingbase == null ? false + : (!entitylivingbase.isEntityAlive() ? false + : (entitylivingbase instanceof EntityPlayer + && ((EntityPlayer) entitylivingbase).capabilities.disableDamage ? false + : --this.field_179465_b > 0)); + } + + public void updateTask() { + this.slime.faceEntity(this.slime.getAttackTarget(), 10.0F, 10.0F); + ((EntitySlime.SlimeMoveHelper) this.slime.getMoveHelper()).func_179920_a(this.slime.rotationYaw, + this.slime.canDamagePlayer()); + } + } + + static class AISlimeFaceRandom extends EntityAIBase { + private EntitySlime slime; + private float field_179459_b; + private int field_179460_c; + + public AISlimeFaceRandom(EntitySlime parEntitySlime) { + this.slime = parEntitySlime; + this.setMutexBits(2); + } + + public boolean shouldExecute() { + return this.slime.getAttackTarget() == null + && (this.slime.onGround || this.slime.isInWater() || this.slime.isInLava()); + } + + public void updateTask() { + if (--this.field_179460_c <= 0) { + this.field_179460_c = 40 + this.slime.getRNG().nextInt(60); + this.field_179459_b = (float) this.slime.getRNG().nextInt(360); + } + + ((EntitySlime.SlimeMoveHelper) this.slime.getMoveHelper()).func_179920_a(this.field_179459_b, false); + } + } + + static class AISlimeFloat extends EntityAIBase { + private EntitySlime slime; + + public AISlimeFloat(EntitySlime parEntitySlime) { + this.slime = parEntitySlime; + this.setMutexBits(5); + ((PathNavigateGround) parEntitySlime.getNavigator()).setCanSwim(true); + } + + public boolean shouldExecute() { + return this.slime.isInWater() || this.slime.isInLava(); + } + + public void updateTask() { + if (this.slime.getRNG().nextFloat() < 0.8F) { + this.slime.getJumpHelper().setJumping(); + } + + ((EntitySlime.SlimeMoveHelper) this.slime.getMoveHelper()).setSpeed(1.2D); + } + } + + static class AISlimeHop extends EntityAIBase { + private EntitySlime slime; + + public AISlimeHop(EntitySlime parEntitySlime) { + this.slime = parEntitySlime; + this.setMutexBits(5); + } + + public boolean shouldExecute() { + return true; + } + + public void updateTask() { + ((EntitySlime.SlimeMoveHelper) this.slime.getMoveHelper()).setSpeed(1.0D); + } + } + + static class SlimeMoveHelper extends EntityMoveHelper { + private float field_179922_g; + private int field_179924_h; + private EntitySlime slime; + private boolean field_179923_j; + + public SlimeMoveHelper(EntitySlime parEntitySlime) { + super(parEntitySlime); + this.slime = parEntitySlime; + } + + public void func_179920_a(float parFloat1, boolean parFlag) { + this.field_179922_g = parFloat1; + this.field_179923_j = parFlag; + } + + public void setSpeed(double speedIn) { + this.speed = speedIn; + this.update = true; + } + + public void onUpdateMoveHelper() { + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, this.field_179922_g, 30.0F); + this.entity.rotationYawHead = this.entity.rotationYaw; + this.entity.renderYawOffset = this.entity.rotationYaw; + if (!this.update) { + this.entity.setMoveForward(0.0F); + } else { + this.update = false; + if (this.entity.onGround) { + this.entity.setAIMoveSpeed((float) (this.speed * this.entity + .getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + if (this.field_179924_h-- <= 0) { + this.field_179924_h = this.slime.getJumpDelay(); + if (this.field_179923_j) { + this.field_179924_h /= 3; + } + + this.slime.getJumpHelper().setJumping(); + if (this.slime.makesSoundOnJump()) { + this.slime.playSound(this.slime.getJumpSound(), this.slime.getSoundVolume(), + ((this.slime.getRNG().nextFloat() - this.slime.getRNG().nextFloat()) * 0.2F + 1.0F) + * 0.8F); + } + } else { + this.slime.moveStrafing = this.slime.moveForward = 0.0F; + this.entity.setAIMoveSpeed(0.0F); + } + } else { + this.entity.setAIMoveSpeed((float) (this.speed * this.entity + .getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + } + + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySnowman.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySnowman.java new file mode 100644 index 0000000..63f4eb3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySnowman.java @@ -0,0 +1,142 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IRangedAttackMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIArrowAttack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySnowman extends EntityGolem implements IRangedAttackMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntitySnowman"); + } + + public EntitySnowman(World worldIn) { + super(worldIn); + this.setSize(0.7F, 1.9F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.25D, 20, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(4, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, + new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.mobSelector)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.worldObj.getBiomeGenForCoords(new BlockPos(i, 0, k)) + .getFloatTemperature(new BlockPos(i, j, k)) > 1.0F) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + for (int l = 0; l < 4; ++l) { + i = MathHelper.floor_double(this.posX + (double) ((float) (l % 2 * 2 - 1) * 0.25F)); + j = MathHelper.floor_double(this.posY); + k = MathHelper.floor_double(this.posZ + (double) ((float) (l / 2 % 2 * 2 - 1) * 0.25F)); + BlockPos blockpos = new BlockPos(i, j, k); + if (this.worldObj.getBlockState(blockpos).getBlock().getMaterial() == Material.air + && this.worldObj.getBiomeGenForCoords(new BlockPos(i, 0, k)) + .getFloatTemperature(blockpos) < 0.8F + && Blocks.snow_layer.canPlaceBlockAt(this.worldObj, blockpos)) { + this.worldObj.setBlockState(blockpos, Blocks.snow_layer.getDefaultState()); + } + } + } + + } + + protected Item getDropItem() { + return Items.snowball; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int var2) { + int i = this.rand.nextInt(16); + + for (int j = 0; j < i; ++j) { + this.dropItem(Items.snowball, 1); + } + + } + + /**+ + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase parEntityLivingBase, float parFloat1) { + EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this); + double d0 = parEntityLivingBase.posY + (double) parEntityLivingBase.getEyeHeight() - 1.100000023841858D; + double d1 = parEntityLivingBase.posX - this.posX; + double d2 = d0 - entitysnowball.posY; + double d3 = parEntityLivingBase.posZ - this.posZ; + float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3) * 0.2F; + entitysnowball.setThrowableHeading(d1, d2 + (double) f, d3, 1.6F, 12.0F); + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entitysnowball); + } + + public float getEyeHeight() { + return 1.7F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySpider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySpider.java new file mode 100644 index 0000000..0a9872a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySpider.java @@ -0,0 +1,288 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateClimber; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySpider extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntitySpider"); + } + + public EntitySpider(World worldIn) { + super(worldIn); + this.setSize(1.4F, 0.9F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntitySpider.AISpiderAttack(this, EntityPlayer.class)); + this.tasks.addTask(4, new EntitySpider.AISpiderAttack(this, EntityIronGolem.class)); + this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntitySpider.AISpiderTarget(this, EntityPlayer.class)); + this.targetTasks.addTask(3, new EntitySpider.AISpiderTarget(this, EntityIronGolem.class)); + } + + /**+ + * Returns the Y offset from the entity's position for any + * entity riding this one. + */ + public double getMountedYOffset() { + return (double) (this.height * 0.5F); + } + + /**+ + * Returns new PathNavigateGround instance + */ + protected PathNavigate getNewNavigator(World world) { + return new PathNavigateClimber(this, world); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 0)); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + { + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } + + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.spider.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.spider.say"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.spider.death"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.spider.step", 0.15F, 1.0F); + } + + protected Item getDropItem() { + return Items.string; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + if (flag && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + i) > 0)) { + this.dropItem(Items.spider_eye, 1); + } + + } + + /**+ + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + return this.isBesideClimbableBlock(); + } + + /**+ + * Sets the Entity inside a web block. + */ + public void setInWeb() { + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } + + public boolean isPotionApplicable(PotionEffect potioneffect) { + return potioneffect.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(potioneffect); + } + + /**+ + * Returns true if the WatchableObject (Byte) is 0x01 otherwise + * returns false. The WatchableObject is updated using + * setBesideClimableBlock. + */ + public boolean isBesideClimbableBlock() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + /**+ + * Updates the WatchableObject (Byte) created in entityInit(), + * setting it to 0x01 if par1 is true or 0x00 if it is false. + */ + public void setBesideClimbableBlock(boolean parFlag) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (parFlag) { + b0 = (byte) (b0 | 1); + } else { + b0 = (byte) (b0 & -2); + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + if (this.worldObj.rand.nextInt(100) == 0) { + EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj); + entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityskeleton.onInitialSpawn(difficultyinstance, (IEntityLivingData) null); + this.worldObj.spawnEntityInWorld(entityskeleton); + entityskeleton.mountEntity(this); + } + + if (ientitylivingdata == null) { + ientitylivingdata = new EntitySpider.GroupData(); + if (this.worldObj.getDifficulty() == EnumDifficulty.HARD + && this.worldObj.rand.nextFloat() < 0.1F * difficultyinstance.getClampedAdditionalDifficulty()) { + ((EntitySpider.GroupData) ientitylivingdata).func_111104_a(this.worldObj.rand); + } + } + + if (ientitylivingdata instanceof EntitySpider.GroupData) { + int i = ((EntitySpider.GroupData) ientitylivingdata).potionEffectId; + if (i > 0 && Potion.potionTypes[i] != null) { + this.addPotionEffect(new PotionEffect(i, Integer.MAX_VALUE)); + } + } + + return ientitylivingdata; + } + + public float getEyeHeight() { + return 0.65F; + } + + static class AISpiderAttack extends EntityAIAttackOnCollide { + public AISpiderAttack(EntitySpider parEntitySpider, Class targetClass) { + super(parEntitySpider, targetClass, 1.0D, true); + } + + public boolean continueExecuting() { + float f = this.attacker.getBrightness(1.0F); + if (f >= 0.5F && this.attacker.getRNG().nextInt(100) == 0) { + this.attacker.setAttackTarget((EntityLivingBase) null); + return false; + } else { + return super.continueExecuting(); + } + } + + protected double func_179512_a(EntityLivingBase entitylivingbase) { + return (double) (4.0F + entitylivingbase.width); + } + } + + static class AISpiderTarget extends EntityAINearestAttackableTarget { + public AISpiderTarget(EntitySpider parEntitySpider, Class classTarget) { + super(parEntitySpider, classTarget, true); + } + + public boolean shouldExecute() { + float f = this.taskOwner.getBrightness(1.0F); + return f >= 0.5F ? false : super.shouldExecute(); + } + } + + public static class GroupData implements IEntityLivingData { + public int potionEffectId; + + public void func_111104_a(EaglercraftRandom rand) { + int i = rand.nextInt(5); + if (i <= 1) { + this.potionEffectId = Potion.moveSpeed.id; + } else if (i <= 2) { + this.potionEffectId = Potion.damageBoost.id; + } else if (i <= 3) { + this.potionEffectId = Potion.regeneration.id; + } else if (i <= 4) { + this.potionEffectId = Potion.invisibility.id; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityWitch.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityWitch.java new file mode 100644 index 0000000..8fcf914 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityWitch.java @@ -0,0 +1,269 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IRangedAttackMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIArrowAttack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityWitch extends EntityMob implements IRangedAttackMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityWitch"); + } + + private static final EaglercraftUUID MODIFIER_UUID = EaglercraftUUID + .fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); + private static final AttributeModifier MODIFIER = (new AttributeModifier(MODIFIER_UUID, "Drinking speed penalty", + -0.25D, 0)).setSaved(false); + /**+ + * List of items a witch should drop on death. + */ + private static final Item[] witchDrops = new Item[] { Items.glowstone_dust, Items.sugar, Items.redstone, + Items.spider_eye, Items.glass_bottle, Items.gunpowder, Items.stick, Items.stick }; + private int witchAttackTimer; + + public EntityWitch(World worldIn) { + super(worldIn); + this.setSize(0.6F, 1.95F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 60, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(3, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(21, Byte.valueOf((byte) 0)); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return null; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return null; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return null; + } + + /**+ + * Set whether this witch is aggressive at an entity. + */ + public void setAggressive(boolean aggressive) { + this.getDataWatcher().updateObject(21, Byte.valueOf((byte) (aggressive ? 1 : 0))); + } + + /**+ + * Return whether this witch is aggressive at an entity. + */ + public boolean getAggressive() { + return this.getDataWatcher().getWatchableObjectByte(21) == 1; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(26.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + { + if (this.getAggressive()) { + if (this.witchAttackTimer-- <= 0) { + this.setAggressive(false); + ItemStack itemstack = this.getHeldItem(); + this.setCurrentItemOrArmor(0, (ItemStack) null); + if (itemstack != null && itemstack.getItem() == Items.potionitem) { + List list = Items.potionitem.getEffects(itemstack); + if (list != null) { + for (PotionEffect potioneffect : (List) list) { + this.addPotionEffect(new PotionEffect(potioneffect)); + } + } + } + + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(MODIFIER); + } + } else { + short short1 = -1; + if (this.rand.nextFloat() < 0.15F && this.isInsideOfMaterial(Material.water) + && !this.isPotionActive(Potion.waterBreathing)) { + short1 = 8237; + } else if (this.rand.nextFloat() < 0.15F && this.isBurning() + && !this.isPotionActive(Potion.fireResistance)) { + short1 = 16307; + } else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { + short1 = 16341; + } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null + && !this.isPotionActive(Potion.moveSpeed) + && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { + short1 = 16274; + } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null + && !this.isPotionActive(Potion.moveSpeed) + && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { + short1 = 16274; + } + + if (short1 > -1) { + this.setCurrentItemOrArmor(0, new ItemStack(Items.potionitem, 1, short1)); + this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration(); + this.setAggressive(true); + IAttributeInstance iattributeinstance = this + .getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(MODIFIER); + iattributeinstance.applyModifier(MODIFIER); + } + } + + if (this.rand.nextFloat() < 7.5E-4F) { + this.worldObj.setEntityState(this, (byte) 15); + } + } + + super.onLivingUpdate(); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 15) { + for (int i = 0; i < this.rand.nextInt(35) + 10; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.SPELL_WITCH, + this.posX + this.rand.nextGaussian() * 0.12999999523162842D, + this.getEntityBoundingBox().maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, + this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D, new int[0]); + } + } else { + super.handleStatusUpdate(b0); + } + + } + + /**+ + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource damagesource, float f) { + f = super.applyPotionDamageCalculations(damagesource, f); + if (damagesource.getEntity() == this) { + f = 0.0F; + } + + if (damagesource.isMagicDamage()) { + f = (float) ((double) f * 0.15D); + } + + return f; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(3) + 1; + + for (int k = 0; k < j; ++k) { + int l = this.rand.nextInt(3); + Item item = witchDrops[this.rand.nextInt(witchDrops.length)]; + if (i > 0) { + l += this.rand.nextInt(i + 1); + } + + for (int i1 = 0; i1 < l; ++i1) { + this.dropItem(item, 1); + } + } + + } + + /**+ + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float var2) { + if (!this.getAggressive()) { + EntityPotion entitypotion = new EntityPotion(this.worldObj, this, 32732); + double d0 = entitylivingbase.posY + (double) entitylivingbase.getEyeHeight() - 1.100000023841858D; + entitypotion.rotationPitch -= -20.0F; + double d1 = entitylivingbase.posX + entitylivingbase.motionX - this.posX; + double d2 = d0 - this.posY; + double d3 = entitylivingbase.posZ + entitylivingbase.motionZ - this.posZ; + float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3); + if (f >= 8.0F && !entitylivingbase.isPotionActive(Potion.moveSlowdown)) { + entitypotion.setPotionDamage(32698); + } else if (entitylivingbase.getHealth() >= 8.0F && !entitylivingbase.isPotionActive(Potion.poison)) { + entitypotion.setPotionDamage(32660); + } else if (f <= 3.0F && !entitylivingbase.isPotionActive(Potion.weakness) + && this.rand.nextFloat() < 0.25F) { + entitypotion.setPotionDamage(32696); + } + + entitypotion.setThrowableHeading(d1, d2 + (double) (f * 0.2F), d3, 0.75F, 8.0F); + this.worldObj.spawnEntityInWorld(entitypotion); + } + } + + public float getEyeHeight() { + return 1.62F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityZombie.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityZombie.java new file mode 100644 index 0000000..6e2fbb5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityZombie.java @@ -0,0 +1,750 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import java.util.Calendar; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBreakDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.RangedAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityPigZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityZombie extends EntityMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/monster/EntityZombie"); + } + + /**+ + * The attribute which determines the chance that this mob will + * spawn reinforcements + */ + protected static final IAttribute reinforcementChance = (new RangedAttribute((IAttribute) null, + "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).setDescription("Spawn Reinforcements Chance"); + private static final EaglercraftUUID babySpeedBoostUUID = EaglercraftUUID + .fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); + private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, + "Baby speed boost", 0.5D, 1); + private final EntityAIBreakDoor breakDoor = new EntityAIBreakDoor(this); + private int conversionTime; + private boolean isBreakDoorsTaskSet = false; + /**+ + * The width of the entity + */ + private float zombieWidth = -1.0F; + private float zombieHeight; + + public EntityZombie(World worldIn) { + super(worldIn); + ((PathNavigateGround) this.getNavigator()).setBreakDoors(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.applyEntityAI(); + this.setSize(0.6F, 1.95F); + } + + protected void applyEntityAI() { + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityIronGolem.class, 1.0D, true)); + this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] { EntityPigZombie.class })); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); + this.getAttributeMap().registerAttribute(reinforcementChance) + .setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); + } + + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(12, Byte.valueOf((byte) 0)); + this.getDataWatcher().addObject(13, Byte.valueOf((byte) 0)); + this.getDataWatcher().addObject(14, Byte.valueOf((byte) 0)); + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + int i = super.getTotalArmorValue() + 2; + if (i > 20) { + i = 20; + } + + return i; + } + + public boolean isBreakDoorsTaskSet() { + return this.isBreakDoorsTaskSet; + } + + /**+ + * Sets or removes EntityAIBreakDoor task + */ + public void setBreakDoorsAItask(boolean par1) { + if (this.isBreakDoorsTaskSet != par1) { + this.isBreakDoorsTaskSet = par1; + if (par1) { + this.tasks.addTask(1, this.breakDoor); + } else { + this.tasks.removeTask(this.breakDoor); + } + } + + } + + /**+ + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return this.getDataWatcher().getWatchableObjectByte(12) == 1; + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer entityplayer) { + if (this.isChild()) { + this.experienceValue = (int) ((float) this.experienceValue * 2.5F); + } + + return super.getExperiencePoints(entityplayer); + } + + /**+ + * Set whether this zombie is a child. + */ + public void setChild(boolean childZombie) { + this.getDataWatcher().updateObject(12, Byte.valueOf((byte) (childZombie ? 1 : 0))); + if (this.worldObj != null) { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(babySpeedBoostModifier); + if (childZombie) { + iattributeinstance.applyModifier(babySpeedBoostModifier); + } + } + + this.setChildSize(childZombie); + } + + /**+ + * Return whether this zombie is a villager. + */ + public boolean isVillager() { + return this.getDataWatcher().getWatchableObjectByte(13) == 1; + } + + /**+ + * Set whether this zombie is a villager. + */ + public void setVillager(boolean villager) { + this.getDataWatcher().updateObject(13, Byte.valueOf((byte) (villager ? 1 : 0))); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.worldObj.isDaytime() && !this.isChild()) { + float f = this.getBrightness(1.0F); + BlockPos blockpos = new BlockPos(this.posX, (double) Math.round(this.posY), this.posZ); + if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canSeeSky(blockpos)) { + boolean flag = true; + ItemStack itemstack = this.getEquipmentInSlot(4); + if (itemstack != null) { + if (itemstack.isItemStackDamageable()) { + itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2)); + if (itemstack.getItemDamage() >= itemstack.getMaxDamage()) { + this.renderBrokenItemStack(itemstack); + this.setCurrentItemOrArmor(4, (ItemStack) null); + } + } + + flag = false; + } + + if (flag) { + this.setFire(8); + } + } + } + + if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken) { + ((EntityLiving) this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D); + } + + super.onLivingUpdate(); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (super.attackEntityFrom(damagesource, f)) { + EntityLivingBase entitylivingbase = this.getAttackTarget(); + if (entitylivingbase == null && damagesource.getEntity() instanceof EntityLivingBase) { + entitylivingbase = (EntityLivingBase) damagesource.getEntity(); + } + + if (entitylivingbase != null && this.worldObj.getDifficulty() == EnumDifficulty.HARD + && (double) this.rand.nextFloat() < this.getEntityAttribute(reinforcementChance) + .getAttributeValue()) { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + EntityZombie entityzombie = new EntityZombie(this.worldObj); + + for (int l = 0; l < 50; ++l) { + int i1 = i + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) + * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int j1 = j + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) + * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int k1 = k + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) + * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + if (World.doesBlockHaveSolidTopSurface(this.worldObj, new BlockPos(i1, j1 - 1, k1)) + && this.worldObj.getLightFromNeighbors(new BlockPos(i1, j1, k1)) < 10) { + entityzombie.setPosition((double) i1, (double) j1, (double) k1); + if (!this.worldObj.isAnyPlayerWithinRangeAt((double) i1, (double) j1, (double) k1, 7.0D) + && this.worldObj.checkNoEntityCollision(entityzombie.getEntityBoundingBox(), + entityzombie) + && this.worldObj + .getCollidingBoundingBoxes(entityzombie, entityzombie.getEntityBoundingBox()) + .isEmpty() + && !this.worldObj.isAnyLiquid(entityzombie.getEntityBoundingBox())) { + this.worldObj.spawnEntityInWorld(entityzombie); + entityzombie.setAttackTarget(entitylivingbase); + entityzombie.onInitialSpawn( + this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), + (IEntityLivingData) null); + this.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier( + "Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier( + "Zombie reinforcement callee charge", -0.05000000074505806D, 0)); + break; + } + } + } + } + + return true; + } else { + return false; + } + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.isConverting()) { + int i = this.getConversionTimeBoost(); + this.conversionTime -= i; + if (this.conversionTime <= 0) { + this.convertToVillager(); + } + } + + super.onUpdate(); + } + + public boolean attackEntityAsMob(Entity entity) { + boolean flag = super.attackEntityAsMob(entity); + if (flag) { + int i = this.worldObj.getDifficulty().getDifficultyId(); + if (this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float) i * 0.3F) { + entity.setFire(2 * i); + } + } + + return flag; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.zombie.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.zombie.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.zombie.death"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + protected Item getDropItem() { + return Items.rotten_flesh; + } + + /**+ + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + /**+ + * Causes this Entity to drop a random item. + */ + protected void addRandomDrop() { + switch (this.rand.nextInt(3)) { + case 0: + this.dropItem(Items.iron_ingot, 1); + break; + case 1: + this.dropItem(Items.carrot, 1); + break; + case 2: + this.dropItem(Items.potato, 1); + } + + } + + /**+ + * Gives armor or weapon for entity based on given + * DifficultyInstance + */ + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficultyinstance) { + super.setEquipmentBasedOnDifficulty(difficultyinstance); + if (this.rand.nextFloat() < (this.worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.05F : 0.01F)) { + int i = this.rand.nextInt(3); + if (i == 0) { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); + } else { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_shovel)); + } + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + if (this.isChild()) { + nbttagcompound.setBoolean("IsBaby", true); + } + + if (this.isVillager()) { + nbttagcompound.setBoolean("IsVillager", true); + } + + nbttagcompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); + nbttagcompound.setBoolean("CanBreakDoors", this.isBreakDoorsTaskSet()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.getBoolean("IsBaby")) { + this.setChild(true); + } + + if (nbttagcompound.getBoolean("IsVillager")) { + this.setVillager(true); + } + + if (nbttagcompound.hasKey("ConversionTime", 99) && nbttagcompound.getInteger("ConversionTime") > -1) { + this.startConversion(nbttagcompound.getInteger("ConversionTime")); + } + + this.setBreakDoorsAItask(nbttagcompound.getBoolean("CanBreakDoors")); + } + + /**+ + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase entitylivingbase) { + super.onKillEntity(entitylivingbase); + if ((this.worldObj.getDifficulty() == EnumDifficulty.NORMAL + || this.worldObj.getDifficulty() == EnumDifficulty.HARD) + && entitylivingbase instanceof EntityVillager) { + if (this.worldObj.getDifficulty() != EnumDifficulty.HARD && this.rand.nextBoolean()) { + return; + } + + EntityLiving entityliving = (EntityLiving) entitylivingbase; + EntityZombie entityzombie = new EntityZombie(this.worldObj); + entityzombie.copyLocationAndAnglesFrom(entitylivingbase); + this.worldObj.removeEntity(entitylivingbase); + entityzombie.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), + (IEntityLivingData) null); + entityzombie.setVillager(true); + if (entitylivingbase.isChild()) { + entityzombie.setChild(true); + } + + entityzombie.setNoAI(entityliving.isAIDisabled()); + if (entityliving.hasCustomName()) { + entityzombie.setCustomNameTag(entityliving.getCustomNameTag()); + entityzombie.setAlwaysRenderNameTag(entityliving.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entityzombie); + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1016, + new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), 0); + } + + } + + public float getEyeHeight() { + float f = 1.74F; + if (this.isChild()) { + f = (float) ((double) f - 0.81D); + } + + return f; + } + + protected boolean func_175448_a(ItemStack itemstack) { + return itemstack.getItem() == Items.egg && this.isChild() && this.isRiding() ? false + : super.func_175448_a(itemstack); + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + float f = difficultyinstance.getClampedAdditionalDifficulty(); + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f); + if (ientitylivingdata == null) { + ientitylivingdata = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < 0.05F, + this.worldObj.rand.nextFloat() < 0.05F); + } + + if (ientitylivingdata instanceof EntityZombie.GroupData) { + EntityZombie.GroupData entityzombie$groupdata = (EntityZombie.GroupData) ientitylivingdata; + if (entityzombie$groupdata.isVillager) { + this.setVillager(true); + } + + if (entityzombie$groupdata.isChild) { + this.setChild(true); + if ((double) this.worldObj.rand.nextFloat() < 0.05D) { + List list = this.worldObj.getEntitiesWithinAABB(EntityChicken.class, + this.getEntityBoundingBox().expand(5.0D, 3.0D, 5.0D), EntitySelectors.IS_STANDALONE); + if (!list.isEmpty()) { + EntityChicken entitychicken = (EntityChicken) list.get(0); + entitychicken.setChickenJockey(true); + this.mountEntity(entitychicken); + } + } else if ((double) this.worldObj.rand.nextFloat() < 0.05D) { + EntityChicken entitychicken1 = new EntityChicken(this.worldObj); + entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entitychicken1.onInitialSpawn(difficultyinstance, (IEntityLivingData) null); + entitychicken1.setChickenJockey(true); + this.worldObj.spawnEntityInWorld(entitychicken1); + this.mountEntity(entitychicken1); + } + } + } + + this.setBreakDoorsAItask(this.rand.nextFloat() < f * 0.1F); + this.setEquipmentBasedOnDifficulty(difficultyinstance); + this.setEnchantmentBasedOnDifficulty(difficultyinstance); + if (this.getEquipmentInSlot(4) == null) { + Calendar calendar = this.worldObj.getCurrentDate(); + if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { + this.setCurrentItemOrArmor(4, + new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier( + new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0)); + double d0 = this.rand.nextDouble() * 1.5D * (double) f; + if (d0 > 1.0D) { + this.getEntityAttribute(SharedMonsterAttributes.followRange) + .applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2)); + } + + if (this.rand.nextFloat() < f * 0.05F) { + this.getEntityAttribute(reinforcementChance).applyModifier( + new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0)); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier( + new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2)); + this.setBreakDoorsAItask(true); + } + + return ientitylivingdata; + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.getCurrentEquippedItem(); + if (itemstack != null && itemstack.getItem() == Items.golden_apple && itemstack.getMetadata() == 0 + && this.isVillager() && this.isPotionActive(Potion.weakness)) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, (ItemStack) null); + } + + this.startConversion(this.rand.nextInt(2401) + 3600); + + return true; + } else { + return false; + } + } + + /**+ + * Starts converting this zombie into a villager. The zombie + * converts into a villager after the specified time in ticks. + */ + protected void startConversion(int ticks) { + this.conversionTime = ticks; + this.getDataWatcher().updateObject(14, Byte.valueOf((byte) 1)); + this.removePotionEffect(Potion.weakness.id); + this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, ticks, + Math.min(this.worldObj.getDifficulty().getDifficultyId() - 1, 0))); + this.worldObj.setEntityState(this, (byte) 16); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 16) { + if (!this.isSilent()) { + this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", + 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } + } else { + super.handleStatusUpdate(b0); + } + + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return !this.isConverting(); + } + + /**+ + * Returns whether this zombie is in the process of converting + * to a villager + */ + public boolean isConverting() { + return this.getDataWatcher().getWatchableObjectByte(14) == 1; + } + + /**+ + * Convert this zombie into a villager. + */ + protected void convertToVillager() { + EntityVillager entityvillager = new EntityVillager(this.worldObj); + entityvillager.copyLocationAndAnglesFrom(this); + entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), + (IEntityLivingData) null); + entityvillager.setLookingForHome(); + if (this.isChild()) { + entityvillager.setGrowingAge(-24000); + } + + this.worldObj.removeEntity(this); + entityvillager.setNoAI(this.isAIDisabled()); + if (this.hasCustomName()) { + entityvillager.setCustomNameTag(this.getCustomNameTag()); + entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entityvillager); + entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1017, + new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), 0); + } + + /**+ + * Return the amount of time decremented from conversionTime + * every tick. + */ + protected int getConversionTimeBoost() { + int i = 1; + if (this.rand.nextFloat() < 0.01F) { + int j = 0; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = (int) this.posX - 4; k < (int) this.posX + 4 && j < 14; ++k) { + for (int l = (int) this.posY - 4; l < (int) this.posY + 4 && j < 14; ++l) { + for (int i1 = (int) this.posZ - 4; i1 < (int) this.posZ + 4 && j < 14; ++i1) { + Block block = this.worldObj.getBlockState(blockpos$mutableblockpos.func_181079_c(k, l, i1)) + .getBlock(); + if (block == Blocks.iron_bars || block == Blocks.bed) { + if (this.rand.nextFloat() < 0.3F) { + ++i; + } + + ++j; + } + } + } + } + } + + return i; + } + + /**+ + * sets the size of the entity to be half of its current size if + * true. + */ + public void setChildSize(boolean isChild) { + this.multiplySize(isChild ? 0.5F : 1.0F); + } + + /**+ + * Sets the width and height of the entity. Args: width, height + */ + protected final void setSize(float f, float f1) { + boolean flag = this.zombieWidth > 0.0F && this.zombieHeight > 0.0F; + this.zombieWidth = f; + this.zombieHeight = f1; + if (!flag) { + this.multiplySize(1.0F); + } + + } + + /**+ + * Multiplies the height and width by the provided float. + */ + protected final void multiplySize(float size) { + super.setSize(this.zombieWidth * size, this.zombieHeight * size); + } + + /**+ + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return this.isChild() ? 0.0D : -0.35D; + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + if (damagesource.getEntity() instanceof EntityCreeper && !(this instanceof EntityPigZombie) + && ((EntityCreeper) damagesource.getEntity()).getPowered() + && ((EntityCreeper) damagesource.getEntity()).isAIEnabled()) { + ((EntityCreeper) damagesource.getEntity()).func_175493_co(); + this.entityDropItem(new ItemStack(Items.skull, 1, 2), 0.0F); + } + + } + + class GroupData implements IEntityLivingData { + public boolean isChild; + public boolean isVillager; + + private GroupData(boolean isBaby, boolean isVillagerZombie) { + this.isChild = false; + this.isVillager = false; + this.isChild = isBaby; + this.isVillager = isVillagerZombie; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/IMob.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/IMob.java new file mode 100644 index 0000000..af63521 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/IMob.java @@ -0,0 +1,38 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IMob extends IAnimals { + Predicate mobSelector = new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof IMob; + } + }; + Predicate VISIBLE_MOB_SELECTOR = new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof IMob && !entity.isInvisible(); + } + }; +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAmbientCreature.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAmbientCreature.java new file mode 100644 index 0000000..ba619ba --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAmbientCreature.java @@ -0,0 +1,51 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAmbientCreature extends EntityLiving implements IAnimals { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityAmbientCreature"); + } + + public EntityAmbientCreature(World worldIn) { + super(worldIn); + } + + public boolean allowLeashing() { + return false; + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer var1) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAnimal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAnimal.java new file mode 100644 index 0000000..935ab63 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAnimal.java @@ -0,0 +1,251 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAnimal extends EntityAgeable implements IAnimals { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityAnimal"); + } + + protected Block spawnableBlock = Blocks.grass; + private int inLove; + private EntityPlayer playerInLove; + + public EntityAnimal(World worldIn) { + super(worldIn); + } + + protected void updateAITasks() { + if (this.getGrowingAge() != 0) { + this.inLove = 0; + } + + super.updateAITasks(); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + if (this.getGrowingAge() != 0) { + this.inLove = 0; + } + + if (this.inLove > 0) { + --this.inLove; + if (this.inLove % 10 == 0) { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(EnumParticleTypes.HEART, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, + d2, new int[0]); + } + } + + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.inLove = 0; + return super.attackEntityFrom(damagesource, f); + } + } + + public float getBlockPathWeight(BlockPos blockpos) { + return this.worldObj.getBlockState(blockpos.down()).getBlock() == Blocks.grass ? 10.0F + : this.worldObj.getLightBrightness(blockpos) - 0.5F; + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("InLove", this.inLove); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.inLove = nbttagcompound.getInteger("InLove"); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + return this.worldObj.getBlockState(blockpos.down()).getBlock() == this.spawnableBlock + && this.worldObj.getLight(blockpos) > 8 && super.getCanSpawnHere(); + } + + /**+ + * Get number of ticks, at least during which the living entity + * will be silent. + */ + public int getTalkInterval() { + return 120; + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return false; + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer var1) { + return 1 + this.worldObj.rand.nextInt(3); + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack stack) { + return stack == null ? false : stack.getItem() == Items.wheat; + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null) { + if (this.isBreedingItem(itemstack) && this.getGrowingAge() == 0 && this.inLove <= 0) { + this.consumeItemFromStack(entityplayer, itemstack); + this.setInLove(entityplayer); + return true; + } + + if (this.isChild() && this.isBreedingItem(itemstack)) { + this.consumeItemFromStack(entityplayer, itemstack); + this.func_175501_a((int) ((float) (-this.getGrowingAge() / 20) * 0.1F), true); + return true; + } + } + + return super.interact(entityplayer); + } + + /**+ + * Decreases ItemStack size by one + */ + protected void consumeItemFromStack(EntityPlayer player, ItemStack stack) { + if (!player.capabilities.isCreativeMode) { + --stack.stackSize; + if (stack.stackSize <= 0) { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack) null); + } + } + + } + + public void setInLove(EntityPlayer player) { + this.inLove = 600; + this.playerInLove = player; + this.worldObj.setEntityState(this, (byte) 18); + } + + public EntityPlayer getPlayerInLove() { + return this.playerInLove; + } + + /**+ + * Returns if the entity is currently in 'love mode'. + */ + public boolean isInLove() { + return this.inLove > 0; + } + + public void resetInLove() { + this.inLove = 0; + } + + /**+ + * Returns true if the mob is currently able to mate with the + * specified mob. + */ + public boolean canMateWith(EntityAnimal otherAnimal) { + return otherAnimal == this ? false + : (otherAnimal.getClass() != this.getClass() ? false : this.isInLove() && otherAnimal.isInLove()); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 18) { + for (int i = 0; i < 7; ++i) { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(EnumParticleTypes.HEART, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, + d2, new int[0]); + } + } else { + super.handleStatusUpdate(b0); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityBat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityBat.java new file mode 100644 index 0000000..564e8c2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityBat.java @@ -0,0 +1,273 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import java.util.Calendar; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAmbientCreature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityBat extends EntityAmbientCreature { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityBat"); + } + + private BlockPos spawnPosition; + + public EntityBat(World worldIn) { + super(worldIn); + this.setSize(0.5F, 0.9F); + this.setIsBatHanging(true); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 0)); + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.1F; + } + + /**+ + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() { + return super.getSoundPitch() * 0.95F; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.bat.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.bat.death"; + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return false; + } + + protected void collideWithEntity(Entity var1) { + } + + protected void collideWithNearbyEntities() { + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D); + } + + public boolean getIsBatHanging() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setIsBatHanging(boolean isHanging) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (isHanging) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -2))); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.getIsBatHanging()) { + this.motionX = this.motionY = this.motionZ = 0.0D; + this.posY = (double) MathHelper.floor_double(this.posY) + 1.0D - (double) this.height; + } else { + this.motionY *= 0.6000000238418579D; + } + + } + + protected void updateAITasks() { + super.updateAITasks(); + BlockPos blockpos = new BlockPos(this); + BlockPos blockpos1 = blockpos.up(); + if (this.getIsBatHanging()) { + if (!this.worldObj.getBlockState(blockpos1).getBlock().isNormalCube()) { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1015, blockpos, 0); + } else { + if (this.rand.nextInt(200) == 0) { + this.rotationYawHead = (float) this.rand.nextInt(360); + } + + if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1015, blockpos, 0); + } + } + } else { + if (this.spawnPosition != null + && (!this.worldObj.isAirBlock(this.spawnPosition) || this.spawnPosition.getY() < 1)) { + this.spawnPosition = null; + } + + if (this.spawnPosition == null || this.rand.nextInt(30) == 0 + || this.spawnPosition.distanceSq((double) ((int) this.posX), (double) ((int) this.posY), + (double) ((int) this.posZ)) < 4.0D) { + this.spawnPosition = new BlockPos((int) this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), + (int) this.posY + this.rand.nextInt(6) - 2, + (int) this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); + } + + double d0 = (double) this.spawnPosition.getX() + 0.5D - this.posX; + double d1 = (double) this.spawnPosition.getY() + 0.1D - this.posY; + double d2 = (double) this.spawnPosition.getZ() + 0.5D - this.posZ; + this.motionX += (Math.signum(d0) * 0.5D - this.motionX) * 0.10000000149011612D; + this.motionY += (Math.signum(d1) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; + this.motionZ += (Math.signum(d2) * 0.5D - this.motionZ) * 0.10000000149011612D; + float f = (float) (MathHelper.func_181159_b(this.motionZ, this.motionX) * 180.0D / 3.1415927410125732D) + - 90.0F; + float f1 = MathHelper.wrapAngleTo180_float(f - this.rotationYaw); + this.moveForward = 0.5F; + this.rotationYaw += f1; + if (this.rand.nextInt(100) == 0 && this.worldObj.getBlockState(blockpos1).getBlock().isNormalCube()) { + this.setIsBatHanging(true); + } + } + + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public void fall(float var1, float var2) { + } + + protected void updateFallState(double var1, boolean var3, Block var4, BlockPos var5) { + } + + /**+ + * Return whether this entity should NOT trigger a pressure + * plate or a tripwire. + */ + public boolean doesEntityNotTriggerPressurePlate() { + return true; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + if (this.getIsBatHanging()) { + this.setIsBatHanging(false); + } + + return super.attackEntityFrom(damagesource, f); + } + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.dataWatcher.updateObject(16, Byte.valueOf(nbttagcompound.getByte("BatFlags"))); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); + if (blockpos.getY() >= this.worldObj.func_181545_F()) { + return false; + } else { + int i = this.worldObj.getLightFromNeighbors(blockpos); + byte b0 = 4; + if (this.isDateAroundHalloween(this.worldObj.getCurrentDate())) { + b0 = 7; + } else if (this.rand.nextBoolean()) { + return false; + } + + return i > this.rand.nextInt(b0) ? false : super.getCanSpawnHere(); + } + } + + private boolean isDateAroundHalloween(Calendar parCalendar) { + return parCalendar.get(2) + 1 == 10 && parCalendar.get(5) >= 20 + || parCalendar.get(2) + 1 == 11 && parCalendar.get(5) <= 3; + } + + public float getEyeHeight() { + return this.height / 2.0F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityChicken.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityChicken.java new file mode 100644 index 0000000..5e67113 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityChicken.java @@ -0,0 +1,244 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowParent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPanic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITempt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityChicken extends EntityAnimal { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityChicken"); + } + + public float wingRotation; + public float destPos; + public float field_70884_g; + public float field_70888_h; + public float wingRotDelta = 1.0F; + public int timeUntilNextEgg; + public boolean chickenJockey; + + public EntityChicken(World worldIn) { + super(worldIn); + this.setSize(0.4F, 0.7F); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.wheat_seeds, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + public float getEyeHeight() { + return this.height; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.field_70888_h = this.wingRotation; + this.field_70884_g = this.destPos; + this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D); + this.destPos = MathHelper.clamp_float(this.destPos, 0.0F, 1.0F); + if (!this.onGround && this.wingRotDelta < 1.0F) { + this.wingRotDelta = 1.0F; + } + + this.wingRotDelta = (float) ((double) this.wingRotDelta * 0.9D); + if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + this.wingRotation += this.wingRotDelta * 2.0F; + if (!this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0) { + this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(Items.egg, 1); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + } + + } + + public void fall(float var1, float var2) { + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.chicken.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.chicken.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.chicken.hurt"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.chicken.step", 0.15F, 1.0F); + } + + protected Item getDropItem() { + return Items.feather; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(3) + this.rand.nextInt(1 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.feather, 1); + } + + if (this.isBurning()) { + this.dropItem(Items.cooked_chicken, 1); + } else { + this.dropItem(Items.chicken, 1); + } + + } + + public EntityChicken createChild(EntityAgeable var1) { + return new EntityChicken(this.worldObj); + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack itemstack) { + return itemstack != null && itemstack.getItem() == Items.wheat_seeds; + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.chickenJockey = nbttagcompound.getBoolean("IsChickenJockey"); + if (nbttagcompound.hasKey("EggLayTime")) { + this.timeUntilNextEgg = nbttagcompound.getInteger("EggLayTime"); + } + + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer entityplayer) { + return this.isChickenJockey() ? 10 : super.getExperiencePoints(entityplayer); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("IsChickenJockey", this.chickenJockey); + nbttagcompound.setInteger("EggLayTime", this.timeUntilNextEgg); + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return this.isChickenJockey() && this.riddenByEntity == null; + } + + public void updateRiderPosition() { + super.updateRiderPosition(); + float f = MathHelper.sin(this.renderYawOffset * 3.1415927F / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * 3.1415927F / 180.0F); + float f2 = 0.1F; + float f3 = 0.0F; + this.riddenByEntity.setPosition(this.posX + (double) (f2 * f), + this.posY + (double) (this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double) f3, + this.posZ - (double) (f2 * f1)); + if (this.riddenByEntity instanceof EntityLivingBase) { + ((EntityLivingBase) this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + + } + + /**+ + * Determines if this chicken is a jokey with a zombie riding + * it. + */ + public boolean isChickenJockey() { + return this.chickenJockey; + } + + /**+ + * Sets whether this chicken is a jockey or not. + */ + public void setChickenJockey(boolean jockey) { + this.chickenJockey = jockey; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityCow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityCow.java new file mode 100644 index 0000000..92a861f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityCow.java @@ -0,0 +1,157 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowParent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPanic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITempt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityCow extends EntityAnimal { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityCow"); + } + + public EntityCow(World worldIn) { + super(worldIn); + this.setSize(0.9F, 1.3F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.cow.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.cow.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.cow.hurt"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.cow.step", 0.15F, 1.0F); + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item getDropItem() { + return Items.leather; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(3) + this.rand.nextInt(1 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.leather, 1); + } + + j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + i); + + for (int l = 0; l < j; ++l) { + if (this.isBurning()) { + this.dropItem(Items.cooked_beef, 1); + } else { + this.dropItem(Items.beef, 1); + } + } + + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.bucket && !entityplayer.capabilities.isCreativeMode + && !this.isChild()) { + if (itemstack.stackSize-- == 1) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + new ItemStack(Items.milk_bucket)); + } else if (!entityplayer.inventory.addItemStackToInventory(new ItemStack(Items.milk_bucket))) { + entityplayer.dropPlayerItemWithRandomChoice(new ItemStack(Items.milk_bucket, 1, 0), false); + } + + return true; + } else { + return super.interact(entityplayer); + } + } + + public EntityCow createChild(EntityAgeable var1) { + return new EntityCow(this.worldObj); + } + + public float getEyeHeight() { + return this.height; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityHorse.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityHorse.java new file mode 100644 index 0000000..13601f7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityHorse.java @@ -0,0 +1,1556 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowParent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPanic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIRunAroundLikeCrazy; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.RangedAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.AnimalChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInvBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityHorse extends EntityAnimal implements IInvBasic { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityHorse"); + } + + private static final Predicate horseBreedingSelector = new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof EntityHorse && ((EntityHorse) entity).isBreeding(); + } + }; + private static final IAttribute horseJumpStrength = (new RangedAttribute((IAttribute) null, "horse.jumpStrength", + 0.7D, 0.0D, 2.0D)).setDescription("Jump Strength").setShouldWatch(true); + private static final String[] horseArmorTextures = new String[] { null, + "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", + "textures/entity/horse/armor/horse_armor_diamond.png" }; + private static final String[] HORSE_ARMOR_TEXTURES_ABBR = new String[] { "", "meo", "goo", "dio" }; + private static final int[] armorValues = new int[] { 0, 5, 7, 11 }; + private static final String[] horseTextures = new String[] { "textures/entity/horse/horse_white.png", + "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", + "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", + "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png" }; + private static final String[] HORSE_TEXTURES_ABBR = new String[] { "hwh", "hcr", "hch", "hbr", "hbl", "hgr", + "hdb" }; + private static final String[] horseMarkingTextures = new String[] { null, + "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", + "textures/entity/horse/horse_markings_whitedots.png", + "textures/entity/horse/horse_markings_blackdots.png" }; + private static final String[] HORSE_MARKING_TEXTURES_ABBR = new String[] { "", "wo_", "wmo", "wdo", "bdo" }; + private int eatingHaystackCounter; + private int openMouthCounter; + private int jumpRearingCounter; + public int field_110278_bp; + public int field_110279_bq; + protected boolean horseJumping; + private AnimalChest horseChest; + private boolean hasReproduced; + protected int temper; + protected float jumpPower; + private boolean field_110294_bI; + private float headLean; + private float prevHeadLean; + private float rearingAmount; + private float prevRearingAmount; + private float mouthOpenness; + private float prevMouthOpenness; + private int gallopTime; + private String texturePrefix; + private String[] horseTexturesArray = new String[3]; + private boolean field_175508_bO = false; + + public EntityHorse(World worldIn) { + super(worldIn); + this.setSize(1.4F, 1.6F); + this.isImmuneToFire = false; + this.setChested(false); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.2D)); + this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWander(this, 0.7D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.initHorseChest(); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + this.dataWatcher.addObject(19, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(20, Integer.valueOf(0)); + this.dataWatcher.addObject(21, String.valueOf("")); + this.dataWatcher.addObject(22, Integer.valueOf(0)); + } + + public void setHorseType(int type) { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) type)); + this.resetTexturePrefix(); + } + + /**+ + * Returns the horse type. 0 = Normal, 1 = Donkey, 2 = Mule, 3 = + * Undead Horse, 4 = Skeleton Horse + */ + public int getHorseType() { + return this.dataWatcher.getWatchableObjectByte(19); + } + + public void setHorseVariant(int variant) { + this.dataWatcher.updateObject(20, Integer.valueOf(variant)); + this.resetTexturePrefix(); + } + + public int getHorseVariant() { + return this.dataWatcher.getWatchableObjectInt(20); + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + if (this.hasCustomName()) { + return this.getCustomNameTag(); + } else { + int i = this.getHorseType(); + switch (i) { + case 0: + default: + return StatCollector.translateToLocal("entity.horse.name"); + case 1: + return StatCollector.translateToLocal("entity.donkey.name"); + case 2: + return StatCollector.translateToLocal("entity.mule.name"); + case 3: + return StatCollector.translateToLocal("entity.zombiehorse.name"); + case 4: + return StatCollector.translateToLocal("entity.skeletonhorse.name"); + } + } + } + + private boolean getHorseWatchableBoolean(int parInt1) { + return (this.dataWatcher.getWatchableObjectInt(16) & parInt1) != 0; + } + + private void setHorseWatchableBoolean(int parInt1, boolean parFlag) { + int i = this.dataWatcher.getWatchableObjectInt(16); + if (parFlag) { + this.dataWatcher.updateObject(16, Integer.valueOf(i | parInt1)); + } else { + this.dataWatcher.updateObject(16, Integer.valueOf(i & ~parInt1)); + } + + } + + public boolean isAdultHorse() { + return !this.isChild(); + } + + public boolean isTame() { + return this.getHorseWatchableBoolean(2); + } + + public boolean func_110253_bW() { + return this.isAdultHorse(); + } + + /**+ + * Gets the horse's owner + */ + public String getOwnerId() { + return this.dataWatcher.getWatchableObjectString(21); + } + + public void setOwnerId(String id) { + this.dataWatcher.updateObject(21, id); + } + + public float getHorseSize() { + return 0.5F; + } + + /**+ + * "Sets the scale for an ageable entity according to the + * boolean parameter, which says if it's a child." + */ + public void setScaleForAge(boolean flag) { + if (flag) { + this.setScale(this.getHorseSize()); + } else { + this.setScale(1.0F); + } + + } + + public boolean isHorseJumping() { + return this.horseJumping; + } + + public void setHorseTamed(boolean tamed) { + this.setHorseWatchableBoolean(2, tamed); + } + + public void setHorseJumping(boolean jumping) { + this.horseJumping = jumping; + } + + public boolean allowLeashing() { + return !this.isUndead() && super.allowLeashing(); + } + + protected void func_142017_o(float f) { + if (f > 6.0F && this.isEatingHaystack()) { + this.setEatingHaystack(false); + } + + } + + public boolean isChested() { + return this.getHorseWatchableBoolean(8); + } + + /**+ + * Returns type of armor from DataWatcher (0 = iron, 1 = gold, 2 + * = diamond) + */ + public int getHorseArmorIndexSynced() { + return this.dataWatcher.getWatchableObjectInt(22); + } + + /**+ + * 0 = iron, 1 = gold, 2 = diamond + */ + private int getHorseArmorIndex(ItemStack itemStackIn) { + if (itemStackIn == null) { + return 0; + } else { + Item item = itemStackIn.getItem(); + return item == Items.iron_horse_armor ? 1 + : (item == Items.golden_horse_armor ? 2 : (item == Items.diamond_horse_armor ? 3 : 0)); + } + } + + public boolean isEatingHaystack() { + return this.getHorseWatchableBoolean(32); + } + + public boolean isRearing() { + return this.getHorseWatchableBoolean(64); + } + + public boolean isBreeding() { + return this.getHorseWatchableBoolean(16); + } + + public boolean getHasReproduced() { + return this.hasReproduced; + } + + /**+ + * Set horse armor stack (for example: new + * ItemStack(Items.iron_horse_armor)) + */ + public void setHorseArmorStack(ItemStack itemStackIn) { + this.dataWatcher.updateObject(22, Integer.valueOf(this.getHorseArmorIndex(itemStackIn))); + this.resetTexturePrefix(); + } + + public void setBreeding(boolean breeding) { + this.setHorseWatchableBoolean(16, breeding); + } + + public void setChested(boolean chested) { + this.setHorseWatchableBoolean(8, chested); + } + + public void setHasReproduced(boolean hasReproducedIn) { + this.hasReproduced = hasReproducedIn; + } + + public void setHorseSaddled(boolean saddled) { + this.setHorseWatchableBoolean(4, saddled); + } + + public int getTemper() { + return this.temper; + } + + public void setTemper(int temperIn) { + this.temper = temperIn; + } + + public int increaseTemper(int parInt1) { + int i = MathHelper.clamp_int(this.getTemper() + parInt1, 0, this.getMaxTemper()); + this.setTemper(i); + return i; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + Entity entity = damagesource.getEntity(); + return this.riddenByEntity != null && this.riddenByEntity.equals(entity) ? false + : super.attackEntityFrom(damagesource, f); + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return armorValues[this.getHorseArmorIndexSynced()]; + } + + /**+ + * Returns true if this entity should push and be pushed by + * other entities when colliding. + */ + public boolean canBePushed() { + return this.riddenByEntity == null; + } + + public boolean prepareChunkForSpawn() { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posZ); + this.worldObj.getBiomeGenForCoords(new BlockPos(i, 0, j)); + return true; + } + + public void dropChests() { + if (this.isChested()) { + this.dropItem(Item.getItemFromBlock(Blocks.chest), 1); + this.setChested(false); + } + } + + private void func_110266_cB() { + this.openHorseMouth(); + if (!this.isSilent()) { + this.worldObj.playSoundAtEntity(this, "eating", 1.0F, + 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + } + + } + + public void fall(float f, float f1) { + if (f > 1.0F) { + this.playSound("mob.horse.land", 0.4F, 1.0F); + } + + int i = MathHelper.ceiling_float_int((f * 0.5F - 3.0F) * f1); + if (i > 0) { + this.attackEntityFrom(DamageSource.fall, (float) i); + if (this.riddenByEntity != null) { + this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float) i); + } + + Block block = this.worldObj + .getBlockState(new BlockPos(this.posX, this.posY - 0.2D - (double) this.prevRotationYaw, this.posZ)) + .getBlock(); + if (block.getMaterial() != Material.air && !this.isSilent()) { + Block.SoundType block$soundtype = block.stepSound; + this.worldObj.playSoundAtEntity(this, block$soundtype.getStepSound(), + block$soundtype.getVolume() * 0.5F, block$soundtype.getFrequency() * 0.75F); + } + + } + } + + /**+ + * Returns number of slots depending horse type + */ + private int getChestSize() { + int i = this.getHorseType(); + return !this.isChested() || i != 1 && i != 2 ? 2 : 17; + } + + private void initHorseChest() { + AnimalChest animalchest = this.horseChest; + this.horseChest = new AnimalChest("HorseChest", this.getChestSize()); + this.horseChest.setCustomName(this.getName()); + if (animalchest != null) { + animalchest.func_110132_b(this); + int i = Math.min(animalchest.getSizeInventory(), this.horseChest.getSizeInventory()); + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = animalchest.getStackInSlot(j); + if (itemstack != null) { + this.horseChest.setInventorySlotContents(j, itemstack.copy()); + } + } + } + + this.horseChest.func_110134_a(this); + this.updateHorseSlots(); + } + + /**+ + * Updates the items in the saddle and armor slots of the + * horse's inventory. + */ + private void updateHorseSlots() { + { + this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); + if (this.canWearArmor()) { + this.setHorseArmorStack(this.horseChest.getStackInSlot(1)); + } + } + } + + /**+ + * Called by InventoryBasic.onInventoryChanged() on a array that + * is never filled. + */ + public void onInventoryChanged(InventoryBasic var1) { + int i = this.getHorseArmorIndexSynced(); + boolean flag = this.isHorseSaddled(); + this.updateHorseSlots(); + if (this.ticksExisted > 20) { + if (i == 0 && i != this.getHorseArmorIndexSynced()) { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } else if (i != this.getHorseArmorIndexSynced()) { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + + if (!flag && this.isHorseSaddled()) { + this.playSound("mob.horse.leather", 0.5F, 1.0F); + } + } + + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + this.prepareChunkForSpawn(); + return super.getCanSpawnHere(); + } + + protected EntityHorse getClosestHorse(Entity entityIn, double distance) { + double d0 = Double.MAX_VALUE; + Entity entity = null; + + for (Entity entity1 : this.worldObj.getEntitiesInAABBexcluding(entityIn, + entityIn.getEntityBoundingBox().addCoord(distance, distance, distance), horseBreedingSelector)) { + double d1 = entity1.getDistanceSq(entityIn.posX, entityIn.posY, entityIn.posZ); + if (d1 < d0) { + entity = entity1; + d0 = d1; + } + } + + return (EntityHorse) entity; + } + + public double getHorseJumpStrength() { + return this.getEntityAttribute(horseJumpStrength).getAttributeValue(); + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + this.openHorseMouth(); + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.death" + : (i == 4 ? "mob.horse.skeleton.death" + : (i != 1 && i != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); + } + + protected Item getDropItem() { + boolean flag = this.rand.nextInt(4) == 0; + int i = this.getHorseType(); + return i == 4 ? Items.bone : (i == 3 ? (flag ? null : Items.rotten_flesh) : Items.leather); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + this.openHorseMouth(); + if (this.rand.nextInt(3) == 0) { + this.makeHorseRear(); + } + + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.hit" + : (i == 4 ? "mob.horse.skeleton.hit" : (i != 1 && i != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit")); + } + + public boolean isHorseSaddled() { + return this.getHorseWatchableBoolean(4); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + this.openHorseMouth(); + if (this.rand.nextInt(10) == 0 && !this.isMovementBlocked()) { + this.makeHorseRear(); + } + + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.idle" + : (i == 4 ? "mob.horse.skeleton.idle" + : (i != 1 && i != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle")); + } + + protected String getAngrySoundName() { + this.openHorseMouth(); + this.makeHorseRear(); + int i = this.getHorseType(); + return i != 3 && i != 4 ? (i != 1 && i != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; + } + + protected void playStepSound(BlockPos blockpos, Block block) { + Block.SoundType block$soundtype = block.stepSound; + if (this.worldObj.getBlockState(blockpos.up()).getBlock() == Blocks.snow_layer) { + block$soundtype = Blocks.snow_layer.stepSound; + } + + if (!block.getMaterial().isLiquid()) { + int i = this.getHorseType(); + if (this.riddenByEntity != null && i != 1 && i != 2) { + ++this.gallopTime; + if (this.gallopTime > 5 && this.gallopTime % 3 == 0) { + this.playSound("mob.horse.gallop", block$soundtype.getVolume() * 0.15F, + block$soundtype.getFrequency()); + if (i == 0 && this.rand.nextInt(10) == 0) { + this.playSound("mob.horse.breathe", block$soundtype.getVolume() * 0.6F, + block$soundtype.getFrequency()); + } + } else if (this.gallopTime <= 5) { + this.playSound("mob.horse.wood", block$soundtype.getVolume() * 0.15F, + block$soundtype.getFrequency()); + } + } else if (block$soundtype == Block.soundTypeWood) { + this.playSound("mob.horse.wood", block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } else { + this.playSound("mob.horse.soft", block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } + } + + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(horseJumpStrength); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(53.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.22499999403953552D); + } + + /**+ + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 6; + } + + public int getMaxTemper() { + return 100; + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.8F; + } + + /**+ + * Get number of ticks, at least during which the living entity + * will be silent. + */ + public int getTalkInterval() { + return 400; + } + + public boolean func_110239_cn() { + return this.getHorseType() == 0 || this.getHorseArmorIndexSynced() > 0; + } + + private void resetTexturePrefix() { + this.texturePrefix = null; + } + + public boolean func_175507_cI() { + return this.field_175508_bO; + } + + private void setHorseTexturePaths() { + this.texturePrefix = "horse/"; + this.horseTexturesArray[0] = null; + this.horseTexturesArray[1] = null; + this.horseTexturesArray[2] = null; + int i = this.getHorseType(); + int j = this.getHorseVariant(); + if (i == 0) { + int k = j & 255; + int l = (j & '\uff00') >> 8; + if (k >= horseTextures.length) { + this.field_175508_bO = false; + return; + } + + this.horseTexturesArray[0] = horseTextures[k]; + this.texturePrefix = this.texturePrefix + HORSE_TEXTURES_ABBR[k]; + if (l >= horseMarkingTextures.length) { + this.field_175508_bO = false; + return; + } + + this.horseTexturesArray[1] = horseMarkingTextures[l]; + this.texturePrefix = this.texturePrefix + HORSE_MARKING_TEXTURES_ABBR[l]; + } else { + this.horseTexturesArray[0] = ""; + this.texturePrefix = this.texturePrefix + "_" + i + "_"; + } + + int i1 = this.getHorseArmorIndexSynced(); + if (i1 >= horseArmorTextures.length) { + this.field_175508_bO = false; + } else { + this.horseTexturesArray[2] = horseArmorTextures[i1]; + this.texturePrefix = this.texturePrefix + HORSE_ARMOR_TEXTURES_ABBR[i1]; + this.field_175508_bO = true; + } + } + + public String getHorseTexture() { + if (this.texturePrefix == null) { + this.setHorseTexturePaths(); + } + + return this.texturePrefix; + } + + public String[] getVariantTexturePaths() { + if (this.texturePrefix == null) { + this.setHorseTexturePaths(); + } + + return this.horseTexturesArray; + } + + public void openGUI(EntityPlayer playerEntity) { + if ((this.riddenByEntity == null || this.riddenByEntity == playerEntity) && this.isTame()) { + this.horseChest.setCustomName(this.getName()); + playerEntity.displayGUIHorse(this, this.horseChest); + } + + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) { + return super.interact(entityplayer); + } else if (!this.isTame() && this.isUndead()) { + return false; + } else if (this.isTame() && this.isAdultHorse() && entityplayer.isSneaking()) { + this.openGUI(entityplayer); + return true; + } else if (this.func_110253_bW() && this.riddenByEntity != null) { + return super.interact(entityplayer); + } else { + if (itemstack != null) { + boolean flag = false; + if (this.canWearArmor()) { + byte b0 = -1; + if (itemstack.getItem() == Items.iron_horse_armor) { + b0 = 1; + } else if (itemstack.getItem() == Items.golden_horse_armor) { + b0 = 2; + } else if (itemstack.getItem() == Items.diamond_horse_armor) { + b0 = 3; + } + + if (b0 >= 0) { + if (!this.isTame()) { + this.makeHorseRearWithSound(); + return true; + } + + this.openGUI(entityplayer); + return true; + } + } + + if (!flag && !this.isUndead()) { + float f = 0.0F; + short short1 = 0; + byte b1 = 0; + if (itemstack.getItem() == Items.wheat) { + f = 2.0F; + short1 = 20; + b1 = 3; + } else if (itemstack.getItem() == Items.sugar) { + f = 1.0F; + short1 = 30; + b1 = 3; + } else if (Block.getBlockFromItem(itemstack.getItem()) == Blocks.hay_block) { + f = 20.0F; + short1 = 180; + } else if (itemstack.getItem() == Items.apple) { + f = 3.0F; + short1 = 60; + b1 = 3; + } else if (itemstack.getItem() == Items.golden_carrot) { + f = 4.0F; + short1 = 60; + b1 = 5; + if (this.isTame() && this.getGrowingAge() == 0) { + flag = true; + this.setInLove(entityplayer); + } + } else if (itemstack.getItem() == Items.golden_apple) { + f = 10.0F; + short1 = 240; + b1 = 10; + if (this.isTame() && this.getGrowingAge() == 0) { + flag = true; + this.setInLove(entityplayer); + } + } + + if (this.getHealth() < this.getMaxHealth() && f > 0.0F) { + this.heal(f); + flag = true; + } + + if (!this.isAdultHorse() && short1 > 0) { + this.addGrowth(short1); + flag = true; + } + + if (b1 > 0 && (flag || !this.isTame()) && b1 < this.getMaxTemper()) { + flag = true; + this.increaseTemper(b1); + } + + if (flag) { + this.func_110266_cB(); + } + } + + if (!this.isTame() && !flag) { + if (itemstack != null && itemstack.interactWithEntity(entityplayer, this)) { + return true; + } + + this.makeHorseRearWithSound(); + return true; + } + + if (!flag && this.canCarryChest() && !this.isChested() + && itemstack.getItem() == Item.getItemFromBlock(Blocks.chest)) { + this.setChested(true); + this.playSound("mob.chickenplop", 1.0F, + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + flag = true; + this.initHorseChest(); + } + + if (!flag && this.func_110253_bW() && !this.isHorseSaddled() && itemstack.getItem() == Items.saddle) { + this.openGUI(entityplayer); + return true; + } + + if (flag) { + if (!entityplayer.capabilities.isCreativeMode && --itemstack.stackSize == 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + + return true; + } + } + + if (this.func_110253_bW() && this.riddenByEntity == null) { + if (itemstack != null && itemstack.interactWithEntity(entityplayer, this)) { + return true; + } else { + this.mountTo(entityplayer); + return true; + } + } else { + return super.interact(entityplayer); + } + } + } + + private void mountTo(EntityPlayer player) { + player.rotationYaw = this.rotationYaw; + player.rotationPitch = this.rotationPitch; + this.setEatingHaystack(false); + this.setRearing(false); + player.mountEntity(this); + } + + /**+ + * Return true if the horse entity can wear an armor + */ + public boolean canWearArmor() { + return this.getHorseType() == 0; + } + + /**+ + * Return true if the horse entity can carry a chest. + */ + public boolean canCarryChest() { + int i = this.getHorseType(); + return i == 2 || i == 1; + } + + /**+ + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() { + return this.riddenByEntity != null && this.isHorseSaddled() ? true + : this.isEatingHaystack() || this.isRearing(); + } + + /**+ + * Used to know if the horse can be leashed, if he can mate, or + * if we can interact with him + */ + public boolean isUndead() { + int i = this.getHorseType(); + return i == 3 || i == 4; + } + + /**+ + * Return true if the horse entity is sterile (Undead || Mule) + */ + public boolean isSterile() { + return this.isUndead() || this.getHorseType() == 2; + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack var1) { + return false; + } + + private void func_110210_cH() { + this.field_110278_bp = 1; + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + this.dropChestItems(); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.rand.nextInt(200) == 0) { + this.func_110210_cH(); + } + + super.onLivingUpdate(); + { + if (this.rand.nextInt(900) == 0 && this.deathTime == 0) { + this.heal(1.0F); + } + + if (!this.isEatingHaystack() && this.riddenByEntity == null && this.rand.nextInt(300) == 0 + && this.worldObj + .getBlockState(new BlockPos(MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ))) + .getBlock() == Blocks.grass) { + this.setEatingHaystack(true); + } + + if (this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) { + this.eatingHaystackCounter = 0; + this.setEatingHaystack(false); + } + + if (this.isBreeding() && !this.isAdultHorse() && !this.isEatingHaystack()) { + EntityHorse entityhorse = this.getClosestHorse(this, 16.0D); + if (entityhorse != null && this.getDistanceSqToEntity(entityhorse) > 4.0D) { + this.navigator.getPathToEntityLiving(entityhorse); + } + } + } + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) { + this.openMouthCounter = 0; + this.setHorseWatchableBoolean(128, false); + } + + if (this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) { + this.jumpRearingCounter = 0; + this.setRearing(false); + } + + if (this.field_110278_bp > 0 && ++this.field_110278_bp > 8) { + this.field_110278_bp = 0; + } + + if (this.field_110279_bq > 0) { + ++this.field_110279_bq; + if (this.field_110279_bq > 300) { + this.field_110279_bq = 0; + } + } + + this.prevHeadLean = this.headLean; + if (this.isEatingHaystack()) { + this.headLean += (1.0F - this.headLean) * 0.4F + 0.05F; + if (this.headLean > 1.0F) { + this.headLean = 1.0F; + } + } else { + this.headLean += (0.0F - this.headLean) * 0.4F - 0.05F; + if (this.headLean < 0.0F) { + this.headLean = 0.0F; + } + } + + this.prevRearingAmount = this.rearingAmount; + if (this.isRearing()) { + this.prevHeadLean = this.headLean = 0.0F; + this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F; + if (this.rearingAmount > 1.0F) { + this.rearingAmount = 1.0F; + } + } else { + this.field_110294_bI = false; + this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount + - this.rearingAmount) * 0.6F - 0.05F; + if (this.rearingAmount < 0.0F) { + this.rearingAmount = 0.0F; + } + } + + this.prevMouthOpenness = this.mouthOpenness; + if (this.getHorseWatchableBoolean(128)) { + this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; + if (this.mouthOpenness > 1.0F) { + this.mouthOpenness = 1.0F; + } + } else { + this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; + if (this.mouthOpenness < 0.0F) { + this.mouthOpenness = 0.0F; + } + } + + } + + private void openHorseMouth() { + this.openMouthCounter = 1; + this.setHorseWatchableBoolean(128, true); + } + + /**+ + * Return true if the horse entity ready to mate. (no rider, not + * riding, tame, adult, not steril...) + */ + private boolean canMate() { + return this.riddenByEntity == null && this.ridingEntity == null && this.isTame() && this.isAdultHorse() + && !this.isSterile() && this.getHealth() >= this.getMaxHealth() && this.isInLove(); + } + + public void setEating(boolean flag) { + this.setHorseWatchableBoolean(32, flag); + } + + public void setEatingHaystack(boolean parFlag) { + this.setEating(parFlag); + } + + public void setRearing(boolean rearing) { + if (rearing) { + this.setEatingHaystack(false); + } + + this.setHorseWatchableBoolean(64, rearing); + } + + private void makeHorseRear() { + this.jumpRearingCounter = 1; + this.setRearing(true); + } + + public void makeHorseRearWithSound() { + this.makeHorseRear(); + String s = this.getAngrySoundName(); + if (s != null) { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + + } + + public void dropChestItems() { + this.dropItemsInChest(this, this.horseChest); + this.dropChests(); + } + + private void dropItemsInChest(Entity entityIn, AnimalChest animalChestIn) { + if (animalChestIn != null) { + for (int i = 0; i < animalChestIn.getSizeInventory(); ++i) { + ItemStack itemstack = animalChestIn.getStackInSlot(i); + if (itemstack != null) { + this.entityDropItem(itemstack, 0.0F); + } + } + + } + } + + public boolean setTamedBy(EntityPlayer player) { + this.setOwnerId(player.getUniqueID().toString()); + this.setHorseTamed(true); + return true; + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float f, float f1) { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase && this.isHorseSaddled()) { + this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; + this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.rotationYawHead = this.renderYawOffset = this.rotationYaw; + f = ((EntityLivingBase) this.riddenByEntity).moveStrafing * 0.5F; + f1 = ((EntityLivingBase) this.riddenByEntity).moveForward; + if (f1 <= 0.0F) { + f1 *= 0.25F; + this.gallopTime = 0; + } + + if (this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) { + f = 0.0F; + f1 = 0.0F; + } + + if (this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) { + this.motionY = this.getHorseJumpStrength() * (double) this.jumpPower; + if (this.isPotionActive(Potion.jump)) { + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) + * 0.1F); + } + + this.setHorseJumping(true); + this.isAirBorne = true; + if (f1 > 0.0F) { + float f2 = MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F); + float f3 = MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F); + this.motionX += (double) (-0.4F * f2 * this.jumpPower); + this.motionZ += (double) (0.4F * f3 * this.jumpPower); + this.playSound("mob.horse.jump", 0.4F, 1.0F); + } + + this.jumpPower = 0.0F; + } + + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + this.setAIMoveSpeed( + (float) this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + super.moveEntityWithHeading(f, f1); + + if (this.onGround) { + this.jumpPower = 0.0F; + this.setHorseJumping(false); + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; + if (f4 > 1.0F) { + f4 = 1.0F; + } + + this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } else { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; + super.moveEntityWithHeading(f, f1); + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("EatingHaystack", this.isEatingHaystack()); + nbttagcompound.setBoolean("ChestedHorse", this.isChested()); + nbttagcompound.setBoolean("HasReproduced", this.getHasReproduced()); + nbttagcompound.setBoolean("Bred", this.isBreeding()); + nbttagcompound.setInteger("Type", this.getHorseType()); + nbttagcompound.setInteger("Variant", this.getHorseVariant()); + nbttagcompound.setInteger("Temper", this.getTemper()); + nbttagcompound.setBoolean("Tame", this.isTame()); + nbttagcompound.setString("Owner", this.getOwnerId()); + if (this.isChested()) { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 2; i < this.horseChest.getSizeInventory(); ++i) { + ItemStack itemstack = this.horseChest.getStackInSlot(i); + if (itemstack != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + itemstack.writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + } + + if (this.horseChest.getStackInSlot(1) != null) { + nbttagcompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound())); + } + + if (this.horseChest.getStackInSlot(0) != null) { + nbttagcompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound())); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setEatingHaystack(nbttagcompound.getBoolean("EatingHaystack")); + this.setBreeding(nbttagcompound.getBoolean("Bred")); + this.setChested(nbttagcompound.getBoolean("ChestedHorse")); + this.setHasReproduced(nbttagcompound.getBoolean("HasReproduced")); + this.setHorseType(nbttagcompound.getInteger("Type")); + this.setHorseVariant(nbttagcompound.getInteger("Variant")); + this.setTemper(nbttagcompound.getInteger("Temper")); + this.setHorseTamed(nbttagcompound.getBoolean("Tame")); + String s = ""; + if (nbttagcompound.hasKey("Owner", 8)) { + s = nbttagcompound.getString("Owner"); + } + + if (s.length() > 0) { + this.setOwnerId(s); + } + + IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed"); + if (iattributeinstance != null) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed) + .setBaseValue(iattributeinstance.getBaseValue() * 0.25D); + } + + if (this.isChested()) { + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.initHorseChest(); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + if (j >= 2 && j < this.horseChest.getSizeInventory()) { + this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound1)); + } + } + } + + if (nbttagcompound.hasKey("ArmorItem", 10)) { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("ArmorItem")); + if (itemstack != null && isArmorItem(itemstack.getItem())) { + this.horseChest.setInventorySlotContents(1, itemstack); + } + } + + if (nbttagcompound.hasKey("SaddleItem", 10)) { + ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("SaddleItem")); + if (itemstack1 != null && itemstack1.getItem() == Items.saddle) { + this.horseChest.setInventorySlotContents(0, itemstack1); + } + } else if (nbttagcompound.getBoolean("Saddle")) { + this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle)); + } + + this.updateHorseSlots(); + } + + /**+ + * Returns true if the mob is currently able to mate with the + * specified mob. + */ + public boolean canMateWith(EntityAnimal entityanimal) { + if (entityanimal == this) { + return false; + } else if (entityanimal.getClass() != this.getClass()) { + return false; + } else { + EntityHorse entityhorse = (EntityHorse) entityanimal; + if (this.canMate() && entityhorse.canMate()) { + int i = this.getHorseType(); + int j = entityhorse.getHorseType(); + return i == j || i == 0 && j == 1 || i == 1 && j == 0; + } else { + return false; + } + } + } + + public EntityAgeable createChild(EntityAgeable entityageable) { + EntityHorse entityhorse = (EntityHorse) entityageable; + EntityHorse entityhorse1 = new EntityHorse(this.worldObj); + int i = this.getHorseType(); + int j = entityhorse.getHorseType(); + int k = 0; + if (i == j) { + k = i; + } else if (i == 0 && j == 1 || i == 1 && j == 0) { + k = 2; + } + + if (k == 0) { + int i1 = this.rand.nextInt(9); + int l; + if (i1 < 4) { + l = this.getHorseVariant() & 255; + } else if (i1 < 8) { + l = entityhorse.getHorseVariant() & 255; + } else { + l = this.rand.nextInt(7); + } + + int j1 = this.rand.nextInt(5); + if (j1 < 2) { + l = l | this.getHorseVariant() & '\uff00'; + } else if (j1 < 4) { + l = l | entityhorse.getHorseVariant() & '\uff00'; + } else { + l = l | this.rand.nextInt(5) << 8 & '\uff00'; + } + + entityhorse1.setHorseVariant(l); + } + + entityhorse1.setHorseType(k); + double d1 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + + entityageable.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + + (double) this.getModifiedMaxHealth(); + entityhorse1.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(d1 / 3.0D); + double d2 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + + entityageable.getEntityAttribute(horseJumpStrength).getBaseValue() + this.getModifiedJumpStrength(); + entityhorse1.getEntityAttribute(horseJumpStrength).setBaseValue(d2 / 3.0D); + double d0 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + + entityageable.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + + this.getModifiedMovementSpeed(); + entityhorse1.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(d0 / 3.0D); + return entityhorse1; + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + int i = 0; + int j = 0; + if (ientitylivingdata instanceof EntityHorse.GroupData) { + i = ((EntityHorse.GroupData) ientitylivingdata).horseType; + j = ((EntityHorse.GroupData) ientitylivingdata).horseVariant & 255 | this.rand.nextInt(5) << 8; + } else { + if (this.rand.nextInt(10) == 0) { + i = 1; + } else { + int k = this.rand.nextInt(7); + int l = this.rand.nextInt(5); + i = 0; + j = k | l << 8; + } + + ientitylivingdata = new EntityHorse.GroupData(i, j); + } + + this.setHorseType(i); + this.setHorseVariant(j); + if (this.rand.nextInt(5) == 0) { + this.setGrowingAge(-24000); + } + + if (i != 4 && i != 3) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth) + .setBaseValue((double) this.getModifiedMaxHealth()); + if (i == 0) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed) + .setBaseValue(this.getModifiedMovementSpeed()); + } else { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.17499999701976776D); + } + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + if (i != 2 && i != 1) { + this.getEntityAttribute(horseJumpStrength).setBaseValue(this.getModifiedJumpStrength()); + } else { + this.getEntityAttribute(horseJumpStrength).setBaseValue(0.5D); + } + + this.setHealth(this.getMaxHealth()); + return ientitylivingdata; + } + + public float getGrassEatingAmount(float parFloat1) { + return this.prevHeadLean + (this.headLean - this.prevHeadLean) * parFloat1; + } + + public float getRearingAmount(float parFloat1) { + return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * parFloat1; + } + + public float getMouthOpennessAngle(float parFloat1) { + return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * parFloat1; + } + + public void setJumpPower(int jumpPowerIn) { + if (this.isHorseSaddled()) { + if (jumpPowerIn < 0) { + jumpPowerIn = 0; + } else { + this.field_110294_bI = true; + this.makeHorseRear(); + } + + if (jumpPowerIn >= 90) { + this.jumpPower = 1.0F; + } else { + this.jumpPower = 0.4F + 0.4F * (float) jumpPowerIn / 90.0F; + } + } + + } + + /**+ + * "Spawns particles for the horse entity. par1 tells whether to + * spawn hearts. If it is false, it spawns smoke." + */ + protected void spawnHorseParticles(boolean parFlag) { + EnumParticleTypes enumparticletypes = parFlag ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL; + + for (int i = 0; i < 7; ++i) { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(enumparticletypes, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2, + new int[0]); + } + + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 7) { + this.spawnHorseParticles(true); + } else if (b0 == 6) { + this.spawnHorseParticles(false); + } else { + super.handleStatusUpdate(b0); + } + + } + + public void updateRiderPosition() { + super.updateRiderPosition(); + if (this.prevRearingAmount > 0.0F) { + float f = MathHelper.sin(this.renderYawOffset * 3.1415927F / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * 3.1415927F / 180.0F); + float f2 = 0.7F * this.prevRearingAmount; + float f3 = 0.15F * this.prevRearingAmount; + this.riddenByEntity.setPosition(this.posX + (double) (f2 * f), + this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double) f3, + this.posZ - (double) (f2 * f1)); + if (this.riddenByEntity instanceof EntityLivingBase) { + ((EntityLivingBase) this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + + } + + /**+ + * Returns randomized max health + */ + private float getModifiedMaxHealth() { + return 15.0F + (float) this.rand.nextInt(8) + (float) this.rand.nextInt(9); + } + + /**+ + * Returns randomized jump strength + */ + private double getModifiedJumpStrength() { + return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + + this.rand.nextDouble() * 0.2D; + } + + /**+ + * Returns randomized movement speed + */ + private double getModifiedMovementSpeed() { + return (0.44999998807907104D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + + this.rand.nextDouble() * 0.3D) * 0.25D; + } + + /**+ + * Returns true if given item is horse armor + */ + public static boolean isArmorItem(Item parItem) { + return parItem == Items.iron_horse_armor || parItem == Items.golden_horse_armor + || parItem == Items.diamond_horse_armor; + } + + /**+ + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + return false; + } + + public float getEyeHeight() { + return this.height; + } + + public boolean replaceItemInInventory(int i, ItemStack itemstack) { + if (i == 499 && this.canCarryChest()) { + if (itemstack == null && this.isChested()) { + this.setChested(false); + this.initHorseChest(); + return true; + } + + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.chest) && !this.isChested()) { + this.setChested(true); + this.initHorseChest(); + return true; + } + } + + int j = i - 400; + if (j >= 0 && j < 2 && j < this.horseChest.getSizeInventory()) { + if (j == 0 && itemstack != null && itemstack.getItem() != Items.saddle) { + return false; + } else if (j != 1 || (itemstack == null || isArmorItem(itemstack.getItem())) && this.canWearArmor()) { + this.horseChest.setInventorySlotContents(j, itemstack); + this.updateHorseSlots(); + return true; + } else { + return false; + } + } else { + int k = i - 500 + 2; + if (k >= 2 && k < this.horseChest.getSizeInventory()) { + this.horseChest.setInventorySlotContents(k, itemstack); + return true; + } else { + return false; + } + } + } + + public static class GroupData implements IEntityLivingData { + public int horseType; + public int horseVariant; + + public GroupData(int type, int variant) { + this.horseType = type; + this.horseVariant = variant; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityMooshroom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityMooshroom.java new file mode 100644 index 0000000..26a4fa0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityMooshroom.java @@ -0,0 +1,100 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityCow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityMooshroom extends EntityCow { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityMooshroom"); + } + + public EntityMooshroom(World worldIn) { + super(worldIn); + this.setSize(0.9F, 1.3F); + this.spawnableBlock = Blocks.mycelium; + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.bowl && this.getGrowingAge() >= 0) { + if (itemstack.stackSize == 1) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + new ItemStack(Items.mushroom_stew)); + return true; + } + + if (entityplayer.inventory.addItemStackToInventory(new ItemStack(Items.mushroom_stew)) + && !entityplayer.capabilities.isCreativeMode) { + entityplayer.inventory.decrStackSize(entityplayer.inventory.currentItem, 1); + return true; + } + } + + if (itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) { + this.setDead(); + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, + this.posY + (double) (this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + { + EntityCow entitycow = new EntityCow(this.worldObj); + entitycow.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + entitycow.setHealth(this.getHealth()); + entitycow.renderYawOffset = this.renderYawOffset; + if (this.hasCustomName()) { + entitycow.setCustomNameTag(this.getCustomNameTag()); + } + + this.worldObj.spawnEntityInWorld(entitycow); + + for (int i = 0; i < 5; ++i) { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, + this.posY + (double) this.height, this.posZ, new ItemStack(Blocks.red_mushroom))); + } + + itemstack.damageItem(1, entityplayer); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + + return true; + } else { + return super.interact(entityplayer); + } + } + + public EntityMooshroom createChild(EntityAgeable var1) { + return new EntityMooshroom(this.worldObj); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityOcelot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityOcelot.java new file mode 100644 index 0000000..05bd9cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityOcelot.java @@ -0,0 +1,361 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowOwner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIOcelotAttack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIOcelotSit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITempt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityOcelot extends EntityTameable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityOcelot"); + } + + private EntityAIAvoidEntity avoidEntity; + private EntityAITempt aiTempt; + + public EntityOcelot(World worldIn) { + super(worldIn); + this.setSize(0.6F, 0.7F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F)); + this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D)); + this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F)); + this.tasks.addTask(8, new EntityAIOcelotAttack(this)); + this.tasks.addTask(9, new EntityAIMate(this, 0.8D)); + this.tasks.addTask(10, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); + this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate) null)); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(18, Byte.valueOf((byte) 0)); + } + + public void updateAITasks() { + if (this.getMoveHelper().isUpdating()) { + double d0 = this.getMoveHelper().getSpeed(); + if (d0 == 0.6D) { + this.setSneaking(true); + this.setSprinting(false); + } else if (d0 == 1.33D) { + this.setSneaking(false); + this.setSprinting(true); + } else { + this.setSneaking(false); + this.setSprinting(false); + } + } else { + this.setSneaking(false); + this.setSprinting(false); + } + + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return !this.isTamed() && this.ticksExisted > 2400; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + public void fall(float var1, float var2) { + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("CatType", this.getTameSkin()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setTameSkin(nbttagcompound.getInteger("CatType")); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isTamed() + ? (this.isInLove() ? "mob.cat.purr" : (this.rand.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) + : ""; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.cat.hitt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.cat.hitt"; + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item getDropItem() { + return Items.leather; + } + + public boolean attackEntityAsMob(Entity entity) { + return entity.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.aiSit.setSitting(false); + return super.attackEntityFrom(damagesource, f); + } + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int var2) { + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (this.isTamed()) { + if (this.isOwner(entityplayer) && !this.isBreedingItem(itemstack)) { + this.aiSit.setSitting(!this.isSitting()); + } + } else if (this.aiTempt.isRunning() && itemstack != null && itemstack.getItem() == Items.fish + && entityplayer.getDistanceSqToEntity(this) < 9.0D) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, (ItemStack) null); + } + + { + if (this.rand.nextInt(3) == 0) { + this.setTamed(true); + this.setTameSkin(1 + this.worldObj.rand.nextInt(3)); + this.setOwnerId(entityplayer.getUniqueID().toString()); + this.playTameEffect(true); + this.aiSit.setSitting(true); + this.worldObj.setEntityState(this, (byte) 7); + } else { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(entityplayer); + } + + public EntityOcelot createChild(EntityAgeable var1) { + EntityOcelot entityocelot = new EntityOcelot(this.worldObj); + if (this.isTamed()) { + entityocelot.setOwnerId(this.getOwnerId()); + entityocelot.setTamed(true); + entityocelot.setTameSkin(this.getTameSkin()); + } + + return entityocelot; + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack itemstack) { + return itemstack != null && itemstack.getItem() == Items.fish; + } + + /**+ + * Returns true if the mob is currently able to mate with the + * specified mob. + */ + public boolean canMateWith(EntityAnimal entityanimal) { + if (entityanimal == this) { + return false; + } else if (!this.isTamed()) { + return false; + } else if (!(entityanimal instanceof EntityOcelot)) { + return false; + } else { + EntityOcelot entityocelot = (EntityOcelot) entityanimal; + return !entityocelot.isTamed() ? false : this.isInLove() && entityocelot.isInLove(); + } + } + + public int getTameSkin() { + return this.dataWatcher.getWatchableObjectByte(18); + } + + public void setTameSkin(int skinId) { + this.dataWatcher.updateObject(18, Byte.valueOf((byte) skinId)); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.rand.nextInt(3) != 0; + } + + /**+ + * Checks that the entity is not colliding with any blocks / + * liquids + */ + public boolean isNotColliding() { + if (this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) + && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() + && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox())) { + BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); + if (blockpos.getY() < this.worldObj.func_181545_F()) { + return false; + } + + Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); + if (block == Blocks.grass || block.getMaterial() == Material.leaves) { + return true; + } + } + + return false; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.getCustomNameTag() + : (this.isTamed() ? StatCollector.translateToLocal("entity.Cat.name") : super.getName()); + } + + public void setTamed(boolean flag) { + super.setTamed(flag); + } + + protected void setupTamedAI() { + if (this.avoidEntity == null) { + this.avoidEntity = new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D); + } + + this.tasks.removeTask(this.avoidEntity); + if (!this.isTamed()) { + this.tasks.addTask(4, this.avoidEntity); + } + + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + if (this.worldObj.rand.nextInt(7) == 0) { + for (int i = 0; i < 2; ++i) { + EntityOcelot entityocelot = new EntityOcelot(this.worldObj); + entityocelot.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityocelot.setGrowingAge(-24000); + this.worldObj.spawnEntityInWorld(entityocelot); + } + } + + return ientitylivingdata; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityPig.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityPig.java new file mode 100644 index 0000000..37cf8dc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityPig.java @@ -0,0 +1,242 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIControlledByPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowParent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPanic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITempt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityPigZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityPig extends EntityAnimal { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityPig"); + } + + private final EntityAIControlledByPlayer aiControlledByPlayer; + + public EntityPig(World worldIn) { + super(worldIn); + this.setSize(0.9F, 0.9F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F)); + this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false)); + this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /**+ + * returns true if all the conditions for steering the entity + * are met. For pigs, this is true if it is being ridden by a + * player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() { + ItemStack itemstack = ((EntityPlayer) this.riddenByEntity).getHeldItem(); + return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("Saddle", this.getSaddled()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setSaddled(nbttagcompound.getBoolean("Saddle")); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.pig.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.pig.say"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.pig.death"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.pig.step", 0.15F, 1.0F); + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + if (super.interact(entityplayer)) { + return true; + } else if (!this.getSaddled() || this.riddenByEntity != null && this.riddenByEntity != entityplayer) { + return false; + } else { + entityplayer.mountEntity(this); + return true; + } + } + + protected Item getDropItem() { + return this.isBurning() ? Items.cooked_porkchop : Items.porkchop; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + i); + + for (int k = 0; k < j; ++k) { + if (this.isBurning()) { + this.dropItem(Items.cooked_porkchop, 1); + } else { + this.dropItem(Items.porkchop, 1); + } + } + + if (this.getSaddled()) { + this.dropItem(Items.saddle, 1); + } + + } + + /**+ + * Returns true if the pig is saddled. + */ + public boolean getSaddled() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + /**+ + * Set or remove the saddle of the pig. + */ + public void setSaddled(boolean saddled) { + if (saddled) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) 1)); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) 0)); + } + + } + + /**+ + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt var1) { + if (!this.isDead) { + EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj); + entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + entitypigzombie.setNoAI(this.isAIDisabled()); + if (this.hasCustomName()) { + entitypigzombie.setCustomNameTag(this.getCustomNameTag()); + entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entitypigzombie); + this.setDead(); + } + } + + public void fall(float f, float f1) { + super.fall(f, f1); + if (f > 5.0F && this.riddenByEntity instanceof EntityPlayer) { + ((EntityPlayer) this.riddenByEntity).triggerAchievement(AchievementList.flyPig); + } + + } + + public EntityPig createChild(EntityAgeable var1) { + return new EntityPig(this.worldObj); + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack itemstack) { + return itemstack != null && itemstack.getItem() == Items.carrot; + } + + /**+ + * Return the AI task for player control. + */ + public EntityAIControlledByPlayer getAIControlledByPlayer() { + return this.aiControlledByPlayer; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityRabbit.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityRabbit.java new file mode 100644 index 0000000..f6452b1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityRabbit.java @@ -0,0 +1,666 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCarrot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPanic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITempt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityJumpHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityMoveHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityRabbit extends EntityAnimal { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityRabbit"); + } + + private EntityRabbit.AIAvoidEntity aiAvoidWolves; + private int field_175540_bm = 0; + private int field_175535_bn = 0; + private boolean field_175536_bo = false; + private boolean field_175537_bp = false; + private int currentMoveTypeDuration = 0; + private EntityRabbit.EnumMoveType moveType = EntityRabbit.EnumMoveType.HOP; + private int carrotTicks = 0; + private EntityPlayer field_175543_bt = null; + + public EntityRabbit(World worldIn) { + super(worldIn); + this.setSize(0.6F, 0.7F); + this.jumpHelper = new EntityRabbit.RabbitJumpHelper(this); + this.moveHelper = new EntityRabbit.RabbitMoveHelper(this); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.navigator.setHeightRequirement(2.5F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityRabbit.AIPanic(this, 1.33D)); + this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.carrot, false)); + this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.golden_carrot, false)); + this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Item.getItemFromBlock(Blocks.yellow_flower), false)); + this.tasks.addTask(3, new EntityAIMate(this, 0.8D)); + this.tasks.addTask(5, new EntityRabbit.AIRaidFarm(this)); + this.tasks.addTask(5, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); + this.aiAvoidWolves = new EntityRabbit.AIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D); + this.tasks.addTask(4, this.aiAvoidWolves); + this.setMovementSpeed(0.0D); + } + + protected float getJumpUpwardsMotion() { + return this.moveHelper.isUpdating() && this.moveHelper.getY() > this.posY + 0.5D ? 0.5F + : this.moveType.func_180074_b(); + } + + public void setMoveType(EntityRabbit.EnumMoveType type) { + this.moveType = type; + } + + public float func_175521_o(float parFloat1) { + return this.field_175535_bn == 0 ? 0.0F + : ((float) this.field_175540_bm + parFloat1) / (float) this.field_175535_bn; + } + + public void setMovementSpeed(double newSpeed) { + this.getNavigator().setSpeed(newSpeed); + this.moveHelper.setMoveTo(this.moveHelper.getX(), this.moveHelper.getY(), this.moveHelper.getZ(), newSpeed); + } + + public void setJumping(boolean jump, EntityRabbit.EnumMoveType moveTypeIn) { + super.setJumping(jump); + if (!jump) { + if (this.moveType == EntityRabbit.EnumMoveType.ATTACK) { + this.moveType = EntityRabbit.EnumMoveType.HOP; + } + } else { + this.setMovementSpeed(1.5D * (double) moveTypeIn.getSpeed()); + this.playSound(this.getJumpingSound(), this.getSoundVolume(), + ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + + this.field_175536_bo = jump; + } + + public void doMovementAction(EntityRabbit.EnumMoveType movetype) { + this.setJumping(true, movetype); + this.field_175535_bn = movetype.func_180073_d(); + this.field_175540_bm = 0; + } + + public boolean func_175523_cj() { + return this.field_175536_bo; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(18, Byte.valueOf((byte) 0)); + } + + public void updateAITasks() { + if (this.moveHelper.getSpeed() > 0.8D) { + this.setMoveType(EntityRabbit.EnumMoveType.SPRINT); + } else if (this.moveType != EntityRabbit.EnumMoveType.ATTACK) { + this.setMoveType(EntityRabbit.EnumMoveType.HOP); + } + + if (this.currentMoveTypeDuration > 0) { + --this.currentMoveTypeDuration; + } + + if (this.carrotTicks > 0) { + this.carrotTicks -= this.rand.nextInt(3); + if (this.carrotTicks < 0) { + this.carrotTicks = 0; + } + } + + if (this.onGround) { + if (!this.field_175537_bp) { + this.setJumping(false, EntityRabbit.EnumMoveType.NONE); + this.func_175517_cu(); + } + + if (this.getRabbitType() == 99 && this.currentMoveTypeDuration == 0) { + EntityLivingBase entitylivingbase = this.getAttackTarget(); + if (entitylivingbase != null && this.getDistanceSqToEntity(entitylivingbase) < 16.0D) { + this.calculateRotationYaw(entitylivingbase.posX, entitylivingbase.posZ); + this.moveHelper.setMoveTo(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ, + this.moveHelper.getSpeed()); + this.doMovementAction(EntityRabbit.EnumMoveType.ATTACK); + this.field_175537_bp = true; + } + } + + EntityRabbit.RabbitJumpHelper entityrabbit$rabbitjumphelper = (EntityRabbit.RabbitJumpHelper) this.jumpHelper; + if (!entityrabbit$rabbitjumphelper.getIsJumping()) { + if (this.moveHelper.isUpdating() && this.currentMoveTypeDuration == 0) { + PathEntity pathentity = this.navigator.getPath(); + Vec3 vec3 = new Vec3(this.moveHelper.getX(), this.moveHelper.getY(), this.moveHelper.getZ()); + if (pathentity != null && pathentity.getCurrentPathIndex() < pathentity.getCurrentPathLength()) { + vec3 = pathentity.getPosition(this); + } + + this.calculateRotationYaw(vec3.xCoord, vec3.zCoord); + this.doMovementAction(this.moveType); + } + } else if (!entityrabbit$rabbitjumphelper.func_180065_d()) { + this.func_175518_cr(); + } + } + + this.field_175537_bp = this.onGround; + } + + /**+ + * Attempts to create sprinting particles if the entity is + * sprinting and not in water. + */ + public void spawnRunningParticles() { + } + + private void calculateRotationYaw(double x, double z) { + this.rotationYaw = (float) (MathHelper.func_181159_b(z - this.posZ, x - this.posX) * 180.0D + / 3.1415927410125732D) - 90.0F; + } + + private void func_175518_cr() { + ((EntityRabbit.RabbitJumpHelper) this.jumpHelper).func_180066_a(true); + } + + private void func_175520_cs() { + ((EntityRabbit.RabbitJumpHelper) this.jumpHelper).func_180066_a(false); + } + + private void updateMoveTypeDuration() { + this.currentMoveTypeDuration = this.getMoveTypeDuration(); + } + + private void func_175517_cu() { + this.updateMoveTypeDuration(); + this.func_175520_cs(); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + if (this.field_175540_bm != this.field_175535_bn) { + if (this.field_175540_bm == 0) { + this.worldObj.setEntityState(this, (byte) 1); + } + + ++this.field_175540_bm; + } else if (this.field_175535_bn != 0) { + this.field_175540_bm = 0; + this.field_175535_bn = 0; + } + + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("RabbitType", this.getRabbitType()); + nbttagcompound.setInteger("MoreCarrotTicks", this.carrotTicks); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setRabbitType(nbttagcompound.getInteger("RabbitType")); + this.carrotTicks = nbttagcompound.getInteger("MoreCarrotTicks"); + } + + protected String getJumpingSound() { + return "mob.rabbit.hop"; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.rabbit.idle"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.rabbit.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.rabbit.death"; + } + + public boolean attackEntityAsMob(Entity entity) { + if (this.getRabbitType() == 99) { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + return entity.attackEntityFrom(DamageSource.causeMobDamage(this), 8.0F); + } else { + return entity.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return this.getRabbitType() == 99 ? 8 : super.getTotalArmorValue(); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + return this.isEntityInvulnerable(damagesource) ? false : super.attackEntityFrom(damagesource, f); + } + + /**+ + * Causes this Entity to drop a random item. + */ + protected void addRandomDrop() { + this.entityDropItem(new ItemStack(Items.rabbit_foot, 1), 0.0F); + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(2) + this.rand.nextInt(1 + i); + + for (int k = 0; k < j; ++k) { + this.dropItem(Items.rabbit_hide, 1); + } + + j = this.rand.nextInt(2); + + for (int l = 0; l < j; ++l) { + if (this.isBurning()) { + this.dropItem(Items.cooked_rabbit, 1); + } else { + this.dropItem(Items.rabbit, 1); + } + } + + } + + private boolean isRabbitBreedingItem(Item itemIn) { + return itemIn == Items.carrot || itemIn == Items.golden_carrot + || itemIn == Item.getItemFromBlock(Blocks.yellow_flower); + } + + public EntityRabbit createChild(EntityAgeable entityageable) { + EntityRabbit entityrabbit = new EntityRabbit(this.worldObj); + if (entityageable instanceof EntityRabbit) { + entityrabbit.setRabbitType( + this.rand.nextBoolean() ? this.getRabbitType() : ((EntityRabbit) entityageable).getRabbitType()); + } + + return entityrabbit; + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack itemstack) { + return itemstack != null && this.isRabbitBreedingItem(itemstack.getItem()); + } + + public int getRabbitType() { + return this.dataWatcher.getWatchableObjectByte(18); + } + + public void setRabbitType(int rabbitTypeId) { + if (rabbitTypeId == 99) { + this.tasks.removeTask(this.aiAvoidWolves); + this.tasks.addTask(4, new EntityRabbit.AIEvilAttack(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, true)); + if (!this.hasCustomName()) { + this.setCustomNameTag(StatCollector.translateToLocal("entity.KillerBunny.name")); + } + } + + this.dataWatcher.updateObject(18, Byte.valueOf((byte) rabbitTypeId)); + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + int i = this.rand.nextInt(6); + boolean flag = false; + if (ientitylivingdata instanceof EntityRabbit.RabbitTypeData) { + i = ((EntityRabbit.RabbitTypeData) ientitylivingdata).typeData; + flag = true; + } else { + ientitylivingdata = new EntityRabbit.RabbitTypeData(i); + } + + this.setRabbitType(i); + if (flag) { + this.setGrowingAge(-24000); + } + + return ientitylivingdata; + } + + /**+ + * Returns true if {@link + * net.minecraft.entity.passive.EntityRabbit#carrotTicks + * carrotTicks} has reached zero + */ + private boolean isCarrotEaten() { + return this.carrotTicks == 0; + } + + /**+ + * Returns duration of the current {@link + * net.minecraft.entity.passive.EntityRabbit.EnumMoveType move + * type} + */ + protected int getMoveTypeDuration() { + return this.moveType.getDuration(); + } + + protected void createEatingParticles() { + this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 0.0D, 0.0D, + 0.0D, new int[] { Block.getStateId(Blocks.carrots.getStateFromMeta(7)) }); + this.carrotTicks = 100; + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 1) { + this.createRunningParticles(); + this.field_175535_bn = 10; + this.field_175540_bm = 0; + } else { + super.handleStatusUpdate(b0); + } + + } + + static class AIAvoidEntity extends EntityAIAvoidEntity { + private EntityRabbit entityInstance; + + public AIAvoidEntity(EntityRabbit parEntityRabbit, Class parClass1, float parFloat1, double parDouble1, + double parDouble2) { + super(parEntityRabbit, parClass1, parFloat1, parDouble1, parDouble2); + this.entityInstance = parEntityRabbit; + } + + public void updateTask() { + super.updateTask(); + } + } + + static class AIEvilAttack extends EntityAIAttackOnCollide { + public AIEvilAttack(EntityRabbit parEntityRabbit) { + super(parEntityRabbit, EntityLivingBase.class, 1.4D, true); + } + + protected double func_179512_a(EntityLivingBase entitylivingbase) { + return (double) (4.0F + entitylivingbase.width); + } + } + + static class AIPanic extends EntityAIPanic { + private EntityRabbit theEntity; + + public AIPanic(EntityRabbit parEntityRabbit, double speedIn) { + super(parEntityRabbit, speedIn); + this.theEntity = parEntityRabbit; + } + + public void updateTask() { + super.updateTask(); + this.theEntity.setMovementSpeed(this.speed); + } + } + + static class AIRaidFarm extends EntityAIMoveToBlock { + private final EntityRabbit field_179500_c; + private boolean field_179498_d; + private boolean field_179499_e = false; + + public AIRaidFarm(EntityRabbit parEntityRabbit) { + super(parEntityRabbit, 0.699999988079071D, 16); + this.field_179500_c = parEntityRabbit; + } + + public boolean shouldExecute() { + if (this.runDelay <= 0) { + if (!this.field_179500_c.worldObj.getGameRules().getBoolean("mobGriefing")) { + return false; + } + + this.field_179499_e = false; + this.field_179498_d = this.field_179500_c.isCarrotEaten(); + } + + return super.shouldExecute(); + } + + public boolean continueExecuting() { + return this.field_179499_e && super.continueExecuting(); + } + + public void startExecuting() { + super.startExecuting(); + } + + public void resetTask() { + super.resetTask(); + } + + public void updateTask() { + super.updateTask(); + this.field_179500_c.getLookHelper().setLookPosition((double) this.destinationBlock.getX() + 0.5D, + (double) (this.destinationBlock.getY() + 1), (double) this.destinationBlock.getZ() + 0.5D, 10.0F, + (float) this.field_179500_c.getVerticalFaceSpeed()); + if (this.getIsAboveDestination()) { + World world = this.field_179500_c.worldObj; + BlockPos blockpos = this.destinationBlock.up(); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (this.field_179499_e && block instanceof BlockCarrot + && ((Integer) iblockstate.getValue(BlockCarrot.AGE)).intValue() == 7) { + world.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); + world.destroyBlock(blockpos, true); + this.field_179500_c.createEatingParticles(); + } + + this.field_179499_e = false; + this.runDelay = 10; + } + + } + + protected boolean shouldMoveTo(World world, BlockPos blockpos) { + Block block = world.getBlockState(blockpos).getBlock(); + if (block == Blocks.farmland) { + blockpos = blockpos.up(); + IBlockState iblockstate = world.getBlockState(blockpos); + block = iblockstate.getBlock(); + if (block instanceof BlockCarrot && ((Integer) iblockstate.getValue(BlockCarrot.AGE)).intValue() == 7 + && this.field_179498_d && !this.field_179499_e) { + this.field_179499_e = true; + return true; + } + } + + return false; + } + } + + static enum EnumMoveType { + NONE(0.0F, 0.0F, 30, 1), HOP(0.8F, 0.2F, 20, 10), STEP(1.0F, 0.45F, 14, 14), SPRINT(1.75F, 0.4F, 1, 8), + ATTACK(2.0F, 0.7F, 7, 8); + + private final float speed; + private final float field_180077_g; + private final int duration; + private final int field_180085_i; + + private EnumMoveType(float typeSpeed, float parFloat1, int typeDuration, int parInt1) { + this.speed = typeSpeed; + this.field_180077_g = parFloat1; + this.duration = typeDuration; + this.field_180085_i = parInt1; + } + + public float getSpeed() { + return this.speed; + } + + public float func_180074_b() { + return this.field_180077_g; + } + + public int getDuration() { + return this.duration; + } + + public int func_180073_d() { + return this.field_180085_i; + } + } + + public class RabbitJumpHelper extends EntityJumpHelper { + private EntityRabbit theEntity; + private boolean field_180068_d = false; + + public RabbitJumpHelper(EntityRabbit rabbit) { + super(rabbit); + this.theEntity = rabbit; + } + + public boolean getIsJumping() { + return this.isJumping; + } + + public boolean func_180065_d() { + return this.field_180068_d; + } + + public void func_180066_a(boolean parFlag) { + this.field_180068_d = parFlag; + } + + public void doJump() { + if (this.isJumping) { + this.theEntity.doMovementAction(EntityRabbit.EnumMoveType.STEP); + this.isJumping = false; + } + + } + } + + static class RabbitMoveHelper extends EntityMoveHelper { + private EntityRabbit theEntity; + + public RabbitMoveHelper(EntityRabbit parEntityRabbit) { + super(parEntityRabbit); + this.theEntity = parEntityRabbit; + } + + public void onUpdateMoveHelper() { + if (this.theEntity.onGround && !this.theEntity.func_175523_cj()) { + this.theEntity.setMovementSpeed(0.0D); + } + + super.onUpdateMoveHelper(); + } + } + + public static class RabbitTypeData implements IEntityLivingData { + public int typeData; + + public RabbitTypeData(int type) { + this.typeData = type; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySheep.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySheep.java new file mode 100644 index 0000000..7daccf5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySheep.java @@ -0,0 +1,362 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIEatGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowParent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPanic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITempt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySheep extends EntityAnimal { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntitySheep"); + } + + /**+ + * Internal crafting inventory used to check the result of + * mixing dyes corresponding to the fleece color when breeding + * sheep. + */ + private final InventoryCrafting inventoryCrafting = new InventoryCrafting(new Container() { + public boolean canInteractWith(EntityPlayer var1) { + return false; + } + }, 2, 1); + private static final Map DYE_TO_RGB = Maps.newEnumMap(EnumDyeColor.class); + private int sheepTimer; + private EntityAIEatGrass entityAIEatGrass = new EntityAIEatGrass(this); + + public static float[] func_175513_a(EnumDyeColor dyeColor) { + return (float[]) DYE_TO_RGB.get(dyeColor); + } + + public EntitySheep(World worldIn) { + super(worldIn); + this.setSize(0.9F, 1.3F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, this.entityAIEatGrass); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.inventoryCrafting.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0)); + this.inventoryCrafting.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0)); + } + + protected void updateAITasks() { + this.sheepTimer = this.entityAIEatGrass.getEatingGrassTimer(); + super.updateAITasks(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 0)); + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + if (!this.getSheared()) { + this.entityDropItem( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor().getMetadata()), 0.0F); + } + + int j = this.rand.nextInt(2) + 1 + this.rand.nextInt(1 + i); + + for (int k = 0; k < j; ++k) { + if (this.isBurning()) { + this.dropItem(Items.cooked_mutton, 1); + } else { + this.dropItem(Items.mutton, 1); + } + } + + } + + protected Item getDropItem() { + return Item.getItemFromBlock(Blocks.wool); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 10) { + this.sheepTimer = 40; + } else { + super.handleStatusUpdate(b0); + } + + } + + public float getHeadRotationPointY(float parFloat1) { + return this.sheepTimer <= 0 ? 0.0F + : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F + : (this.sheepTimer < 4 ? ((float) this.sheepTimer - parFloat1) / 4.0F + : -((float) (this.sheepTimer - 40) - parFloat1) / 4.0F)); + } + + public float getHeadRotationAngleX(float parFloat1) { + if (this.sheepTimer > 4 && this.sheepTimer <= 36) { + float f = ((float) (this.sheepTimer - 4) - parFloat1) / 32.0F; + return 0.62831855F + 0.21991149F * MathHelper.sin(f * 28.7F); + } else { + return this.sheepTimer > 0 ? 0.62831855F : this.rotationPitch / 57.295776F; + } + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) { + { + this.setSheared(true); + int i = 1 + this.rand.nextInt(3); + + for (int j = 0; j < i; ++j) { + EntityItem entityitem = this.entityDropItem( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor().getMetadata()), + 1.0F); + entityitem.motionY += (double) (this.rand.nextFloat() * 0.05F); + entityitem.motionX += (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + entityitem.motionZ += (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + } + } + + itemstack.damageItem(1, entityplayer); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + + return super.interact(entityplayer); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("Sheared", this.getSheared()); + nbttagcompound.setByte("Color", (byte) this.getFleeceColor().getMetadata()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setSheared(nbttagcompound.getBoolean("Sheared")); + this.setFleeceColor(EnumDyeColor.byMetadata(nbttagcompound.getByte("Color"))); + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.sheep.say"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.sheep.say"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.sheep.say"; + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.sheep.step", 0.15F, 1.0F); + } + + /**+ + * Gets the wool color of this sheep. + */ + public EnumDyeColor getFleeceColor() { + return EnumDyeColor.byMetadata(this.dataWatcher.getWatchableObjectByte(16) & 15); + } + + /**+ + * Sets the wool color of this sheep + */ + public void setFleeceColor(EnumDyeColor color) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & 240 | color.getMetadata() & 15))); + } + + /**+ + * returns true if a sheeps wool has been sheared + */ + public boolean getSheared() { + return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; + } + + /**+ + * make a sheep sheared if set to true + */ + public void setSheared(boolean sheared) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (sheared) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 16))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -17))); + } + + } + + /**+ + * Chooses a "vanilla" sheep color based on the provided random. + */ + public static EnumDyeColor getRandomSheepColor(EaglercraftRandom random) { + int i = random.nextInt(100); + return i < 5 ? EnumDyeColor.BLACK + : (i < 10 ? EnumDyeColor.GRAY + : (i < 15 ? EnumDyeColor.SILVER + : (i < 18 ? EnumDyeColor.BROWN + : (random.nextInt(500) == 0 ? EnumDyeColor.PINK : EnumDyeColor.WHITE)))); + } + + public EntitySheep createChild(EntityAgeable entityageable) { + EntitySheep entitysheep = (EntitySheep) entityageable; + EntitySheep entitysheep1 = new EntitySheep(this.worldObj); + entitysheep1.setFleeceColor(this.getDyeColorMixFromParents(this, entitysheep)); + return entitysheep1; + } + + /**+ + * This function applies the benefits of growing back wool and + * faster growing up to the acting entity. (This function is + * used in the AIEatGrass) + */ + public void eatGrassBonus() { + this.setSheared(false); + if (this.isChild()) { + this.addGrowth(60); + } + + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + this.setFleeceColor(getRandomSheepColor(this.worldObj.rand)); + return ientitylivingdata; + } + + /**+ + * Attempts to mix both parent sheep to come up with a mixed dye + * color. + */ + private EnumDyeColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother) { + int i = ((EntitySheep) father).getFleeceColor().getDyeDamage(); + int j = ((EntitySheep) mother).getFleeceColor().getDyeDamage(); + this.inventoryCrafting.getStackInSlot(0).setItemDamage(i); + this.inventoryCrafting.getStackInSlot(1).setItemDamage(j); + ItemStack itemstack = CraftingManager.getInstance().findMatchingRecipe(this.inventoryCrafting, + ((EntitySheep) father).worldObj); + int k; + if (itemstack != null && itemstack.getItem() == Items.dye) { + k = itemstack.getMetadata(); + } else { + k = this.worldObj.rand.nextBoolean() ? i : j; + } + + return EnumDyeColor.byDyeDamage(k); + } + + public float getEyeHeight() { + return 0.95F * this.height; + } + + static { + DYE_TO_RGB.put(EnumDyeColor.WHITE, new float[] { 1.0F, 1.0F, 1.0F }); + DYE_TO_RGB.put(EnumDyeColor.ORANGE, new float[] { 0.85F, 0.5F, 0.2F }); + DYE_TO_RGB.put(EnumDyeColor.MAGENTA, new float[] { 0.7F, 0.3F, 0.85F }); + DYE_TO_RGB.put(EnumDyeColor.LIGHT_BLUE, new float[] { 0.4F, 0.6F, 0.85F }); + DYE_TO_RGB.put(EnumDyeColor.YELLOW, new float[] { 0.9F, 0.9F, 0.2F }); + DYE_TO_RGB.put(EnumDyeColor.LIME, new float[] { 0.5F, 0.8F, 0.1F }); + DYE_TO_RGB.put(EnumDyeColor.PINK, new float[] { 0.95F, 0.5F, 0.65F }); + DYE_TO_RGB.put(EnumDyeColor.GRAY, new float[] { 0.3F, 0.3F, 0.3F }); + DYE_TO_RGB.put(EnumDyeColor.SILVER, new float[] { 0.6F, 0.6F, 0.6F }); + DYE_TO_RGB.put(EnumDyeColor.CYAN, new float[] { 0.3F, 0.5F, 0.6F }); + DYE_TO_RGB.put(EnumDyeColor.PURPLE, new float[] { 0.5F, 0.25F, 0.7F }); + DYE_TO_RGB.put(EnumDyeColor.BLUE, new float[] { 0.2F, 0.3F, 0.7F }); + DYE_TO_RGB.put(EnumDyeColor.BROWN, new float[] { 0.4F, 0.3F, 0.2F }); + DYE_TO_RGB.put(EnumDyeColor.GREEN, new float[] { 0.4F, 0.5F, 0.2F }); + DYE_TO_RGB.put(EnumDyeColor.RED, new float[] { 0.6F, 0.2F, 0.2F }); + DYE_TO_RGB.put(EnumDyeColor.BLACK, new float[] { 0.1F, 0.1F, 0.1F }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySquid.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySquid.java new file mode 100644 index 0000000..f0579a6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySquid.java @@ -0,0 +1,262 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWaterMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySquid extends EntityWaterMob { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntitySquid"); + } + + public float squidPitch; + public float prevSquidPitch; + public float squidYaw; + public float prevSquidYaw; + public float squidRotation; + public float prevSquidRotation; + public float tentacleAngle; + public float lastTentacleAngle; + private float randomMotionSpeed; + private float rotationVelocity; + private float field_70871_bB; + private float randomMotionVecX; + private float randomMotionVecY; + private float randomMotionVecZ; + + public EntitySquid(World worldIn) { + super(worldIn); + this.setSize(0.95F, 0.95F); + this.rand.setSeed((long) (1 + this.getEntityId())); + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + this.tasks.addTask(0, new EntitySquid.AIMoveRandom(this)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + public float getEyeHeight() { + return this.height * 0.5F; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return null; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return null; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return null; + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item getDropItem() { + return null; + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /**+ + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean var1, int i) { + int j = this.rand.nextInt(3 + i) + 1; + + for (int k = 0; k < j; ++k) { + this.entityDropItem(new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), 0.0F); + } + + } + + /**+ + * Checks if this entity is inside water (if inWater field is + * true as a result of handleWaterMovement() returning true) + */ + public boolean isInWater() { + return this.worldObj.handleMaterialAcceleration( + this.getEntityBoundingBox().expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; + this.lastTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; + if ((double) this.squidRotation > 6.283185307179586D) { + { + this.squidRotation = (float) ((double) this.squidRotation - 6.283185307179586D); + if (this.rand.nextInt(10) == 0) { + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + + this.worldObj.setEntityState(this, (byte) 19); + } + } + + if (this.inWater) { + if (this.squidRotation < 3.1415927F) { + float f = this.squidRotation / 3.1415927F; + this.tentacleAngle = MathHelper.sin(f * f * 3.1415927F) * 3.1415927F * 0.25F; + if ((double) f > 0.75D) { + this.randomMotionSpeed = 1.0F; + this.field_70871_bB = 1.0F; + } else { + this.field_70871_bB *= 0.8F; + } + } else { + this.tentacleAngle = 0.0F; + this.randomMotionSpeed *= 0.9F; + this.field_70871_bB *= 0.99F; + } + + { + this.motionX = (double) (this.randomMotionVecX * this.randomMotionSpeed); + this.motionY = (double) (this.randomMotionVecY * this.randomMotionSpeed); + this.motionZ = (double) (this.randomMotionVecZ * this.randomMotionSpeed); + } + + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.renderYawOffset += (-((float) MathHelper.func_181159_b(this.motionX, this.motionZ)) * 180.0F + / 3.1415927F - this.renderYawOffset) * 0.1F; + this.rotationYaw = this.renderYawOffset; + this.squidYaw = (float) ((double) this.squidYaw + 3.141592653589793D * (double) this.field_70871_bB * 1.5D); + this.squidPitch += (-((float) MathHelper.func_181159_b((double) f1, this.motionY)) * 180.0F / 3.1415927F + - this.squidPitch) * 0.1F; + } else { + this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * 3.1415927F * 0.25F; + { + this.motionX = 0.0D; + this.motionY -= 0.08D; + this.motionY *= 0.9800000190734863D; + this.motionZ = 0.0D; + } + + this.squidPitch = (float) ((double) this.squidPitch + (double) (-90.0F - this.squidPitch) * 0.02D); + } + + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float var1, float var2) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.posY > 45.0D && this.posY < (double) this.worldObj.func_181545_F() && super.getCanSpawnHere(); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 19) { + this.squidRotation = 0.0F; + } else { + super.handleStatusUpdate(b0); + } + + } + + public void func_175568_b(float randomMotionVecXIn, float randomMotionVecYIn, float randomMotionVecZIn) { + this.randomMotionVecX = randomMotionVecXIn; + this.randomMotionVecY = randomMotionVecYIn; + this.randomMotionVecZ = randomMotionVecZIn; + } + + public boolean func_175567_n() { + return this.randomMotionVecX != 0.0F || this.randomMotionVecY != 0.0F || this.randomMotionVecZ != 0.0F; + } + + static class AIMoveRandom extends EntityAIBase { + private EntitySquid squid; + + public AIMoveRandom(EntitySquid parEntitySquid) { + this.squid = parEntitySquid; + } + + public boolean shouldExecute() { + return true; + } + + public void updateTask() { + int i = this.squid.getAge(); + if (i > 100) { + this.squid.func_175568_b(0.0F, 0.0F, 0.0F); + } else if (this.squid.getRNG().nextInt(50) == 0 || !this.squid.inWater || !this.squid.func_175567_n()) { + float f = this.squid.getRNG().nextFloat() * 3.1415927F * 2.0F; + float f1 = MathHelper.cos(f) * 0.2F; + float f2 = -0.1F + this.squid.getRNG().nextFloat() * 0.2F; + float f3 = MathHelper.sin(f) * 0.2F; + this.squid.func_175568_b(f1, f2, f3); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityTameable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityTameable.java new file mode 100644 index 0000000..0402b25 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityTameable.java @@ -0,0 +1,226 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityOwnable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityTameable extends EntityAnimal implements IEntityOwnable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityTameable"); + } + + protected EntityAISit aiSit = new EntityAISit(this); + + public EntityTameable(World worldIn) { + super(worldIn); + this.setupTamedAI(); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(17, ""); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + if (this.getOwnerId() == null) { + nbttagcompound.setString("Owner", ""); + } else { + nbttagcompound.setString("Owner", this.getOwnerId()); + } + + nbttagcompound.setBoolean("Sitting", this.isSitting()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + String s = ""; + if (nbttagcompound.hasKey("Owner", 8)) { + s = nbttagcompound.getString("Owner"); + } + + if (s.length() > 0) { + this.setOwnerId(s); + this.setTamed(true); + } + + this.aiSit.setSitting(nbttagcompound.getBoolean("Sitting")); + this.setSitting(nbttagcompound.getBoolean("Sitting")); + } + + /**+ + * Play the taming effect, will either be hearts or smoke + * depending on status + */ + protected void playTameEffect(boolean play) { + EnumParticleTypes enumparticletypes = EnumParticleTypes.HEART; + if (!play) { + enumparticletypes = EnumParticleTypes.SMOKE_NORMAL; + } + + for (int i = 0; i < 7; ++i) { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(enumparticletypes, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2, + new int[0]); + } + + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 7) { + this.playTameEffect(true); + } else if (b0 == 6) { + this.playTameEffect(false); + } else { + super.handleStatusUpdate(b0); + } + + } + + public boolean isTamed() { + return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; + } + + public void setTamed(boolean tamed) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (tamed) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 4))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -5))); + } + + this.setupTamedAI(); + } + + protected void setupTamedAI() { + } + + public boolean isSitting() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setSitting(boolean sitting) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (sitting) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -2))); + } + + } + + public String getOwnerId() { + return this.dataWatcher.getWatchableObjectString(17); + } + + public void setOwnerId(String ownerUuid) { + this.dataWatcher.updateObject(17, ownerUuid); + } + + public EntityLivingBase getOwner() { + try { + EaglercraftUUID uuid = EaglercraftUUID.fromString(this.getOwnerId()); + return uuid == null ? null : this.worldObj.getPlayerEntityByUUID(uuid); + } catch (IllegalArgumentException var2) { + return null; + } + } + + public boolean isOwner(EntityLivingBase entityIn) { + return entityIn == this.getOwner(); + } + + /**+ + * Returns the AITask responsible of the sit logic + */ + public EntityAISit getAISit() { + return this.aiSit; + } + + public boolean shouldAttackEntity(EntityLivingBase parEntityLivingBase, EntityLivingBase parEntityLivingBase2) { + return true; + } + + public Team getTeam() { + if (this.isTamed()) { + EntityLivingBase entitylivingbase = this.getOwner(); + if (entitylivingbase != null) { + return entitylivingbase.getTeam(); + } + } + + return super.getTeam(); + } + + public boolean isOnSameTeam(EntityLivingBase entitylivingbase) { + if (this.isTamed()) { + EntityLivingBase entitylivingbase1 = this.getOwner(); + if (entitylivingbase == entitylivingbase1) { + return true; + } + + if (entitylivingbase1 != null) { + return entitylivingbase1.isOnSameTeam(entitylivingbase); + } + } + + return super.isOnSameTeam(entitylivingbase); + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + if (this.worldObj.getGameRules().getBoolean("showDeathMessages") && this.hasCustomName() + && this.getOwner() instanceof EntityPlayerMP) { + ((EntityPlayerMP) this.getOwner()).addChatMessage(this.getCombatTracker().getDeathMessage()); + } + + super.onDeath(damagesource); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityVillager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityVillager.java new file mode 100644 index 0000000..b060bed --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityVillager.java @@ -0,0 +1,1060 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.INpc; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHarvestFarmland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookAtTradePlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveIndoors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIOpenDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIPlay; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIRestrictOpenDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITradePlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIVillagerInteract; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIVillagerMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityWitch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Tuple; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipeList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityVillager extends EntityAgeable implements IMerchant, INpc { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityVillager"); + } + + private int randomTickDivider; + private boolean isMating; + private boolean isPlaying; + Village villageObj; + private EntityPlayer buyingPlayer; + private MerchantRecipeList buyingList; + private int timeUntilReset; + private boolean needsInitilization; + private boolean isWillingToMate; + private int wealth; + private String lastBuyingPlayer; + private int careerId; + private int careerLevel; + private boolean isLookingForHome; + private boolean areAdditionalTasksSet; + private InventoryBasic villagerInventory; + /**+ + * A multi-dimensional array mapping the various professions, + * careers and career levels that a Villager may offer + */ + private static final EntityVillager.ITradeList[][][][] DEFAULT_TRADE_LIST_MAP = new EntityVillager.ITradeList[][][][] { + { { { new EntityVillager.EmeraldForItems(Items.wheat, new EntityVillager.PriceInfo(18, 22)), + new EntityVillager.EmeraldForItems(Items.potato, new EntityVillager.PriceInfo(15, 19)), + new EntityVillager.EmeraldForItems(Items.carrot, new EntityVillager.PriceInfo(15, 19)), + new EntityVillager.ListItemForEmeralds(Items.bread, new EntityVillager.PriceInfo(-4, -2)) }, + { new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), + new EntityVillager.PriceInfo(8, 13)), + new EntityVillager.ListItemForEmeralds(Items.pumpkin_pie, + new EntityVillager.PriceInfo(-3, -2)) }, + { new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), + new EntityVillager.PriceInfo(7, 12)), + new EntityVillager.ListItemForEmeralds(Items.apple, new EntityVillager.PriceInfo(-5, -7)) }, + { new EntityVillager.ListItemForEmeralds(Items.cookie, new EntityVillager.PriceInfo(-6, -10)), + new EntityVillager.ListItemForEmeralds(Items.cake, new EntityVillager.PriceInfo(1, 1)) } }, + { { new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), + new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ItemAndEmeraldToItem(Items.fish, new EntityVillager.PriceInfo(6, 6), + Items.cooked_fish, new EntityVillager.PriceInfo(6, 6)) }, + { new EntityVillager.ListEnchantedItemForEmeralds(Items.fishing_rod, + new EntityVillager.PriceInfo(7, 8)) } }, + { { new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.wool), + new EntityVillager.PriceInfo(16, 22)), + new EntityVillager.ListItemForEmeralds(Items.shears, new EntityVillager.PriceInfo(3, 4)) }, + { new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 1), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 2), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 3), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 4), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 5), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 6), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 7), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 8), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 9), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 10), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 11), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 12), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 13), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 14), + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 15), + new EntityVillager.PriceInfo(1, 2)) } }, + { { new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), + new EntityVillager.ListItemForEmeralds(Items.arrow, + new EntityVillager.PriceInfo(-12, -8)) }, + { new EntityVillager.ListItemForEmeralds(Items.bow, new EntityVillager.PriceInfo(2, 3)), + new EntityVillager.ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), + new EntityVillager.PriceInfo(10, 10), Items.flint, + new EntityVillager.PriceInfo(6, 10)) } } }, + { { { new EntityVillager.EmeraldForItems(Items.paper, new EntityVillager.PriceInfo(24, 36)), + new EntityVillager.ListEnchantedBookForEmeralds() }, + { new EntityVillager.EmeraldForItems(Items.book, new EntityVillager.PriceInfo(8, 10)), + new EntityVillager.ListItemForEmeralds(Items.compass, new EntityVillager.PriceInfo(10, 12)), + new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), + new EntityVillager.PriceInfo(3, 4)) }, + { new EntityVillager.EmeraldForItems(Items.written_book, new EntityVillager.PriceInfo(2, 2)), + new EntityVillager.ListItemForEmeralds(Items.clock, new EntityVillager.PriceInfo(10, 12)), + new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), + new EntityVillager.PriceInfo(-5, -3)) }, + { new EntityVillager.ListEnchantedBookForEmeralds() }, + { new EntityVillager.ListEnchantedBookForEmeralds() }, + { new EntityVillager.ListItemForEmeralds(Items.name_tag, + new EntityVillager.PriceInfo(20, 22)) } } }, + { { { new EntityVillager.EmeraldForItems(Items.rotten_flesh, new EntityVillager.PriceInfo(36, 40)), + new EntityVillager.EmeraldForItems(Items.gold_ingot, new EntityVillager.PriceInfo(8, 10)) }, + { new EntityVillager.ListItemForEmeralds(Items.redstone, new EntityVillager.PriceInfo(-4, -1)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + new EntityVillager.PriceInfo(-2, -1)) }, + { new EntityVillager.ListItemForEmeralds(Items.ender_eye, new EntityVillager.PriceInfo(7, 11)), + new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), + new EntityVillager.PriceInfo(-3, -1)) }, + { new EntityVillager.ListItemForEmeralds(Items.experience_bottle, + new EntityVillager.PriceInfo(3, 11)) } } }, + { { { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListItemForEmeralds(Items.iron_helmet, new EntityVillager.PriceInfo(4, 6)) }, + { new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), + new EntityVillager.ListItemForEmeralds(Items.iron_chestplate, + new EntityVillager.PriceInfo(10, 14)) }, + { new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_chestplate, + new EntityVillager.PriceInfo(16, 19)) }, + { new EntityVillager.ListItemForEmeralds(Items.chainmail_boots, new EntityVillager.PriceInfo(5, 7)), + new EntityVillager.ListItemForEmeralds(Items.chainmail_leggings, + new EntityVillager.PriceInfo(9, 11)), + new EntityVillager.ListItemForEmeralds(Items.chainmail_helmet, + new EntityVillager.PriceInfo(5, 7)), + new EntityVillager.ListItemForEmeralds(Items.chainmail_chestplate, + new EntityVillager.PriceInfo(11, 15)) } }, + { { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListItemForEmeralds(Items.iron_axe, + new EntityVillager.PriceInfo(6, 8)) }, + { new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_sword, + new EntityVillager.PriceInfo(9, 10)) }, + { new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_sword, + new EntityVillager.PriceInfo(12, 15)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_axe, + new EntityVillager.PriceInfo(9, 12)) } }, + { { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_shovel, + new EntityVillager.PriceInfo(5, 7)) }, + { new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_pickaxe, + new EntityVillager.PriceInfo(9, 11)) }, + { new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_pickaxe, + new EntityVillager.PriceInfo(12, 15)) } } }, + { { { new EntityVillager.EmeraldForItems(Items.porkchop, new EntityVillager.PriceInfo(14, 18)), + new EntityVillager.EmeraldForItems(Items.chicken, new EntityVillager.PriceInfo(14, 18)) }, + { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListItemForEmeralds(Items.cooked_porkchop, + new EntityVillager.PriceInfo(-7, -5)), + new EntityVillager.ListItemForEmeralds(Items.cooked_chicken, + new EntityVillager.PriceInfo(-8, -6)) } }, + { { new EntityVillager.EmeraldForItems(Items.leather, new EntityVillager.PriceInfo(9, 12)), + new EntityVillager.ListItemForEmeralds(Items.leather_leggings, + new EntityVillager.PriceInfo(2, 4)) }, + { new EntityVillager.ListEnchantedItemForEmeralds(Items.leather_chestplate, + new EntityVillager.PriceInfo(7, 12)) }, + { new EntityVillager.ListItemForEmeralds(Items.saddle, + new EntityVillager.PriceInfo(8, 10)) } } } }; + + public EntityVillager(World worldIn) { + this(worldIn, 0); + } + + public EntityVillager(World worldIn, int professionId) { + super(worldIn); + this.villagerInventory = new InventoryBasic("Items", false, 8); + this.setProfession(professionId); + this.setSize(0.6F, 1.8F); + ((PathNavigateGround) this.getNavigator()).setBreakDoors(true); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); + this.tasks.addTask(1, new EntityAITradePlayer(this)); + this.tasks.addTask(1, new EntityAILookAtTradePlayer(this)); + this.tasks.addTask(2, new EntityAIMoveIndoors(this)); + this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); + this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); + this.tasks.addTask(6, new EntityAIVillagerMate(this)); + this.tasks.addTask(7, new EntityAIFollowGolem(this)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); + this.tasks.addTask(9, new EntityAIVillagerInteract(this)); + this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); + this.setCanPickUpLoot(true); + } + + private void setAdditionalAItasks() { + if (!this.areAdditionalTasksSet) { + this.areAdditionalTasksSet = true; + if (this.isChild()) { + this.tasks.addTask(8, new EntityAIPlay(this, 0.32D)); + } else if (this.getProfession() == 0) { + this.tasks.addTask(6, new EntityAIHarvestFarmland(this, 0.6D)); + } + + } + } + + /**+ + * This is called when Entity's growing age timer reaches 0 + * (negative values are considered as a child, positive as an + * adult) + */ + protected void onGrowingAdult() { + if (this.getProfession() == 0) { + this.tasks.addTask(8, new EntityAIHarvestFarmland(this, 0.6D)); + } + + super.onGrowingAdult(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + } + + protected void updateAITasks() { + if (--this.randomTickDivider <= 0) { + BlockPos blockpos = new BlockPos(this); + this.worldObj.getVillageCollection().addToVillagerPositionList(blockpos); + this.randomTickDivider = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(blockpos, 32); + if (this.villageObj == null) { + this.detachHome(); + } else { + BlockPos blockpos1 = this.villageObj.getCenter(); + this.setHomePosAndDistance(blockpos1, (int) ((float) this.villageObj.getVillageRadius() * 1.0F)); + if (this.isLookingForHome) { + this.isLookingForHome = false; + this.villageObj.setDefaultPlayerReputation(5); + } + } + } + + if (!this.isTrading() && this.timeUntilReset > 0) { + --this.timeUntilReset; + if (this.timeUntilReset <= 0) { + if (this.needsInitilization) { + for (MerchantRecipe merchantrecipe : this.buyingList) { + if (merchantrecipe.isRecipeDisabled()) { + merchantrecipe.increaseMaxTradeUses(this.rand.nextInt(6) + this.rand.nextInt(6) + 2); + } + } + + this.populateBuyingList(); + this.needsInitilization = false; + if (this.villageObj != null && this.lastBuyingPlayer != null) { + this.worldObj.setEntityState(this, (byte) 14); + this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1); + } + } + + this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0)); + } + } + + super.updateAITasks(); + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; + if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { + if (this.buyingList == null || this.buyingList.size() > 0) { + this.setCustomer(entityplayer); + entityplayer.displayVillagerTradeGui(this); + } + + entityplayer.triggerAchievement(StatList.timesTalkedToVillagerStat); + return true; + } else { + return super.interact(entityplayer); + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("Profession", this.getProfession()); + nbttagcompound.setInteger("Riches", this.wealth); + nbttagcompound.setInteger("Career", this.careerId); + nbttagcompound.setInteger("CareerLevel", this.careerLevel); + nbttagcompound.setBoolean("Willing", this.isWillingToMate); + if (this.buyingList != null) { + nbttagcompound.setTag("Offers", this.buyingList.getRecipiesAsTags()); + } + + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + if (itemstack != null) { + nbttaglist.appendTag(itemstack.writeToNBT(new NBTTagCompound())); + } + } + + nbttagcompound.setTag("Inventory", nbttaglist); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setProfession(nbttagcompound.getInteger("Profession")); + this.wealth = nbttagcompound.getInteger("Riches"); + this.careerId = nbttagcompound.getInteger("Career"); + this.careerLevel = nbttagcompound.getInteger("CareerLevel"); + this.isWillingToMate = nbttagcompound.getBoolean("Willing"); + if (nbttagcompound.hasKey("Offers", 10)) { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Offers"); + this.buyingList = new MerchantRecipeList(nbttagcompound1); + } + + NBTTagList nbttaglist = nbttagcompound.getTagList("Inventory", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + if (itemstack != null) { + this.villagerInventory.func_174894_a(itemstack); + } + } + + this.setCanPickUpLoot(true); + this.setAdditionalAItasks(); + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return false; + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isTrading() ? "mob.villager.haggle" : "mob.villager.idle"; + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.villager.hit"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.villager.death"; + } + + public void setProfession(int professionId) { + this.dataWatcher.updateObject(16, Integer.valueOf(professionId)); + } + + public int getProfession() { + return Math.max(this.dataWatcher.getWatchableObjectInt(16) % 5, 0); + } + + public boolean isMating() { + return this.isMating; + } + + public void setMating(boolean mating) { + this.isMating = mating; + } + + public void setPlaying(boolean playing) { + this.isPlaying = playing; + } + + public boolean isPlaying() { + return this.isPlaying; + } + + public void setRevengeTarget(EntityLivingBase entitylivingbase) { + super.setRevengeTarget(entitylivingbase); + if (this.villageObj != null && entitylivingbase != null) { + this.villageObj.addOrRenewAgressor(entitylivingbase); + if (entitylivingbase instanceof EntityPlayer) { + byte b0 = -1; + if (this.isChild()) { + b0 = -3; + } + + this.villageObj.setReputationForPlayer(entitylivingbase.getName(), b0); + if (this.isEntityAlive()) { + this.worldObj.setEntityState(this, (byte) 13); + } + } + } + + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + if (this.villageObj != null) { + Entity entity = damagesource.getEntity(); + if (entity != null) { + if (entity instanceof EntityPlayer) { + this.villageObj.setReputationForPlayer(entity.getName(), -2); + } else if (entity instanceof IMob) { + this.villageObj.endMatingSeason(); + } + } else { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 16.0D); + if (entityplayer != null) { + this.villageObj.endMatingSeason(); + } + } + } + + super.onDeath(damagesource); + } + + public void setCustomer(EntityPlayer entityplayer) { + this.buyingPlayer = entityplayer; + } + + public EntityPlayer getCustomer() { + return this.buyingPlayer; + } + + public boolean isTrading() { + return this.buyingPlayer != null; + } + + /**+ + * Returns current or updated value of {@link #isWillingToMate} + */ + public boolean getIsWillingToMate(boolean updateFirst) { + if (!this.isWillingToMate && updateFirst && this.func_175553_cp()) { + boolean flag = false; + + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + if (itemstack != null) { + if (itemstack.getItem() == Items.bread && itemstack.stackSize >= 3) { + flag = true; + this.villagerInventory.decrStackSize(i, 3); + } else if ((itemstack.getItem() == Items.potato || itemstack.getItem() == Items.carrot) + && itemstack.stackSize >= 12) { + flag = true; + this.villagerInventory.decrStackSize(i, 12); + } + } + + if (flag) { + this.worldObj.setEntityState(this, (byte) 18); + this.isWillingToMate = true; + break; + } + } + } + + return this.isWillingToMate; + } + + public void setIsWillingToMate(boolean willingToTrade) { + this.isWillingToMate = willingToTrade; + } + + public void useRecipe(MerchantRecipe merchantrecipe) { + merchantrecipe.incrementToolUses(); + this.livingSoundTime = -this.getTalkInterval(); + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + int i = 3 + this.rand.nextInt(4); + if (merchantrecipe.getToolUses() == 1 || this.rand.nextInt(5) == 0) { + this.timeUntilReset = 40; + this.needsInitilization = true; + this.isWillingToMate = true; + if (this.buyingPlayer != null) { + this.lastBuyingPlayer = this.buyingPlayer.getName(); + } else { + this.lastBuyingPlayer = null; + } + + i += 5; + } + + if (merchantrecipe.getItemToBuy().getItem() == Items.emerald) { + this.wealth += merchantrecipe.getItemToBuy().stackSize; + } + + if (merchantrecipe.getRewardsExp()) { + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i)); + } + + } + + /**+ + * Notifies the merchant of a possible merchantrecipe being + * fulfilled or not. Usually, this is just a sound byte being + * played depending if the suggested itemstack is not null. + */ + public void verifySellingItem(ItemStack itemstack) { + if (this.livingSoundTime > -this.getTalkInterval() + 20) { + this.livingSoundTime = -this.getTalkInterval(); + if (itemstack != null) { + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + } else { + this.playSound("mob.villager.no", this.getSoundVolume(), this.getSoundPitch()); + } + } + + } + + public MerchantRecipeList getRecipes(EntityPlayer var1) { + if (this.buyingList == null) { + this.populateBuyingList(); + } + + return this.buyingList; + } + + private void populateBuyingList() { + EntityVillager.ITradeList[][][] aentityvillager$itradelist = DEFAULT_TRADE_LIST_MAP[this.getProfession()]; + if (this.careerId != 0 && this.careerLevel != 0) { + ++this.careerLevel; + } else { + this.careerId = this.rand.nextInt(aentityvillager$itradelist.length) + 1; + this.careerLevel = 1; + } + + if (this.buyingList == null) { + this.buyingList = new MerchantRecipeList(); + } + + int i = this.careerId - 1; + int j = this.careerLevel - 1; + EntityVillager.ITradeList[][] aentityvillager$itradelist1 = aentityvillager$itradelist[i]; + if (j >= 0 && j < aentityvillager$itradelist1.length) { + EntityVillager.ITradeList[] aentityvillager$itradelist2 = aentityvillager$itradelist1[j]; + + for (EntityVillager.ITradeList entityvillager$itradelist : aentityvillager$itradelist2) { + entityvillager$itradelist.modifyMerchantRecipeList(this.buyingList, this.rand); + } + } + + } + + public void setRecipes(MerchantRecipeList var1) { + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + String s = this.getCustomNameTag(); + if (s != null && s.length() > 0) { + ChatComponentText chatcomponenttext = new ChatComponentText(s); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttext; + } else { + if (this.buyingList == null) { + this.populateBuyingList(); + } + + String s1 = null; + switch (this.getProfession()) { + case 0: + if (this.careerId == 1) { + s1 = "farmer"; + } else if (this.careerId == 2) { + s1 = "fisherman"; + } else if (this.careerId == 3) { + s1 = "shepherd"; + } else if (this.careerId == 4) { + s1 = "fletcher"; + } + break; + case 1: + s1 = "librarian"; + break; + case 2: + s1 = "cleric"; + break; + case 3: + if (this.careerId == 1) { + s1 = "armor"; + } else if (this.careerId == 2) { + s1 = "weapon"; + } else if (this.careerId == 3) { + s1 = "tool"; + } + break; + case 4: + if (this.careerId == 1) { + s1 = "butcher"; + } else if (this.careerId == 2) { + s1 = "leather"; + } + } + + if (s1 != null) { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation( + "entity.Villager." + s1, new Object[0]); + chatcomponenttranslation.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttranslation.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttranslation; + } else { + return super.getDisplayName(); + } + } + } + + public float getEyeHeight() { + float f = 1.62F; + if (this.isChild()) { + f = (float) ((double) f - 0.81D); + } + + return f; + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 12) { + this.spawnParticles(EnumParticleTypes.HEART); + } else if (b0 == 13) { + this.spawnParticles(EnumParticleTypes.VILLAGER_ANGRY); + } else if (b0 == 14) { + this.spawnParticles(EnumParticleTypes.VILLAGER_HAPPY); + } else { + super.handleStatusUpdate(b0); + } + + } + + private void spawnParticles(EnumParticleTypes particleType) { + for (int i = 0; i < 5; ++i) { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(particleType, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, + this.posY + 1.0D + (double) (this.rand.nextFloat() * this.height), + this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2, + new int[0]); + } + + } + + /**+ + * Called only once on an entity when first time spawned, via + * egg, mob spawner, natural spawning etc, but not called when + * entity is reloaded from nbt. Mainly used for initializing + * attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficultyinstance, + IEntityLivingData ientitylivingdata) { + ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); + this.setProfession(this.worldObj.rand.nextInt(5)); + this.setAdditionalAItasks(); + return ientitylivingdata; + } + + public void setLookingForHome() { + this.isLookingForHome = true; + } + + public EntityVillager createChild(EntityAgeable var1) { + EntityVillager entityvillager = new EntityVillager(this.worldObj); + entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), + (IEntityLivingData) null); + return entityvillager; + } + + public boolean allowLeashing() { + return false; + } + + /**+ + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt var1) { + if (!this.isDead) { + EntityWitch entitywitch = new EntityWitch(this.worldObj); + entitywitch.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + entitywitch.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entitywitch)), + (IEntityLivingData) null); + entitywitch.setNoAI(this.isAIDisabled()); + if (this.hasCustomName()) { + entitywitch.setCustomNameTag(this.getCustomNameTag()); + entitywitch.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entitywitch); + this.setDead(); + } + } + + public InventoryBasic getVillagerInventory() { + return this.villagerInventory; + } + + /**+ + * Tests if this entity should pickup a weapon or an armor. + * Entity drops current weapon or armor if the new one is + * better. + */ + protected void updateEquipmentIfNeeded(EntityItem entityitem) { + ItemStack itemstack = entityitem.getEntityItem(); + Item item = itemstack.getItem(); + if (this.canVillagerPickupItem(item)) { + ItemStack itemstack1 = this.villagerInventory.func_174894_a(itemstack); + if (itemstack1 == null) { + entityitem.setDead(); + } else { + itemstack.stackSize = itemstack1.stackSize; + } + } + + } + + private boolean canVillagerPickupItem(Item itemIn) { + return itemIn == Items.bread || itemIn == Items.potato || itemIn == Items.carrot || itemIn == Items.wheat + || itemIn == Items.wheat_seeds; + } + + public boolean func_175553_cp() { + return this.hasEnoughItems(1); + } + + /**+ + * Used by {@link + * net.minecraft.entity.ai.EntityAIVillagerInteract + * EntityAIVillagerInteract} to check if the villager can give + * some items from an inventory to another villager. + */ + public boolean canAbondonItems() { + return this.hasEnoughItems(2); + } + + public boolean func_175557_cr() { + boolean flag = this.getProfession() == 0; + return flag ? !this.hasEnoughItems(5) : !this.hasEnoughItems(1); + } + + /**+ + * Returns true if villager has enough items in inventory + */ + private boolean hasEnoughItems(int multiplier) { + boolean flag = this.getProfession() == 0; + + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + if (itemstack != null) { + if (itemstack.getItem() == Items.bread && itemstack.stackSize >= 3 * multiplier + || itemstack.getItem() == Items.potato && itemstack.stackSize >= 12 * multiplier + || itemstack.getItem() == Items.carrot && itemstack.stackSize >= 12 * multiplier) { + return true; + } + + if (flag && itemstack.getItem() == Items.wheat && itemstack.stackSize >= 9 * multiplier) { + return true; + } + } + } + + return false; + } + + /**+ + * Returns true if villager has seeds, potatoes or carrots in + * inventory + */ + public boolean isFarmItemInInventory() { + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + if (itemstack != null && (itemstack.getItem() == Items.wheat_seeds || itemstack.getItem() == Items.potato + || itemstack.getItem() == Items.carrot)) { + return true; + } + } + + return false; + } + + public boolean replaceItemInInventory(int i, ItemStack itemstack) { + if (super.replaceItemInInventory(i, itemstack)) { + return true; + } else { + int j = i - 300; + if (j >= 0 && j < this.villagerInventory.getSizeInventory()) { + this.villagerInventory.setInventorySlotContents(j, itemstack); + return true; + } else { + return false; + } + } + } + + static class EmeraldForItems implements EntityVillager.ITradeList { + public Item sellItem; + public EntityVillager.PriceInfo price; + + public EmeraldForItems(Item itemIn, EntityVillager.PriceInfo priceIn) { + this.sellItem = itemIn; + this.price = priceIn; + } + + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, EaglercraftRandom random) { + int i = 1; + if (this.price != null) { + i = this.price.getPrice(random); + } + + recipeList.add(new MerchantRecipe(new ItemStack(this.sellItem, i, 0), Items.emerald)); + } + } + + interface ITradeList { + void modifyMerchantRecipeList(MerchantRecipeList var1, EaglercraftRandom var2); + } + + static class ItemAndEmeraldToItem implements EntityVillager.ITradeList { + public ItemStack field_179411_a; + public EntityVillager.PriceInfo field_179409_b; + public ItemStack field_179410_c; + public EntityVillager.PriceInfo field_179408_d; + + public ItemAndEmeraldToItem(Item parItem, EntityVillager.PriceInfo parPriceInfo, Item parItem2, + EntityVillager.PriceInfo parPriceInfo2) { + this.field_179411_a = new ItemStack(parItem); + this.field_179409_b = parPriceInfo; + this.field_179410_c = new ItemStack(parItem2); + this.field_179408_d = parPriceInfo2; + } + + public void modifyMerchantRecipeList(MerchantRecipeList merchantrecipelist, EaglercraftRandom random) { + int i = 1; + if (this.field_179409_b != null) { + i = this.field_179409_b.getPrice(random); + } + + int j = 1; + if (this.field_179408_d != null) { + j = this.field_179408_d.getPrice(random); + } + + merchantrecipelist.add(new MerchantRecipe( + new ItemStack(this.field_179411_a.getItem(), i, this.field_179411_a.getMetadata()), + new ItemStack(Items.emerald), + new ItemStack(this.field_179410_c.getItem(), j, this.field_179410_c.getMetadata()))); + } + } + + static class ListEnchantedBookForEmeralds implements EntityVillager.ITradeList { + public void modifyMerchantRecipeList(MerchantRecipeList merchantrecipelist, EaglercraftRandom random) { + Enchantment enchantment = Enchantment.enchantmentsBookList[random + .nextInt(Enchantment.enchantmentsBookList.length)]; + int i = MathHelper.getRandomIntegerInRange(random, enchantment.getMinLevel(), enchantment.getMaxLevel()); + ItemStack itemstack = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i)); + int j = 2 + random.nextInt(5 + i * 10) + 3 * i; + if (j > 64) { + j = 64; + } + + merchantrecipelist + .add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, j), itemstack)); + } + } + + static class ListEnchantedItemForEmeralds implements EntityVillager.ITradeList { + public ItemStack field_179407_a; + public EntityVillager.PriceInfo field_179406_b; + + public ListEnchantedItemForEmeralds(Item parItem, EntityVillager.PriceInfo parPriceInfo) { + this.field_179407_a = new ItemStack(parItem); + this.field_179406_b = parPriceInfo; + } + + public void modifyMerchantRecipeList(MerchantRecipeList merchantrecipelist, EaglercraftRandom random) { + int i = 1; + if (this.field_179406_b != null) { + i = this.field_179406_b.getPrice(random); + } + + ItemStack itemstack = new ItemStack(Items.emerald, i, 0); + ItemStack itemstack1 = new ItemStack(this.field_179407_a.getItem(), 1, this.field_179407_a.getMetadata()); + itemstack1 = EnchantmentHelper.addRandomEnchantment(random, itemstack1, 5 + random.nextInt(15)); + merchantrecipelist.add(new MerchantRecipe(itemstack, itemstack1)); + } + } + + static class ListItemForEmeralds implements EntityVillager.ITradeList { + public ItemStack field_179403_a; + public EntityVillager.PriceInfo field_179402_b; + + public ListItemForEmeralds(Item par1Item, EntityVillager.PriceInfo priceInfo) { + this.field_179403_a = new ItemStack(par1Item); + this.field_179402_b = priceInfo; + } + + public ListItemForEmeralds(ItemStack stack, EntityVillager.PriceInfo priceInfo) { + this.field_179403_a = stack; + this.field_179402_b = priceInfo; + } + + public void modifyMerchantRecipeList(MerchantRecipeList merchantrecipelist, EaglercraftRandom random) { + int i = 1; + if (this.field_179402_b != null) { + i = this.field_179402_b.getPrice(random); + } + + ItemStack itemstack; + ItemStack itemstack1; + if (i < 0) { + itemstack = new ItemStack(Items.emerald, 1, 0); + itemstack1 = new ItemStack(this.field_179403_a.getItem(), -i, this.field_179403_a.getMetadata()); + } else { + itemstack = new ItemStack(Items.emerald, i, 0); + itemstack1 = new ItemStack(this.field_179403_a.getItem(), 1, this.field_179403_a.getMetadata()); + } + + merchantrecipelist.add(new MerchantRecipe(itemstack, itemstack1)); + } + } + + static class PriceInfo extends Tuple { + public PriceInfo(int parInt1, int parInt2) { + super(Integer.valueOf(parInt1), Integer.valueOf(parInt2)); + } + + public int getPrice(EaglercraftRandom rand) { + return ((Integer) this.getFirst()).intValue() >= ((Integer) this.getSecond()).intValue() + ? ((Integer) this.getFirst()).intValue() + : ((Integer) this.getFirst()).intValue() + rand.nextInt( + ((Integer) this.getSecond()).intValue() - ((Integer) this.getFirst()).intValue() + 1); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWaterMob.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWaterMob.java new file mode 100644 index 0000000..c0de26f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWaterMob.java @@ -0,0 +1,106 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.IAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityWaterMob extends EntityLiving implements IAnimals { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityWaterMob"); + } + + public EntityWaterMob(World worldIn) { + super(worldIn); + } + + public boolean canBreatheUnderwater() { + return true; + } + + /**+ + * Checks if the entity's current position is a valid location + * to spawn this entity. + */ + public boolean getCanSpawnHere() { + return true; + } + + /**+ + * Checks that the entity is not colliding with any blocks / + * liquids + */ + public boolean isNotColliding() { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this); + } + + /**+ + * Get number of ticks, at least during which the living entity + * will be silent. + */ + public int getTalkInterval() { + return 120; + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return true; + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer var1) { + return 1 + this.worldObj.rand.nextInt(3); + } + + /**+ + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + int i = this.getAir(); + super.onEntityUpdate(); + if (this.isEntityAlive() && !this.isInWater()) { + --i; + this.setAir(i); + if (this.getAir() == -20) { + this.setAir(0); + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } else { + this.setAir(300); + } + + } + + public boolean isPushedByWater() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWolf.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWolf.java new file mode 100644 index 0000000..6d54435 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWolf.java @@ -0,0 +1,568 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityAgeable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIBeg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIFollowOwner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAILookIdle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIMate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAISwimming; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWander; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.EntityAIWatchClosest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGhast; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityRabbit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityTameable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityWolf extends EntityTameable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/passive/EntityWolf"); + } + + private float headRotationCourse; + private float headRotationCourseOld; + private boolean isWet; + private boolean isShaking; + private float timeWolfIsShaking; + private float prevTimeWolfIsShaking; + + public EntityWolf(World worldIn) { + super(worldIn); + this.setSize(0.6F, 0.8F); + ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(4, + new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof EntitySheep || entity instanceof EntityRabbit; + } + })); + this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false)); + this.setTamed(false); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + if (this.isTamed()) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); + } + + /**+ + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase entitylivingbase) { + super.setAttackTarget(entitylivingbase); + if (entitylivingbase == null) { + this.setAngry(false); + } else if (!this.isTamed()) { + this.setAngry(true); + } + + } + + protected void updateAITasks() { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + this.dataWatcher.addObject(20, new Byte((byte) EnumDyeColor.RED.getMetadata())); + } + + protected void playStepSound(BlockPos var1, Block var2) { + this.playSound("mob.wolf.step", 0.15F, 1.0F); + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setBoolean("Angry", this.isAngry()); + nbttagcompound.setByte("CollarColor", (byte) this.getCollarColor().getDyeDamage()); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.setAngry(nbttagcompound.getBoolean("Angry")); + if (nbttagcompound.hasKey("CollarColor", 99)) { + this.setCollarColor(EnumDyeColor.byDyeDamage(nbttagcompound.getByte("CollarColor"))); + } + + } + + /**+ + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isAngry() ? "mob.wolf.growl" + : (this.rand.nextInt(3) == 0 + ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" + : "mob.wolf.panting") + : "mob.wolf.bark"); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.wolf.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.wolf.death"; + } + + /**+ + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item getDropItem() { + return Item.getItemById(-1); + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + if (this.isWet && !this.isShaking && !this.hasPath() && this.onGround) { + this.isShaking = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + this.worldObj.setEntityState(this, (byte) 8); + } + + if (this.getAttackTarget() == null && this.isAngry()) { + this.setAngry(false); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + this.headRotationCourseOld = this.headRotationCourse; + if (this.isBegging()) { + this.headRotationCourse += (1.0F - this.headRotationCourse) * 0.4F; + } else { + this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F; + } + + if (this.isWet()) { + this.isWet = true; + this.isShaking = false; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } else if ((this.isWet || this.isShaking) && this.isShaking) { + if (this.timeWolfIsShaking == 0.0F) { + this.playSound("mob.wolf.shake", this.getSoundVolume(), + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.prevTimeWolfIsShaking = this.timeWolfIsShaking; + this.timeWolfIsShaking += 0.05F; + if (this.prevTimeWolfIsShaking >= 2.0F) { + this.isWet = false; + this.isShaking = false; + this.prevTimeWolfIsShaking = 0.0F; + this.timeWolfIsShaking = 0.0F; + } + + if (this.timeWolfIsShaking > 0.4F) { + float f = (float) this.getEntityBoundingBox().minY; + int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * 3.1415927F) * 7.0F); + + for (int j = 0; j < i; ++j) { + float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double) f1, + (double) (f + 0.8F), this.posZ + (double) f2, this.motionX, this.motionY, this.motionZ, + new int[0]); + } + } + } + + } + + /**+ + * True if the wolf is wet + */ + public boolean isWolfWet() { + return this.isWet; + } + + /**+ + * Used when calculating the amount of shading to apply while + * the wolf is wet. + */ + public float getShadingWhileWet(float parFloat1) { + return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * parFloat1) + / 2.0F * 0.25F; + } + + public float getShakeAngle(float parFloat1, float parFloat2) { + float f = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * parFloat1 + + parFloat2) / 1.8F; + if (f < 0.0F) { + f = 0.0F; + } else if (f > 1.0F) { + f = 1.0F; + } + + return MathHelper.sin(f * 3.1415927F) * MathHelper.sin(f * 3.1415927F * 11.0F) * 0.15F * 3.1415927F; + } + + public float getInterestedAngle(float parFloat1) { + return (this.headRotationCourseOld + (this.headRotationCourse - this.headRotationCourseOld) * parFloat1) * 0.15F + * 3.1415927F; + } + + public float getEyeHeight() { + return this.height * 0.8F; + } + + /**+ + * The speed it takes to move the entityliving's rotationPitch + * through the faceEntity method. This is only currently use in + * wolves. + */ + public int getVerticalFaceSpeed() { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + Entity entity = damagesource.getEntity(); + this.aiSit.setSitting(false); + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) { + f = (f + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(damagesource, f); + } + } + + public boolean attackEntityAsMob(Entity entity) { + boolean flag = entity.attackEntityFrom(DamageSource.causeMobDamage(this), + (float) ((int) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue())); + if (flag) { + this.applyEnchantments(this, entity); + } + + return flag; + } + + public void setTamed(boolean flag) { + super.setTamed(flag); + if (flag) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); + } + + /**+ + * Called when a player interacts with a mob. e.g. gets milk + * from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (this.isTamed()) { + if (itemstack != null) { + if (itemstack.getItem() instanceof ItemFood) { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + this.heal((float) itemfood.getHealAmount(itemstack)); + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + + return true; + } + } else if (itemstack.getItem() == Items.dye) { + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(itemstack.getMetadata()); + if (enumdyecolor != this.getCollarColor()) { + this.setCollarColor(enumdyecolor); + if (!entityplayer.capabilities.isCreativeMode && --itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + + return true; + } + } + } + + if (this.isOwner(entityplayer) && !this.isBreedingItem(itemstack)) { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.navigator.clearPathEntity(); + this.setAttackTarget((EntityLivingBase) null); + } + } else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry()) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, (ItemStack) null); + } + + { + if (this.rand.nextInt(3) == 0) { + this.setTamed(true); + this.navigator.clearPathEntity(); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(20.0F); + this.setOwnerId(entityplayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(entityplayer); + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 8) { + this.isShaking = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } else { + super.handleStatusUpdate(b0); + } + + } + + public float getTailRotation() { + return this.isAngry() ? 1.5393804F + : (this.isTamed() + ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * 3.1415927F + : 0.62831855F); + } + + /**+ + * Checks if the parameter is an item which this animal can be + * fed to breed it (wheat, carrots or seeds depending on the + * animal type) + */ + public boolean isBreedingItem(ItemStack itemstack) { + return itemstack == null ? false + : (!(itemstack.getItem() instanceof ItemFood) ? false + : ((ItemFood) itemstack.getItem()).isWolfsFavoriteMeat()); + } + + /**+ + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 8; + } + + /**+ + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /**+ + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean angry) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (angry) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + + } + + public EnumDyeColor getCollarColor() { + return EnumDyeColor.byDyeDamage(this.dataWatcher.getWatchableObjectByte(20) & 15); + } + + public void setCollarColor(EnumDyeColor collarcolor) { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (collarcolor.getDyeDamage() & 15))); + } + + public EntityWolf createChild(EntityAgeable var1) { + EntityWolf entitywolf = new EntityWolf(this.worldObj); + String s = this.getOwnerId(); + if (s != null && s.trim().length() > 0) { + entitywolf.setOwnerId(s); + entitywolf.setTamed(true); + } + + return entitywolf; + } + + public void setBegging(boolean beg) { + if (beg) { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + + } + + /**+ + * Returns true if the mob is currently able to mate with the + * specified mob. + */ + public boolean canMateWith(EntityAnimal entityanimal) { + if (entityanimal == this) { + return false; + } else if (!this.isTamed()) { + return false; + } else if (!(entityanimal instanceof EntityWolf)) { + return false; + } else { + EntityWolf entitywolf = (EntityWolf) entityanimal; + return !entitywolf.isTamed() ? false + : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove()); + } + } + + public boolean isBegging() { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /**+ + * Determines if an entity can be despawned, used on idle far + * away entities + */ + protected boolean canDespawn() { + return !this.isTamed() && this.ticksExisted > 2400; + } + + public boolean shouldAttackEntity(EntityLivingBase entitylivingbase, EntityLivingBase entitylivingbase1) { + if (!(entitylivingbase instanceof EntityCreeper) && !(entitylivingbase instanceof EntityGhast)) { + if (entitylivingbase instanceof EntityWolf) { + EntityWolf entitywolf = (EntityWolf) entitylivingbase; + if (entitywolf.isTamed() && entitywolf.getOwner() == entitylivingbase1) { + return false; + } + } + + return entitylivingbase instanceof EntityPlayer && entitylivingbase1 instanceof EntityPlayer + && !((EntityPlayer) entitylivingbase1).canAttackPlayer((EntityPlayer) entitylivingbase) ? false + : !(entitylivingbase instanceof EntityHorse) || !((EntityHorse) entitylivingbase).isTame(); + } else { + return false; + } + } + + public boolean allowLeashing() { + return !this.isAngry() && super.allowLeashing(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/IAnimals.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/IAnimals.java new file mode 100644 index 0000000..6366e87 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/IAnimals.java @@ -0,0 +1,24 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IAnimals { +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayer.java new file mode 100644 index 0000000..b42635e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayer.java @@ -0,0 +1,2085 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; + +import java.util.Collection; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBlockLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityMultiPart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragonPart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.IMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityPig; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EnumPlayerModelParts; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.PlayerCapabilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFishHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.ClickEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryEnderChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.FoodStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.LockCode; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityPlayer extends EntityLivingBase { + + static { + __checkIntegratedContextValid("net/minecraft/entity/player/EntityPlayer"); + } + + /**+ + * Inventory of the player + */ + public InventoryPlayer inventory = new InventoryPlayer(this); + private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); + public Container inventoryContainer; + public Container openContainer; + /**+ + * The food object of the player, the general hunger logic. + */ + protected FoodStats foodStats = new FoodStats(); + protected int flyToggleTimer; + public float prevCameraYaw; + public float cameraYaw; + public int xpCooldown; + public double prevChasingPosX; + public double prevChasingPosY; + public double prevChasingPosZ; + public double chasingPosX; + public double chasingPosY; + public double chasingPosZ; + protected boolean sleeping; + public BlockPos playerLocation; + private int sleepTimer; + public float renderOffsetX; + public float renderOffsetY; + public float renderOffsetZ; + private BlockPos spawnChunk; + private boolean spawnForced; + private BlockPos startMinecartRidingCoordinate; + /**+ + * The player's capabilities. (See class PlayerCapabilities) + */ + public PlayerCapabilities capabilities = new PlayerCapabilities(); + public int experienceLevel; + public int experienceTotal; + public float experience; + private int xpSeed; + private ItemStack itemInUse; + private int itemInUseCount; + protected float speedOnGround = 0.1F; + protected float speedInAir = 0.02F; + private int lastXPSound; + private final GameProfile gameProfile; + private boolean hasReducedDebug = false; + public EntityFishHook fishEntity; + + public EntityPlayer(World worldIn, GameProfile gameProfileIn) { + super(worldIn); + this.entityUniqueID = getUUID(gameProfileIn); + this.gameProfile = gameProfileIn; + this.inventoryContainer = new ContainerPlayer(this.inventory, true, this); + this.openContainer = this.inventoryContainer; + BlockPos blockpos = worldIn.getSpawnPoint(); + this.setLocationAndAngles((double) blockpos.getX() + 0.5D, (double) (blockpos.getY() + 1), + (double) blockpos.getZ() + 0.5D, 0.0F, 0.0F); + this.field_70741_aB = 180.0F; + this.fireResistance = 20; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.10000000149011612D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(17, Float.valueOf(0.0F)); + this.dataWatcher.addObject(18, Integer.valueOf(0)); + this.dataWatcher.addObject(10, Byte.valueOf((byte) 0)); + } + + /**+ + * returns the ItemStack containing the itemInUse + */ + public ItemStack getItemInUse() { + return this.itemInUse; + } + + /**+ + * Returns the item in use count + */ + public int getItemInUseCount() { + return this.itemInUseCount; + } + + /**+ + * Checks if the entity is currently using an item (e.g., bow, + * food, sword) by holding down the useItemButton + */ + public boolean isUsingItem() { + return this.itemInUse != null; + } + + /**+ + * gets the duration for how long the current itemInUse has been + * in use + */ + public int getItemInUseDuration() { + return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; + } + + public void stopUsingItem() { + if (this.itemInUse != null) { + this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); + } + + this.clearItemInUse(); + } + + public void clearItemInUse() { + this.itemInUse = null; + this.itemInUseCount = 0; + this.setEating(false); + } + + public boolean isBlocking() { + return this.isUsingItem() && this.itemInUse.getItem().getItemUseAction(this.itemInUse) == EnumAction.BLOCK; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.noClip = this.isSpectator(); + if (this.isSpectator()) { + this.onGround = false; + } + + if (this.itemInUse != null) { + ItemStack itemstack = this.inventory.getCurrentItem(); + if (itemstack == this.itemInUse) { + if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { + this.updateItemUse(itemstack, 5); + } + + if (--this.itemInUseCount == 0) { + this.onItemUseFinish(); + } + } else { + this.clearItemInUse(); + } + } + + if (this.xpCooldown > 0) { + --this.xpCooldown; + } + + if (this.isPlayerSleeping()) { + ++this.sleepTimer; + if (this.sleepTimer > 100) { + this.sleepTimer = 100; + } + + { + if (!this.isInBed()) { + this.wakeUpPlayer(true, true, false); + } else if (this.worldObj.isDaytime()) { + this.wakeUpPlayer(false, true, true); + } + } + } else if (this.sleepTimer > 0) { + ++this.sleepTimer; + if (this.sleepTimer >= 110) { + this.sleepTimer = 0; + } + } + + super.onUpdate(); + if (this.openContainer != null && !this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + if (this.isBurning() && this.capabilities.disableDamage) { + this.extinguish(); + } + + this.prevChasingPosX = this.chasingPosX; + this.prevChasingPosY = this.chasingPosY; + this.prevChasingPosZ = this.chasingPosZ; + double d5 = this.posX - this.chasingPosX; + double d0 = this.posY - this.chasingPosY; + double d1 = this.posZ - this.chasingPosZ; + double d2 = 10.0D; + if (d5 > d2) { + this.prevChasingPosX = this.chasingPosX = this.posX; + } + + if (d1 > d2) { + this.prevChasingPosZ = this.chasingPosZ = this.posZ; + } + + if (d0 > d2) { + this.prevChasingPosY = this.chasingPosY = this.posY; + } + + if (d5 < -d2) { + this.prevChasingPosX = this.chasingPosX = this.posX; + } + + if (d1 < -d2) { + this.prevChasingPosZ = this.chasingPosZ = this.posZ; + } + + if (d0 < -d2) { + this.prevChasingPosY = this.chasingPosY = this.posY; + } + + this.chasingPosX += d5 * 0.25D; + this.chasingPosZ += d1 * 0.25D; + this.chasingPosY += d0 * 0.25D; + if (this.ridingEntity == null) { + this.startMinecartRidingCoordinate = null; + } + + { + this.foodStats.onUpdate(this); + this.triggerAchievement(StatList.minutesPlayedStat); + if (this.isEntityAlive()) { + this.triggerAchievement(StatList.timeSinceDeathStat); + } + } + + int i = 29999999; + double d3 = MathHelper.clamp_double(this.posX, -2.9999999E7D, 2.9999999E7D); + double d4 = MathHelper.clamp_double(this.posZ, -2.9999999E7D, 2.9999999E7D); + if (d3 != this.posX || d4 != this.posZ) { + this.setPosition(d3, this.posY, d4); + } + + } + + /**+ + * Return the amount of time this entity should stay in a portal + * before being transported. + */ + public int getMaxInPortalTime() { + return this.capabilities.disableDamage ? 0 : 80; + } + + protected String getSwimSound() { + return "game.player.swim"; + } + + protected String getSplashSound() { + return "game.player.swim.splash"; + } + + /**+ + * Return the amount of cooldown before this entity can use a + * portal again. + */ + public int getPortalCooldown() { + return 10; + } + + public void playSound(String s, float f, float f1) { + this.worldObj.playSoundToNearExcept(this, s, f, f1); + } + + /**+ + * Plays sounds and makes particles for item in use state + */ + protected void updateItemUse(ItemStack itemStackIn, int parInt1) { + if (itemStackIn.getItemUseAction() == EnumAction.DRINK) { + this.playSound("random.drink", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (itemStackIn.getItemUseAction() == EnumAction.EAT) { + for (int i = 0; i < parInt1; ++i) { + Vec3 vec3 = new Vec3(((double) this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + vec3 = vec3.rotatePitch(-this.rotationPitch * 3.1415927F / 180.0F); + vec3 = vec3.rotateYaw(-this.rotationYaw * 3.1415927F / 180.0F); + double d0 = (double) (-this.rand.nextFloat()) * 0.6D - 0.3D; + Vec3 vec31 = new Vec3(((double) this.rand.nextFloat() - 0.5D) * 0.3D, d0, 0.6D); + vec31 = vec31.rotatePitch(-this.rotationPitch * 3.1415927F / 180.0F); + vec31 = vec31.rotateYaw(-this.rotationYaw * 3.1415927F / 180.0F); + vec31 = vec31.addVector(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + if (itemStackIn.getHasSubtypes()) { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, + vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, + new int[] { Item.getIdFromItem(itemStackIn.getItem()), itemStackIn.getMetadata() }); + } else { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, + vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, + new int[] { Item.getIdFromItem(itemStackIn.getItem()) }); + } + } + + this.playSound("random.eat", 0.5F + 0.5F * (float) this.rand.nextInt(2), + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + } + + /**+ + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() { + if (this.itemInUse != null) { + this.updateItemUse(this.itemInUse, 16); + int i = this.itemInUse.stackSize; + ItemStack itemstack = this.itemInUse.onItemUseFinish(this.worldObj, this); + if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) { + this.inventory.mainInventory[this.inventory.currentItem] = itemstack; + if (itemstack.stackSize == 0) { + this.inventory.mainInventory[this.inventory.currentItem] = null; + } + } + + this.clearItemInUse(); + } + + } + + public void handleStatusUpdate(byte b0) { + if (b0 == 9) { + this.onItemUseFinish(); + } else if (b0 == 23) { + this.hasReducedDebug = false; + } else if (b0 == 22) { + this.hasReducedDebug = true; + } else { + super.handleStatusUpdate(b0); + } + + } + + /**+ + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + + /**+ + * set current crafting inventory back to the 2x2 square + */ + protected void closeScreen() { + this.openContainer = this.inventoryContainer; + } + + /**+ + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + if (this.isSneaking()) { + this.mountEntity((Entity) null); + this.setSneaking(false); + } else { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + float f = this.rotationYaw; + float f1 = this.rotationPitch; + super.updateRidden(); + this.prevCameraYaw = this.cameraYaw; + this.cameraYaw = 0.0F; + this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + if (this.ridingEntity instanceof EntityPig) { + this.rotationPitch = f1; + this.rotationYaw = f; + this.renderYawOffset = ((EntityPig) this.ridingEntity).renderYawOffset; + } + + } + } + + /**+ + * Keeps moving the entity up so it isn't colliding with blocks + * and other requirements for this entity to be spawned (only + * actually used on players though its also on Entity) + */ + public void preparePlayerToSpawn() { + this.setSize(0.6F, 1.8F); + super.preparePlayerToSpawn(); + this.setHealth(this.getMaxHealth()); + this.deathTime = 0; + } + + protected void updateEntityActionState() { + super.updateEntityActionState(); + this.updateArmSwingProgress(); + this.rotationYawHead = this.rotationYaw; + } + + /**+ + * Called frequently so the entity can update its state every + * tick as required. For example, zombies and skeletons use this + * to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.flyToggleTimer > 0) { + --this.flyToggleTimer; + } + + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL + && this.worldObj.getGameRules().getBoolean("naturalRegeneration")) { + if (this.getHealth() < this.getMaxHealth() && this.ticksExisted % 20 == 0) { + this.heal(1.0F); + } + + if (this.foodStats.needFood() && this.ticksExisted % 10 == 0) { + this.foodStats.setFoodLevel(this.foodStats.getFoodLevel() + 1); + } + } + + this.inventory.decrementAnimations(); + this.prevCameraYaw = this.cameraYaw; + super.onLivingUpdate(); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.setBaseValue((double) this.capabilities.getWalkSpeed()); + + this.jumpMovementFactor = this.speedInAir; + if (this.isSprinting()) { + this.jumpMovementFactor = (float) ((double) this.jumpMovementFactor + (double) this.speedInAir * 0.3D); + } + + this.setAIMoveSpeed((float) iattributeinstance.getAttributeValue()); + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f1 = (float) (Math.atan(-this.motionY * 0.20000000298023224D) * 15.0D); + if (f > 0.1F) { + f = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) { + f = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) { + f1 = 0.0F; + } + + this.cameraYaw += (f - this.cameraYaw) * 0.4F; + this.cameraPitch += (f1 - this.cameraPitch) * 0.8F; + if (this.getHealth() > 0.0F && !this.isSpectator()) { + AxisAlignedBB axisalignedbb = null; + if (this.ridingEntity != null && !this.ridingEntity.isDead) { + axisalignedbb = this.getEntityBoundingBox().union(this.ridingEntity.getEntityBoundingBox()).expand(1.0D, + 0.0D, 1.0D); + } else { + axisalignedbb = this.getEntityBoundingBox().expand(1.0D, 0.5D, 1.0D); + } + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, axisalignedbb); + + for (int i = 0; i < list.size(); ++i) { + Entity entity = (Entity) list.get(i); + if (!entity.isDead) { + this.collideWithPlayer(entity); + } + } + } + + } + + private void collideWithPlayer(Entity parEntity) { + parEntity.onCollideWithPlayer(this); + } + + public int getScore() { + return this.dataWatcher.getWatchableObjectInt(18); + } + + /**+ + * Set player's score + */ + public void setScore(int parInt1) { + this.dataWatcher.updateObject(18, Integer.valueOf(parInt1)); + } + + /**+ + * Add to player's score + */ + public void addScore(int parInt1) { + int i = this.getScore(); + this.dataWatcher.updateObject(18, Integer.valueOf(i + parInt1)); + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + this.setSize(0.2F, 0.2F); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionY = 0.10000000149011612D; + if (this.getName().equals("Notch")) { + this.dropItem(new ItemStack(Items.apple, 1), true, false); + } + + if (!this.worldObj.getGameRules().getBoolean("keepInventory")) { + this.inventory.dropAllItems(); + } + + if (damagesource != null) { + this.motionX = (double) (-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * 3.1415927F / 180.0F) + * 0.1F); + this.motionZ = (double) (-MathHelper.sin((this.attackedAtYaw + this.rotationYaw) * 3.1415927F / 180.0F) + * 0.1F); + } else { + this.motionX = this.motionZ = 0.0D; + } + + this.triggerAchievement(StatList.deathsStat); + this.func_175145_a(StatList.timeSinceDeathStat); + } + + /**+ + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "game.player.hurt"; + } + + /**+ + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "game.player.die"; + } + + /**+ + * Adds a value to the player score. Currently not actually used + * and the entity passed in does nothing. Args: entity, + * scoreToAdd + */ + public void addToPlayerScore(Entity entity, int i) { + this.addScore(i); + Collection collection = this.getWorldScoreboard() + .getObjectivesFromCriteria(IScoreObjectiveCriteria.totalKillCount); + if (entity instanceof EntityPlayer) { + this.triggerAchievement(StatList.playerKillsStat); + collection.addAll( + this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.playerKillCount)); + collection.addAll(this.func_175137_e(entity)); + } else { + this.triggerAchievement(StatList.mobKillsStat); + } + + for (ScoreObjective scoreobjective : (Collection) collection) { + Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective); + score.func_96648_a(); + } + + } + + private Collection func_175137_e(Entity parEntity) { + ScorePlayerTeam scoreplayerteam = this.getWorldScoreboard().getPlayersTeam(this.getName()); + if (scoreplayerteam != null) { + int i = scoreplayerteam.getChatFormat().getColorIndex(); + if (i >= 0 && i < IScoreObjectiveCriteria.field_178793_i.length) { + for (ScoreObjective scoreobjective : this.getWorldScoreboard() + .getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178793_i[i])) { + Score score = this.getWorldScoreboard().getValueFromObjective(parEntity.getName(), scoreobjective); + score.func_96648_a(); + } + } + } + + ScorePlayerTeam scoreplayerteam1 = this.getWorldScoreboard().getPlayersTeam(parEntity.getName()); + if (scoreplayerteam1 != null) { + int j = scoreplayerteam1.getChatFormat().getColorIndex(); + if (j >= 0 && j < IScoreObjectiveCriteria.field_178792_h.length) { + return this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178792_h[j]); + } + } + + return Lists.newArrayList(); + } + + /**+ + * Called when player presses the drop item key + */ + public EntityItem dropOneItem(boolean flag) { + return this.dropItem(this.inventory.decrStackSize(this.inventory.currentItem, + flag && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, + true); + } + + /**+ + * Args: itemstack, flag + */ + public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean unused) { + return this.dropItem(itemStackIn, false, false); + } + + public EntityItem dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem) { + if (droppedItem == null) { + return null; + } else if (droppedItem.stackSize == 0) { + return null; + } else { + double d0 = this.posY - 0.30000001192092896D + (double) this.getEyeHeight(); + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, d0, this.posZ, droppedItem); + entityitem.setPickupDelay(40); + if (traceItem) { + entityitem.setThrower(this.getName()); + } + + if (dropAround) { + float f = this.rand.nextFloat() * 0.5F; + float f1 = this.rand.nextFloat() * 3.1415927F * 2.0F; + entityitem.motionX = (double) (-MathHelper.sin(f1) * f); + entityitem.motionZ = (double) (MathHelper.cos(f1) * f); + entityitem.motionY = 0.20000000298023224D; + } else { + float f2 = 0.3F; + entityitem.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F) * f2); + entityitem.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F) * f2); + entityitem.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * 3.1415927F) * f2 + 0.1F); + float f3 = this.rand.nextFloat() * 3.1415927F * 2.0F; + f2 = 0.02F * this.rand.nextFloat(); + entityitem.motionX += Math.cos((double) f3) * (double) f2; + entityitem.motionY += (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + entityitem.motionZ += Math.sin((double) f3) * (double) f2; + } + + this.joinEntityItemWithWorld(entityitem); + if (traceItem) { + this.triggerAchievement(StatList.dropStat); + } + + return entityitem; + } + } + + /**+ + * Joins the passed in entity item with the world. Args: + * entityItem + */ + protected void joinEntityItemWithWorld(EntityItem entityitem) { + this.worldObj.spawnEntityInWorld(entityitem); + } + + /**+ + * Block hardness will be further counted in + * net/minecraft/block/Block.getPlayerRelativeBlockHardness + */ + public float getToolDigEfficiency(Block parBlock) { + float f = this.inventory.getStrVsBlock(parBlock); + if (f > 1.0F) { + int i = EnchantmentHelper.getEfficiencyModifier(this); + ItemStack itemstack = this.inventory.getCurrentItem(); + if (i > 0 && itemstack != null) { + f += (float) (i * i + 1); + } + } + + if (this.isPotionActive(Potion.digSpeed)) { + f *= 1.0F + (float) (this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F; + } + + if (this.isPotionActive(Potion.digSlowdown)) { + float f1 = 1.0F; + switch (this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) { + case 0: + f1 = 0.3F; + break; + case 1: + f1 = 0.09F; + break; + case 2: + f1 = 0.0027F; + break; + case 3: + default: + f1 = 8.1E-4F; + } + + f *= f1; + } + + if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) { + f /= 5.0F; + } + + if (!this.onGround) { + f /= 5.0F; + } + + return f; + } + + /**+ + * Checks if the player has the ability to harvest a block + * (checks current inventory item for a tool if necessary) + */ + public boolean canHarvestBlock(Block blockToHarvest) { + return this.inventory.canHeldItemHarvest(blockToHarvest); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + this.entityUniqueID = getUUID(this.gameProfile); + NBTTagList nbttaglist = nbttagcompound.getTagList("Inventory", 10); + this.inventory.readFromNBT(nbttaglist); + this.inventory.currentItem = nbttagcompound.getInteger("SelectedItemSlot"); + this.sleeping = nbttagcompound.getBoolean("Sleeping"); + this.sleepTimer = nbttagcompound.getShort("SleepTimer"); + this.experience = nbttagcompound.getFloat("XpP"); + this.experienceLevel = nbttagcompound.getInteger("XpLevel"); + this.experienceTotal = nbttagcompound.getInteger("XpTotal"); + this.xpSeed = nbttagcompound.getInteger("XpSeed"); + if (this.xpSeed == 0) { + this.xpSeed = this.rand.nextInt(); + } + + this.setScore(nbttagcompound.getInteger("Score")); + if (this.sleeping) { + this.playerLocation = new BlockPos(this); + this.wakeUpPlayer(true, true, false); + } + + if (nbttagcompound.hasKey("SpawnX", 99) && nbttagcompound.hasKey("SpawnY", 99) + && nbttagcompound.hasKey("SpawnZ", 99)) { + this.spawnChunk = new BlockPos(nbttagcompound.getInteger("SpawnX"), nbttagcompound.getInteger("SpawnY"), + nbttagcompound.getInteger("SpawnZ")); + this.spawnForced = nbttagcompound.getBoolean("SpawnForced"); + } + + this.foodStats.readNBT(nbttagcompound); + this.capabilities.readCapabilitiesFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("EnderItems", 9)) { + NBTTagList nbttaglist1 = nbttagcompound.getTagList("EnderItems", 10); + this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); + nbttagcompound.setInteger("SelectedItemSlot", this.inventory.currentItem); + nbttagcompound.setBoolean("Sleeping", this.sleeping); + nbttagcompound.setShort("SleepTimer", (short) this.sleepTimer); + nbttagcompound.setFloat("XpP", this.experience); + nbttagcompound.setInteger("XpLevel", this.experienceLevel); + nbttagcompound.setInteger("XpTotal", this.experienceTotal); + nbttagcompound.setInteger("XpSeed", this.xpSeed); + nbttagcompound.setInteger("Score", this.getScore()); + if (this.spawnChunk != null) { + nbttagcompound.setInteger("SpawnX", this.spawnChunk.getX()); + nbttagcompound.setInteger("SpawnY", this.spawnChunk.getY()); + nbttagcompound.setInteger("SpawnZ", this.spawnChunk.getZ()); + nbttagcompound.setBoolean("SpawnForced", this.spawnForced); + } + + this.foodStats.writeNBT(nbttagcompound); + this.capabilities.writeCapabilitiesToNBT(nbttagcompound); + nbttagcompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); + ItemStack itemstack = this.inventory.getCurrentItem(); + if (itemstack != null && itemstack.getItem() != null) { + nbttagcompound.setTag("SelectedItem", itemstack.writeToNBT(new NBTTagCompound())); + } + + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (this.capabilities.disableDamage && !damagesource.canHarmInCreative()) { + return false; + } else { + this.entityAge = 0; + if (this.getHealth() <= 0.0F) { + return false; + } else { + if (this.isPlayerSleeping()) { + this.wakeUpPlayer(true, true, false); + } + + if (damagesource.isDifficultyScaled()) { + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) { + f = 0.0F; + } + + if (this.worldObj.getDifficulty() == EnumDifficulty.EASY) { + f = f / 2.0F + 1.0F; + } + + if (this.worldObj.getDifficulty() == EnumDifficulty.HARD) { + f = f * 3.0F / 2.0F; + } + } + + if (f == 0.0F) { + return false; + } else { + Entity entity = damagesource.getEntity(); + if (entity instanceof EntityArrow && ((EntityArrow) entity).shootingEntity != null) { + entity = ((EntityArrow) entity).shootingEntity; + } + + return super.attackEntityFrom(damagesource, f); + } + } + } + } + + public boolean canAttackPlayer(EntityPlayer entityplayer) { + Team team = this.getTeam(); + Team team1 = entityplayer.getTeam(); + return team == null ? true : (!team.isSameTeam(team1) ? true : team.getAllowFriendlyFire()); + } + + protected void damageArmor(float f) { + this.inventory.damageArmor(f); + } + + /**+ + * Returns the current armor value as determined by a call to + * InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return this.inventory.getTotalArmorValue(); + } + + /**+ + * When searching for vulnerable players, if a player is + * invisible, the return value of this is the chance of seeing + * them anyway. + */ + public float getArmorVisibility() { + int i = 0; + + for (ItemStack itemstack : this.inventory.armorInventory) { + if (itemstack != null) { + ++i; + } + } + + return (float) i / (float) this.inventory.armorInventory.length; + } + + /**+ + * Deals damage to the entity. If its a EntityPlayer then will + * take damage from the armor first and then health second with + * the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource damagesource, float f) { + if (!this.isEntityInvulnerable(damagesource)) { + if (!damagesource.isUnblockable() && this.isBlocking() && f > 0.0F) { + f = (1.0F + f) * 0.5F; + } + + f = this.applyArmorCalculations(damagesource, f); + f = this.applyPotionDamageCalculations(damagesource, f); + float f1 = f; + f = Math.max(f - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (f1 - f)); + if (f != 0.0F) { + this.addExhaustion(damagesource.getHungerDamage()); + float f2 = this.getHealth(); + this.setHealth(this.getHealth() - f); + this.getCombatTracker().trackDamage(damagesource, f2, f); + if (f < 3.4028235E37F) { + this.addStat(StatList.damageTakenStat, Math.round(f * 10.0F)); + } + + } + } + } + + public void openEditSign(TileEntitySign var1) { + } + + public void openEditCommandBlock(CommandBlockLogic var1) { + } + + public void displayVillagerTradeGui(IMerchant var1) { + } + + /**+ + * Displays the GUI for interacting with a chest inventory. + * Args: chestInventory + */ + public void displayGUIChest(IInventory var1) { + } + + public void displayGUIHorse(EntityHorse var1, IInventory var2) { + } + + public void displayGui(IInteractionObject var1) { + } + + /**+ + * Displays the GUI for interacting with a book. + */ + public void displayGUIBook(ItemStack var1) { + } + + public boolean interactWith(Entity parEntity) { + if (this.isSpectator()) { + if (parEntity instanceof IInventory) { + this.displayGUIChest((IInventory) parEntity); + } + + return false; + } else { + ItemStack itemstack = this.getCurrentEquippedItem(); + ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; + if (!parEntity.interactFirst(this)) { + if (itemstack != null && parEntity instanceof EntityLivingBase) { + if (this.capabilities.isCreativeMode) { + itemstack = itemstack1; + } + + if (itemstack.interactWithEntity(this, (EntityLivingBase) parEntity)) { + if (itemstack.stackSize <= 0 && !this.capabilities.isCreativeMode) { + this.destroyCurrentEquippedItem(); + } + + return true; + } + } else if (MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("clickToRide") && itemstack == null && parEntity instanceof EntityPlayer) { + EntityPlayer otherPlayer = (EntityPlayer) parEntity; + while (otherPlayer.riddenByEntity instanceof EntityPlayer) { + otherPlayer = (EntityPlayer) otherPlayer.riddenByEntity; + } + if (otherPlayer.riddenByEntity == null && otherPlayer != this) { + mountEntity(otherPlayer); + return true; + } + } + + return false; + } else { + if (itemstack != null && itemstack == this.getCurrentEquippedItem()) { + if (itemstack.stackSize <= 0 && !this.capabilities.isCreativeMode) { + this.destroyCurrentEquippedItem(); + } else if (itemstack.stackSize < itemstack1.stackSize && this.capabilities.isCreativeMode) { + itemstack.stackSize = itemstack1.stackSize; + } + } + + return true; + } + } + } + + /**+ + * Returns the currently being used item by the player. + */ + public ItemStack getCurrentEquippedItem() { + return this.inventory.getCurrentItem(); + } + + /**+ + * Destroys the currently equipped item from the player's + * inventory. + */ + public void destroyCurrentEquippedItem() { + this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack) null); + } + + /**+ + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return -0.35D; + } + + /**+ + * Attacks for the player the targeted entity with the currently + * equipped item. The equipped item has hitEntity called on it. + * Args: targetEntity + */ + public void attackTargetEntityWithCurrentItem(Entity entity) { + if (entity.canAttackWithItem()) { + if (!entity.hitByEntity(this)) { + float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + float f1 = 0.0F; + if (entity instanceof EntityLivingBase) { + f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), + ((EntityLivingBase) entity).getCreatureAttribute()); + } else { + f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), EnumCreatureAttribute.UNDEFINED); + } + + i = i + EnchantmentHelper.getKnockbackModifier(this); + if (this.isSprinting()) { + ++i; + } + + if (f > 0.0F || f1 > 0.0F) { + boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() + && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null + && entity instanceof EntityLivingBase; + if (flag && f > 0.0F) { + f *= 1.5F; + } + + f = f + f1; + boolean flag1 = false; + int j = EnchantmentHelper.getFireAspectModifier(this); + if (entity instanceof EntityLivingBase && j > 0 && !entity.isBurning()) { + flag1 = true; + entity.setFire(1); + } + + double d0 = entity.motionX; + double d1 = entity.motionY; + double d2 = entity.motionZ; + boolean flag2 = entity.attackEntityFrom(DamageSource.causePlayerDamage(this), f); + if (flag2) { + if (i > 0) { + entity.addVelocity( + (double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i + * 0.5F), + 0.1D, (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i + * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + + if (entity instanceof EntityPlayerMP && entity.velocityChanged) { + ((EntityPlayerMP) entity).playerNetServerHandler + .sendPacket(new S12PacketEntityVelocity(entity)); + entity.velocityChanged = false; + entity.motionX = d0; + entity.motionY = d1; + entity.motionZ = d2; + } + + if (flag) { + this.onCriticalHit(entity); + } + + if (f1 > 0.0F) { + this.onEnchantmentCritical(entity); + } + + if (f >= 18.0F) { + this.triggerAchievement(AchievementList.overkill); + } + + this.setLastAttacker(entity); + if (entity instanceof EntityLivingBase) { + EnchantmentHelper.applyThornEnchantments((EntityLivingBase) entity, this); + } + + EnchantmentHelper.applyArthropodEnchantments(this, entity); + ItemStack itemstack = this.getCurrentEquippedItem(); + Object object = entity; + if (entity instanceof EntityDragonPart) { + IEntityMultiPart ientitymultipart = ((EntityDragonPart) entity).entityDragonObj; + if (ientitymultipart instanceof EntityLivingBase) { + object = (EntityLivingBase) ientitymultipart; + } + } + + if (itemstack != null && object instanceof EntityLivingBase) { + itemstack.hitEntity((EntityLivingBase) object, this); + if (itemstack.stackSize <= 0) { + this.destroyCurrentEquippedItem(); + } + } + + if (entity instanceof EntityLivingBase) { + this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F)); + if (j > 0) { + entity.setFire(j * 4); + } + } + + this.addExhaustion(0.3F); + } else if (flag1) { + entity.extinguish(); + } + } + + } + } + } + + /**+ + * Called when the player performs a critical hit on the Entity. + * Args: entity that was hit critically + */ + public void onCriticalHit(Entity var1) { + } + + public void onEnchantmentCritical(Entity var1) { + } + + public void respawnPlayer() { + } + + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + super.setDead(); + this.inventoryContainer.onContainerClosed(this); + if (this.openContainer != null) { + this.openContainer.onContainerClosed(this); + } + + } + + /**+ + * Checks if this entity is inside of an opaque block + */ + public boolean isEntityInsideOpaqueBlock() { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + + /**+ + * returns true if this is an EntityPlayerSP, or the logged in + * player. + */ + public boolean isUser() { + return false; + } + + /**+ + * Returns the GameProfile for this player + */ + public GameProfile getGameProfile() { + return this.gameProfile; + } + + public EntityPlayer.EnumStatus trySleep(BlockPos blockpos) { + { + if (this.isPlayerSleeping() || !this.isEntityAlive()) { + return EntityPlayer.EnumStatus.OTHER_PROBLEM; + } + + if (!this.worldObj.provider.isSurfaceWorld()) { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_HERE; + } + + if (this.worldObj.isDaytime()) { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW; + } + + if (Math.abs(this.posX - (double) blockpos.getX()) > 3.0D + || Math.abs(this.posY - (double) blockpos.getY()) > 2.0D + || Math.abs(this.posZ - (double) blockpos.getZ()) > 3.0D) { + return EntityPlayer.EnumStatus.TOO_FAR_AWAY; + } + + double d0 = 8.0D; + double d1 = 5.0D; + List list = this.worldObj.getEntitiesWithinAABB(EntityMob.class, + new AxisAlignedBB((double) blockpos.getX() - d0, (double) blockpos.getY() - d1, + (double) blockpos.getZ() - d0, (double) blockpos.getX() + d0, (double) blockpos.getY() + d1, + (double) blockpos.getZ() + d0)); + if (!list.isEmpty()) { + return EntityPlayer.EnumStatus.NOT_SAFE; + } + } + + if (this.isRiding()) { + this.mountEntity((Entity) null); + } + + this.setSize(0.2F, 0.2F); + if (this.worldObj.isBlockLoaded(blockpos)) { + EnumFacing enumfacing = (EnumFacing) this.worldObj.getBlockState(blockpos) + .getValue(BlockDirectional.FACING); + float f = 0.5F; + float f1 = 0.5F; + switch (enumfacing) { + case SOUTH: + f1 = 0.9F; + break; + case NORTH: + f1 = 0.1F; + break; + case WEST: + f = 0.1F; + break; + case EAST: + f = 0.9F; + } + + this.func_175139_a(enumfacing); + this.setPosition((double) ((float) blockpos.getX() + f), (double) ((float) blockpos.getY() + 0.6875F), + (double) ((float) blockpos.getZ() + f1)); + } else { + this.setPosition((double) ((float) blockpos.getX() + 0.5F), (double) ((float) blockpos.getY() + 0.6875F), + (double) ((float) blockpos.getZ() + 0.5F)); + } + + this.sleeping = true; + this.sleepTimer = 0; + this.playerLocation = blockpos; + this.motionX = this.motionZ = this.motionY = 0.0D; + this.worldObj.updateAllPlayersSleepingFlag(); + + return EntityPlayer.EnumStatus.OK; + } + + private void func_175139_a(EnumFacing parEnumFacing) { + this.renderOffsetX = 0.0F; + this.renderOffsetZ = 0.0F; + switch (parEnumFacing) { + case SOUTH: + this.renderOffsetZ = -1.8F; + break; + case NORTH: + this.renderOffsetZ = 1.8F; + break; + case WEST: + this.renderOffsetX = 1.8F; + break; + case EAST: + this.renderOffsetX = -1.8F; + } + + } + + /**+ + * Wake up the player if they're sleeping. + */ + public void wakeUpPlayer(boolean flag, boolean flag1, boolean flag2) { + this.setSize(0.6F, 1.8F); + IBlockState iblockstate = this.worldObj.getBlockState(this.playerLocation); + if (this.playerLocation != null && iblockstate.getBlock() == Blocks.bed) { + this.worldObj.setBlockState(this.playerLocation, + iblockstate.withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)), 4); + BlockPos blockpos = BlockBed.getSafeExitLocation(this.worldObj, this.playerLocation, 0); + if (blockpos == null) { + blockpos = this.playerLocation.up(); + } + + this.setPosition((double) ((float) blockpos.getX() + 0.5F), (double) ((float) blockpos.getY() + 0.1F), + (double) ((float) blockpos.getZ() + 0.5F)); + } + + this.sleeping = false; + if (flag1) { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + this.sleepTimer = flag ? 0 : 100; + if (flag2) { + this.setSpawnPoint(this.playerLocation, false); + } + + } + + private boolean isInBed() { + return this.worldObj.getBlockState(this.playerLocation).getBlock() == Blocks.bed; + } + + /**+ + * Return null if bed is invalid + */ + public static BlockPos getBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn) { + Block block = worldIn.getBlockState(bedLocation).getBlock(); + if (block != Blocks.bed) { + if (!forceSpawn) { + return null; + } else { + boolean flag = block.func_181623_g(); + boolean flag1 = worldIn.getBlockState(bedLocation.up()).getBlock().func_181623_g(); + return flag && flag1 ? bedLocation : null; + } + } else { + return BlockBed.getSafeExitLocation(worldIn, bedLocation, 0); + } + } + + /**+ + * Returns the orientation of the bed in degrees. + */ + public float getBedOrientationInDegrees() { + if (this.playerLocation != null) { + EnumFacing enumfacing = (EnumFacing) this.worldObj.getBlockState(this.playerLocation) + .getValue(BlockDirectional.FACING); + switch (enumfacing) { + case SOUTH: + return 90.0F; + case NORTH: + return 270.0F; + case WEST: + return 0.0F; + case EAST: + return 180.0F; + } + } + + return 0.0F; + } + + /**+ + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() { + return this.sleeping; + } + + /**+ + * Returns whether or not the player is asleep and the screen + * has fully faded. + */ + public boolean isPlayerFullyAsleep() { + return this.sleeping && this.sleepTimer >= 100; + } + + public int getSleepTimer() { + return this.sleepTimer; + } + + public void addChatComponentMessage(IChatComponent var1) { + } + + public BlockPos getBedLocation() { + return this.spawnChunk; + } + + public boolean isSpawnForced() { + return this.spawnForced; + } + + public void setSpawnPoint(BlockPos pos, boolean forced) { + if (pos != null) { + this.spawnChunk = pos; + this.spawnForced = forced; + } else { + this.spawnChunk = null; + this.spawnForced = false; + } + + } + + /**+ + * Will trigger the specified trigger. + */ + public void triggerAchievement(StatBase achievementIn) { + this.addStat(achievementIn, 1); + } + + /**+ + * Adds a value to a statistic field. + */ + public void addStat(StatBase var1, int var2) { + } + + public void func_175145_a(StatBase var1) { + } + + /**+ + * Causes this entity to do an upwards motion (jumping). + */ + public void jump() { + super.jump(); + this.triggerAchievement(StatList.jumpStat); + if (this.isSprinting()) { + this.addExhaustion(0.8F); + } else { + this.addExhaustion(0.2F); + } + + } + + /**+ + * Moves the entity based on the specified heading. Args: + * strafe, forward + */ + public void moveEntityWithHeading(float f, float f1) { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + if (this.capabilities.isFlying && this.ridingEntity == null) { + double d3 = this.motionY; + float f2 = this.jumpMovementFactor; + this.jumpMovementFactor = this.capabilities.getFlySpeed() * (float) (this.isSprinting() ? 2 : 1); + super.moveEntityWithHeading(f, f1); + this.motionY = d3 * 0.6D; + this.jumpMovementFactor = f2; + } else { + super.moveEntityWithHeading(f, f1); + } + + this.addMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + } + + /**+ + * the movespeed used for the new AI system + */ + public float getAIMoveSpeed() { + return (float) this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + } + + /**+ + * Adds a value to a movement statistic field - like run, walk, + * swin or climb. + */ + public void addMovementStat(double parDouble1, double parDouble2, double parDouble3) { + if (this.ridingEntity == null) { + if (this.isInsideOfMaterial(Material.water)) { + int i = Math.round(MathHelper.sqrt_double( + parDouble1 * parDouble1 + parDouble2 * parDouble2 + parDouble3 * parDouble3) * 100.0F); + if (i > 0) { + this.addStat(StatList.distanceDoveStat, i); + this.addExhaustion(0.015F * (float) i * 0.01F); + } + } else if (this.isInWater()) { + int j = Math.round(MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble3 * parDouble3) * 100.0F); + if (j > 0) { + this.addStat(StatList.distanceSwumStat, j); + this.addExhaustion(0.015F * (float) j * 0.01F); + } + } else if (this.isOnLadder()) { + if (parDouble2 > 0.0D) { + this.addStat(StatList.distanceClimbedStat, (int) Math.round(parDouble2 * 100.0D)); + } + } else if (this.onGround) { + int k = Math.round(MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble3 * parDouble3) * 100.0F); + if (k > 0) { + this.addStat(StatList.distanceWalkedStat, k); + if (this.isSprinting()) { + this.addStat(StatList.distanceSprintedStat, k); + this.addExhaustion(0.099999994F * (float) k * 0.01F); + } else { + if (this.isSneaking()) { + this.addStat(StatList.distanceCrouchedStat, k); + } + + this.addExhaustion(0.01F * (float) k * 0.01F); + } + } + } else { + int l = Math.round(MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble3 * parDouble3) * 100.0F); + if (l > 25) { + this.addStat(StatList.distanceFlownStat, l); + } + } + + } + } + + /**+ + * Adds a value to a mounted movement statistic field - by + * minecart, boat, or pig. + */ + private void addMountedMovementStat(double parDouble1, double parDouble2, double parDouble3) { + if (this.ridingEntity != null) { + int i = Math.round( + MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble2 * parDouble2 + parDouble3 * parDouble3) + * 100.0F); + if (i > 0) { + if (this.ridingEntity instanceof EntityMinecart) { + this.addStat(StatList.distanceByMinecartStat, i); + if (this.startMinecartRidingCoordinate == null) { + this.startMinecartRidingCoordinate = new BlockPos(this); + } else if (this.startMinecartRidingCoordinate.distanceSq( + (double) MathHelper.floor_double(this.posX), (double) MathHelper.floor_double(this.posY), + (double) MathHelper.floor_double(this.posZ)) >= 1000000.0D) { + this.triggerAchievement(AchievementList.onARail); + } + } else if (this.ridingEntity instanceof EntityBoat) { + this.addStat(StatList.distanceByBoatStat, i); + } else if (this.ridingEntity instanceof EntityPig) { + this.addStat(StatList.distanceByPigStat, i); + } else if (this.ridingEntity instanceof EntityHorse) { + this.addStat(StatList.distanceByHorseStat, i); + } + } + } + + } + + public void fall(float f, float f1) { + if (!this.capabilities.allowFlying) { + if (f >= 2.0F) { + this.addStat(StatList.distanceFallenStat, (int) Math.round((double) f * 100.0D)); + } + + super.fall(f, f1); + } + } + + /**+ + * sets the players height back to normal after doing things + * like sleeping and dieing + */ + protected void resetHeight() { + if (!this.isSpectator()) { + super.resetHeight(); + } + + } + + protected String getFallSoundString(int i) { + return i > 4 ? "game.player.hurt.fall.big" : "game.player.hurt.fall.small"; + } + + /**+ + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase entitylivingbase) { + if (entitylivingbase instanceof IMob) { + this.triggerAchievement(AchievementList.killEnemy); + } + + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo) EntityList.entityEggs + .get(Integer.valueOf(EntityList.getEntityID(entitylivingbase))); + if (entitylist$entityegginfo != null) { + this.triggerAchievement(entitylist$entityegginfo.field_151512_d); + } + + } + + /**+ + * Sets the Entity inside a web block. + */ + public void setInWeb() { + if (!this.capabilities.isFlying) { + super.setInWeb(); + } + + } + + public ItemStack getCurrentArmor(int i) { + return this.inventory.armorItemInSlot(i); + } + + /**+ + * Add experience points to player. + */ + public void addExperience(int amount) { + this.addScore(amount); + int i = Integer.MAX_VALUE - this.experienceTotal; + if (amount > i) { + amount = i; + } + + this.experience += (float) amount / (float) this.xpBarCap(); + + for (this.experienceTotal += amount; this.experience >= 1.0F; this.experience /= (float) this.xpBarCap()) { + this.experience = (this.experience - 1.0F) * (float) this.xpBarCap(); + this.addExperienceLevel(1); + } + + } + + public int getXPSeed() { + return this.xpSeed; + } + + public void removeExperienceLevel(int i) { + this.experienceLevel -= i; + if (this.experienceLevel < 0) { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + + this.xpSeed = this.rand.nextInt(); + } + + /**+ + * Add experience levels to this player. + */ + public void addExperienceLevel(int i) { + this.experienceLevel += i; + if (this.experienceLevel < 0) { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + + if (i > 0 && this.experienceLevel % 5 == 0 && (float) this.lastXPSound < (float) this.ticksExisted - 100.0F) { + float f = this.experienceLevel > 30 ? 1.0F : (float) this.experienceLevel / 30.0F; + this.worldObj.playSoundAtEntity(this, "random.levelup", f * 0.75F, 1.0F); + this.lastXPSound = this.ticksExisted; + } + + } + + /**+ + * This method returns the cap amount of experience that the + * experience bar can hold. With each level, the experience cap + * on the player's experience bar is raised by 10. + */ + public int xpBarCap() { + return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 + : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); + } + + /**+ + * increases exhaustion level by supplied amount + */ + public void addExhaustion(float parFloat1) { + if (!this.capabilities.disableDamage) { + this.foodStats.addExhaustion(parFloat1); + } + } + + /**+ + * Returns the player's FoodStats object. + */ + public FoodStats getFoodStats() { + return this.foodStats; + } + + public boolean canEat(boolean ignoreHunger) { + return (ignoreHunger || this.foodStats.needFood()) && !this.capabilities.disableDamage; + } + + /**+ + * Checks if the player's health is not full and not zero. + */ + public boolean shouldHeal() { + return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); + } + + /**+ + * sets the itemInUse when the use item button is clicked. Args: + * itemstack, int maxItemUseDuration + */ + public void setItemInUse(ItemStack itemstack, int i) { + if (itemstack != this.itemInUse) { + this.itemInUse = itemstack; + this.itemInUseCount = i; + this.setEating(true); + } + } + + public boolean isAllowEdit() { + return this.capabilities.allowEdit; + } + + public boolean canPlayerEdit(BlockPos parBlockPos, EnumFacing parEnumFacing, ItemStack parItemStack) { + if (this.capabilities.allowEdit) { + return true; + } else if (parItemStack == null) { + return false; + } else { + BlockPos blockpos = parBlockPos.offset(parEnumFacing.getOpposite()); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + return parItemStack.canPlaceOn(block) || parItemStack.canEditBlocks(); + } + } + + /**+ + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer var1) { + if (this.worldObj.getGameRules().getBoolean("keepInventory")) { + return 0; + } else { + int i = this.experienceLevel * 7; + return i > 100 ? 100 : i; + } + } + + /**+ + * Only use is to identify if class is an instance of player for + * experience dropping + */ + protected boolean isPlayer() { + return true; + } + + public boolean getAlwaysRenderNameTagForRender() { + return true; + } + + /**+ + * Copies the values from the given player into this player if + * boolean par2 is true. Always clones Ender Chest Inventory. + */ + public void clonePlayer(EntityPlayer entityplayer, boolean flag) { + if (flag) { + this.inventory.copyInventory(entityplayer.inventory); + this.setHealth(entityplayer.getHealth()); + this.foodStats = entityplayer.foodStats; + this.experienceLevel = entityplayer.experienceLevel; + this.experienceTotal = entityplayer.experienceTotal; + this.experience = entityplayer.experience; + this.setScore(entityplayer.getScore()); + this.field_181016_an = entityplayer.field_181016_an; + this.field_181017_ao = entityplayer.field_181017_ao; + this.field_181018_ap = entityplayer.field_181018_ap; + } else if (this.worldObj.getGameRules().getBoolean("keepInventory")) { + this.inventory.copyInventory(entityplayer.inventory); + this.experienceLevel = entityplayer.experienceLevel; + this.experienceTotal = entityplayer.experienceTotal; + this.experience = entityplayer.experience; + this.setScore(entityplayer.getScore()); + } + + this.xpSeed = entityplayer.xpSeed; + this.theInventoryEnderChest = entityplayer.theInventoryEnderChest; + this.getDataWatcher().updateObject(10, Byte.valueOf(entityplayer.getDataWatcher().getWatchableObjectByte(10))); + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return !this.capabilities.isFlying; + } + + /**+ + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() { + } + + /**+ + * Sets the player's game mode and sends it to them. + */ + public void setGameType(WorldSettings.GameType var1) { + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.gameProfile.getName(); + } + + /**+ + * Returns the InventoryEnderChest of this player. + */ + public InventoryEnderChest getInventoryEnderChest() { + return this.theInventoryEnderChest; + } + + /**+ + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int i) { + return i == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[i - 1]; + } + + /**+ + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() { + return this.inventory.getCurrentItem(); + } + + /**+ + * Sets the held item, or an armor slot. Slot 0 is held item. + * Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int i, ItemStack itemstack) { + this.inventory.armorInventory[i] = itemstack; + } + + /**+ + * Only used by renderer in EntityLivingBase + * subclasses.\nDetermines if an entity is visible or not to a + * specfic player, if the entity is normally invisible.\nFor + * EntityLivingBase subclasses, returning false when invisible + * will render the entity semitransparent. + */ + public boolean isInvisibleToPlayer(EntityPlayer entityplayer) { + if (!this.isInvisible()) { + return false; + } else if (entityplayer.isSpectator()) { + return false; + } else { + Team team = this.getTeam(); + return team == null || entityplayer == null || entityplayer.getTeam() != team + || !team.getSeeFriendlyInvisiblesEnabled(); + } + } + + public abstract boolean isSpectator(); + + /**+ + * returns the inventory of this entity (only used in + * EntityPlayerMP it seems) + */ + public ItemStack[] getInventory() { + return this.inventory.armorInventory; + } + + public boolean isPushedByWater() { + return !this.capabilities.isFlying; + } + + public Scoreboard getWorldScoreboard() { + return this.worldObj.getScoreboard(); + } + + public Team getTeam() { + return this.getWorldScoreboard().getPlayersTeam(this.getName()); + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + ChatComponentText chatcomponenttext = new ChatComponentText( + ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getName())); + chatcomponenttext.getChatStyle() + .setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getName() + " ")); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getName()); + return chatcomponenttext; + } + + public float getEyeHeight() { + float f = 1.62F; + if (this.isPlayerSleeping()) { + f = 0.2F; + } + + if (this.isSneaking()) { + f -= 0.08F; + } + + return f; + } + + public void setAbsorptionAmount(float f) { + if (f < 0.0F) { + f = 0.0F; + } + + this.getDataWatcher().updateObject(17, Float.valueOf(f)); + } + + public float getAbsorptionAmount() { + return this.getDataWatcher().getWatchableObjectFloat(17); + } + + /**+ + * Gets a players UUID given their GameProfie + */ + public static EaglercraftUUID getUUID(GameProfile profile) { + EaglercraftUUID uuid = profile.getId(); + if (uuid == null) { + uuid = getOfflineUUID(profile.getName()); + } + + return uuid; + } + + public static EaglercraftUUID getOfflineUUID(String username) { + return EaglercraftUUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes(Charsets.UTF_8)); + } + + /**+ + * Check whether this player can open an inventory locked with + * the given LockCode. + */ + public boolean canOpen(LockCode code) { + if (code.isEmpty()) { + return true; + } else { + ItemStack itemstack = this.getCurrentEquippedItem(); + return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) + : false; + } + } + + public boolean isWearing(EnumPlayerModelParts parEnumPlayerModelParts) { + return (this.getDataWatcher().getWatchableObjectByte(10) + & parEnumPlayerModelParts.getPartMask()) == parEnumPlayerModelParts.getPartMask(); + } + + /**+ + * Returns true if the command sender should be sent feedback + * about executed commands + */ + public boolean sendCommandFeedback() { + return MinecraftServer.getServer().worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); + } + + public boolean replaceItemInInventory(int i, ItemStack itemstack) { + if (i >= 0 && i < this.inventory.mainInventory.length) { + this.inventory.setInventorySlotContents(i, itemstack); + return true; + } else { + int j = i - 100; + if (j >= 0 && j < this.inventory.armorInventory.length) { + int l = j + 1; + if (itemstack != null && itemstack.getItem() != null) { + if (itemstack.getItem() instanceof ItemArmor) { + if (EntityLiving.getArmorPosition(itemstack) != l) { + return false; + } + } else if (l != 4 + || itemstack.getItem() != Items.skull && !(itemstack.getItem() instanceof ItemBlock)) { + return false; + } + } + + this.inventory.setInventorySlotContents(j + this.inventory.mainInventory.length, itemstack); + return true; + } else { + int k = i - 200; + if (k >= 0 && k < this.theInventoryEnderChest.getSizeInventory()) { + this.theInventoryEnderChest.setInventorySlotContents(k, itemstack); + return true; + } else { + return false; + } + } + } + } + + /**+ + * Whether the "reducedDebugInfo" option is active for this + * player. + */ + public boolean hasReducedDebug() { + return this.hasReducedDebug; + } + + public void setReducedDebug(boolean reducedDebug) { + this.hasReducedDebug = reducedDebug; + } + + public static enum EnumChatVisibility { + FULL(0, "options.chat.visibility.full"), SYSTEM(1, "options.chat.visibility.system"), + HIDDEN(2, "options.chat.visibility.hidden"); + + private static final EntityPlayer.EnumChatVisibility[] ID_LOOKUP = new EntityPlayer.EnumChatVisibility[values().length]; + private final int chatVisibility; + private final String resourceKey; + + private EnumChatVisibility(int id, String resourceKey) { + this.chatVisibility = id; + this.resourceKey = resourceKey; + } + + public int getChatVisibility() { + return this.chatVisibility; + } + + public static EntityPlayer.EnumChatVisibility getEnumChatVisibility(int id) { + return ID_LOOKUP[id % ID_LOOKUP.length]; + } + + public String getResourceKey() { + return this.resourceKey; + } + + static { + for (EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility : values()) { + ID_LOOKUP[entityplayer$enumchatvisibility.chatVisibility] = entityplayer$enumchatvisibility; + } + + } + } + + public static enum EnumStatus { + OK, NOT_POSSIBLE_HERE, NOT_POSSIBLE_NOW, TOO_FAR_AWAY, OTHER_PROBLEM, NOT_SAFE; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayerMP.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayerMP.java new file mode 100644 index 0000000..43c76b0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayerMP.java @@ -0,0 +1,1155 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFenceGate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWall; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerHorseInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMapBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.NetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C15PacketClientSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S02PacketChat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0APacketUseBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0BPacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1FPacketSetExperience; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S21PacketChunkData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S29PacketSoundEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2FPacketSetSlot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S30PacketWindowItems; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S31PacketWindowProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S42PacketCombatEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S43PacketCamera; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.ItemInWorldManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatisticsFile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.JsonSerializableSet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipeList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ILockableContainer; +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.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityPlayerMP extends EntityPlayer implements ICrafting { + + static { + __checkIntegratedContextValid("net/minecraft/entity/player/EntityPlayerMP"); + } + + private static final Logger logger = LogManager.getLogger(); + private String translator = "en_US"; + public NetHandlerPlayServer playerNetServerHandler; + public final MinecraftServer mcServer; + public final ItemInWorldManager theItemInWorldManager; + public double managedPosX; + public double managedPosZ; + /**+ + * LinkedList that holds the loaded chunks. + */ + public final List loadedChunks = Lists.newLinkedList(); + /**+ + * entities added to this list will be packet29'd to the player + */ + private final List destroyedItemsNetCache = Lists.newLinkedList(); + private final StatisticsFile statsFile; + /**+ + * the total health of the player, includes actual health and + * absorption health. Updated every tick. + */ + private float combinedHealth = Float.MIN_VALUE; + /**+ + * amount of health the client was last set to + */ + private float lastHealth = -1.0E8F; + /**+ + * set to foodStats.GetFoodLevel + */ + private int lastFoodLevel = -99999999; + /**+ + * set to foodStats.getSaturationLevel() == 0.0F each tick + */ + private boolean wasHungry = true; + /**+ + * Amount of experience the client was last set to + */ + private int lastExperience = -99999999; + private int respawnInvulnerabilityTicks = 60; + private EntityPlayer.EnumChatVisibility chatVisibility; + private boolean chatColours = true; + private long playerLastActiveTime = System.currentTimeMillis(); + /**+ + * The entity the player is currently spectating through. + */ + private Entity spectatingEntity = null; + private int currentWindowId; + public boolean isChangingQuantityOnly; + public int ping; + public boolean playerConqueredTheEnd; + public byte[] updateCertificate = null; + + public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, + ItemInWorldManager interactionManager) { + super(worldIn, profile); + interactionManager.thisPlayerMP = this; + this.theItemInWorldManager = interactionManager; + BlockPos blockpos = worldIn.getSpawnPoint(); + if (!worldIn.provider.getHasNoSky() + && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) { + int i = Math.max(5, server.getSpawnProtectionSize() - 6); + int j = MathHelper.floor_double( + worldIn.getWorldBorder().getClosestDistance((double) blockpos.getX(), (double) blockpos.getZ())); + if (j < i) { + i = j; + } + + if (j <= 1) { + i = 1; + } + + blockpos = worldIn.getTopSolidOrLiquidBlock( + blockpos.add(this.rand.nextInt(i * 2) - i, 0, this.rand.nextInt(i * 2) - i)); + } + + this.mcServer = server; + this.statsFile = server.getConfigurationManager().getPlayerStatsFile(this); + this.stepHeight = 0.0F; + this.moveToBlockPosAndAngles(blockpos, 0.0F, 0.0F); + + while (!worldIn.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && this.posY < 255.0D) { + this.setPosition(this.posX, this.posY + 1.0D, this.posZ); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("playerGameType", 99)) { + if (MinecraftServer.getServer().getForceGamemode()) { + this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType()); + } else { + this.theItemInWorldManager + .setGameType(WorldSettings.GameType.getByID(nbttagcompound.getInteger("playerGameType"))); + } + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); + } + + /**+ + * Add experience levels to this player. + */ + public void addExperienceLevel(int levels) { + super.addExperienceLevel(levels); + this.lastExperience = -1; + } + + public void removeExperienceLevel(int levels) { + super.removeExperienceLevel(levels); + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() { + this.openContainer.onCraftGuiOpened(this); + } + + /**+ + * Sends an ENTER_COMBAT packet to the client + */ + public void sendEnterCombat() { + super.sendEnterCombat(); + this.playerNetServerHandler + .sendPacket(new S42PacketCombatEvent(this.getCombatTracker(), S42PacketCombatEvent.Event.ENTER_COMBAT)); + } + + /**+ + * Sends an END_COMBAT packet to the client + */ + public void sendEndCombat() { + super.sendEndCombat(); + this.playerNetServerHandler + .sendPacket(new S42PacketCombatEvent(this.getCombatTracker(), S42PacketCombatEvent.Event.END_COMBAT)); + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.theItemInWorldManager.updateBlockRemoving(); + --this.respawnInvulnerabilityTicks; + if (this.hurtResistantTime > 0) { + --this.hurtResistantTime; + } + + this.openContainer.detectAndSendChanges(); + if (!this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + while (!this.destroyedItemsNetCache.isEmpty()) { + int i = Math.min(this.destroyedItemsNetCache.size(), Integer.MAX_VALUE); + int[] aint = new int[i]; + Iterator iterator = this.destroyedItemsNetCache.iterator(); + int j = 0; + + while (iterator.hasNext() && j < i) { + aint[j++] = ((Integer) iterator.next()).intValue(); + iterator.remove(); + } + + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(aint)); + } + + if (!this.loadedChunks.isEmpty()) { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator1 = this.loadedChunks.iterator(); + ArrayList arraylist1 = Lists.newArrayList(); + + while (iterator1.hasNext() && arraylist.size() < 10) { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator1.next(); + if (chunkcoordintpair != null) { + if (this.worldObj.isBlockLoaded( + new BlockPos(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4))) { + Chunk chunk = this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, + chunkcoordintpair.chunkZPos); + if (chunk.isPopulated()) { + arraylist.add(chunk); + arraylist1.addAll(((WorldServer) this.worldObj).getTileEntitiesIn( + chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, + chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16)); + iterator1.remove(); + } + } + } else { + iterator1.remove(); + } + } + + if (!arraylist.isEmpty()) { + if (arraylist.size() == 1) { + this.playerNetServerHandler + .sendPacket(new S21PacketChunkData((Chunk) arraylist.get(0), true, '\uffff')); + } else { + this.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(arraylist)); + } + + for (TileEntity tileentity : (ArrayList) arraylist1) { + this.sendTileEntityUpdate(tileentity); + } + + for (Chunk chunk1 : (ArrayList) arraylist) { + this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk1); + } + } + } + + Entity entity = this.getSpectatingEntity(); + if (entity != this) { + if (!entity.isEntityAlive()) { + this.setSpectatingEntity(this); + } else { + this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, + entity.rotationPitch); + this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this); + if (this.isSneaking()) { + this.setSpectatingEntity(this); + } + } + } + + } + + public void onUpdateEntity() { + try { + super.onUpdate(); + + for (int i = 0; i < this.inventory.getSizeInventory(); ++i) { + ItemStack itemstack = this.inventory.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().isMap()) { + Packet packet = ((ItemMapBase) itemstack.getItem()).createMapDataPacket(itemstack, this.worldObj, + this); + if (packet != null) { + this.playerNetServerHandler.sendPacket(packet); + } + } + } + + if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() + || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) { + this.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(this.getHealth(), + this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + + if (this.getHealth() + this.getAbsorptionAmount() != this.combinedHealth) { + this.combinedHealth = this.getHealth() + this.getAbsorptionAmount(); + + for (ScoreObjective scoreobjective : this.getWorldScoreboard() + .getObjectivesFromCriteria(IScoreObjectiveCriteria.health)) { + this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective) + .func_96651_a(Arrays.asList(new EntityPlayer[] { this })); + } + } + + if (this.experienceTotal != this.lastExperience) { + this.lastExperience = this.experienceTotal; + this.playerNetServerHandler.sendPacket( + new S1FPacketSetExperience(this.experience, this.experienceTotal, this.experienceLevel)); + } + + if (this.ticksExisted % 20 * 5 == 0 + && !this.getStatFile().hasAchievementUnlocked(AchievementList.exploreAllBiomes)) { + this.updateBiomesExplored(); + } + + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking player"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Player being ticked"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + /**+ + * Updates all biomes that have been explored by this player and + * triggers Adventuring Time if player qualifies. + */ + protected void updateBiomesExplored() { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords( + new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))); + String s = biomegenbase.biomeName; + JsonSerializableSet jsonserializableset = (JsonSerializableSet) this.getStatFile() + .func_150870_b(AchievementList.exploreAllBiomes); + if (jsonserializableset == null) { + jsonserializableset = (JsonSerializableSet) this.getStatFile() + .func_150872_a(AchievementList.exploreAllBiomes, new JsonSerializableSet()); + } + + jsonserializableset.add(s); + if (this.getStatFile().canUnlockAchievement(AchievementList.exploreAllBiomes) + && jsonserializableset.size() >= BiomeGenBase.explorationBiomesList.size()) { + HashSet hashset = Sets.newHashSet(BiomeGenBase.explorationBiomesList); + + for (String s1 : jsonserializableset) { + Iterator iterator = hashset.iterator(); + + while (iterator.hasNext()) { + BiomeGenBase biomegenbase1 = (BiomeGenBase) iterator.next(); + if (biomegenbase1.biomeName.equals(s1)) { + iterator.remove(); + } + } + + if (hashset.isEmpty()) { + break; + } + } + + if (hashset.isEmpty()) { + this.triggerAchievement(AchievementList.exploreAllBiomes); + } + } + + } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource cause) { + if (this.worldObj.getGameRules().getBoolean("showDeathMessages")) { + Team team = this.getTeam(); + if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS) { + if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS) { + this.mcServer.getConfigurationManager().sendMessageToAllTeamMembers(this, + this.getCombatTracker().getDeathMessage()); + } else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM) { + this.mcServer.getConfigurationManager().sendMessageToTeamOrEvryPlayer(this, + this.getCombatTracker().getDeathMessage()); + } + } else { + this.mcServer.getConfigurationManager().sendChatMsg(this.getCombatTracker().getDeathMessage()); + } + } + + if (!this.worldObj.getGameRules().getBoolean("keepInventory")) { + this.inventory.dropAllItems(); + } + + for (ScoreObjective scoreobjective : this.worldObj.getScoreboard() + .getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount)) { + Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective); + score.func_96648_a(); + } + + EntityLivingBase entitylivingbase = this.func_94060_bK(); + if (entitylivingbase != null) { + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo) EntityList.entityEggs + .get(Integer.valueOf(EntityList.getEntityID(entitylivingbase))); + if (entitylist$entityegginfo != null) { + this.triggerAchievement(entitylist$entityegginfo.field_151513_e); + } + + entitylivingbase.addToPlayerScore(this, this.scoreValue); + } + + this.triggerAchievement(StatList.deathsStat); + this.func_175145_a(StatList.timeSinceDeathStat); + this.getCombatTracker().reset(); + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + boolean flag = this.mcServer.isDedicatedServer() && this.canPlayersAttack() + && "fall".equals(damagesource.damageType); + if (!flag && this.respawnInvulnerabilityTicks > 0 && damagesource != DamageSource.outOfWorld) { + return false; + } else { + if (damagesource instanceof EntityDamageSource) { + Entity entity = damagesource.getEntity(); + if (entity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer) entity)) { + return false; + } + + if (entity instanceof EntityArrow) { + EntityArrow entityarrow = (EntityArrow) entity; + if (entityarrow.shootingEntity instanceof EntityPlayer + && !this.canAttackPlayer((EntityPlayer) entityarrow.shootingEntity)) { + return false; + } + } + } + + return super.attackEntityFrom(damagesource, f); + } + } + } + + public boolean canAttackPlayer(EntityPlayer other) { + return !this.canPlayersAttack() ? false : super.canAttackPlayer(other); + } + + /**+ + * Returns if other players can attack this player + */ + private boolean canPlayersAttack() { + return this.mcServer.isPVPEnabled(); + } + + /**+ + * Teleports the entity to another dimension. Params: Dimension + * number to teleport to + */ + public void travelToDimension(int dimensionId) { + if (this.dimension == 1 && dimensionId == 1) { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(4, 0.0F)); + } else { + if (this.dimension == 0 && dimensionId == 1) { + this.triggerAchievement(AchievementList.theEnd); + BlockPos blockpos = this.mcServer.worldServerForDimension(dimensionId).getSpawnCoordinate(); + if (blockpos != null) { + this.playerNetServerHandler.setPlayerLocation((double) blockpos.getX(), (double) blockpos.getY(), + (double) blockpos.getZ(), 0.0F, 0.0F); + } + + dimensionId = 1; + } else { + this.triggerAchievement(AchievementList.portal); + } + + this.mcServer.getConfigurationManager().transferPlayerToDimension(this, dimensionId); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + } + + } + + public boolean isSpectatedByPlayer(EntityPlayerMP player) { + return player.isSpectator() ? this.getSpectatingEntity() == this + : (this.isSpectator() ? false : super.isSpectatedByPlayer(player)); + } + + private void sendTileEntityUpdate(TileEntity parTileEntity) { + if (parTileEntity != null) { + Packet packet = parTileEntity.getDescriptionPacket(); + if (packet != null) { + this.playerNetServerHandler.sendPacket(packet); + } + } + + } + + /**+ + * Called whenever an item is picked up from walking over it. + * Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity parEntity, int parInt1) { + super.onItemPickup(parEntity, parInt1); + this.openContainer.detectAndSendChanges(); + } + + public EntityPlayer.EnumStatus trySleep(BlockPos bedLocation) { + EntityPlayer.EnumStatus entityplayer$enumstatus = super.trySleep(bedLocation); + if (entityplayer$enumstatus == EntityPlayer.EnumStatus.OK) { + S0APacketUseBed s0apacketusebed = new S0APacketUseBed(this, bedLocation); + this.getServerForPlayer().getEntityTracker().sendToAllTrackingEntity(this, s0apacketusebed); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, + this.rotationPitch); + this.playerNetServerHandler.sendPacket(s0apacketusebed); + } + + return entityplayer$enumstatus; + } + + /**+ + * Wake up the player if they're sleeping. + */ + public void wakeUpPlayer(boolean updateWorldFlag, boolean setSpawn, boolean parFlag3) { + if (this.isPlayerSleeping()) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 2)); + } + + super.wakeUpPlayer(updateWorldFlag, setSpawn, parFlag3); + if (this.playerNetServerHandler != null) { + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, + this.rotationPitch); + } + + } + + /**+ + * Called when a player mounts an entity. e.g. mounts a pig, + * mounts a boat. + */ + public void mountEntity(Entity entity) { + Entity entity1 = this.ridingEntity; + super.mountEntity(entity); + if (entity != entity1) { + this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, + this.rotationPitch); + } + + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) { + } + + /**+ + * process player falling based on movement packet + */ + public void handleFalling(double parDouble1, boolean parFlag) { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + if (block.getMaterial() == Material.air) { + Block block1 = this.worldObj.getBlockState(blockpos.down()).getBlock(); + if (block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) { + blockpos = blockpos.down(); + block = this.worldObj.getBlockState(blockpos).getBlock(); + } + } + + super.updateFallState(parDouble1, parFlag, block, blockpos); + } + + public void openEditSign(TileEntitySign tileentitysign) { + tileentitysign.setPlayer(this); + this.playerNetServerHandler.sendPacket(new S36PacketSignEditorOpen(tileentitysign.getPos())); + } + + /**+ + * get the next window id to use + */ + private void getNextWindowId() { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + + public void displayGui(IInteractionObject iinteractionobject) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, + iinteractionobject.getGuiID(), iinteractionobject.getDisplayName())); + this.openContainer = iinteractionobject.createContainer(this.inventory, this); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + } + + /**+ + * Displays the GUI for interacting with a chest inventory. + * Args: chestInventory + */ + public void displayGUIChest(IInventory iinventory) { + if (this.openContainer != this.inventoryContainer) { + this.closeScreen(); + } + + if (iinventory instanceof ILockableContainer) { + ILockableContainer ilockablecontainer = (ILockableContainer) iinventory; + if (ilockablecontainer.isLocked() && !this.canOpen(ilockablecontainer.getLockCode()) + && !this.isSpectator()) { + this.playerNetServerHandler + .sendPacket(new S02PacketChat(new ChatComponentTranslation("container.isLocked", + new Object[] { iinventory.getDisplayName() }), (byte) 2)); + this.playerNetServerHandler.sendPacket( + new S29PacketSoundEffect("random.door_close", this.posX, this.posY, this.posZ, 1.0F, 1.0F)); + return; + } + } + + this.getNextWindowId(); + if (iinventory instanceof IInteractionObject) { + this.playerNetServerHandler.sendPacket( + new S2DPacketOpenWindow(this.currentWindowId, ((IInteractionObject) iinventory).getGuiID(), + iinventory.getDisplayName(), iinventory.getSizeInventory())); + this.openContainer = ((IInteractionObject) iinventory).createContainer(this.inventory, this); + } else { + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:container", + iinventory.getDisplayName(), iinventory.getSizeInventory())); + this.openContainer = new ContainerChest(this.inventory, iinventory, this); + } + + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + } + + public void displayVillagerTradeGui(IMerchant imerchant) { + this.getNextWindowId(); + this.openContainer = new ContainerMerchant(this.inventory, imerchant, this.worldObj); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + InventoryMerchant inventorymerchant = ((ContainerMerchant) this.openContainer).getMerchantInventory(); + IChatComponent ichatcomponent = imerchant.getDisplayName(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:villager", + ichatcomponent, inventorymerchant.getSizeInventory())); + MerchantRecipeList merchantrecipelist = imerchant.getRecipes(this); + if (merchantrecipelist != null) { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + packetbuffer.writeInt(this.currentWindowId); + merchantrecipelist.writeToBuf(packetbuffer); + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", packetbuffer)); + } + + } + + public void displayGUIHorse(EntityHorse entityhorse, IInventory iinventory) { + if (this.openContainer != this.inventoryContainer) { + this.closeScreen(); + } + + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "EntityHorse", + iinventory.getDisplayName(), iinventory.getSizeInventory(), entityhorse.getEntityId())); + this.openContainer = new ContainerHorseInventory(this.inventory, iinventory, entityhorse, this); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + } + + /**+ + * Displays the GUI for interacting with a book. + */ + public void displayGUIBook(ItemStack itemstack) { + Item item = itemstack.getItem(); + if (item == Items.written_book) { + this.playerNetServerHandler + .sendPacket(new S3FPacketCustomPayload("MC|BOpen", new PacketBuffer(Unpooled.buffer()))); + } + + } + + /**+ + * Sends the contents of an inventory slot to the client-side + * Container. This doesn't have to match the actual contents of + * that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container container, int i, ItemStack itemstack) { + if (!(container.getSlot(i) instanceof SlotCrafting)) { + if (!this.isChangingQuantityOnly) { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(container.windowId, i, itemstack)); + } + } + } + + public void sendContainerToPlayer(Container parContainer) { + this.updateCraftingInventory(parContainer, parContainer.getInventory()); + } + + /**+ + * update the crafting window inventory with the items in the + * list + */ + public void updateCraftingInventory(Container container, List list) { + this.playerNetServerHandler.sendPacket(new S30PacketWindowItems(container.windowId, list)); + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + + /**+ + * Sends two ints to the client-side Container. Used for furnace + * burning time, smelting progress, brewing progress, and + * enchanting level. Normally the first int identifies which + * variable to update, and the second contains the new value. + * Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container container, int i, int j) { + this.playerNetServerHandler.sendPacket(new S31PacketWindowProperty(container.windowId, i, j)); + } + + public void func_175173_a(Container container, IInventory iinventory) { + for (int i = 0; i < iinventory.getFieldCount(); ++i) { + this.playerNetServerHandler + .sendPacket(new S31PacketWindowProperty(container.windowId, i, iinventory.getField(i))); + } + + } + + /**+ + * set current crafting inventory back to the 2x2 square + */ + public void closeScreen() { + this.playerNetServerHandler.sendPacket(new S2EPacketCloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + + /**+ + * updates item held by mouse + */ + public void updateHeldItem() { + if (!this.isChangingQuantityOnly) { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + } + + /**+ + * Closes the container the player currently has open. + */ + public void closeContainer() { + this.openContainer.onContainerClosed(this); + this.openContainer = this.inventoryContainer; + } + + public void setEntityActionState(float sneaking, float parFloat2, boolean parFlag, boolean parFlag2) { + if (this.ridingEntity != null) { + if (sneaking >= -1.0F && sneaking <= 1.0F) { + this.moveStrafing = sneaking; + } + + if (parFloat2 >= -1.0F && parFloat2 <= 1.0F) { + this.moveForward = parFloat2; + } + + this.isJumping = parFlag; + this.setSneaking(parFlag2); + } + + } + + /**+ + * Adds a value to a statistic field. + */ + public void addStat(StatBase statbase, int i) { + if (statbase != null) { + this.statsFile.increaseStat(this, statbase, i); + + for (ScoreObjective scoreobjective : this.getWorldScoreboard() + .getObjectivesFromCriteria(statbase.func_150952_k())) { + this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective).increseScore(i); + } + + if (this.statsFile.func_150879_e()) { + this.statsFile.func_150876_a(this); + } + + } + } + + public void func_175145_a(StatBase parStatBase) { + if (parStatBase != null) { + this.statsFile.unlockAchievement(this, parStatBase, 0); + + for (ScoreObjective scoreobjective : this.getWorldScoreboard() + .getObjectivesFromCriteria(parStatBase.func_150952_k())) { + this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective).setScorePoints(0); + } + + if (this.statsFile.func_150879_e()) { + this.statsFile.func_150876_a(this); + } + + } + } + + public void mountEntityAndWakeUp() { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + + if (this.sleeping) { + this.wakeUpPlayer(true, false, false); + } + + } + + /**+ + * this function is called when a players inventory is sent to + * him, lastHealth is updated on any dimension transitions, then + * reset. + */ + public void setPlayerHealthUpdated() { + this.lastHealth = -1.0E8F; + } + + public void addChatComponentMessage(IChatComponent ichatcomponent) { + this.playerNetServerHandler.sendPacket(new S02PacketChat(ichatcomponent)); + } + + /**+ + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() { + this.playerNetServerHandler.sendPacket(new S19PacketEntityStatus(this, (byte) 9)); + super.onItemUseFinish(); + } + + /**+ + * sets the itemInUse when the use item button is clicked. Args: + * itemstack, int maxItemUseDuration + */ + public void setItemInUse(ItemStack stack, int duration) { + super.setItemInUse(stack, duration); + if (stack != null && stack.getItem() != null && stack.getItem().getItemUseAction(stack) == EnumAction.EAT) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 3)); + } + + } + + /**+ + * Copies the values from the given player into this player if + * boolean par2 is true. Always clones Ender Chest Inventory. + */ + public void clonePlayer(EntityPlayer oldPlayer, boolean respawnFromEnd) { + super.clonePlayer(oldPlayer, respawnFromEnd); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + this.destroyedItemsNetCache.addAll(((EntityPlayerMP) oldPlayer).destroyedItemsNetCache); + } + + protected void onNewPotionEffect(PotionEffect id) { + super.onNewPotionEffect(id); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), id)); + } + + protected void onChangedPotionEffect(PotionEffect id, boolean parFlag) { + super.onChangedPotionEffect(id, parFlag); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), id)); + } + + protected void onFinishedPotionEffect(PotionEffect parPotionEffect) { + super.onFinishedPotionEffect(parPotionEffect); + this.playerNetServerHandler.sendPacket(new S1EPacketRemoveEntityEffect(this.getEntityId(), parPotionEffect)); + } + + /**+ + * Sets the position of the entity and updates the 'last' + * variables + */ + public void setPositionAndUpdate(double x, double y, double z) { + this.playerNetServerHandler.setPlayerLocation(x, y, z, this.rotationYaw, this.rotationPitch); + } + + /**+ + * Called when the player performs a critical hit on the Entity. + * Args: entity that was hit critically + */ + public void onCriticalHit(Entity entity) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(entity, 4)); + } + + public void onEnchantmentCritical(Entity entity) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(entity, 5)); + } + + /**+ + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() { + if (this.playerNetServerHandler != null) { + this.playerNetServerHandler.sendPacket(new S39PacketPlayerAbilities(this.capabilities)); + this.updatePotionMetadata(); + } + } + + public WorldServer getServerForPlayer() { + return (WorldServer) this.worldObj; + } + + /**+ + * Sets the player's game mode and sends it to them. + */ + public void setGameType(WorldSettings.GameType gameType) { + this.theItemInWorldManager.setGameType(gameType); + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(3, (float) gameType.getID())); + if (gameType == WorldSettings.GameType.SPECTATOR) { + this.mountEntity((Entity) null); + } else { + this.setSpectatingEntity(this); + } + + this.sendPlayerAbilities(); + this.markPotionsDirty(); + } + + /**+ + * Returns true if the player is in spectator mode. + */ + public boolean isSpectator() { + return this.theItemInWorldManager.getGameType() == WorldSettings.GameType.SPECTATOR; + } + + /**+ + * Send a chat message to the CommandSender + */ + public void addChatMessage(IChatComponent ichatcomponent) { + this.playerNetServerHandler.sendPacket(new S02PacketChat(ichatcomponent)); + } + + /**+ + * Returns {@code true} if the CommandSender is allowed to + * execute the command, {@code false} if not + */ + public boolean canCommandSenderUseCommand(int i, String s) { + if ("seed".equals(s)) { + return true; + } else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) { + return this.mcServer.getConfigurationManager().canSendCommands(this.getGameProfile()); + } else { + return true; + } + } + + /**+ + * Gets the player's IP address. Used in /banip. + */ + public String getPlayerIP() { + return "channel:" + this.playerNetServerHandler.netManager.playerChannel; + } + + public void handleClientSettings(C15PacketClientSettings packetIn) { + this.translator = packetIn.getLang(); + this.chatVisibility = packetIn.getChatVisibility(); + this.chatColours = packetIn.isColorsEnabled(); + this.mcServer.getConfigurationManager().updatePlayerViewDistance(this, packetIn.getViewDistance()); + this.getDataWatcher().updateObject(10, Byte.valueOf((byte) packetIn.getModelPartFlags())); + } + + public EntityPlayer.EnumChatVisibility getChatVisibility() { + return this.chatVisibility; + } + + public void loadResourcePack(String url, String hash) { + this.playerNetServerHandler.sendPacket(new S48PacketResourcePackSend(url, hash)); + } + + /**+ + * Get the position in the world. {@code null} is not + * allowed! If you are not an entity in the world, return + * the coordinates 0, 0, 0 + */ + public BlockPos getPosition() { + return new BlockPos(this.posX, this.posY + 0.5D, this.posZ); + } + + public void markPlayerActive() { + this.playerLastActiveTime = MinecraftServer.getCurrentTimeMillis(); + } + + /**+ + * Gets the stats file for reading achievements + */ + public StatisticsFile getStatFile() { + return this.statsFile; + } + + /**+ + * Sends a packet to the player to remove an entity. + */ + public void removeEntity(Entity parEntity) { + if (parEntity instanceof EntityPlayer) { + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(new int[] { parEntity.getEntityId() })); + } else { + this.destroyedItemsNetCache.add(Integer.valueOf(parEntity.getEntityId())); + } + + } + + /**+ + * Clears potion metadata values if the entity has no potion + * effects. Otherwise, updates potion effect color, ambience, + * and invisibility metadata values + */ + protected void updatePotionMetadata() { + if (this.isSpectator()) { + this.resetPotionEffectMetadata(); + this.setInvisible(true); + } else { + super.updatePotionMetadata(); + } + + this.getServerForPlayer().getEntityTracker().func_180245_a(this); + } + + public Entity getSpectatingEntity() { + return (Entity) (this.spectatingEntity == null ? this : this.spectatingEntity); + } + + public void setSpectatingEntity(Entity entityToSpectate) { + Entity entity = this.getSpectatingEntity(); + this.spectatingEntity = (Entity) (entityToSpectate == null ? this : entityToSpectate); + if (entity != this.spectatingEntity) { + this.playerNetServerHandler.sendPacket(new S43PacketCamera(this.spectatingEntity)); + this.setPositionAndUpdate(this.spectatingEntity.posX, this.spectatingEntity.posY, + this.spectatingEntity.posZ); + } + + } + + /**+ + * Attacks for the player the targeted entity with the currently + * equipped item. The equipped item has hitEntity called on it. + * Args: targetEntity + */ + public void attackTargetEntityWithCurrentItem(Entity targetEntity) { + if (this.theItemInWorldManager.getGameType() == WorldSettings.GameType.SPECTATOR) { + this.setSpectatingEntity(targetEntity); + } else { + super.attackTargetEntityWithCurrentItem(targetEntity); + } + + } + + public long getLastActiveTime() { + return this.playerLastActiveTime; + } + + /**+ + * Returns null which indicates the tab list should just display + * the player's name, return a different value to display the + * specified text instead of the player's name + */ + public IChatComponent getTabListDisplayName() { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EnumPlayerModelParts.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EnumPlayerModelParts.java new file mode 100644 index 0000000..4025aa3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EnumPlayerModelParts.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumPlayerModelParts { + CAPE(0, "cape"), JACKET(1, "jacket"), LEFT_SLEEVE(2, "left_sleeve"), RIGHT_SLEEVE(3, "right_sleeve"), + LEFT_PANTS_LEG(4, "left_pants_leg"), RIGHT_PANTS_LEG(5, "right_pants_leg"), HAT(6, "hat"); + + static { + __checkIntegratedContextValid("net/minecraft/entity/player/EnumPlayerModelParts"); + } + + private final int partId; + private final int partMask; + private final String partName; + private final IChatComponent field_179339_k; + + private EnumPlayerModelParts(int partIdIn, String partNameIn) { + this.partId = partIdIn; + this.partMask = 1 << partIdIn; + this.partName = partNameIn; + this.field_179339_k = new ChatComponentTranslation("options.modelPart." + partNameIn, new Object[0]); + } + + public int getPartMask() { + return this.partMask; + } + + public int getPartId() { + return this.partId; + } + + public String getPartName() { + return this.partName; + } + + public IChatComponent func_179326_d() { + return this.field_179339_k; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/InventoryPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/InventoryPlayer.java new file mode 100644 index 0000000..1d607b4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/InventoryPlayer.java @@ -0,0 +1,756 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player; + +import java.util.concurrent.Callable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryPlayer implements IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/entity/player/InventoryPlayer"); + } + + /**+ + * An array of 36 item stacks indicating the main player + * inventory (including the visible bar). + */ + public ItemStack[] mainInventory = new ItemStack[36]; + /**+ + * An array of 4 item stacks containing the currently worn armor + * pieces. + */ + public ItemStack[] armorInventory = new ItemStack[4]; + public int currentItem; + public EntityPlayer player; + private ItemStack itemStack; + public boolean inventoryChanged; + + public InventoryPlayer(EntityPlayer playerIn) { + this.player = playerIn; + } + + /**+ + * Returns the item stack currently held by the player. + */ + public ItemStack getCurrentItem() { + return this.currentItem < 9 && this.currentItem >= 0 ? this.mainInventory[this.currentItem] : null; + } + + /**+ + * Get the size of the player hotbar inventory + */ + public static int getHotbarSize() { + return 9; + } + + private int getInventorySlotContainItem(Item itemIn) { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemIn) { + return i; + } + } + + return -1; + } + + private int getInventorySlotContainItemAndDamage(Item itemIn, int parInt1) { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemIn + && this.mainInventory[i].getMetadata() == parInt1) { + return i; + } + } + + return -1; + } + + /**+ + * stores an itemstack in the users inventory + */ + private int storeItemStack(ItemStack itemStackIn) { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemStackIn.getItem() + && this.mainInventory[i].isStackable() + && this.mainInventory[i].stackSize < this.mainInventory[i].getMaxStackSize() + && this.mainInventory[i].stackSize < this.getInventoryStackLimit() + && (!this.mainInventory[i].getHasSubtypes() + || this.mainInventory[i].getMetadata() == itemStackIn.getMetadata()) + && ItemStack.areItemStackTagsEqual(this.mainInventory[i], itemStackIn)) { + return i; + } + } + + return -1; + } + + /**+ + * Returns the first item stack that is empty. + */ + public int getFirstEmptyStack() { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] == null) { + return i; + } + } + + return -1; + } + + public void setCurrentItem(Item itemIn, int parInt1, boolean parFlag, boolean parFlag2) { + ItemStack itemstack = this.getCurrentItem(); + int i = parFlag ? this.getInventorySlotContainItemAndDamage(itemIn, parInt1) + : this.getInventorySlotContainItem(itemIn); + if (i >= 0 && i < 9) { + this.currentItem = i; + } else if (parFlag2 && itemIn != null) { + int j = this.getFirstEmptyStack(); + if (j >= 0 && j < 9) { + this.currentItem = j; + } + + if (itemstack == null || !itemstack.isItemEnchantable() + || this.getInventorySlotContainItemAndDamage(itemstack.getItem(), + itemstack.getItemDamage()) != this.currentItem) { + int k = this.getInventorySlotContainItemAndDamage(itemIn, parInt1); + int l; + if (k >= 0) { + l = this.mainInventory[k].stackSize; + this.mainInventory[k] = this.mainInventory[this.currentItem]; + } else { + l = 1; + } + + this.mainInventory[this.currentItem] = new ItemStack(itemIn, l, parInt1); + } + + } + } + + /**+ + * Switch the current item to the next one or the previous one + */ + public void changeCurrentItem(int parInt1) { + if (parInt1 > 0) { + parInt1 = 1; + } + + if (parInt1 < 0) { + parInt1 = -1; + } + + for (this.currentItem -= parInt1; this.currentItem < 0; this.currentItem += 9) { + ; + } + + while (this.currentItem >= 9) { + this.currentItem -= 9; + } + + } + + /**+ + * Removes matching items from the inventory.\n@param itemIn The + * item to match, null ignores.\n@param metadataIn The metadata + * to match, -1 ignores.\n@param removeCount The number of items + * to remove. If less than 1, removes all matching + * items.\n@param itemNBT The NBT data to match, null + * ignores.\n@return The number of items removed from the + * inventory. + */ + public int clearMatchingItems(Item itemIn, int metadataIn, int removeCount, NBTTagCompound itemNBT) { + int i = 0; + + for (int j = 0; j < this.mainInventory.length; ++j) { + ItemStack itemstack = this.mainInventory[j]; + if (itemstack != null && (itemIn == null || itemstack.getItem() == itemIn) + && (metadataIn <= -1 || itemstack.getMetadata() == metadataIn) + && (itemNBT == null || NBTUtil.func_181123_a(itemNBT, itemstack.getTagCompound(), true))) { + int k = removeCount <= 0 ? itemstack.stackSize : Math.min(removeCount - i, itemstack.stackSize); + i += k; + if (removeCount != 0) { + this.mainInventory[j].stackSize -= k; + if (this.mainInventory[j].stackSize == 0) { + this.mainInventory[j] = null; + } + + if (removeCount > 0 && i >= removeCount) { + return i; + } + } + } + } + + for (int l = 0; l < this.armorInventory.length; ++l) { + ItemStack itemstack1 = this.armorInventory[l]; + if (itemstack1 != null && (itemIn == null || itemstack1.getItem() == itemIn) + && (metadataIn <= -1 || itemstack1.getMetadata() == metadataIn) + && (itemNBT == null || NBTUtil.func_181123_a(itemNBT, itemstack1.getTagCompound(), false))) { + int j1 = removeCount <= 0 ? itemstack1.stackSize : Math.min(removeCount - i, itemstack1.stackSize); + i += j1; + if (removeCount != 0) { + this.armorInventory[l].stackSize -= j1; + if (this.armorInventory[l].stackSize == 0) { + this.armorInventory[l] = null; + } + + if (removeCount > 0 && i >= removeCount) { + return i; + } + } + } + } + + if (this.itemStack != null) { + if (itemIn != null && this.itemStack.getItem() != itemIn) { + return i; + } + + if (metadataIn > -1 && this.itemStack.getMetadata() != metadataIn) { + return i; + } + + if (itemNBT != null && !NBTUtil.func_181123_a(itemNBT, this.itemStack.getTagCompound(), false)) { + return i; + } + + int i1 = removeCount <= 0 ? this.itemStack.stackSize : Math.min(removeCount - i, this.itemStack.stackSize); + i += i1; + if (removeCount != 0) { + this.itemStack.stackSize -= i1; + if (this.itemStack.stackSize == 0) { + this.itemStack = null; + } + + if (removeCount > 0 && i >= removeCount) { + return i; + } + } + } + + return i; + } + + /**+ + * This function stores as many items of an ItemStack as + * possible in a matching slot and returns the quantity of left + * over items. + */ + private int storePartialItemStack(ItemStack itemStackIn) { + Item item = itemStackIn.getItem(); + int i = itemStackIn.stackSize; + int j = this.storeItemStack(itemStackIn); + if (j < 0) { + j = this.getFirstEmptyStack(); + } + + if (j < 0) { + return i; + } else { + if (this.mainInventory[j] == null) { + this.mainInventory[j] = new ItemStack(item, 0, itemStackIn.getMetadata()); + if (itemStackIn.hasTagCompound()) { + this.mainInventory[j].setTagCompound((NBTTagCompound) itemStackIn.getTagCompound().copy()); + } + } + + int k = i; + if (i > this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize) { + k = this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize; + } + + if (k > this.getInventoryStackLimit() - this.mainInventory[j].stackSize) { + k = this.getInventoryStackLimit() - this.mainInventory[j].stackSize; + } + + if (k == 0) { + return i; + } else { + i = i - k; + this.mainInventory[j].stackSize += k; + this.mainInventory[j].animationsToGo = 5; + return i; + } + } + } + + /**+ + * Decrement the number of animations remaining. Only called on + * client side. This is used to handle the animation of + * receiving a block. + */ + public void decrementAnimations() { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] != null) { + this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); + } + } + + } + + /**+ + * removed one item of specified Item from inventory (if it is + * in a stack, the stack size will reduce with 1) + */ + public boolean consumeInventoryItem(Item itemIn) { + int i = this.getInventorySlotContainItem(itemIn); + if (i < 0) { + return false; + } else { + if (--this.mainInventory[i].stackSize <= 0) { + this.mainInventory[i] = null; + } + + return true; + } + } + + /**+ + * Checks if a specified Item is inside the inventory + */ + public boolean hasItem(Item itemIn) { + int i = this.getInventorySlotContainItem(itemIn); + return i >= 0; + } + + /**+ + * Adds the item stack to the inventory, returns false if it is + * impossible. + */ + public boolean addItemStackToInventory(final ItemStack itemStackIn) { + if (itemStackIn != null && itemStackIn.stackSize != 0 && itemStackIn.getItem() != null) { + try { + if (itemStackIn.isItemDamaged()) { + int j = this.getFirstEmptyStack(); + if (j >= 0) { + this.mainInventory[j] = ItemStack.copyItemStack(itemStackIn); + this.mainInventory[j].animationsToGo = 5; + itemStackIn.stackSize = 0; + return true; + } else if (this.player.capabilities.isCreativeMode) { + itemStackIn.stackSize = 0; + return true; + } else { + return false; + } + } else { + int i; + while (true) { + i = itemStackIn.stackSize; + itemStackIn.stackSize = this.storePartialItemStack(itemStackIn); + if (itemStackIn.stackSize <= 0 || itemStackIn.stackSize >= i) { + break; + } + } + + if (itemStackIn.stackSize == i && this.player.capabilities.isCreativeMode) { + itemStackIn.stackSize = 0; + return true; + } else { + return itemStackIn.stackSize < i; + } + } + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding item to inventory"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being added"); + crashreportcategory.addCrashSection("Item ID", + Integer.valueOf(Item.getIdFromItem(itemStackIn.getItem()))); + crashreportcategory.addCrashSection("Item data", Integer.valueOf(itemStackIn.getMetadata())); + crashreportcategory.addCrashSectionCallable("Item name", new Callable() { + public String call() throws Exception { + return itemStackIn.getDisplayName(); + } + }); + throw new ReportedException(crashreport); + } + } else { + return false; + } + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + ItemStack[] aitemstack = this.mainInventory; + if (i >= this.mainInventory.length) { + aitemstack = this.armorInventory; + i -= this.mainInventory.length; + } + + if (aitemstack[i] != null) { + if (aitemstack[i].stackSize <= j) { + ItemStack itemstack1 = aitemstack[i]; + aitemstack[i] = null; + return itemstack1; + } else { + ItemStack itemstack = aitemstack[i].splitStack(j); + if (aitemstack[i].stackSize == 0) { + aitemstack[i] = null; + } + + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + ItemStack[] aitemstack = this.mainInventory; + if (i >= this.mainInventory.length) { + aitemstack = this.armorInventory; + i -= this.mainInventory.length; + } + + if (aitemstack[i] != null) { + ItemStack itemstack = aitemstack[i]; + aitemstack[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + ItemStack[] aitemstack = this.mainInventory; + if (i >= aitemstack.length) { + i -= aitemstack.length; + aitemstack = this.armorInventory; + } + + aitemstack[i] = itemstack; + } + + public float getStrVsBlock(Block blockIn) { + float f = 1.0F; + if (this.mainInventory[this.currentItem] != null) { + f *= this.mainInventory[this.currentItem].getStrVsBlock(blockIn); + } + + return f; + } + + /**+ + * Writes the inventory out as a list of compound tags. This is + * where the slot indices are used (+100 for armor, +80 for + * crafting). + */ + public NBTTagList writeToNBT(NBTTagList parNBTTagList) { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte) i); + this.mainInventory[i].writeToNBT(nbttagcompound); + parNBTTagList.appendTag(nbttagcompound); + } + } + + for (int j = 0; j < this.armorInventory.length; ++j) { + if (this.armorInventory[j] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) (j + 100)); + this.armorInventory[j].writeToNBT(nbttagcompound1); + parNBTTagList.appendTag(nbttagcompound1); + } + } + + return parNBTTagList; + } + + /**+ + * Reads from the given tag list and fills the slots in the + * inventory with the correct items. + */ + public void readFromNBT(NBTTagList parNBTTagList) { + this.mainInventory = new ItemStack[36]; + this.armorInventory = new ItemStack[4]; + + for (int i = 0; i < parNBTTagList.tagCount(); ++i) { + NBTTagCompound nbttagcompound = parNBTTagList.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound); + if (itemstack != null) { + if (j >= 0 && j < this.mainInventory.length) { + this.mainInventory[j] = itemstack; + } + + if (j >= 100 && j < this.armorInventory.length + 100) { + this.armorInventory[j - 100] = itemstack; + } + } + } + + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.mainInventory.length + 4; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + ItemStack[] aitemstack = this.mainInventory; + if (i >= aitemstack.length) { + i -= aitemstack.length; + aitemstack = this.armorInventory; + } + + return aitemstack[i]; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return "container.inventory"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return false; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + public boolean canHeldItemHarvest(Block blockIn) { + if (blockIn.getMaterial().isToolNotRequired()) { + return true; + } else { + ItemStack itemstack = this.getStackInSlot(this.currentItem); + return itemstack != null ? itemstack.canHarvestBlock(blockIn) : false; + } + } + + /**+ + * returns a player armor item (as itemstack) contained in + * specified armor slot. + */ + public ItemStack armorItemInSlot(int parInt1) { + return this.armorInventory[parInt1]; + } + + /**+ + * Based on the damage values and maximum damage values of each + * armor item, returns the current armor value. + */ + public int getTotalArmorValue() { + int i = 0; + + for (int j = 0; j < this.armorInventory.length; ++j) { + if (this.armorInventory[j] != null && this.armorInventory[j].getItem() instanceof ItemArmor) { + int k = ((ItemArmor) this.armorInventory[j].getItem()).damageReduceAmount; + i += k; + } + } + + return i; + } + + /**+ + * Damages armor in each slot by the specified amount. + */ + public void damageArmor(float damage) { + damage = damage / 4.0F; + if (damage < 1.0F) { + damage = 1.0F; + } + + for (int i = 0; i < this.armorInventory.length; ++i) { + if (this.armorInventory[i] != null && this.armorInventory[i].getItem() instanceof ItemArmor) { + this.armorInventory[i].damageItem((int) damage, this.player); + if (this.armorInventory[i].stackSize == 0) { + this.armorInventory[i] = null; + } + } + } + + } + + /**+ + * Drop all armor and main inventory items. + */ + public void dropAllItems() { + for (int i = 0; i < this.mainInventory.length; ++i) { + if (this.mainInventory[i] != null) { + this.player.dropItem(this.mainInventory[i], true, false); + this.mainInventory[i] = null; + } + } + + for (int j = 0; j < this.armorInventory.length; ++j) { + if (this.armorInventory[j] != null) { + this.player.dropItem(this.armorInventory[j], true, false); + this.armorInventory[j] = null; + } + } + + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + this.inventoryChanged = true; + } + + /**+ + * Set the stack helds by mouse, used in GUI/Container + */ + public void setItemStack(ItemStack itemStackIn) { + this.itemStack = itemStackIn; + } + + /**+ + * Stack helds by mouse, used in GUI and Containers + */ + public ItemStack getItemStack() { + return this.itemStack; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.player.isDead ? false : entityplayer.getDistanceSqToEntity(this.player) <= 64.0D; + } + + /**+ + * Returns true if the specified ItemStack exists in the + * inventory. + */ + public boolean hasItemStack(ItemStack itemStackIn) { + for (int i = 0; i < this.armorInventory.length; ++i) { + if (this.armorInventory[i] != null && this.armorInventory[i].isItemEqual(itemStackIn)) { + return true; + } + } + + for (int j = 0; j < this.mainInventory.length; ++j) { + if (this.mainInventory[j] != null && this.mainInventory[j].isItemEqual(itemStackIn)) { + return true; + } + } + + return false; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + /**+ + * Copy the ItemStack contents from another InventoryPlayer + * instance + */ + public void copyInventory(InventoryPlayer playerInventory) { + for (int i = 0; i < this.mainInventory.length; ++i) { + this.mainInventory[i] = ItemStack.copyItemStack(playerInventory.mainInventory[i]); + } + + for (int j = 0; j < this.armorInventory.length; ++j) { + this.armorInventory[j] = ItemStack.copyItemStack(playerInventory.armorInventory[j]); + } + + this.currentItem = playerInventory.currentItem; + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.mainInventory.length; ++i) { + this.mainInventory[i] = null; + } + + for (int j = 0; j < this.armorInventory.length; ++j) { + this.armorInventory[j] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/PlayerCapabilities.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/PlayerCapabilities.java new file mode 100644 index 0000000..34db06e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/PlayerCapabilities.java @@ -0,0 +1,91 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player; + +import net.minecraft.nbt.NBTTagCompound; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PlayerCapabilities { + + static { + __checkIntegratedContextValid("net/minecraft/entity/player/PlayerCapabilities"); + } + + public boolean disableDamage; + public boolean isFlying; + public boolean allowFlying; + public boolean isCreativeMode; + /**+ + * Indicates whether the player is allowed to modify the + * surroundings + */ + public boolean allowEdit = true; + private float flySpeed = 0.05F; + private float walkSpeed = 0.1F; + + public void writeCapabilitiesToNBT(NBTTagCompound tagCompound) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setBoolean("invulnerable", this.disableDamage); + nbttagcompound.setBoolean("flying", this.isFlying); + nbttagcompound.setBoolean("mayfly", this.allowFlying); + nbttagcompound.setBoolean("instabuild", this.isCreativeMode); + nbttagcompound.setBoolean("mayBuild", this.allowEdit); + nbttagcompound.setFloat("flySpeed", this.flySpeed); + nbttagcompound.setFloat("walkSpeed", this.walkSpeed); + tagCompound.setTag("abilities", nbttagcompound); + } + + public void readCapabilitiesFromNBT(NBTTagCompound tagCompound) { + if (tagCompound.hasKey("abilities", 10)) { + NBTTagCompound nbttagcompound = tagCompound.getCompoundTag("abilities"); + this.disableDamage = nbttagcompound.getBoolean("invulnerable"); + this.isFlying = nbttagcompound.getBoolean("flying"); + this.allowFlying = nbttagcompound.getBoolean("mayfly"); + this.isCreativeMode = nbttagcompound.getBoolean("instabuild"); + if (nbttagcompound.hasKey("flySpeed", 99)) { + this.flySpeed = nbttagcompound.getFloat("flySpeed"); + this.walkSpeed = nbttagcompound.getFloat("walkSpeed"); + } + + if (nbttagcompound.hasKey("mayBuild", 1)) { + this.allowEdit = nbttagcompound.getBoolean("mayBuild"); + } + } + + } + + public float getFlySpeed() { + return this.flySpeed; + } + + public void setFlySpeed(float speed) { + this.flySpeed = speed; + } + + public float getWalkSpeed() { + return this.walkSpeed; + } + + public void setPlayerWalkSpeed(float speed) { + this.walkSpeed = speed; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityArrow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityArrow.java new file mode 100644 index 0000000..74c594e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityArrow.java @@ -0,0 +1,570 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IProjectile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEnderman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityArrow extends Entity implements IProjectile { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityArrow"); + } + + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + private int inData; + private boolean inGround; + public int canBePickedUp; + public int arrowShake; + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + private int knockbackStrength; + + public EntityArrow(World worldIn) { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityArrow(World worldIn, double x, double y, double z) { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(x, y, z); + } + + public EntityArrow(World worldIn, EntityLivingBase shooter, EntityLivingBase parEntityLivingBase, float parFloat1, + float parFloat2) { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = shooter; + if (shooter instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + + this.posY = shooter.posY + (double) shooter.getEyeHeight() - 0.10000000149011612D; + double d0 = parEntityLivingBase.posX - shooter.posX; + double d1 = parEntityLivingBase.getEntityBoundingBox().minY + (double) (parEntityLivingBase.height / 3.0F) + - this.posY; + double d2 = parEntityLivingBase.posZ - shooter.posZ; + double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + if (d3 >= 1.0E-7D) { + float f = (float) (MathHelper.func_181159_b(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F; + float f1 = (float) (-(MathHelper.func_181159_b(d1, d3) * 180.0D / 3.1415927410125732D)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(shooter.posX + d4, this.posY, shooter.posZ + d5, f, f1); + float f2 = (float) (d3 * 0.20000000298023224D); + this.setThrowableHeading(d0, d1 + (double) f2, d2, parFloat1, parFloat2); + } + } + + public EntityArrow(World worldIn, EntityLivingBase shooter, float velocity) { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = shooter; + if (shooter instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(shooter.posX, shooter.posY + (double) shooter.getEyeHeight(), shooter.posZ, + shooter.rotationYaw, shooter.rotationPitch); + this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F)); + this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F)); + this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * 3.1415927F)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, velocity * 1.5F, 1.0F); + } + + protected void entityInit() { + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + /**+ + * Similar to setArrowHeading, it's point the throwable entity + * to a x, y, z direction. + */ + public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { + float f = MathHelper.sqrt_double(x * x + y * y + z * z); + x = x / (double) f; + y = y / (double) f; + z = z / (double) f; + x = x + this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D + * (double) inaccuracy; + y = y + this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D + * (double) inaccuracy; + z = z + this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D + * (double) inaccuracy; + x = x * (double) velocity; + y = y * (double) velocity; + z = z * (double) velocity; + this.motionX = x; + this.motionY = y; + this.motionZ = z; + float f1 = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(x, z) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(y, (double) f1) * 180.0D + / 3.1415927410125732D); + this.ticksInGround = 0; + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int var9, boolean var10) { + this.setPosition(d0, d1, d2); + this.setRotation(f, f1); + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.motionX = d0; + this.motionY = d1; + this.motionZ = d2; + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(d0, d2) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(d1, (double) f) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + + } + + public boolean isChair = false; + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (isChair) { + if (!(riddenByEntity instanceof EntityPlayer)) { + isChair = false; + setDead(); + } + return; + } + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) + * 180.0D / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f) + * 180.0D / 3.1415927410125732D); + } + + BlockPos blockpos = new BlockPos(this.xTile, this.yTile, this.zTile); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(this.worldObj, blockpos); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(this.worldObj, blockpos, iblockstate); + if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } + } + + if (this.arrowShake > 0) { + --this.arrowShake; + } + + if (this.inGround) { + int j = block.getMetaFromState(iblockstate); + if (block == this.inTile && j == this.inData) { + ++this.ticksInGround; + if (this.ticksInGround >= 1200) { + this.setDead(); + } + } else { + this.inGround = false; + this.motionX *= (double) (this.rand.nextFloat() * 0.2F); + this.motionY *= (double) (this.rand.nextFloat() * 0.2F); + this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + + } else { + ++this.ticksInAir; + Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3, false, true, false); + vec31 = new Vec3(this.posX, this.posY, this.posZ); + vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if (movingobjectposition != null) { + vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, + movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox() + .addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { + float f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double) f1, (double) f1, + (double) f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + if (movingobjectposition1 != null) { + double d1 = vec31.squareDistanceTo(movingobjectposition1.hitVec); + if (d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null && movingobjectposition.entityHit != null + && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer + && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { + movingobjectposition = null; + } + } + + if (movingobjectposition != null) { + if (movingobjectposition.entityHit != null) { + float f2 = MathHelper.sqrt_double( + this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int l = MathHelper.ceiling_double_int((double) f2 * this.damage); + if (this.getIsCritical()) { + l += this.rand.nextInt(l / 2 + 2); + } + + DamageSource damagesource; + if (this.shootingEntity == null) { + damagesource = DamageSource.causeArrowDamage(this, this); + } else { + damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity); + } + + if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) { + movingobjectposition.entityHit.setFire(5); + } + + if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float) l)) { + if (movingobjectposition.entityHit instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) movingobjectposition.entityHit; + entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); + + if (this.knockbackStrength > 0) { + float f7 = MathHelper + .sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (f7 > 0.0F) { + movingobjectposition.entityHit.addVelocity( + this.motionX * (double) this.knockbackStrength * 0.6000000238418579D + / (double) f7, + 0.1D, this.motionZ * (double) this.knockbackStrength * 0.6000000238418579D + / (double) f7); + } + } + + if (this.shootingEntity instanceof EntityLivingBase) { + EnchantmentHelper.applyThornEnchantments(entitylivingbase, this.shootingEntity); + EnchantmentHelper.applyArthropodEnchantments((EntityLivingBase) this.shootingEntity, + entitylivingbase); + } + + if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity + && movingobjectposition.entityHit instanceof EntityPlayer + && this.shootingEntity instanceof EntityPlayerMP) { + ((EntityPlayerMP) this.shootingEntity).playerNetServerHandler + .sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } + + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + if (!(movingobjectposition.entityHit instanceof EntityEnderman)) { + this.setDead(); + } + } else { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } else { + BlockPos blockpos1 = movingobjectposition.getBlockPos(); + this.xTile = blockpos1.getX(); + this.yTile = blockpos1.getY(); + this.zTile = blockpos1.getZ(); + IBlockState iblockstate1 = this.worldObj.getBlockState(blockpos1); + this.inTile = iblockstate1.getBlock(); + this.inData = this.inTile.getMetaFromState(iblockstate1); + this.motionX = (double) ((float) (movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = (double) ((float) (movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = (double) ((float) (movingobjectposition.hitVec.zCoord - this.posZ)); + float f5 = MathHelper.sqrt_double( + this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double) f5 * 0.05000000074505806D; + this.posY -= this.motionY / (double) f5 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double) f5 * 0.05000000074505806D; + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); + if (this.inTile.getMaterial() != Material.air) { + this.inTile.onEntityCollidedWithBlock(this.worldObj, blockpos1, iblockstate1, this); + } + } + } + + if (this.getIsCritical()) { + for (int k = 0; k < 4; ++k) { + this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX + this.motionX * (double) k / 4.0D, + this.posY + this.motionY * (double) k / 4.0D, this.posZ + this.motionZ * (double) k / 4.0D, + -this.motionX, -this.motionY + 0.2D, -this.motionZ, new int[0]); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D + / 3.1415927410125732D); + + for (this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f3) * 180.0D + / 3.1415927410125732D); this.rotationPitch + - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f4 = 0.99F; + float f6 = 0.05F; + if (this.isInWater()) { + for (int i1 = 0; i1 < 4; ++i1) { + float f8 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double) f8, + this.posY - this.motionY * (double) f8, this.posZ - this.motionZ * (double) f8, + this.motionX, this.motionY, this.motionZ, new int[0]); + } + + f4 = 0.6F; + } + + if (this.isWet()) { + this.extinguish(); + } + + this.motionX *= (double) f4; + this.motionY *= (double) f4; + this.motionZ *= (double) f4; + this.motionY -= (double) f6; + this.setPosition(this.posX, this.posY, this.posZ); + this.doBlockCollisions(); + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("xTile", (short) this.xTile); + nbttagcompound.setShort("yTile", (short) this.yTile); + nbttagcompound.setShort("zTile", (short) this.zTile); + nbttagcompound.setShort("life", (short) this.ticksInGround); + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry.getNameForObject(this.inTile); + nbttagcompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setByte("inData", (byte) this.inData); + nbttagcompound.setByte("shake", (byte) this.arrowShake); + nbttagcompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + nbttagcompound.setByte("pickup", (byte) this.canBePickedUp); + nbttagcompound.setDouble("damage", this.damage); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.xTile = nbttagcompound.getShort("xTile"); + this.yTile = nbttagcompound.getShort("yTile"); + this.zTile = nbttagcompound.getShort("zTile"); + this.ticksInGround = nbttagcompound.getShort("life"); + if (nbttagcompound.hasKey("inTile", 8)) { + this.inTile = Block.getBlockFromName(nbttagcompound.getString("inTile")); + } else { + this.inTile = Block.getBlockById(nbttagcompound.getByte("inTile") & 255); + } + + this.inData = nbttagcompound.getByte("inData") & 255; + this.arrowShake = nbttagcompound.getByte("shake") & 255; + this.inGround = nbttagcompound.getByte("inGround") == 1; + if (nbttagcompound.hasKey("damage", 99)) { + this.damage = nbttagcompound.getDouble("damage"); + } + + if (nbttagcompound.hasKey("pickup", 99)) { + this.canBePickedUp = nbttagcompound.getByte("pickup"); + } else if (nbttagcompound.hasKey("player", 99)) { + this.canBePickedUp = nbttagcompound.getBoolean("player") ? 1 : 0; + } + + } + + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) { + if (this.inGround && this.arrowShake <= 0) { + boolean flag = this.canBePickedUp == 1 + || this.canBePickedUp == 2 && entityplayer.capabilities.isCreativeMode; + if (this.canBePickedUp == 1 + && !entityplayer.inventory.addItemStackToInventory(new ItemStack(Items.arrow, 1))) { + flag = false; + } + + if (flag) { + this.playSound("random.pop", 0.2F, + ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + entityplayer.onItemPickup(this, 1); + this.setDead(); + } + + } + } + + /**+ + * returns if this entity triggers Block.onEntityWalking on the + * blocks they walk on. used for spiders and wolves to prevent + * them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public void setDamage(double damageIn) { + this.damage = damageIn; + } + + public double getDamage() { + return this.damage; + } + + /**+ + * Sets the amount of knockback the arrow applies when it hits a + * mob. + */ + public void setKnockbackStrength(int knockbackStrengthIn) { + this.knockbackStrength = knockbackStrengthIn; + } + + /**+ + * If returns false, the item will not inflict any damage + * against entities. + */ + public boolean canAttackWithItem() { + return false; + } + + public float getEyeHeight() { + return 0.0F; + } + + /**+ + * Whether the arrow has a stream of critical hit particles + * flying behind it. + */ + public void setIsCritical(boolean critical) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + if (critical) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -2))); + } + + } + + /**+ + * Whether the arrow has a stream of critical hit particles + * flying behind it. + */ + public boolean getIsCritical() { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityEgg.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityEgg.java new file mode 100644 index 0000000..f8a55e1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityEgg.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityThrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityEgg extends EntityThrowable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityEgg"); + } + + public EntityEgg(World worldIn) { + super(worldIn); + } + + public EntityEgg(World worldIn, EntityLivingBase throwerIn) { + super(worldIn, throwerIn); + } + + public EntityEgg(World worldIn, double x, double y, double z) { + super(worldIn, x, y, z); + } + + /**+ + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movingobjectposition) { + if (movingobjectposition.entityHit != null) { + movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), + 0.0F); + } + + if (this.rand.nextInt(8) == 0) { + byte b0 = 1; + if (this.rand.nextInt(32) == 0) { + b0 = 4; + } + + for (int i = 0; i < b0; ++i) { + EntityChicken entitychicken = new EntityChicken(this.worldObj); + entitychicken.setGrowingAge(-24000); + entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + this.worldObj.spawnEntityInWorld(entitychicken); + } + } + + double d0 = 0.08D; + + for (int j = 0; j < 8; ++j) { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, + ((double) this.rand.nextFloat() - 0.5D) * 0.08D, ((double) this.rand.nextFloat() - 0.5D) * 0.08D, + ((double) this.rand.nextFloat() - 0.5D) * 0.08D, new int[] { Item.getIdFromItem(Items.egg) }); + } + + this.setDead(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFireball.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFireball.java new file mode 100644 index 0000000..19fb201 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFireball.java @@ -0,0 +1,335 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityFireball extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityFireball"); + } + + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + private boolean inGround; + public EntityLivingBase shootingEntity; + private int ticksAlive; + private int ticksInAir; + public double accelerationX; + public double accelerationY; + public double accelerationZ; + + public EntityFireball(World worldIn) { + super(worldIn); + this.setSize(1.0F, 1.0F); + } + + protected void entityInit() { + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + if (Double.isNaN(d1)) { + d1 = 4.0D; + } + + d1 = d1 * 64.0D; + return d0 < d1 * d1; + } + + public EntityFireball(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) { + super(worldIn); + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch); + this.setPosition(x, y, z); + double d0 = (double) MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ); + this.accelerationX = accelX / d0 * 0.1D; + this.accelerationY = accelY / d0 * 0.1D; + this.accelerationZ = accelZ / d0 * 0.1D; + } + + public EntityFireball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) { + super(worldIn); + this.shootingEntity = shooter; + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(shooter.posX, shooter.posY, shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionX = this.motionY = this.motionZ = 0.0D; + accelX = accelX + this.rand.nextGaussian() * 0.4D; + accelY = accelY + this.rand.nextGaussian() * 0.4D; + accelZ = accelZ + this.rand.nextGaussian() * 0.4D; + double d0 = (double) MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ); + this.accelerationX = accelX / d0 * 0.1D; + this.accelerationY = accelY / d0 * 0.1D; + this.accelerationZ = accelZ / d0 * 0.1D; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if ((this.shootingEntity == null || !this.shootingEntity.isDead) + && this.worldObj.isBlockLoaded(new BlockPos(this))) { + super.onUpdate(); + this.setFire(1); + if (this.inGround) { + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)) + .getBlock() == this.inTile) { + ++this.ticksAlive; + if (this.ticksAlive == 600) { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double) (this.rand.nextFloat() * 0.2F); + this.motionY *= (double) (this.rand.nextFloat() * 0.2F); + this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); + this.ticksAlive = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + + Vec3 vec3 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = new Vec3(this.posX, this.posY, this.posZ); + vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if (movingobjectposition != null) { + vec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, + movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox() + .addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); + if (entity1.canBeCollidedWith() + && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double) f, (double) f, + (double) f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + if (movingobjectposition1 != null) { + double d1 = vec3.squareDistanceTo(movingobjectposition1.hitVec); + if (d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) { + this.onImpact(movingobjectposition); + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionZ, this.motionX) * 180.0D + / 3.1415927410125732D) + 90.0F; + + for (this.rotationPitch = (float) (MathHelper.func_181159_b((double) f1, this.motionY) * 180.0D + / 3.1415927410125732D) + - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = this.getMotionFactor(); + if (this.isInWater()) { + for (int j = 0; j < 4; ++j) { + float f3 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double) f3, + this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, + this.motionX, this.motionY, this.motionZ, new int[0]); + } + + f2 = 0.8F; + } + + this.motionX += this.accelerationX; + this.motionY += this.accelerationY; + this.motionZ += this.accelerationZ; + this.motionX *= (double) f2; + this.motionY *= (double) f2; + this.motionZ *= (double) f2; + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, + 0.0D, 0.0D, new int[0]); + this.setPosition(this.posX, this.posY, this.posZ); + } else { + this.setDead(); + } + } + + /**+ + * Return the motion factor for this projectile. The factor is + * multiplied by the original motion. + */ + protected float getMotionFactor() { + return 0.95F; + } + + protected abstract void onImpact(MovingObjectPosition var1); + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("xTile", (short) this.xTile); + nbttagcompound.setShort("yTile", (short) this.yTile); + nbttagcompound.setShort("zTile", (short) this.zTile); + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry.getNameForObject(this.inTile); + nbttagcompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + nbttagcompound.setTag("direction", + this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ })); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.xTile = nbttagcompound.getShort("xTile"); + this.yTile = nbttagcompound.getShort("yTile"); + this.zTile = nbttagcompound.getShort("zTile"); + if (nbttagcompound.hasKey("inTile", 8)) { + this.inTile = Block.getBlockFromName(nbttagcompound.getString("inTile")); + } else { + this.inTile = Block.getBlockById(nbttagcompound.getByte("inTile") & 255); + } + + this.inGround = nbttagcompound.getByte("inGround") == 1; + if (nbttagcompound.hasKey("direction", 9)) { + NBTTagList nbttaglist = nbttagcompound.getTagList("direction", 6); + this.motionX = nbttaglist.getDoubleAt(0); + this.motionY = nbttaglist.getDoubleAt(1); + this.motionZ = nbttaglist.getDoubleAt(2); + } else { + this.setDead(); + } + + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + public float getCollisionBorderSize() { + return 1.0F; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float var2) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + this.setBeenAttacked(); + if (damagesource.getEntity() != null) { + Vec3 vec3 = damagesource.getEntity().getLookVec(); + if (vec3 != null) { + this.motionX = vec3.xCoord; + this.motionY = vec3.yCoord; + this.motionZ = vec3.zCoord; + this.accelerationX = this.motionX * 0.1D; + this.accelerationY = this.motionY * 0.1D; + this.accelerationZ = this.motionZ * 0.1D; + } + + if (damagesource.getEntity() instanceof EntityLivingBase) { + this.shootingEntity = (EntityLivingBase) damagesource.getEntity(); + } + + return true; + } else { + return false; + } + } + } + + /**+ + * Gets how bright this entity is. + */ + public float getBrightness(float var1) { + return 1.0F; + } + + public int getBrightnessForRender(float var1) { + return 15728880; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFishHook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFishHook.java new file mode 100644 index 0000000..25271b6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFishHook.java @@ -0,0 +1,598 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import java.util.Arrays; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomFishable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityFishHook extends Entity { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityFishHook"); + } + + private static final List JUNK = Arrays.asList(new WeightedRandomFishable[] { + (new WeightedRandomFishable(new ItemStack(Items.leather_boots), 10)).setMaxDamagePercent(0.9F), + new WeightedRandomFishable(new ItemStack(Items.leather), 10), + new WeightedRandomFishable(new ItemStack(Items.bone), 10), + new WeightedRandomFishable(new ItemStack(Items.potionitem), 10), + new WeightedRandomFishable(new ItemStack(Items.string), 5), + (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 2)).setMaxDamagePercent(0.9F), + new WeightedRandomFishable(new ItemStack(Items.bowl), 10), + new WeightedRandomFishable(new ItemStack(Items.stick), 5), + new WeightedRandomFishable(new ItemStack(Items.dye, 10, EnumDyeColor.BLACK.getDyeDamage()), 1), + new WeightedRandomFishable(new ItemStack(Blocks.tripwire_hook), 10), + new WeightedRandomFishable(new ItemStack(Items.rotten_flesh), 10) }); + private static final List TREASURE = Arrays.asList(new WeightedRandomFishable[] { + new WeightedRandomFishable(new ItemStack(Blocks.waterlily), 1), + new WeightedRandomFishable(new ItemStack(Items.name_tag), 1), + new WeightedRandomFishable(new ItemStack(Items.saddle), 1), + (new WeightedRandomFishable(new ItemStack(Items.bow), 1)).setMaxDamagePercent(0.25F).setEnchantable(), + (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 1)).setMaxDamagePercent(0.25F) + .setEnchantable(), + (new WeightedRandomFishable(new ItemStack(Items.book), 1)).setEnchantable() }); + private static final List FISH = Arrays.asList(new WeightedRandomFishable[] { + new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.getMetadata()), 60), + new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.SALMON.getMetadata()), 25), + new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.CLOWNFISH.getMetadata()), 2), + new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.PUFFERFISH.getMetadata()), + 13) }); + private int xTile; + private int yTile; + private int zTile; + private Block inTile; + private boolean inGround; + public int shake; + public EntityPlayer angler; + private int ticksInGround; + private int ticksInAir; + private int ticksCatchable; + private int ticksCaughtDelay; + private int ticksCatchableDelay; + private float fishApproachAngle; + public Entity caughtEntity; + private int fishPosRotationIncrements; + private double fishX; + private double fishY; + private double fishZ; + private double fishYaw; + private double fishPitch; + private double clientMotionX; + private double clientMotionY; + private double clientMotionZ; + + public static List func_174855_j() { + return FISH; + } + + public EntityFishHook(World worldIn) { + super(worldIn); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; + this.setSize(0.25F, 0.25F); + this.ignoreFrustumCheck = true; + } + + public EntityFishHook(World worldIn, double x, double y, double z, EntityPlayer anglerIn) { + this(worldIn); + this.setPosition(x, y, z); + this.ignoreFrustumCheck = true; + this.angler = anglerIn; + anglerIn.fishEntity = this; + } + + public EntityFishHook(World worldIn, EntityPlayer fishingPlayer) { + super(worldIn); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; + this.ignoreFrustumCheck = true; + this.angler = fishingPlayer; + this.angler.fishEntity = this; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(fishingPlayer.posX, fishingPlayer.posY + (double) fishingPlayer.getEyeHeight(), + fishingPlayer.posZ, fishingPlayer.rotationYaw, fishingPlayer.rotationPitch); + this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + float f = 0.4F; + this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F) * f); + this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F) * f); + this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * 3.1415927F) * f); + this.handleHookCasting(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); + } + + protected void entityInit() { + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + if (Double.isNaN(d1)) { + d1 = 4.0D; + } + + d1 = d1 * 64.0D; + return d0 < d1 * d1; + } + + public void handleHookCasting(double parDouble1, double parDouble2, double parDouble3, float parFloat1, + float parFloat2) { + float f = MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble2 * parDouble2 + parDouble3 * parDouble3); + parDouble1 = parDouble1 / (double) f; + parDouble2 = parDouble2 / (double) f; + parDouble3 = parDouble3 / (double) f; + parDouble1 = parDouble1 + this.rand.nextGaussian() * 0.007499999832361937D * (double) parFloat2; + parDouble2 = parDouble2 + this.rand.nextGaussian() * 0.007499999832361937D * (double) parFloat2; + parDouble3 = parDouble3 + this.rand.nextGaussian() * 0.007499999832361937D * (double) parFloat2; + parDouble1 = parDouble1 * (double) parFloat1; + parDouble2 = parDouble2 * (double) parFloat1; + parDouble3 = parDouble3 * (double) parFloat1; + this.motionX = parDouble1; + this.motionY = parDouble2; + this.motionZ = parDouble3; + float f1 = MathHelper.sqrt_double(parDouble1 * parDouble1 + parDouble3 * parDouble3); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(parDouble1, parDouble3) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(parDouble2, (double) f1) + * 180.0D / 3.1415927410125732D); + this.ticksInGround = 0; + } + + public void setPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int i, boolean var10) { + this.fishX = d0; + this.fishY = d1; + this.fishZ = d2; + this.fishYaw = (double) f; + this.fishPitch = (double) f1; + this.fishPosRotationIncrements = i; + this.motionX = this.clientMotionX; + this.motionY = this.clientMotionY; + this.motionZ = this.clientMotionZ; + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.clientMotionX = this.motionX = d0; + this.clientMotionY = this.motionY = d1; + this.clientMotionZ = this.motionZ = d2; + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (this.fishPosRotationIncrements > 0) { + double d7 = this.posX + (this.fishX - this.posX) / (double) this.fishPosRotationIncrements; + double d8 = this.posY + (this.fishY - this.posY) / (double) this.fishPosRotationIncrements; + double d9 = this.posZ + (this.fishZ - this.posZ) / (double) this.fishPosRotationIncrements; + double d1 = MathHelper.wrapAngleTo180_double(this.fishYaw - (double) this.rotationYaw); + this.rotationYaw = (float) ((double) this.rotationYaw + d1 / (double) this.fishPosRotationIncrements); + this.rotationPitch = (float) ((double) this.rotationPitch + + (this.fishPitch - (double) this.rotationPitch) / (double) this.fishPosRotationIncrements); + --this.fishPosRotationIncrements; + this.setPosition(d7, d8, d9); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { + { + ItemStack itemstack = this.angler.getCurrentEquippedItem(); + if (this.angler.isDead || !this.angler.isEntityAlive() || itemstack == null + || itemstack.getItem() != Items.fishing_rod + || this.getDistanceSqToEntity(this.angler) > 1024.0D) { + this.setDead(); + this.angler.fishEntity = null; + return; + } + + if (this.caughtEntity != null) { + if (!this.caughtEntity.isDead) { + this.posX = this.caughtEntity.posX; + double d17 = (double) this.caughtEntity.height; + this.posY = this.caughtEntity.getEntityBoundingBox().minY + d17 * 0.8D; + this.posZ = this.caughtEntity.posZ; + return; + } + + this.caughtEntity = null; + } + } + + if (this.shake > 0) { + --this.shake; + } + + if (this.inGround) { + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)) + .getBlock() == this.inTile) { + ++this.ticksInGround; + if (this.ticksInGround == 1200) { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double) (this.rand.nextFloat() * 0.2F); + this.motionY *= (double) (this.rand.nextFloat() * 0.2F); + this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + + Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3); + vec31 = new Vec3(this.posX, this.posY, this.posZ); + vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if (movingobjectposition != null) { + vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, + movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox() + .addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); + if (entity1.canBeCollidedWith() && (entity1 != this.angler || this.ticksInAir >= 5)) { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double) f, (double) f, + (double) f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec31, vec3); + if (movingobjectposition1 != null) { + double d2 = vec31.squareDistanceTo(movingobjectposition1.hitVec); + if (d2 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d2; + } + } + } + } + + if (entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) { + if (movingobjectposition.entityHit != null) { + if (movingobjectposition.entityHit + .attackEntityFrom(DamageSource.causeThrownDamage(this, this.angler), 0.0F)) { + this.caughtEntity = movingobjectposition.entityHit; + } + } else { + this.inGround = true; + } + } + + if (!this.inGround) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f5 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D + / 3.1415927410125732D); + + for (this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f5) * 180.0D + / 3.1415927410125732D); this.rotationPitch + - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f6 = 0.92F; + if (this.onGround || this.isCollidedHorizontally) { + f6 = 0.5F; + } + + byte b0 = 5; + double d10 = 0.0D; + + for (int j = 0; j < b0; ++j) { + AxisAlignedBB axisalignedbb1 = this.getEntityBoundingBox(); + double d3 = axisalignedbb1.maxY - axisalignedbb1.minY; + double d4 = axisalignedbb1.minY + d3 * (double) j / (double) b0; + double d5 = axisalignedbb1.minY + d3 * (double) (j + 1) / (double) b0; + AxisAlignedBB axisalignedbb2 = new AxisAlignedBB(axisalignedbb1.minX, d4, axisalignedbb1.minZ, + axisalignedbb1.maxX, d5, axisalignedbb1.maxZ); + if (this.worldObj.isAABBInMaterial(axisalignedbb2, Material.water)) { + d10 += 1.0D / (double) b0; + } + } + + if (d10 > 0.0D) { + WorldServer worldserver = (WorldServer) this.worldObj; + int k = 1; + BlockPos blockpos = (new BlockPos(this)).up(); + if (this.rand.nextFloat() < 0.25F && this.worldObj.canLightningStrike(blockpos)) { + k = 2; + } + + if (this.rand.nextFloat() < 0.5F && !this.worldObj.canSeeSky(blockpos)) { + --k; + } + + if (this.ticksCatchable > 0) { + --this.ticksCatchable; + if (this.ticksCatchable <= 0) { + this.ticksCaughtDelay = 0; + this.ticksCatchableDelay = 0; + } + } else if (this.ticksCatchableDelay > 0) { + this.ticksCatchableDelay -= k; + if (this.ticksCatchableDelay <= 0) { + this.motionY -= 0.20000000298023224D; + this.playSound("random.splash", 0.25F, + 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float f8 = (float) MathHelper.floor_double(this.getEntityBoundingBox().minY); + worldserver.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX, (double) (f8 + 1.0F), + this.posZ, (int) (1.0F + this.width * 20.0F), (double) this.width, 0.0D, + (double) this.width, 0.20000000298023224D, new int[0]); + worldserver.spawnParticle(EnumParticleTypes.WATER_WAKE, this.posX, (double) (f8 + 1.0F), + this.posZ, (int) (1.0F + this.width * 20.0F), (double) this.width, 0.0D, + (double) this.width, 0.20000000298023224D, new int[0]); + this.ticksCatchable = MathHelper.getRandomIntegerInRange(this.rand, 10, 30); + } else { + this.fishApproachAngle = (float) ((double) this.fishApproachAngle + + this.rand.nextGaussian() * 4.0D); + float f7 = this.fishApproachAngle * 0.017453292F; + float f10 = MathHelper.sin(f7); + float f11 = MathHelper.cos(f7); + double d13 = this.posX + (double) (f10 * (float) this.ticksCatchableDelay * 0.1F); + double d15 = (double) ((float) MathHelper.floor_double(this.getEntityBoundingBox().minY) + + 1.0F); + double d16 = this.posZ + (double) (f11 * (float) this.ticksCatchableDelay * 0.1F); + Block block1 = worldserver.getBlockState(new BlockPos((int) d13, (int) d15 - 1, (int) d16)) + .getBlock(); + if (block1 == Blocks.water || block1 == Blocks.flowing_water) { + if (this.rand.nextFloat() < 0.15F) { + worldserver.spawnParticle(EnumParticleTypes.WATER_BUBBLE, d13, + d15 - 0.10000000149011612D, d16, 1, (double) f10, 0.1D, (double) f11, 0.0D, + new int[0]); + } + + float f3 = f10 * 0.04F; + float f4 = f11 * 0.04F; + worldserver.spawnParticle(EnumParticleTypes.WATER_WAKE, d13, d15, d16, 0, (double) f4, + 0.01D, (double) (-f3), 1.0D, new int[0]); + worldserver.spawnParticle(EnumParticleTypes.WATER_WAKE, d13, d15, d16, 0, + (double) (-f4), 0.01D, (double) f3, 1.0D, new int[0]); + } + } + } else if (this.ticksCaughtDelay > 0) { + this.ticksCaughtDelay -= k; + float f1 = 0.15F; + if (this.ticksCaughtDelay < 20) { + f1 = (float) ((double) f1 + (double) (20 - this.ticksCaughtDelay) * 0.05D); + } else if (this.ticksCaughtDelay < 40) { + f1 = (float) ((double) f1 + (double) (40 - this.ticksCaughtDelay) * 0.02D); + } else if (this.ticksCaughtDelay < 60) { + f1 = (float) ((double) f1 + (double) (60 - this.ticksCaughtDelay) * 0.01D); + } + + if (this.rand.nextFloat() < f1) { + float f9 = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F) * 0.017453292F; + float f2 = MathHelper.randomFloatClamp(this.rand, 25.0F, 60.0F); + double d12 = this.posX + (double) (MathHelper.sin(f9) * f2 * 0.1F); + double d14 = (double) ((float) MathHelper.floor_double(this.getEntityBoundingBox().minY) + + 1.0F); + double d6 = this.posZ + (double) (MathHelper.cos(f9) * f2 * 0.1F); + Block block = worldserver.getBlockState(new BlockPos((int) d12, (int) d14 - 1, (int) d6)) + .getBlock(); + if (block == Blocks.water || block == Blocks.flowing_water) { + worldserver.spawnParticle(EnumParticleTypes.WATER_SPLASH, d12, d14, d6, + 2 + this.rand.nextInt(2), 0.10000000149011612D, 0.0D, 0.10000000149011612D, + 0.0D, new int[0]); + } + } + + if (this.ticksCaughtDelay <= 0) { + this.fishApproachAngle = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F); + this.ticksCatchableDelay = MathHelper.getRandomIntegerInRange(this.rand, 20, 80); + } + } else { + this.ticksCaughtDelay = MathHelper.getRandomIntegerInRange(this.rand, 100, 900); + this.ticksCaughtDelay -= EnchantmentHelper.getLureModifier(this.angler) * 20 * 5; + } + + if (this.ticksCatchable > 0) { + this.motionY -= (double) (this.rand.nextFloat() * this.rand.nextFloat() * this.rand.nextFloat()) + * 0.2D; + } + } + + double d11 = d10 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * d11; + if (d10 > 0.0D) { + f6 = (float) ((double) f6 * 0.9D); + this.motionY *= 0.8D; + } + + this.motionX *= (double) f6; + this.motionY *= (double) f6; + this.motionZ *= (double) f6; + this.setPosition(this.posX, this.posY, this.posZ); + } + } + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("xTile", (short) this.xTile); + nbttagcompound.setShort("yTile", (short) this.yTile); + nbttagcompound.setShort("zTile", (short) this.zTile); + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry.getNameForObject(this.inTile); + nbttagcompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setByte("shake", (byte) this.shake); + nbttagcompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.xTile = nbttagcompound.getShort("xTile"); + this.yTile = nbttagcompound.getShort("yTile"); + this.zTile = nbttagcompound.getShort("zTile"); + if (nbttagcompound.hasKey("inTile", 8)) { + this.inTile = Block.getBlockFromName(nbttagcompound.getString("inTile")); + } else { + this.inTile = Block.getBlockById(nbttagcompound.getByte("inTile") & 255); + } + + this.shake = nbttagcompound.getByte("shake") & 255; + this.inGround = nbttagcompound.getByte("inGround") == 1; + } + + public int handleHookRetraction() { + { + byte b0 = 0; + if (this.caughtEntity != null) { + double d0 = this.angler.posX - this.posX; + double d2 = this.angler.posY - this.posY; + double d4 = this.angler.posZ - this.posZ; + double d6 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2 + d4 * d4); + double d8 = 0.1D; + this.caughtEntity.motionX += d0 * d8; + this.caughtEntity.motionY += d2 * d8 + (double) MathHelper.sqrt_double(d6) * 0.08D; + this.caughtEntity.motionZ += d4 * d8; + b0 = 3; + } else if (this.ticksCatchable > 0) { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, + this.getFishingResult()); + double d1 = this.angler.posX - this.posX; + double d3 = this.angler.posY - this.posY; + double d5 = this.angler.posZ - this.posZ; + double d7 = (double) MathHelper.sqrt_double(d1 * d1 + d3 * d3 + d5 * d5); + double d9 = 0.1D; + entityitem.motionX = d1 * d9; + entityitem.motionY = d3 * d9 + (double) MathHelper.sqrt_double(d7) * 0.08D; + entityitem.motionZ = d5 * d9; + this.worldObj.spawnEntityInWorld(entityitem); + this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, + this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.rand.nextInt(6) + 1)); + b0 = 1; + } + + if (this.inGround) { + b0 = 2; + } + + this.setDead(); + this.angler.fishEntity = null; + return b0; + } + } + + private ItemStack getFishingResult() { + float f = this.worldObj.rand.nextFloat(); + int i = EnchantmentHelper.getLuckOfSeaModifier(this.angler); + int j = EnchantmentHelper.getLureModifier(this.angler); + float f1 = 0.1F - (float) i * 0.025F - (float) j * 0.01F; + float f2 = 0.05F + (float) i * 0.01F - (float) j * 0.01F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f2 = MathHelper.clamp_float(f2, 0.0F, 1.0F); + if (f < f1) { + this.angler.triggerAchievement(StatList.junkFishedStat); + return ((WeightedRandomFishable) WeightedRandom.getRandomItem(this.rand, JUNK)).getItemStack(this.rand); + } else { + f = f - f1; + if (f < f2) { + this.angler.triggerAchievement(StatList.treasureFishedStat); + return ((WeightedRandomFishable) WeightedRandom.getRandomItem(this.rand, TREASURE)) + .getItemStack(this.rand); + } else { + float f3 = f - f2; + this.angler.triggerAchievement(StatList.fishCaughtStat); + return ((WeightedRandomFishable) WeightedRandom.getRandomItem(this.rand, FISH)).getItemStack(this.rand); + } + } + } + + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + super.setDead(); + if (this.angler != null) { + this.angler.fishEntity = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityLargeFireball.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityLargeFireball.java new file mode 100644 index 0000000..c54bd6a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityLargeFireball.java @@ -0,0 +1,93 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityLargeFireball extends EntityFireball { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityLargeFireball"); + } + + public int explosionPower = 1; + + public EntityLargeFireball(World worldIn) { + super(worldIn); + } + + public EntityLargeFireball(World worldIn, double x, double y, double z, double accelX, double accelY, + double accelZ) { + super(worldIn, x, y, z, accelX, accelY, accelZ); + } + + public EntityLargeFireball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) { + super(worldIn, shooter, accelX, accelY, accelZ); + } + + /**+ + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movingobjectposition) { + { + if (movingobjectposition.entityHit != null) { + movingobjectposition.entityHit + .attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); + this.applyEnchantments(this.shootingEntity, movingobjectposition.entityHit); + } + + boolean flag = this.worldObj.getGameRules().getBoolean("mobGriefing"); + this.worldObj.newExplosion((Entity) null, this.posX, this.posY, this.posZ, (float) this.explosionPower, + flag, flag); + this.setDead(); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + nbttagcompound.setInteger("ExplosionPower", this.explosionPower); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("ExplosionPower", 99)) { + this.explosionPower = nbttagcompound.getInteger("ExplosionPower"); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityPotion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityPotion.java new file mode 100644 index 0000000..7dcf4b4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityPotion.java @@ -0,0 +1,178 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityThrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityPotion extends EntityThrowable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityPotion"); + } + + private ItemStack potionDamage; + + public EntityPotion(World worldIn) { + super(worldIn); + } + + public EntityPotion(World worldIn, EntityLivingBase throwerIn, int meta) { + this(worldIn, throwerIn, new ItemStack(Items.potionitem, 1, meta)); + } + + public EntityPotion(World worldIn, EntityLivingBase throwerIn, ItemStack potionDamageIn) { + super(worldIn, throwerIn); + this.potionDamage = potionDamageIn; + } + + public EntityPotion(World worldIn, double x, double y, double z, int parInt1) { + this(worldIn, x, y, z, new ItemStack(Items.potionitem, 1, parInt1)); + } + + public EntityPotion(World worldIn, double x, double y, double z, ItemStack potionDamageIn) { + super(worldIn, x, y, z); + this.potionDamage = potionDamageIn; + } + + /**+ + * Gets the amount of gravity to apply to the thrown entity with + * each tick. + */ + protected float getGravityVelocity() { + return 0.05F; + } + + protected float getVelocity() { + return 0.5F; + } + + protected float getInaccuracy() { + return -20.0F; + } + + /**+ + * Sets the PotionEffect by the given id of the potion effect. + */ + public void setPotionDamage(int potionId) { + if (this.potionDamage == null) { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + this.potionDamage.setItemDamage(potionId); + } + + /**+ + * Returns the damage value of the thrown potion that this + * EntityPotion represents. + */ + public int getPotionDamage() { + if (this.potionDamage == null) { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + return this.potionDamage.getMetadata(); + } + + /**+ + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movingobjectposition) { + { + List list = Items.potionitem.getEffects(this.potionDamage); + if (list != null && !list.isEmpty()) { + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + if (!list1.isEmpty()) { + for (EntityLivingBase entitylivingbase : (List) list1) { + double d0 = this.getDistanceSqToEntity(entitylivingbase); + if (d0 < 16.0D) { + double d1 = 1.0D - Math.sqrt(d0) / 4.0D; + if (entitylivingbase == movingobjectposition.entityHit) { + d1 = 1.0D; + } + + for (PotionEffect potioneffect : (List) list) { + int i = potioneffect.getPotionID(); + if (Potion.potionTypes[i].isInstant()) { + Potion.potionTypes[i].affectEntity(this, this.getThrower(), entitylivingbase, + potioneffect.getAmplifier(), d1); + } else { + int j = (int) (d1 * (double) potioneffect.getDuration() + 0.5D); + if (j > 20) { + entitylivingbase + .addPotionEffect(new PotionEffect(i, j, potioneffect.getAmplifier())); + } + } + } + } + } + } + } + + this.worldObj.playAuxSFX(2002, new BlockPos(this), this.getPotionDamage()); + this.setDead(); + } + + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + super.readEntityFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("Potion", 10)) { + this.potionDamage = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Potion")); + } else { + this.setPotionDamage(nbttagcompound.getInteger("potionValue")); + } + + if (this.potionDamage == null) { + this.setDead(); + } + + } + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + super.writeEntityToNBT(nbttagcompound); + if (this.potionDamage != null) { + nbttagcompound.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySmallFireball.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySmallFireball.java new file mode 100644 index 0000000..96dd312 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySmallFireball.java @@ -0,0 +1,103 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySmallFireball extends EntityFireball { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntitySmallFireball"); + } + + public EntitySmallFireball(World worldIn) { + super(worldIn); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) { + super(worldIn, shooter, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World worldIn, double x, double y, double z, double accelX, double accelY, + double accelZ) { + super(worldIn, x, y, z, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + /**+ + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movingobjectposition) { + { + if (movingobjectposition.entityHit != null) { + boolean flag = movingobjectposition.entityHit + .attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F); + if (flag) { + this.applyEnchantments(this.shootingEntity, movingobjectposition.entityHit); + if (!movingobjectposition.entityHit.isImmuneToFire()) { + movingobjectposition.entityHit.setFire(5); + } + } + } else { + boolean flag1 = true; + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLiving) { + flag1 = this.worldObj.getGameRules().getBoolean("mobGriefing"); + } + + if (flag1) { + BlockPos blockpos = movingobjectposition.getBlockPos().offset(movingobjectposition.sideHit); + if (this.worldObj.isAirBlock(blockpos)) { + this.worldObj.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + } + } + + this.setDead(); + } + + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource var1, float var2) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySnowball.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySnowball.java new file mode 100644 index 0000000..19bf5c2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySnowball.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityBlaze; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityThrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntitySnowball extends EntityThrowable { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntitySnowball"); + } + + public EntitySnowball(World worldIn) { + super(worldIn); + } + + public EntitySnowball(World worldIn, EntityLivingBase throwerIn) { + super(worldIn, throwerIn); + } + + public EntitySnowball(World worldIn, double x, double y, double z) { + super(worldIn, x, y, z); + } + + /**+ + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition parMovingObjectPosition) { + if (parMovingObjectPosition.entityHit != null) { + byte b0 = 0; + if (parMovingObjectPosition.entityHit instanceof EntityBlaze) { + b0 = 3; + } + + parMovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), + (float) b0); + } + + for (int i = 0; i < 8; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, + new int[0]); + } + + this.setDead(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityThrowable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityThrowable.java new file mode 100644 index 0000000..120d41b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityThrowable.java @@ -0,0 +1,362 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IProjectile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityThrowable extends Entity implements IProjectile { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityThrowable"); + } + + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + protected boolean inGround; + public int throwableShake; + private EntityLivingBase thrower; + private String throwerName; + private int ticksInGround; + private int ticksInAir; + + public EntityThrowable(World worldIn) { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() { + } + + /**+ + * Checks if the entity is in range to render by using the past + * in distance and comparing it to its average edge length * 64 + * * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double d0) { + double d1 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + if (Double.isNaN(d1)) { + d1 = 4.0D; + } + + d1 = d1 * 64.0D; + return d0 < d1 * d1; + } + + public EntityThrowable(World worldIn, EntityLivingBase throwerIn) { + super(worldIn); + this.thrower = throwerIn; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(throwerIn.posX, throwerIn.posY + (double) throwerIn.getEyeHeight(), throwerIn.posZ, + throwerIn.rotationYaw, throwerIn.rotationPitch); + this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + float f = 0.4F; + this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F) * f); + this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.1415927F) + * MathHelper.cos(this.rotationPitch / 180.0F * 3.1415927F) * f); + this.motionY = (double) (-MathHelper.sin((this.rotationPitch + this.getInaccuracy()) / 180.0F * 3.1415927F) + * f); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.getVelocity(), 1.0F); + } + + public EntityThrowable(World worldIn, double x, double y, double z) { + super(worldIn); + this.ticksInGround = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + } + + protected float getVelocity() { + return 1.5F; + } + + protected float getInaccuracy() { + return 0.0F; + } + + /**+ + * Similar to setArrowHeading, it's point the throwable entity + * to a x, y, z direction. + */ + public void setThrowableHeading(double d0, double d1, double d2, float f, float f1) { + float f2 = MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2); + d0 = d0 / (double) f2; + d1 = d1 / (double) f2; + d2 = d2 / (double) f2; + d0 = d0 + this.rand.nextGaussian() * 0.007499999832361937D * (double) f1; + d1 = d1 + this.rand.nextGaussian() * 0.007499999832361937D * (double) f1; + d2 = d2 + this.rand.nextGaussian() * 0.007499999832361937D * (double) f1; + d0 = d0 * (double) f; + d1 = d1 * (double) f; + d2 = d2 * (double) f; + this.motionX = d0; + this.motionY = d1; + this.motionZ = d2; + float f3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(d0, d2) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(d1, (double) f3) * 180.0D + / 3.1415927410125732D); + this.ticksInGround = 0; + } + + /**+ + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d0, double d1, double d2) { + this.motionX = d0; + this.motionY = d1; + this.motionZ = d2; + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.prevRotationYaw = this.rotationYaw = (float) (MathHelper.func_181159_b(d0, d2) * 180.0D + / 3.1415927410125732D); + this.prevRotationPitch = this.rotationPitch = (float) (MathHelper.func_181159_b(d1, (double) f) * 180.0D + / 3.1415927410125732D); + } + + } + + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + if (this.throwableShake > 0) { + --this.throwableShake; + } + + if (this.inGround) { + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)) + .getBlock() == this.inTile) { + ++this.ticksInGround; + if (this.ticksInGround == 1200) { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double) (this.rand.nextFloat() * 0.2F); + this.motionY *= (double) (this.rand.nextFloat() * 0.2F); + this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + + Vec3 vec3 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = new Vec3(this.posX, this.posY, this.posZ); + vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if (movingobjectposition != null) { + vec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, + movingobjectposition.hitVec.zCoord); + } + + { + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox() + .addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + EntityLivingBase entitylivingbase = this.getThrower(); + + for (int j = 0; j < list.size(); ++j) { + Entity entity1 = (Entity) list.get(j); + if (entity1.canBeCollidedWith() && (entity1 != entitylivingbase || this.ticksInAir >= 5)) { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double) f, (double) f, + (double) f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + if (movingobjectposition1 != null) { + double d1 = vec3.squareDistanceTo(movingobjectposition1.hitVec); + if (d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } + } + + if (movingobjectposition != null) { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK + && this.worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal) { + this.func_181015_d(movingobjectposition.getBlockPos()); + } else { + this.onImpact(movingobjectposition); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.func_181159_b(this.motionX, this.motionZ) * 180.0D + / 3.1415927410125732D); + + for (this.rotationPitch = (float) (MathHelper.func_181159_b(this.motionY, (double) f1) * 180.0D + / 3.1415927410125732D); this.rotationPitch + - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = 0.99F; + float f3 = this.getGravityVelocity(); + if (this.isInWater()) { + for (int i = 0; i < 4; ++i) { + float f4 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double) f4, + this.posY - this.motionY * (double) f4, this.posZ - this.motionZ * (double) f4, this.motionX, + this.motionY, this.motionZ, new int[0]); + } + + f2 = 0.8F; + } + + this.motionX *= (double) f2; + this.motionY *= (double) f2; + this.motionZ *= (double) f2; + this.motionY -= (double) f3; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /**+ + * Gets the amount of gravity to apply to the thrown entity with + * each tick. + */ + protected float getGravityVelocity() { + return 0.03F; + } + + protected abstract void onImpact(MovingObjectPosition var1); + + /**+ + * (abstract) Protected helper method to write subclass entity + * data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("xTile", (short) this.xTile); + nbttagcompound.setShort("yTile", (short) this.yTile); + nbttagcompound.setShort("zTile", (short) this.zTile); + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry.getNameForObject(this.inTile); + nbttagcompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setByte("shake", (byte) this.throwableShake); + nbttagcompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + if ((this.throwerName == null || this.throwerName.length() == 0) && this.thrower instanceof EntityPlayer) { + this.throwerName = this.thrower.getName(); + } + + nbttagcompound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); + } + + /**+ + * (abstract) Protected helper method to read subclass entity + * data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) { + this.xTile = nbttagcompound.getShort("xTile"); + this.yTile = nbttagcompound.getShort("yTile"); + this.zTile = nbttagcompound.getShort("zTile"); + if (nbttagcompound.hasKey("inTile", 8)) { + this.inTile = Block.getBlockFromName(nbttagcompound.getString("inTile")); + } else { + this.inTile = Block.getBlockById(nbttagcompound.getByte("inTile") & 255); + } + + this.throwableShake = nbttagcompound.getByte("shake") & 255; + this.inGround = nbttagcompound.getByte("inGround") == 1; + this.thrower = null; + this.throwerName = nbttagcompound.getString("ownerName"); + if (this.throwerName != null && this.throwerName.length() == 0) { + this.throwerName = null; + } + + this.thrower = this.getThrower(); + } + + public EntityLivingBase getThrower() { + if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) { + this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); + if (this.thrower == null && this.worldObj instanceof WorldServer) { + try { + Entity entity = ((WorldServer) this.worldObj) + .getEntityFromUuid(EaglercraftUUID.fromString(this.throwerName)); + if (entity instanceof EntityLivingBase) { + this.thrower = (EntityLivingBase) entity; + } + } catch (Throwable var2) { + this.thrower = null; + } + } + } + + return this.thrower; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityWitherSkull.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityWitherSkull.java new file mode 100644 index 0000000..aac528c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityWitherSkull.java @@ -0,0 +1,164 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityWither; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityWitherSkull extends EntityFireball { + + static { + __checkIntegratedContextValid("net/minecraft/entity/projectile/EntityWitherSkull"); + } + + public EntityWitherSkull(World worldIn) { + super(worldIn); + this.setSize(0.3125F, 0.3125F); + } + + public EntityWitherSkull(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) { + super(worldIn, shooter, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + /**+ + * Return the motion factor for this projectile. The factor is + * multiplied by the original motion. + */ + protected float getMotionFactor() { + return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); + } + + public EntityWitherSkull(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) { + super(worldIn, x, y, z, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + /**+ + * Returns true if the entity is on fire. Used by render to add + * the fire effect on rendering. + */ + public boolean isBurning() { + return false; + } + + /**+ + * Explosion resistance of a block relative to this entity + */ + public float getExplosionResistance(Explosion explosion, World world, BlockPos blockpos, IBlockState iblockstate) { + float f = super.getExplosionResistance(explosion, world, blockpos, iblockstate); + Block block = iblockstate.getBlock(); + if (this.isInvulnerable() && EntityWither.func_181033_a(block)) { + f = Math.min(0.8F, f); + } + + return f; + } + + /**+ + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movingobjectposition) { + { + if (movingobjectposition.entityHit != null) { + if (this.shootingEntity != null) { + if (movingobjectposition.entityHit + .attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F)) { + if (!movingobjectposition.entityHit.isEntityAlive()) { + this.shootingEntity.heal(5.0F); + } else { + this.applyEnchantments(this.shootingEntity, movingobjectposition.entityHit); + } + } + } else { + movingobjectposition.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); + } + + if (movingobjectposition.entityHit instanceof EntityLivingBase) { + byte b0 = 0; + if (this.worldObj.getDifficulty() == EnumDifficulty.NORMAL) { + b0 = 10; + } else if (this.worldObj.getDifficulty() == EnumDifficulty.HARD) { + b0 = 40; + } + + if (b0 > 0) { + ((EntityLivingBase) movingobjectposition.entityHit) + .addPotionEffect(new PotionEffect(Potion.wither.id, 20 * b0, 1)); + } + } + } + + this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, + this.worldObj.getGameRules().getBoolean("mobGriefing")); + this.setDead(); + } + + } + + /**+ + * Returns true if other Entities should be prevented from + * moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource var1, float var2) { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(10, Byte.valueOf((byte) 0)); + } + + /**+ + * Return whether this skull comes from an invulnerable (aura) + * wither boss. + */ + public boolean isInvulnerable() { + return this.dataWatcher.getWatchableObjectByte(10) == 1; + } + + /**+ + * Set whether this skull comes from an invulnerable (aura) + * wither boss. + */ + public void setInvulnerable(boolean invulnerable) { + this.dataWatcher.updateObject(10, Byte.valueOf((byte) (invulnerable ? 1 : 0))); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/ClickEvent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/ClickEvent.java new file mode 100644 index 0000000..692f721 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/ClickEvent.java @@ -0,0 +1,124 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ClickEvent { + + static { + __checkIntegratedContextValid("net/minecraft/event/ClickEvent"); + } + + private final ClickEvent.Action action; + private final String value; + + public ClickEvent(ClickEvent.Action theAction, String theValue) { + this.action = theAction; + this.value = theValue; + } + + /**+ + * Gets the action to perform when this event is raised. + */ + public ClickEvent.Action getAction() { + return this.action; + } + + /**+ + * Gets the value to perform the action on when this event is + * raised. For example, if the action is "open URL", this would + * be the URL to open. + */ + public String getValue() { + return this.value; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + ClickEvent clickevent = (ClickEvent) object; + if (this.action != clickevent.action) { + return false; + } else { + if (this.value != null) { + if (!this.value.equals(clickevent.value)) { + return false; + } + } else if (clickevent.value != null) { + return false; + } + + return true; + } + } else { + return false; + } + } + + public String toString() { + return "ClickEvent{action=" + this.action + ", value=\'" + this.value + '\'' + '}'; + } + + public int hashCode() { + int i = this.action.hashCode(); + i = 31 * i + (this.value != null ? this.value.hashCode() : 0); + return i; + } + + public static enum Action { + OPEN_URL("open_url", true), OPEN_FILE("open_file", false), RUN_COMMAND("run_command", true), + TWITCH_USER_INFO("twitch_user_info", false), SUGGEST_COMMAND("suggest_command", true), + CHANGE_PAGE("change_page", true); + + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private Action(String canonicalNameIn, boolean allowedInChatIn) { + this.canonicalName = canonicalNameIn; + this.allowedInChat = allowedInChatIn; + } + + public boolean shouldAllowInChat() { + return this.allowedInChat; + } + + public String getCanonicalName() { + return this.canonicalName; + } + + public static ClickEvent.Action getValueByCanonicalName(String canonicalNameIn) { + return (ClickEvent.Action) nameMapping.get(canonicalNameIn); + } + + static { + for (ClickEvent.Action clickevent$action : values()) { + nameMapping.put(clickevent$action.getCanonicalName(), clickevent$action); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/HoverEvent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/HoverEvent.java new file mode 100644 index 0000000..a1f051c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/HoverEvent.java @@ -0,0 +1,124 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 HoverEvent { + + static { + __checkIntegratedContextValid("net/minecraft/event/HoverEvent"); + } + + private final HoverEvent.Action action; + private final IChatComponent value; + + public HoverEvent(HoverEvent.Action actionIn, IChatComponent valueIn) { + this.action = actionIn; + this.value = valueIn; + } + + /**+ + * Gets the action to perform when this event is raised. + */ + public HoverEvent.Action getAction() { + return this.action; + } + + /**+ + * Gets the value to perform the action on when this event is + * raised. For example, if the action is "show item", this would + * be the item to show. + */ + public IChatComponent getValue() { + return this.value; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + HoverEvent hoverevent = (HoverEvent) object; + if (this.action != hoverevent.action) { + return false; + } else { + if (this.value != null) { + if (!this.value.equals(hoverevent.value)) { + return false; + } + } else if (hoverevent.value != null) { + return false; + } + + return true; + } + } else { + return false; + } + } + + public String toString() { + return "HoverEvent{action=" + this.action + ", value=\'" + this.value + '\'' + '}'; + } + + public int hashCode() { + int i = this.action.hashCode(); + i = 31 * i + (this.value != null ? this.value.hashCode() : 0); + return i; + } + + public static enum Action { + SHOW_TEXT("show_text", true), SHOW_ACHIEVEMENT("show_achievement", true), SHOW_ITEM("show_item", true), + SHOW_ENTITY("show_entity", true); + + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private Action(String canonicalNameIn, boolean allowedInChatIn) { + this.canonicalName = canonicalNameIn; + this.allowedInChat = allowedInChatIn; + } + + public boolean shouldAllowInChat() { + return this.allowedInChat; + } + + public String getCanonicalName() { + return this.canonicalName; + } + + public static HoverEvent.Action getValueByCanonicalName(String canonicalNameIn) { + return (HoverEvent.Action) nameMapping.get(canonicalNameIn); + } + + static { + for (HoverEvent.Action hoverevent$action : values()) { + nameMapping.put(hoverevent$action.getCanonicalName(), hoverevent$action); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Blocks.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Blocks.java new file mode 100644 index 0000000..9896a84 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Blocks.java @@ -0,0 +1,477 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCactus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCauldron; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDaylightDetector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDeadBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDynamicLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockMycelium; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonExtension; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPistonMoving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneRepeater; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedstoneWire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockReed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStainedGlass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStainedGlassPane; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStaticLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWireHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Bootstrap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Blocks { + + static { + __checkIntegratedContextValid("net/minecraft/init/Blocks"); + } + + public static Block air; + public static Block stone; + public static BlockGrass grass; + public static Block dirt; + public static Block cobblestone; + public static Block planks; + public static Block sapling; + public static Block bedrock; + public static BlockDynamicLiquid flowing_water; + public static BlockStaticLiquid water; + public static BlockDynamicLiquid flowing_lava; + public static BlockStaticLiquid lava; + public static BlockSand sand; + public static Block gravel; + public static Block gold_ore; + public static Block iron_ore; + public static Block coal_ore; + public static Block log; + public static Block log2; + public static BlockLeaves leaves; + public static BlockLeaves leaves2; + public static Block sponge; + public static Block glass; + public static Block lapis_ore; + public static Block lapis_block; + public static Block dispenser; + public static Block sandstone; + public static Block noteblock; + public static Block bed; + public static Block golden_rail; + public static Block detector_rail; + public static BlockPistonBase sticky_piston; + public static Block web; + public static BlockTallGrass tallgrass; + public static BlockDeadBush deadbush; + public static BlockPistonBase piston; + public static BlockPistonExtension piston_head; + public static Block wool; + public static BlockPistonMoving piston_extension; + public static BlockFlower yellow_flower; + public static BlockFlower red_flower; + public static BlockBush brown_mushroom; + public static BlockBush red_mushroom; + public static Block gold_block; + public static Block iron_block; + public static BlockSlab double_stone_slab; + public static BlockSlab stone_slab; + public static Block brick_block; + public static Block tnt; + public static Block bookshelf; + public static Block mossy_cobblestone; + public static Block obsidian; + public static Block torch; + public static BlockFire fire; + public static Block mob_spawner; + public static Block oak_stairs; + public static BlockChest chest; + public static BlockRedstoneWire redstone_wire; + public static Block diamond_ore; + public static Block diamond_block; + public static Block crafting_table; + public static Block wheat; + public static Block farmland; + public static Block furnace; + public static Block lit_furnace; + public static Block standing_sign; + public static Block oak_door; + public static Block spruce_door; + public static Block birch_door; + public static Block jungle_door; + public static Block acacia_door; + public static Block dark_oak_door; + public static Block ladder; + public static Block rail; + public static Block stone_stairs; + public static Block wall_sign; + public static Block lever; + public static Block stone_pressure_plate; + public static Block iron_door; + public static Block wooden_pressure_plate; + public static Block redstone_ore; + public static Block lit_redstone_ore; + public static Block unlit_redstone_torch; + public static Block redstone_torch; + public static Block stone_button; + public static Block snow_layer; + public static Block ice; + public static Block snow; + public static BlockCactus cactus; + public static Block clay; + public static BlockReed reeds; + public static Block jukebox; + public static Block oak_fence; + public static Block spruce_fence; + public static Block birch_fence; + public static Block jungle_fence; + public static Block dark_oak_fence; + public static Block acacia_fence; + public static Block pumpkin; + public static Block netherrack; + public static Block soul_sand; + public static Block glowstone; + public static BlockPortal portal; + public static Block lit_pumpkin; + public static Block cake; + public static BlockRedstoneRepeater unpowered_repeater; + public static BlockRedstoneRepeater powered_repeater; + public static Block trapdoor; + public static Block monster_egg; + public static Block stonebrick; + public static Block brown_mushroom_block; + public static Block red_mushroom_block; + public static Block iron_bars; + public static Block glass_pane; + public static Block melon_block; + public static Block pumpkin_stem; + public static Block melon_stem; + public static Block vine; + public static Block oak_fence_gate; + public static Block spruce_fence_gate; + public static Block birch_fence_gate; + public static Block jungle_fence_gate; + public static Block dark_oak_fence_gate; + public static Block acacia_fence_gate; + public static Block brick_stairs; + public static Block stone_brick_stairs; + public static BlockMycelium mycelium; + public static Block waterlily; + public static Block nether_brick; + public static Block nether_brick_fence; + public static Block nether_brick_stairs; + public static Block nether_wart; + public static Block enchanting_table; + public static Block brewing_stand; + public static BlockCauldron cauldron; + public static Block end_portal; + public static Block end_portal_frame; + public static Block end_stone; + public static Block dragon_egg; + public static Block redstone_lamp; + public static Block lit_redstone_lamp; + public static BlockSlab double_wooden_slab; + public static BlockSlab wooden_slab; + public static Block cocoa; + public static Block sandstone_stairs; + public static Block emerald_ore; + public static Block ender_chest; + public static BlockTripWireHook tripwire_hook; + public static Block tripwire; + public static Block emerald_block; + public static Block spruce_stairs; + public static Block birch_stairs; + public static Block jungle_stairs; + public static Block command_block; + public static BlockBeacon beacon; + public static Block cobblestone_wall; + public static Block flower_pot; + public static Block carrots; + public static Block potatoes; + public static Block wooden_button; + public static BlockSkull skull; + public static Block anvil; + public static Block trapped_chest; + public static Block light_weighted_pressure_plate; + public static Block heavy_weighted_pressure_plate; + public static BlockRedstoneComparator unpowered_comparator; + public static BlockRedstoneComparator powered_comparator; + public static BlockDaylightDetector daylight_detector; + public static BlockDaylightDetector daylight_detector_inverted; + public static Block redstone_block; + public static Block quartz_ore; + public static BlockHopper hopper; + public static Block quartz_block; + public static Block quartz_stairs; + public static Block activator_rail; + public static Block dropper; + public static Block stained_hardened_clay; + public static Block barrier; + public static Block iron_trapdoor; + public static Block hay_block; + public static Block carpet; + public static Block hardened_clay; + public static Block coal_block; + public static Block packed_ice; + public static Block acacia_stairs; + public static Block dark_oak_stairs; + public static Block slime_block; + public static BlockDoublePlant double_plant; + public static BlockStainedGlass stained_glass; + public static BlockStainedGlassPane stained_glass_pane; + public static Block prismarine; + public static Block sea_lantern; + public static Block standing_banner; + public static Block wall_banner; + public static Block red_sandstone; + public static Block red_sandstone_stairs; + public static BlockSlab double_stone_slab2; + public static BlockSlab stone_slab2; + + /**+ + * Returns the Block in the blockRegistry with the specified + * name. + */ + private static Block getRegisteredBlock(String parString1) { + return (Block) Block.blockRegistry.getObject(new ResourceLocation(parString1)); + } + + static void doBootstrap() { + if (!Bootstrap.isRegistered()) { + throw new RuntimeException("Accessed Blocks before Bootstrap!"); + } else { + air = getRegisteredBlock("air"); + stone = getRegisteredBlock("stone"); + grass = (BlockGrass) getRegisteredBlock("grass"); + dirt = getRegisteredBlock("dirt"); + cobblestone = getRegisteredBlock("cobblestone"); + planks = getRegisteredBlock("planks"); + sapling = getRegisteredBlock("sapling"); + bedrock = getRegisteredBlock("bedrock"); + flowing_water = (BlockDynamicLiquid) getRegisteredBlock("flowing_water"); + water = (BlockStaticLiquid) getRegisteredBlock("water"); + flowing_lava = (BlockDynamicLiquid) getRegisteredBlock("flowing_lava"); + lava = (BlockStaticLiquid) getRegisteredBlock("lava"); + sand = (BlockSand) getRegisteredBlock("sand"); + gravel = getRegisteredBlock("gravel"); + gold_ore = getRegisteredBlock("gold_ore"); + iron_ore = getRegisteredBlock("iron_ore"); + coal_ore = getRegisteredBlock("coal_ore"); + log = getRegisteredBlock("log"); + log2 = getRegisteredBlock("log2"); + leaves = (BlockLeaves) getRegisteredBlock("leaves"); + leaves2 = (BlockLeaves) getRegisteredBlock("leaves2"); + sponge = getRegisteredBlock("sponge"); + glass = getRegisteredBlock("glass"); + lapis_ore = getRegisteredBlock("lapis_ore"); + lapis_block = getRegisteredBlock("lapis_block"); + dispenser = getRegisteredBlock("dispenser"); + sandstone = getRegisteredBlock("sandstone"); + noteblock = getRegisteredBlock("noteblock"); + bed = getRegisteredBlock("bed"); + golden_rail = getRegisteredBlock("golden_rail"); + detector_rail = getRegisteredBlock("detector_rail"); + sticky_piston = (BlockPistonBase) getRegisteredBlock("sticky_piston"); + web = getRegisteredBlock("web"); + tallgrass = (BlockTallGrass) getRegisteredBlock("tallgrass"); + deadbush = (BlockDeadBush) getRegisteredBlock("deadbush"); + piston = (BlockPistonBase) getRegisteredBlock("piston"); + piston_head = (BlockPistonExtension) getRegisteredBlock("piston_head"); + wool = getRegisteredBlock("wool"); + piston_extension = (BlockPistonMoving) getRegisteredBlock("piston_extension"); + yellow_flower = (BlockFlower) getRegisteredBlock("yellow_flower"); + red_flower = (BlockFlower) getRegisteredBlock("red_flower"); + brown_mushroom = (BlockBush) getRegisteredBlock("brown_mushroom"); + red_mushroom = (BlockBush) getRegisteredBlock("red_mushroom"); + gold_block = getRegisteredBlock("gold_block"); + iron_block = getRegisteredBlock("iron_block"); + double_stone_slab = (BlockSlab) getRegisteredBlock("double_stone_slab"); + stone_slab = (BlockSlab) getRegisteredBlock("stone_slab"); + brick_block = getRegisteredBlock("brick_block"); + tnt = getRegisteredBlock("tnt"); + bookshelf = getRegisteredBlock("bookshelf"); + mossy_cobblestone = getRegisteredBlock("mossy_cobblestone"); + obsidian = getRegisteredBlock("obsidian"); + torch = getRegisteredBlock("torch"); + fire = (BlockFire) getRegisteredBlock("fire"); + mob_spawner = getRegisteredBlock("mob_spawner"); + oak_stairs = getRegisteredBlock("oak_stairs"); + chest = (BlockChest) getRegisteredBlock("chest"); + redstone_wire = (BlockRedstoneWire) getRegisteredBlock("redstone_wire"); + diamond_ore = getRegisteredBlock("diamond_ore"); + diamond_block = getRegisteredBlock("diamond_block"); + crafting_table = getRegisteredBlock("crafting_table"); + wheat = getRegisteredBlock("wheat"); + farmland = getRegisteredBlock("farmland"); + furnace = getRegisteredBlock("furnace"); + lit_furnace = getRegisteredBlock("lit_furnace"); + standing_sign = getRegisteredBlock("standing_sign"); + oak_door = getRegisteredBlock("wooden_door"); + spruce_door = getRegisteredBlock("spruce_door"); + birch_door = getRegisteredBlock("birch_door"); + jungle_door = getRegisteredBlock("jungle_door"); + acacia_door = getRegisteredBlock("acacia_door"); + dark_oak_door = getRegisteredBlock("dark_oak_door"); + ladder = getRegisteredBlock("ladder"); + rail = getRegisteredBlock("rail"); + stone_stairs = getRegisteredBlock("stone_stairs"); + wall_sign = getRegisteredBlock("wall_sign"); + lever = getRegisteredBlock("lever"); + stone_pressure_plate = getRegisteredBlock("stone_pressure_plate"); + iron_door = getRegisteredBlock("iron_door"); + wooden_pressure_plate = getRegisteredBlock("wooden_pressure_plate"); + redstone_ore = getRegisteredBlock("redstone_ore"); + lit_redstone_ore = getRegisteredBlock("lit_redstone_ore"); + unlit_redstone_torch = getRegisteredBlock("unlit_redstone_torch"); + redstone_torch = getRegisteredBlock("redstone_torch"); + stone_button = getRegisteredBlock("stone_button"); + snow_layer = getRegisteredBlock("snow_layer"); + ice = getRegisteredBlock("ice"); + snow = getRegisteredBlock("snow"); + cactus = (BlockCactus) getRegisteredBlock("cactus"); + clay = getRegisteredBlock("clay"); + reeds = (BlockReed) getRegisteredBlock("reeds"); + jukebox = getRegisteredBlock("jukebox"); + oak_fence = getRegisteredBlock("fence"); + spruce_fence = getRegisteredBlock("spruce_fence"); + birch_fence = getRegisteredBlock("birch_fence"); + jungle_fence = getRegisteredBlock("jungle_fence"); + dark_oak_fence = getRegisteredBlock("dark_oak_fence"); + acacia_fence = getRegisteredBlock("acacia_fence"); + pumpkin = getRegisteredBlock("pumpkin"); + netherrack = getRegisteredBlock("netherrack"); + soul_sand = getRegisteredBlock("soul_sand"); + glowstone = getRegisteredBlock("glowstone"); + portal = (BlockPortal) getRegisteredBlock("portal"); + lit_pumpkin = getRegisteredBlock("lit_pumpkin"); + cake = getRegisteredBlock("cake"); + unpowered_repeater = (BlockRedstoneRepeater) getRegisteredBlock("unpowered_repeater"); + powered_repeater = (BlockRedstoneRepeater) getRegisteredBlock("powered_repeater"); + trapdoor = getRegisteredBlock("trapdoor"); + monster_egg = getRegisteredBlock("monster_egg"); + stonebrick = getRegisteredBlock("stonebrick"); + brown_mushroom_block = getRegisteredBlock("brown_mushroom_block"); + red_mushroom_block = getRegisteredBlock("red_mushroom_block"); + iron_bars = getRegisteredBlock("iron_bars"); + glass_pane = getRegisteredBlock("glass_pane"); + melon_block = getRegisteredBlock("melon_block"); + pumpkin_stem = getRegisteredBlock("pumpkin_stem"); + melon_stem = getRegisteredBlock("melon_stem"); + vine = getRegisteredBlock("vine"); + oak_fence_gate = getRegisteredBlock("fence_gate"); + spruce_fence_gate = getRegisteredBlock("spruce_fence_gate"); + birch_fence_gate = getRegisteredBlock("birch_fence_gate"); + jungle_fence_gate = getRegisteredBlock("jungle_fence_gate"); + dark_oak_fence_gate = getRegisteredBlock("dark_oak_fence_gate"); + acacia_fence_gate = getRegisteredBlock("acacia_fence_gate"); + brick_stairs = getRegisteredBlock("brick_stairs"); + stone_brick_stairs = getRegisteredBlock("stone_brick_stairs"); + mycelium = (BlockMycelium) getRegisteredBlock("mycelium"); + waterlily = getRegisteredBlock("waterlily"); + nether_brick = getRegisteredBlock("nether_brick"); + nether_brick_fence = getRegisteredBlock("nether_brick_fence"); + nether_brick_stairs = getRegisteredBlock("nether_brick_stairs"); + nether_wart = getRegisteredBlock("nether_wart"); + enchanting_table = getRegisteredBlock("enchanting_table"); + brewing_stand = getRegisteredBlock("brewing_stand"); + cauldron = (BlockCauldron) getRegisteredBlock("cauldron"); + end_portal = getRegisteredBlock("end_portal"); + end_portal_frame = getRegisteredBlock("end_portal_frame"); + end_stone = getRegisteredBlock("end_stone"); + dragon_egg = getRegisteredBlock("dragon_egg"); + redstone_lamp = getRegisteredBlock("redstone_lamp"); + lit_redstone_lamp = getRegisteredBlock("lit_redstone_lamp"); + double_wooden_slab = (BlockSlab) getRegisteredBlock("double_wooden_slab"); + wooden_slab = (BlockSlab) getRegisteredBlock("wooden_slab"); + cocoa = getRegisteredBlock("cocoa"); + sandstone_stairs = getRegisteredBlock("sandstone_stairs"); + emerald_ore = getRegisteredBlock("emerald_ore"); + ender_chest = getRegisteredBlock("ender_chest"); + tripwire_hook = (BlockTripWireHook) getRegisteredBlock("tripwire_hook"); + tripwire = getRegisteredBlock("tripwire"); + emerald_block = getRegisteredBlock("emerald_block"); + spruce_stairs = getRegisteredBlock("spruce_stairs"); + birch_stairs = getRegisteredBlock("birch_stairs"); + jungle_stairs = getRegisteredBlock("jungle_stairs"); + command_block = getRegisteredBlock("command_block"); + beacon = (BlockBeacon) getRegisteredBlock("beacon"); + cobblestone_wall = getRegisteredBlock("cobblestone_wall"); + flower_pot = getRegisteredBlock("flower_pot"); + carrots = getRegisteredBlock("carrots"); + potatoes = getRegisteredBlock("potatoes"); + wooden_button = getRegisteredBlock("wooden_button"); + skull = (BlockSkull) getRegisteredBlock("skull"); + anvil = getRegisteredBlock("anvil"); + trapped_chest = getRegisteredBlock("trapped_chest"); + light_weighted_pressure_plate = getRegisteredBlock("light_weighted_pressure_plate"); + heavy_weighted_pressure_plate = getRegisteredBlock("heavy_weighted_pressure_plate"); + unpowered_comparator = (BlockRedstoneComparator) getRegisteredBlock("unpowered_comparator"); + powered_comparator = (BlockRedstoneComparator) getRegisteredBlock("powered_comparator"); + daylight_detector = (BlockDaylightDetector) getRegisteredBlock("daylight_detector"); + daylight_detector_inverted = (BlockDaylightDetector) getRegisteredBlock("daylight_detector_inverted"); + redstone_block = getRegisteredBlock("redstone_block"); + quartz_ore = getRegisteredBlock("quartz_ore"); + hopper = (BlockHopper) getRegisteredBlock("hopper"); + quartz_block = getRegisteredBlock("quartz_block"); + quartz_stairs = getRegisteredBlock("quartz_stairs"); + activator_rail = getRegisteredBlock("activator_rail"); + dropper = getRegisteredBlock("dropper"); + stained_hardened_clay = getRegisteredBlock("stained_hardened_clay"); + barrier = getRegisteredBlock("barrier"); + iron_trapdoor = getRegisteredBlock("iron_trapdoor"); + hay_block = getRegisteredBlock("hay_block"); + carpet = getRegisteredBlock("carpet"); + hardened_clay = getRegisteredBlock("hardened_clay"); + coal_block = getRegisteredBlock("coal_block"); + packed_ice = getRegisteredBlock("packed_ice"); + acacia_stairs = getRegisteredBlock("acacia_stairs"); + dark_oak_stairs = getRegisteredBlock("dark_oak_stairs"); + slime_block = getRegisteredBlock("slime"); + double_plant = (BlockDoublePlant) getRegisteredBlock("double_plant"); + stained_glass = (BlockStainedGlass) getRegisteredBlock("stained_glass"); + stained_glass_pane = (BlockStainedGlassPane) getRegisteredBlock("stained_glass_pane"); + prismarine = getRegisteredBlock("prismarine"); + sea_lantern = getRegisteredBlock("sea_lantern"); + standing_banner = getRegisteredBlock("standing_banner"); + wall_banner = getRegisteredBlock("wall_banner"); + red_sandstone = getRegisteredBlock("red_sandstone"); + red_sandstone_stairs = getRegisteredBlock("red_sandstone_stairs"); + double_stone_slab2 = (BlockSlab) getRegisteredBlock("double_stone_slab2"); + stone_slab2 = (BlockSlab) getRegisteredBlock("stone_slab2"); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Bootstrap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Bootstrap.java new file mode 100644 index 0000000..b193dc8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Bootstrap.java @@ -0,0 +1,493 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init; + +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import java.io.PrintStream; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPumpkin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTNT; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorProjectileDispense; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBehaviorDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IProjectile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityExpBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFireworkRocket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityTNTPrimed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEnderman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySmallFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemAxe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBucket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMonsterPlacer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPickaxe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSpade; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.LoggingPrintStream; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Bootstrap { + + static { + __checkIntegratedContextValid("net/minecraft/init/Bootstrap"); + } + + private static final PrintStream SYSOUT = System.out; + /**+ + * Whether the blocks, items, etc have already been registered + */ + private static boolean alreadyRegistered = false; + private static final Logger LOGGER = LogManager.getLogger(); + + /**+ + * Is Bootstrap registration already done? + */ + public static boolean isRegistered() { + return alreadyRegistered; + } + + static void registerDispenserBehaviors() { + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.arrow, new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World world, IPosition iposition) { + EntityArrow entityarrow = new EntityArrow(world, iposition.getX(), iposition.getY(), iposition.getZ()); + entityarrow.canBePickedUp = 1; + return entityarrow; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.egg, new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World world, IPosition iposition) { + return new EntityEgg(world, iposition.getX(), iposition.getY(), iposition.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.snowball, new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World world, IPosition iposition) { + return new EntitySnowball(world, iposition.getX(), iposition.getY(), iposition.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.experience_bottle, new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World world, IPosition iposition) { + return new EntityExpBottle(world, iposition.getX(), iposition.getY(), iposition.getZ()); + } + + protected float func_82498_a() { + return super.func_82498_a() * 0.5F; + } + + protected float func_82500_b() { + return super.func_82500_b() * 1.25F; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.potionitem, new IBehaviorDispenseItem() { + private final BehaviorDefaultDispenseItem field_150843_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispense(IBlockSource iblocksource, final ItemStack itemstack) { + return ItemPotion.isSplash(itemstack.getMetadata()) ? (new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World world, IPosition iposition) { + return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), + itemstack.copy()); + } + + protected float func_82498_a() { + return super.func_82498_a() * 0.5F; + } + + protected float func_82500_b() { + return super.func_82500_b() * 1.25F; + } + }).dispense(iblocksource, itemstack) : this.field_150843_b.dispense(iblocksource, itemstack); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.spawn_egg, new BehaviorDefaultDispenseItem() { + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + double d0 = iblocksource.getX() + (double) enumfacing.getFrontOffsetX(); + double d1 = (double) ((float) iblocksource.getBlockPos().getY() + 0.2F); + double d2 = iblocksource.getZ() + (double) enumfacing.getFrontOffsetZ(); + Entity entity = ItemMonsterPlacer.spawnCreature(iblocksource.getWorld(), itemstack.getMetadata(), d0, + d1, d2); + if (entity instanceof EntityLivingBase && itemstack.hasDisplayName()) { + ((EntityLiving) entity).setCustomNameTag(itemstack.getDisplayName()); + } + + itemstack.splitStack(1); + return itemstack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fireworks, new BehaviorDefaultDispenseItem() { + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + double d0 = iblocksource.getX() + (double) enumfacing.getFrontOffsetX(); + double d1 = (double) ((float) iblocksource.getBlockPos().getY() + 0.2F); + double d2 = iblocksource.getZ() + (double) enumfacing.getFrontOffsetZ(); + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(iblocksource.getWorld(), d0, d1, + d2, itemstack); + iblocksource.getWorld().spawnEntityInWorld(entityfireworkrocket); + itemstack.splitStack(1); + return itemstack; + } + + protected void playDispenseSound(IBlockSource iblocksource) { + iblocksource.getWorld().playAuxSFX(1002, iblocksource.getBlockPos(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fire_charge, new BehaviorDefaultDispenseItem() { + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + IPosition iposition = BlockDispenser.getDispensePosition(iblocksource); + double d0 = iposition.getX() + (double) ((float) enumfacing.getFrontOffsetX() * 0.3F); + double d1 = iposition.getY() + (double) ((float) enumfacing.getFrontOffsetY() * 0.3F); + double d2 = iposition.getZ() + (double) ((float) enumfacing.getFrontOffsetZ() * 0.3F); + World world = iblocksource.getWorld(); + EaglercraftRandom random = world.rand; + double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.getFrontOffsetX(); + double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.getFrontOffsetY(); + double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.getFrontOffsetZ(); + world.spawnEntityInWorld(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5)); + itemstack.splitStack(1); + return itemstack; + } + + protected void playDispenseSound(IBlockSource iblocksource) { + iblocksource.getWorld().playAuxSFX(1009, iblocksource.getBlockPos(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.boat, new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem field_150842_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + World world = iblocksource.getWorld(); + double d0 = iblocksource.getX() + (double) ((float) enumfacing.getFrontOffsetX() * 1.125F); + double d1 = iblocksource.getY() + (double) ((float) enumfacing.getFrontOffsetY() * 1.125F); + double d2 = iblocksource.getZ() + (double) ((float) enumfacing.getFrontOffsetZ() * 1.125F); + BlockPos blockpos = iblocksource.getBlockPos().offset(enumfacing); + Material material = world.getBlockState(blockpos).getBlock().getMaterial(); + double d3; + if (Material.water.equals(material)) { + d3 = 1.0D; + } else { + if (!Material.air.equals(material) + || !Material.water.equals(world.getBlockState(blockpos.down()).getBlock().getMaterial())) { + return this.field_150842_b.dispense(iblocksource, itemstack); + } + + d3 = 0.0D; + } + + EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2); + world.spawnEntityInWorld(entityboat); + itemstack.splitStack(1); + return itemstack; + } + + protected void playDispenseSound(IBlockSource iblocksource) { + iblocksource.getWorld().playAuxSFX(1000, iblocksource.getBlockPos(), 0); + } + }); + BehaviorDefaultDispenseItem behaviordefaultdispenseitem = new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem field_150841_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + ItemBucket itembucket = (ItemBucket) itemstack.getItem(); + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + if (itembucket.tryPlaceContainedLiquid(iblocksource.getWorld(), blockpos)) { + itemstack.setItem(Items.bucket); + itemstack.stackSize = 1; + return itemstack; + } else { + return this.field_150841_b.dispense(iblocksource, itemstack); + } + } + }; + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.lava_bucket, behaviordefaultdispenseitem); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.water_bucket, behaviordefaultdispenseitem); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + World world = iblocksource.getWorld(); + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + Material material = block.getMaterial(); + Item item; + if (Material.water.equals(material) && block instanceof BlockLiquid + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) { + item = Items.water_bucket; + } else { + if (!Material.lava.equals(material) || !(block instanceof BlockLiquid) + || ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() != 0) { + return super.dispenseStack(iblocksource, itemstack); + } + + item = Items.lava_bucket; + } + + world.setBlockToAir(blockpos); + if (--itemstack.stackSize == 0) { + itemstack.setItem(item); + itemstack.stackSize = 1; + } else if (((TileEntityDispenser) iblocksource.getBlockTileEntity()) + .addItemStack(new ItemStack(item)) < 0) { + this.field_150840_b.dispense(iblocksource, new ItemStack(item)); + } + + return itemstack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.flint_and_steel, new BehaviorDefaultDispenseItem() { + private boolean field_150839_b = true; + + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + World world = iblocksource.getWorld(); + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + if (world.isAirBlock(blockpos)) { + world.setBlockState(blockpos, Blocks.fire.getDefaultState()); + if (itemstack.attemptDamageItem(1, world.rand)) { + itemstack.stackSize = 0; + } + } else if (world.getBlockState(blockpos).getBlock() == Blocks.tnt) { + Blocks.tnt.onBlockDestroyedByPlayer(world, blockpos, + Blocks.tnt.getDefaultState().withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true))); + world.setBlockToAir(blockpos); + } else { + this.field_150839_b = false; + } + + return itemstack; + } + + protected void playDispenseSound(IBlockSource iblocksource) { + if (this.field_150839_b) { + iblocksource.getWorld().playAuxSFX(1000, iblocksource.getBlockPos(), 0); + } else { + iblocksource.getWorld().playAuxSFX(1001, iblocksource.getBlockPos(), 0); + } + + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.dye, new BehaviorDefaultDispenseItem() { + private boolean field_150838_b = true; + + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + if (EnumDyeColor.WHITE == EnumDyeColor.byDyeDamage(itemstack.getMetadata())) { + World world = iblocksource.getWorld(); + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + if (ItemDye.applyBonemeal(itemstack, world, blockpos)) { + world.playAuxSFX(2005, blockpos, 0); + } else { + this.field_150838_b = false; + } + + return itemstack; + } else { + return super.dispenseStack(iblocksource, itemstack); + } + } + + protected void playDispenseSound(IBlockSource iblocksource) { + if (this.field_150838_b) { + iblocksource.getWorld().playAuxSFX(1000, iblocksource.getBlockPos(), 0); + } else { + iblocksource.getWorld().playAuxSFX(1001, iblocksource.getBlockPos(), 0); + } + + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.tnt), + new BehaviorDefaultDispenseItem() { + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + World world = iblocksource.getWorld(); + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockpos.getX() + 0.5D, + (double) blockpos.getY(), (double) blockpos.getZ() + 0.5D, (EntityLivingBase) null); + world.spawnEntityInWorld(entitytntprimed); + world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); + --itemstack.stackSize; + return itemstack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.skull, new BehaviorDefaultDispenseItem() { + private boolean field_179240_b = true; + + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + World world = iblocksource.getWorld(); + EnumFacing enumfacing = BlockDispenser.getFacing(iblocksource.getBlockMetadata()); + BlockPos blockpos = iblocksource.getBlockPos().offset(enumfacing); + BlockSkull blockskull = Blocks.skull; + if (world.isAirBlock(blockpos) && blockskull.canDispenserPlace(world, blockpos, itemstack)) { + { + world.setBlockState(blockpos, + blockskull.getDefaultState().withProperty(BlockSkull.FACING, EnumFacing.UP), 3); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntitySkull) { + if (itemstack.getMetadata() == 3) { + GameProfile gameprofile = null; + if (itemstack.hasTagCompound()) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + if (nbttagcompound.hasKey("SkullOwner", 10)) { + gameprofile = NBTUtil + .readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } else if (nbttagcompound.hasKey("SkullOwner", 8)) { + String s = nbttagcompound.getString("SkullOwner"); + if (!StringUtils.isNullOrEmpty(s)) { + gameprofile = new GameProfile((EaglercraftUUID) null, s); + } + } + } + + ((TileEntitySkull) tileentity).setPlayerProfile(gameprofile); + } else { + ((TileEntitySkull) tileentity).setType(itemstack.getMetadata()); + } + + ((TileEntitySkull) tileentity) + .setSkullRotation(enumfacing.getOpposite().getHorizontalIndex() * 4); + Blocks.skull.checkWitherSpawn(world, blockpos, (TileEntitySkull) tileentity); + } + + --itemstack.stackSize; + } + } else { + this.field_179240_b = false; + } + + return itemstack; + } + + protected void playDispenseSound(IBlockSource iblocksource) { + if (this.field_179240_b) { + iblocksource.getWorld().playAuxSFX(1000, iblocksource.getBlockPos(), 0); + } else { + iblocksource.getWorld().playAuxSFX(1001, iblocksource.getBlockPos(), 0); + } + + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.pumpkin), + new BehaviorDefaultDispenseItem() { + private boolean field_179241_b = true; + + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + World world = iblocksource.getWorld(); + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + BlockPumpkin blockpumpkin = (BlockPumpkin) Blocks.pumpkin; + if (world.isAirBlock(blockpos) && blockpumpkin.canDispenserPlace(world, blockpos)) { + world.setBlockState(blockpos, blockpumpkin.getDefaultState(), 3); + --itemstack.stackSize; + } else { + this.field_179241_b = false; + } + + return itemstack; + } + + protected void playDispenseSound(IBlockSource iblocksource) { + if (this.field_179241_b) { + iblocksource.getWorld().playAuxSFX(1000, iblocksource.getBlockPos(), 0); + } else { + iblocksource.getWorld().playAuxSFX(1001, iblocksource.getBlockPos(), 0); + } + + } + }); + } + + /**+ + * Registers blocks, items, stats, etc. + */ + public static void register() { + if (!alreadyRegistered) { + alreadyRegistered = true; + if (LOGGER.isDebugEnabled()) { + redirectOutputToLog(); + } + + Block.registerBlocks(); + Blocks.doBootstrap(); + BiomeGenBase.doBootstrap(); + BlockFire.init(); + EntityEnderman.doBootstrap(); + ItemAxe.doBootstrap(); + ItemPickaxe.doBootstrap(); + ItemSpade.doBootstrap(); + Item.registerItems(); + Items.doBootstrap(); + StatList.init(); + registerDispenserBehaviors(); + } + } + + /**+ + * redirect standard streams to logger + */ + private static void redirectOutputToLog() { + System.setErr(new LoggingPrintStream("STDERR", true, System.err)); + System.setOut(new LoggingPrintStream("STDOUT", false, SYSOUT)); + } + + public static void printToSYSOUT(String parString1) { + SYSOUT.println(parString1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Items.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Items.java new file mode 100644 index 0000000..1ebe429 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Items.java @@ -0,0 +1,429 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Bootstrap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEmptyMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEnchantedBook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishingRod; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemShears; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Items { + + static { + __checkIntegratedContextValid("net/minecraft/init/Items"); + } + + public static Item iron_shovel; + public static Item iron_pickaxe; + public static Item iron_axe; + public static Item flint_and_steel; + public static Item apple; + public static ItemBow bow; + public static Item arrow; + public static Item coal; + public static Item diamond; + public static Item iron_ingot; + public static Item gold_ingot; + public static Item iron_sword; + public static Item wooden_sword; + public static Item wooden_shovel; + public static Item wooden_pickaxe; + public static Item wooden_axe; + public static Item stone_sword; + public static Item stone_shovel; + public static Item stone_pickaxe; + public static Item stone_axe; + public static Item diamond_sword; + public static Item diamond_shovel; + public static Item diamond_pickaxe; + public static Item diamond_axe; + public static Item stick; + public static Item bowl; + public static Item mushroom_stew; + public static Item golden_sword; + public static Item golden_shovel; + public static Item golden_pickaxe; + public static Item golden_axe; + public static Item string; + public static Item feather; + public static Item gunpowder; + public static Item wooden_hoe; + public static Item stone_hoe; + public static Item iron_hoe; + public static Item diamond_hoe; + public static Item golden_hoe; + public static Item wheat_seeds; + public static Item wheat; + public static Item bread; + public static ItemArmor leather_helmet; + public static ItemArmor leather_chestplate; + public static ItemArmor leather_leggings; + public static ItemArmor leather_boots; + public static ItemArmor chainmail_helmet; + public static ItemArmor chainmail_chestplate; + public static ItemArmor chainmail_leggings; + public static ItemArmor chainmail_boots; + public static ItemArmor iron_helmet; + public static ItemArmor iron_chestplate; + public static ItemArmor iron_leggings; + public static ItemArmor iron_boots; + public static ItemArmor diamond_helmet; + public static ItemArmor diamond_chestplate; + public static ItemArmor diamond_leggings; + public static ItemArmor diamond_boots; + public static ItemArmor golden_helmet; + public static ItemArmor golden_chestplate; + public static ItemArmor golden_leggings; + public static ItemArmor golden_boots; + public static Item flint; + public static Item porkchop; + public static Item cooked_porkchop; + public static Item painting; + public static Item golden_apple; + public static Item sign; + public static Item oak_door; + public static Item spruce_door; + public static Item birch_door; + public static Item jungle_door; + public static Item acacia_door; + public static Item dark_oak_door; + public static Item bucket; + public static Item water_bucket; + public static Item lava_bucket; + public static Item minecart; + public static Item saddle; + public static Item iron_door; + public static Item redstone; + public static Item snowball; + public static Item boat; + public static Item leather; + public static Item milk_bucket; + public static Item brick; + public static Item clay_ball; + public static Item reeds; + public static Item paper; + public static Item book; + public static Item slime_ball; + public static Item chest_minecart; + public static Item furnace_minecart; + public static Item egg; + public static Item compass; + public static ItemFishingRod fishing_rod; + public static Item clock; + public static Item glowstone_dust; + public static Item fish; + public static Item cooked_fish; + public static Item dye; + public static Item bone; + public static Item sugar; + public static Item cake; + public static Item bed; + public static Item repeater; + public static Item cookie; + public static ItemMap filled_map; + public static ItemShears shears; + public static Item melon; + public static Item pumpkin_seeds; + public static Item melon_seeds; + public static Item beef; + public static Item cooked_beef; + public static Item chicken; + public static Item cooked_chicken; + public static Item mutton; + public static Item cooked_mutton; + public static Item rabbit; + public static Item cooked_rabbit; + public static Item rabbit_stew; + public static Item rabbit_foot; + public static Item rabbit_hide; + public static Item rotten_flesh; + public static Item ender_pearl; + public static Item blaze_rod; + public static Item ghast_tear; + public static Item gold_nugget; + public static Item nether_wart; + public static ItemPotion potionitem; + public static Item glass_bottle; + public static Item spider_eye; + public static Item fermented_spider_eye; + public static Item blaze_powder; + public static Item magma_cream; + public static Item brewing_stand; + public static Item cauldron; + public static Item ender_eye; + public static Item speckled_melon; + public static Item spawn_egg; + public static Item experience_bottle; + public static Item fire_charge; + public static Item writable_book; + public static Item written_book; + public static Item emerald; + public static Item item_frame; + public static Item flower_pot; + public static Item carrot; + public static Item potato; + public static Item baked_potato; + public static Item poisonous_potato; + public static ItemEmptyMap map; + public static Item golden_carrot; + public static Item skull; + public static Item carrot_on_a_stick; + public static Item nether_star; + public static Item pumpkin_pie; + public static Item fireworks; + public static Item firework_charge; + public static ItemEnchantedBook enchanted_book; + public static Item comparator; + public static Item netherbrick; + public static Item quartz; + public static Item tnt_minecart; + public static Item hopper_minecart; + public static ItemArmorStand armor_stand; + public static Item iron_horse_armor; + public static Item golden_horse_armor; + public static Item diamond_horse_armor; + public static Item lead; + public static Item name_tag; + public static Item command_block_minecart; + public static Item record_13; + public static Item record_cat; + public static Item record_blocks; + public static Item record_chirp; + public static Item record_far; + public static Item record_mall; + public static Item record_mellohi; + public static Item record_stal; + public static Item record_strad; + public static Item record_ward; + public static Item record_11; + public static Item record_wait; + public static Item prismarine_shard; + public static Item prismarine_crystals; + public static Item banner; + + private static Item getRegisteredItem(String name) { + return (Item) Item.itemRegistry.getObject(new ResourceLocation(name)); + } + + static void doBootstrap() { + if (!Bootstrap.isRegistered()) { + throw new RuntimeException("Accessed Items before Bootstrap!"); + } else { + iron_shovel = getRegisteredItem("iron_shovel"); + iron_pickaxe = getRegisteredItem("iron_pickaxe"); + iron_axe = getRegisteredItem("iron_axe"); + flint_and_steel = getRegisteredItem("flint_and_steel"); + apple = getRegisteredItem("apple"); + bow = (ItemBow) getRegisteredItem("bow"); + arrow = getRegisteredItem("arrow"); + coal = getRegisteredItem("coal"); + diamond = getRegisteredItem("diamond"); + iron_ingot = getRegisteredItem("iron_ingot"); + gold_ingot = getRegisteredItem("gold_ingot"); + iron_sword = getRegisteredItem("iron_sword"); + wooden_sword = getRegisteredItem("wooden_sword"); + wooden_shovel = getRegisteredItem("wooden_shovel"); + wooden_pickaxe = getRegisteredItem("wooden_pickaxe"); + wooden_axe = getRegisteredItem("wooden_axe"); + stone_sword = getRegisteredItem("stone_sword"); + stone_shovel = getRegisteredItem("stone_shovel"); + stone_pickaxe = getRegisteredItem("stone_pickaxe"); + stone_axe = getRegisteredItem("stone_axe"); + diamond_sword = getRegisteredItem("diamond_sword"); + diamond_shovel = getRegisteredItem("diamond_shovel"); + diamond_pickaxe = getRegisteredItem("diamond_pickaxe"); + diamond_axe = getRegisteredItem("diamond_axe"); + stick = getRegisteredItem("stick"); + bowl = getRegisteredItem("bowl"); + mushroom_stew = getRegisteredItem("mushroom_stew"); + golden_sword = getRegisteredItem("golden_sword"); + golden_shovel = getRegisteredItem("golden_shovel"); + golden_pickaxe = getRegisteredItem("golden_pickaxe"); + golden_axe = getRegisteredItem("golden_axe"); + string = getRegisteredItem("string"); + feather = getRegisteredItem("feather"); + gunpowder = getRegisteredItem("gunpowder"); + wooden_hoe = getRegisteredItem("wooden_hoe"); + stone_hoe = getRegisteredItem("stone_hoe"); + iron_hoe = getRegisteredItem("iron_hoe"); + diamond_hoe = getRegisteredItem("diamond_hoe"); + golden_hoe = getRegisteredItem("golden_hoe"); + wheat_seeds = getRegisteredItem("wheat_seeds"); + wheat = getRegisteredItem("wheat"); + bread = getRegisteredItem("bread"); + leather_helmet = (ItemArmor) getRegisteredItem("leather_helmet"); + leather_chestplate = (ItemArmor) getRegisteredItem("leather_chestplate"); + leather_leggings = (ItemArmor) getRegisteredItem("leather_leggings"); + leather_boots = (ItemArmor) getRegisteredItem("leather_boots"); + chainmail_helmet = (ItemArmor) getRegisteredItem("chainmail_helmet"); + chainmail_chestplate = (ItemArmor) getRegisteredItem("chainmail_chestplate"); + chainmail_leggings = (ItemArmor) getRegisteredItem("chainmail_leggings"); + chainmail_boots = (ItemArmor) getRegisteredItem("chainmail_boots"); + iron_helmet = (ItemArmor) getRegisteredItem("iron_helmet"); + iron_chestplate = (ItemArmor) getRegisteredItem("iron_chestplate"); + iron_leggings = (ItemArmor) getRegisteredItem("iron_leggings"); + iron_boots = (ItemArmor) getRegisteredItem("iron_boots"); + diamond_helmet = (ItemArmor) getRegisteredItem("diamond_helmet"); + diamond_chestplate = (ItemArmor) getRegisteredItem("diamond_chestplate"); + diamond_leggings = (ItemArmor) getRegisteredItem("diamond_leggings"); + diamond_boots = (ItemArmor) getRegisteredItem("diamond_boots"); + golden_helmet = (ItemArmor) getRegisteredItem("golden_helmet"); + golden_chestplate = (ItemArmor) getRegisteredItem("golden_chestplate"); + golden_leggings = (ItemArmor) getRegisteredItem("golden_leggings"); + golden_boots = (ItemArmor) getRegisteredItem("golden_boots"); + flint = getRegisteredItem("flint"); + porkchop = getRegisteredItem("porkchop"); + cooked_porkchop = getRegisteredItem("cooked_porkchop"); + painting = getRegisteredItem("painting"); + golden_apple = getRegisteredItem("golden_apple"); + sign = getRegisteredItem("sign"); + oak_door = getRegisteredItem("wooden_door"); + spruce_door = getRegisteredItem("spruce_door"); + birch_door = getRegisteredItem("birch_door"); + jungle_door = getRegisteredItem("jungle_door"); + acacia_door = getRegisteredItem("acacia_door"); + dark_oak_door = getRegisteredItem("dark_oak_door"); + bucket = getRegisteredItem("bucket"); + water_bucket = getRegisteredItem("water_bucket"); + lava_bucket = getRegisteredItem("lava_bucket"); + minecart = getRegisteredItem("minecart"); + saddle = getRegisteredItem("saddle"); + iron_door = getRegisteredItem("iron_door"); + redstone = getRegisteredItem("redstone"); + snowball = getRegisteredItem("snowball"); + boat = getRegisteredItem("boat"); + leather = getRegisteredItem("leather"); + milk_bucket = getRegisteredItem("milk_bucket"); + brick = getRegisteredItem("brick"); + clay_ball = getRegisteredItem("clay_ball"); + reeds = getRegisteredItem("reeds"); + paper = getRegisteredItem("paper"); + book = getRegisteredItem("book"); + slime_ball = getRegisteredItem("slime_ball"); + chest_minecart = getRegisteredItem("chest_minecart"); + furnace_minecart = getRegisteredItem("furnace_minecart"); + egg = getRegisteredItem("egg"); + compass = getRegisteredItem("compass"); + fishing_rod = (ItemFishingRod) getRegisteredItem("fishing_rod"); + clock = getRegisteredItem("clock"); + glowstone_dust = getRegisteredItem("glowstone_dust"); + fish = getRegisteredItem("fish"); + cooked_fish = getRegisteredItem("cooked_fish"); + dye = getRegisteredItem("dye"); + bone = getRegisteredItem("bone"); + sugar = getRegisteredItem("sugar"); + cake = getRegisteredItem("cake"); + bed = getRegisteredItem("bed"); + repeater = getRegisteredItem("repeater"); + cookie = getRegisteredItem("cookie"); + filled_map = (ItemMap) getRegisteredItem("filled_map"); + shears = (ItemShears) getRegisteredItem("shears"); + melon = getRegisteredItem("melon"); + pumpkin_seeds = getRegisteredItem("pumpkin_seeds"); + melon_seeds = getRegisteredItem("melon_seeds"); + beef = getRegisteredItem("beef"); + cooked_beef = getRegisteredItem("cooked_beef"); + chicken = getRegisteredItem("chicken"); + cooked_chicken = getRegisteredItem("cooked_chicken"); + mutton = getRegisteredItem("mutton"); + cooked_mutton = getRegisteredItem("cooked_mutton"); + rabbit = getRegisteredItem("rabbit"); + cooked_rabbit = getRegisteredItem("cooked_rabbit"); + rabbit_stew = getRegisteredItem("rabbit_stew"); + rabbit_foot = getRegisteredItem("rabbit_foot"); + rabbit_hide = getRegisteredItem("rabbit_hide"); + rotten_flesh = getRegisteredItem("rotten_flesh"); + ender_pearl = getRegisteredItem("ender_pearl"); + blaze_rod = getRegisteredItem("blaze_rod"); + ghast_tear = getRegisteredItem("ghast_tear"); + gold_nugget = getRegisteredItem("gold_nugget"); + nether_wart = getRegisteredItem("nether_wart"); + potionitem = (ItemPotion) getRegisteredItem("potion"); + glass_bottle = getRegisteredItem("glass_bottle"); + spider_eye = getRegisteredItem("spider_eye"); + fermented_spider_eye = getRegisteredItem("fermented_spider_eye"); + blaze_powder = getRegisteredItem("blaze_powder"); + magma_cream = getRegisteredItem("magma_cream"); + brewing_stand = getRegisteredItem("brewing_stand"); + cauldron = getRegisteredItem("cauldron"); + ender_eye = getRegisteredItem("ender_eye"); + speckled_melon = getRegisteredItem("speckled_melon"); + spawn_egg = getRegisteredItem("spawn_egg"); + experience_bottle = getRegisteredItem("experience_bottle"); + fire_charge = getRegisteredItem("fire_charge"); + writable_book = getRegisteredItem("writable_book"); + written_book = getRegisteredItem("written_book"); + emerald = getRegisteredItem("emerald"); + item_frame = getRegisteredItem("item_frame"); + flower_pot = getRegisteredItem("flower_pot"); + carrot = getRegisteredItem("carrot"); + potato = getRegisteredItem("potato"); + baked_potato = getRegisteredItem("baked_potato"); + poisonous_potato = getRegisteredItem("poisonous_potato"); + map = (ItemEmptyMap) getRegisteredItem("map"); + golden_carrot = getRegisteredItem("golden_carrot"); + skull = getRegisteredItem("skull"); + carrot_on_a_stick = getRegisteredItem("carrot_on_a_stick"); + nether_star = getRegisteredItem("nether_star"); + pumpkin_pie = getRegisteredItem("pumpkin_pie"); + fireworks = getRegisteredItem("fireworks"); + firework_charge = getRegisteredItem("firework_charge"); + enchanted_book = (ItemEnchantedBook) getRegisteredItem("enchanted_book"); + comparator = getRegisteredItem("comparator"); + netherbrick = getRegisteredItem("netherbrick"); + quartz = getRegisteredItem("quartz"); + tnt_minecart = getRegisteredItem("tnt_minecart"); + hopper_minecart = getRegisteredItem("hopper_minecart"); + armor_stand = (ItemArmorStand) getRegisteredItem("armor_stand"); + iron_horse_armor = getRegisteredItem("iron_horse_armor"); + golden_horse_armor = getRegisteredItem("golden_horse_armor"); + diamond_horse_armor = getRegisteredItem("diamond_horse_armor"); + lead = getRegisteredItem("lead"); + name_tag = getRegisteredItem("name_tag"); + command_block_minecart = getRegisteredItem("command_block_minecart"); + record_13 = getRegisteredItem("record_13"); + record_cat = getRegisteredItem("record_cat"); + record_blocks = getRegisteredItem("record_blocks"); + record_chirp = getRegisteredItem("record_chirp"); + record_far = getRegisteredItem("record_far"); + record_mall = getRegisteredItem("record_mall"); + record_mellohi = getRegisteredItem("record_mellohi"); + record_stal = getRegisteredItem("record_stal"); + record_strad = getRegisteredItem("record_strad"); + record_ward = getRegisteredItem("record_ward"); + record_11 = getRegisteredItem("record_11"); + record_wait = getRegisteredItem("record_wait"); + prismarine_shard = getRegisteredItem("prismarine_shard"); + prismarine_crystals = getRegisteredItem("prismarine_crystals"); + banner = getRegisteredItem("banner"); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/AnimalChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/AnimalChest.java new file mode 100644 index 0000000..89a10c8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/AnimalChest.java @@ -0,0 +1,41 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 AnimalChest extends InventoryBasic { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/AnimalChest"); + } + + public AnimalChest(String inventoryName, int slotCount) { + super(inventoryName, false, slotCount); + } + + public AnimalChest(IChatComponent invTitle, int slotCount) { + super(invTitle, slotCount); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Container.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Container.java new file mode 100644 index 0000000..0f9a519 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Container.java @@ -0,0 +1,689 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/Container"); + } + + /**+ + * the list of all items(stacks) for the corresponding slot + */ + public List inventoryItemStacks = Lists.newArrayList(); + /**+ + * the list of all slots in the inventory + */ + public List inventorySlots = Lists.newArrayList(); + public int windowId; + private short transactionID; + /**+ + * The current drag mode (0 : evenly split, 1 : one item by + * slot, 2 : not used ?) + */ + private int dragMode = -1; + private int dragEvent; + /**+ + * The list of slots where the itemstack holds will be + * distributed + */ + private final Set dragSlots = Sets.newHashSet(); + /**+ + * list of all people that need to be notified when this + * craftinventory changes + */ + protected List crafters = Lists.newArrayList(); + private Set playerList = Sets.newHashSet(); + + /**+ + * Adds an item slot to this container + */ + protected Slot addSlotToContainer(Slot slotIn) { + slotIn.slotNumber = this.inventorySlots.size(); + this.inventorySlots.add(slotIn); + this.inventoryItemStacks.add((ItemStack) null); + return slotIn; + } + + public void onCraftGuiOpened(ICrafting listener) { + if (this.crafters.contains(listener)) { + throw new IllegalArgumentException("Listener already listening"); + } else { + this.crafters.add(listener); + listener.updateCraftingInventory(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + + /**+ + * Remove the given Listener. Method name is for legacy. + */ + public void removeCraftingFromCrafters(ICrafting listeners) { + this.crafters.remove(listeners); + } + + /**+ + * returns a list if itemStacks, for each slot. + */ + public List getInventory() { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < this.inventorySlots.size(); ++i) { + arraylist.add(((Slot) this.inventorySlots.get(i)).getStack()); + } + + return arraylist; + } + + /**+ + * Looks for changes made in the container, sends them to every + * listener. + */ + public void detectAndSendChanges() { + for (int i = 0; i < this.inventorySlots.size(); ++i) { + ItemStack itemstack = ((Slot) this.inventorySlots.get(i)).getStack(); + ItemStack itemstack1 = (ItemStack) this.inventoryItemStacks.get(i); + if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) { + itemstack1 = itemstack == null ? null : itemstack.copy(); + this.inventoryItemStacks.set(i, itemstack1); + + for (int j = 0; j < this.crafters.size(); ++j) { + ((ICrafting) this.crafters.get(j)).sendSlotContents(this, i, itemstack1); + } + } + } + + } + + /**+ + * Handles the given Button-click on the server, currently only + * used by enchanting. Name is for legacy. + */ + public boolean enchantItem(EntityPlayer playerIn, int id) { + return false; + } + + public Slot getSlotFromInventory(IInventory inv, int slotIn) { + for (int i = 0; i < this.inventorySlots.size(); ++i) { + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot.isHere(inv, slotIn)) { + return slot; + } + } + + return null; + } + + public Slot getSlot(int slotId) { + return (Slot) this.inventorySlots.get(slotId); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer var1, int i) { + Slot slot = (Slot) this.inventorySlots.get(i); + return slot != null ? slot.getStack() : null; + } + + /**+ + * Handles slot click. + */ + public ItemStack slotClick(int slotId, int clickedButton, int mode, EntityPlayer playerIn) { + ItemStack itemstack = null; + InventoryPlayer inventoryplayer = playerIn.inventory; + if (mode == 5) { + int i = this.dragEvent; + this.dragEvent = getDragEvent(clickedButton); + if ((i != 1 || this.dragEvent != 2) && i != this.dragEvent) { + this.resetDrag(); + } else if (inventoryplayer.getItemStack() == null) { + this.resetDrag(); + } else if (this.dragEvent == 0) { + this.dragMode = extractDragMode(clickedButton); + if (isValidDragMode(this.dragMode, playerIn)) { + this.dragEvent = 1; + this.dragSlots.clear(); + } else { + this.resetDrag(); + } + } else if (this.dragEvent == 1) { + Slot slot = (Slot) this.inventorySlots.get(slotId); + if (slot != null && canAddItemToSlot(slot, inventoryplayer.getItemStack(), true) + && slot.isItemValid(inventoryplayer.getItemStack()) + && inventoryplayer.getItemStack().stackSize > this.dragSlots.size() + && this.canDragIntoSlot(slot)) { + this.dragSlots.add(slot); + } + } else if (this.dragEvent == 2) { + if (!this.dragSlots.isEmpty()) { + ItemStack itemstack3 = inventoryplayer.getItemStack().copy(); + int j = inventoryplayer.getItemStack().stackSize; + + for (Slot slot1 : this.dragSlots) { + if (slot1 != null && canAddItemToSlot(slot1, inventoryplayer.getItemStack(), true) + && slot1.isItemValid(inventoryplayer.getItemStack()) + && inventoryplayer.getItemStack().stackSize >= this.dragSlots.size() + && this.canDragIntoSlot(slot1)) { + ItemStack itemstack1 = itemstack3.copy(); + int k = slot1.getHasStack() ? slot1.getStack().stackSize : 0; + computeStackSize(this.dragSlots, this.dragMode, itemstack1, k); + if (itemstack1.stackSize > itemstack1.getMaxStackSize()) { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + + if (itemstack1.stackSize > slot1.getItemStackLimit(itemstack1)) { + itemstack1.stackSize = slot1.getItemStackLimit(itemstack1); + } + + j -= itemstack1.stackSize - k; + slot1.putStack(itemstack1); + } + } + + itemstack3.stackSize = j; + if (itemstack3.stackSize <= 0) { + itemstack3 = null; + } + + inventoryplayer.setItemStack(itemstack3); + } + + this.resetDrag(); + } else { + this.resetDrag(); + } + } else if (this.dragEvent != 0) { + this.resetDrag(); + } else if ((mode == 0 || mode == 1) && (clickedButton == 0 || clickedButton == 1)) { + if (slotId == -999) { + if (inventoryplayer.getItemStack() != null) { + if (clickedButton == 0) { + playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), true); + inventoryplayer.setItemStack((ItemStack) null); + } + + if (clickedButton == 1) { + playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack().splitStack(1), true); + if (inventoryplayer.getItemStack().stackSize == 0) { + inventoryplayer.setItemStack((ItemStack) null); + } + } + } + } else if (mode == 1) { + if (slotId < 0) { + return null; + } + + Slot slot6 = (Slot) this.inventorySlots.get(slotId); + if (slot6 != null && slot6.canTakeStack(playerIn)) { + ItemStack itemstack8 = this.transferStackInSlot(playerIn, slotId); + if (itemstack8 != null) { + Item item = itemstack8.getItem(); + itemstack = itemstack8.copy(); + if (slot6.getStack() != null && slot6.getStack().getItem() == item) { + this.retrySlotClick(slotId, clickedButton, true, playerIn); + } + } + } + } else { + if (slotId < 0) { + return null; + } + + Slot slot7 = (Slot) this.inventorySlots.get(slotId); + if (slot7 != null) { + ItemStack itemstack9 = slot7.getStack(); + ItemStack itemstack10 = inventoryplayer.getItemStack(); + if (itemstack9 != null) { + itemstack = itemstack9.copy(); + } + + if (itemstack9 == null) { + if (itemstack10 != null && slot7.isItemValid(itemstack10)) { + int k2 = clickedButton == 0 ? itemstack10.stackSize : 1; + if (k2 > slot7.getItemStackLimit(itemstack10)) { + k2 = slot7.getItemStackLimit(itemstack10); + } + + if (itemstack10.stackSize >= k2) { + slot7.putStack(itemstack10.splitStack(k2)); + } + + if (itemstack10.stackSize == 0) { + inventoryplayer.setItemStack((ItemStack) null); + } + } + } else if (slot7.canTakeStack(playerIn)) { + if (itemstack10 == null) { + int j2 = clickedButton == 0 ? itemstack9.stackSize : (itemstack9.stackSize + 1) / 2; + ItemStack itemstack12 = slot7.decrStackSize(j2); + inventoryplayer.setItemStack(itemstack12); + if (itemstack9.stackSize == 0) { + slot7.putStack((ItemStack) null); + } + + slot7.onPickupFromSlot(playerIn, inventoryplayer.getItemStack()); + } else if (slot7.isItemValid(itemstack10)) { + if (itemstack9.getItem() == itemstack10.getItem() + && itemstack9.getMetadata() == itemstack10.getMetadata() + && ItemStack.areItemStackTagsEqual(itemstack9, itemstack10)) { + int i2 = clickedButton == 0 ? itemstack10.stackSize : 1; + if (i2 > slot7.getItemStackLimit(itemstack10) - itemstack9.stackSize) { + i2 = slot7.getItemStackLimit(itemstack10) - itemstack9.stackSize; + } + + if (i2 > itemstack10.getMaxStackSize() - itemstack9.stackSize) { + i2 = itemstack10.getMaxStackSize() - itemstack9.stackSize; + } + + itemstack10.splitStack(i2); + if (itemstack10.stackSize == 0) { + inventoryplayer.setItemStack((ItemStack) null); + } + + itemstack9.stackSize += i2; + } else if (itemstack10.stackSize <= slot7.getItemStackLimit(itemstack10)) { + slot7.putStack(itemstack10); + inventoryplayer.setItemStack(itemstack9); + } + } else if (itemstack9.getItem() == itemstack10.getItem() && itemstack10.getMaxStackSize() > 1 + && (!itemstack9.getHasSubtypes() + || itemstack9.getMetadata() == itemstack10.getMetadata()) + && ItemStack.areItemStackTagsEqual(itemstack9, itemstack10)) { + int l1 = itemstack9.stackSize; + if (l1 > 0 && l1 + itemstack10.stackSize <= itemstack10.getMaxStackSize()) { + itemstack10.stackSize += l1; + itemstack9 = slot7.decrStackSize(l1); + if (itemstack9.stackSize == 0) { + slot7.putStack((ItemStack) null); + } + + slot7.onPickupFromSlot(playerIn, inventoryplayer.getItemStack()); + } + } + } + + slot7.onSlotChanged(); + } + } + } else if (mode == 2 && clickedButton >= 0 && clickedButton < 9) { + Slot slot5 = (Slot) this.inventorySlots.get(slotId); + if (slot5.canTakeStack(playerIn)) { + ItemStack itemstack7 = inventoryplayer.getStackInSlot(clickedButton); + boolean flag = itemstack7 == null + || slot5.inventory == inventoryplayer && slot5.isItemValid(itemstack7); + int k1 = -1; + if (!flag) { + k1 = inventoryplayer.getFirstEmptyStack(); + flag |= k1 > -1; + } + + if (slot5.getHasStack() && flag) { + ItemStack itemstack11 = slot5.getStack(); + inventoryplayer.setInventorySlotContents(clickedButton, itemstack11.copy()); + if ((slot5.inventory != inventoryplayer || !slot5.isItemValid(itemstack7)) && itemstack7 != null) { + if (k1 > -1) { + inventoryplayer.addItemStackToInventory(itemstack7); + slot5.decrStackSize(itemstack11.stackSize); + slot5.putStack((ItemStack) null); + slot5.onPickupFromSlot(playerIn, itemstack11); + } + } else { + slot5.decrStackSize(itemstack11.stackSize); + slot5.putStack(itemstack7); + slot5.onPickupFromSlot(playerIn, itemstack11); + } + } else if (!slot5.getHasStack() && itemstack7 != null && slot5.isItemValid(itemstack7)) { + inventoryplayer.setInventorySlotContents(clickedButton, (ItemStack) null); + slot5.putStack(itemstack7); + } + } + } else if (mode == 3 && playerIn.capabilities.isCreativeMode && inventoryplayer.getItemStack() == null + && slotId >= 0) { + Slot slot4 = (Slot) this.inventorySlots.get(slotId); + if (slot4 != null && slot4.getHasStack()) { + ItemStack itemstack6 = slot4.getStack().copy(); + itemstack6.stackSize = itemstack6.getMaxStackSize(); + inventoryplayer.setItemStack(itemstack6); + } + } else if (mode == 4 && inventoryplayer.getItemStack() == null && slotId >= 0) { + Slot slot3 = (Slot) this.inventorySlots.get(slotId); + if (slot3 != null && slot3.getHasStack() && slot3.canTakeStack(playerIn)) { + ItemStack itemstack5 = slot3.decrStackSize(clickedButton == 0 ? 1 : slot3.getStack().stackSize); + slot3.onPickupFromSlot(playerIn, itemstack5); + playerIn.dropPlayerItemWithRandomChoice(itemstack5, true); + } + } else if (mode == 6 && slotId >= 0) { + Slot slot2 = (Slot) this.inventorySlots.get(slotId); + ItemStack itemstack4 = inventoryplayer.getItemStack(); + if (itemstack4 != null && (slot2 == null || !slot2.getHasStack() || !slot2.canTakeStack(playerIn))) { + int i1 = clickedButton == 0 ? 0 : this.inventorySlots.size() - 1; + int j1 = clickedButton == 0 ? 1 : -1; + + for (int l2 = 0; l2 < 2; ++l2) { + for (int i3 = i1; i3 >= 0 && i3 < this.inventorySlots.size() + && itemstack4.stackSize < itemstack4.getMaxStackSize(); i3 += j1) { + Slot slot8 = (Slot) this.inventorySlots.get(i3); + if (slot8.getHasStack() && canAddItemToSlot(slot8, itemstack4, true) + && slot8.canTakeStack(playerIn) && this.canMergeSlot(itemstack4, slot8) + && (l2 != 0 || slot8.getStack().stackSize != slot8.getStack().getMaxStackSize())) { + int l = Math.min(itemstack4.getMaxStackSize() - itemstack4.stackSize, + slot8.getStack().stackSize); + ItemStack itemstack2 = slot8.decrStackSize(l); + itemstack4.stackSize += l; + if (itemstack2.stackSize <= 0) { + slot8.putStack((ItemStack) null); + } + + slot8.onPickupFromSlot(playerIn, itemstack2); + } + } + } + } + + this.detectAndSendChanges(); + } + + return itemstack; + } + + /**+ + * Called to determine if the current slot is valid for the + * stack merging (double-click) code. The stack passed in is + * null for the initial slot that was double-clicked. + */ + public boolean canMergeSlot(ItemStack var1, Slot var2) { + return true; + } + + /**+ + * Retries slotClick() in case of failure + */ + protected void retrySlotClick(int i, int j, boolean var3, EntityPlayer entityplayer) { + this.slotClick(i, j, 1, entityplayer); + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer playerIn) { + InventoryPlayer inventoryplayer = playerIn.inventory; + if (inventoryplayer.getItemStack() != null) { + playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), false); + inventoryplayer.setItemStack((ItemStack) null); + } + + } + + /**+ + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory inventoryIn) { + this.detectAndSendChanges(); + } + + /**+ + * args: slotID, itemStack to put in slot + */ + public void putStackInSlot(int slotID, ItemStack stack) { + this.getSlot(slotID).putStack(stack); + } + + /**+ + * places itemstacks in first x slots, x being aitemstack.lenght + */ + public void putStacksInSlots(ItemStack[] parArrayOfItemStack) { + for (int i = 0; i < parArrayOfItemStack.length; ++i) { + this.getSlot(i).putStack(parArrayOfItemStack[i]); + } + + } + + public void updateProgressBar(int id, int data) { + } + + /**+ + * Gets a unique transaction ID. Parameter is unused. + */ + public short getNextTransactionID(InventoryPlayer parInventoryPlayer) { + ++this.transactionID; + return this.transactionID; + } + + /**+ + * gets whether or not the player can craft in this inventory or + * not + */ + public boolean getCanCraft(EntityPlayer parEntityPlayer) { + return !this.playerList.contains(parEntityPlayer); + } + + /**+ + * sets whether the player can craft in this inventory or not + */ + public void setCanCraft(EntityPlayer parEntityPlayer, boolean parFlag) { + if (parFlag) { + this.playerList.remove(parEntityPlayer); + } else { + this.playerList.add(parEntityPlayer); + } + + } + + public abstract boolean canInteractWith(EntityPlayer var1); + + /**+ + * Merges provided ItemStack with the first avaliable one in the + * container/player inventor between minIndex (included) and + * maxIndex (excluded). Args : stack, minIndex, maxIndex, + * negativDirection. /!\ the Container implementation do not + * check if the item is valid for the slot + */ + protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) { + boolean flag = false; + int i = startIndex; + if (reverseDirection) { + i = endIndex - 1; + } + + if (stack.isStackable()) { + while (stack.stackSize > 0 && (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex)) { + Slot slot = (Slot) this.inventorySlots.get(i); + ItemStack itemstack = slot.getStack(); + if (itemstack != null && itemstack.getItem() == stack.getItem() + && (!stack.getHasSubtypes() || stack.getMetadata() == itemstack.getMetadata()) + && ItemStack.areItemStackTagsEqual(stack, itemstack)) { + int j = itemstack.stackSize + stack.stackSize; + if (j <= stack.getMaxStackSize()) { + stack.stackSize = 0; + itemstack.stackSize = j; + slot.onSlotChanged(); + flag = true; + } else if (itemstack.stackSize < stack.getMaxStackSize()) { + stack.stackSize -= stack.getMaxStackSize() - itemstack.stackSize; + itemstack.stackSize = stack.getMaxStackSize(); + slot.onSlotChanged(); + flag = true; + } + } + + if (reverseDirection) { + --i; + } else { + ++i; + } + } + } + + if (stack.stackSize > 0) { + if (reverseDirection) { + i = endIndex - 1; + } else { + i = startIndex; + } + + while (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex) { + Slot slot1 = (Slot) this.inventorySlots.get(i); + ItemStack itemstack1 = slot1.getStack(); + if (itemstack1 == null) { + slot1.putStack(stack.copy()); + slot1.onSlotChanged(); + stack.stackSize = 0; + flag = true; + break; + } + + if (reverseDirection) { + --i; + } else { + ++i; + } + } + } + + return flag; + } + + /**+ + * Extracts the drag mode. Args : eventButton. Return (0 : + * evenly split, 1 : one item by slot, 2 : not used ?) + */ + public static int extractDragMode(int parInt1) { + return parInt1 >> 2 & 3; + } + + /**+ + * Args : clickedButton, Returns (0 : start drag, 1 : add slot, + * 2 : end drag) + */ + public static int getDragEvent(int parInt1) { + return parInt1 & 3; + } + + public static int func_94534_d(int parInt1, int parInt2) { + return parInt1 & 3 | (parInt2 & 3) << 2; + } + + public static boolean isValidDragMode(int dragModeIn, EntityPlayer player) { + return dragModeIn == 0 ? true + : (dragModeIn == 1 ? true : dragModeIn == 2 && player.capabilities.isCreativeMode); + } + + /**+ + * Reset the drag fields + */ + protected void resetDrag() { + this.dragEvent = 0; + this.dragSlots.clear(); + } + + /**+ + * Checks if it's possible to add the given itemstack to the + * given slot. + */ + public static boolean canAddItemToSlot(Slot slotIn, ItemStack stack, boolean stackSizeMatters) { + boolean flag = slotIn == null || !slotIn.getHasStack(); + if (slotIn != null && slotIn.getHasStack() && stack != null && stack.isItemEqual(slotIn.getStack()) + && ItemStack.areItemStackTagsEqual(slotIn.getStack(), stack)) { + flag |= slotIn.getStack().stackSize + (stackSizeMatters ? 0 : stack.stackSize) <= stack.getMaxStackSize(); + } + + return flag; + } + + /**+ + * Compute the new stack size, Returns the stack with the new + * size. Args : dragSlots, dragMode, dragStack, slotStackSize + */ + public static void computeStackSize(Set parSet, int parInt1, ItemStack parItemStack, int parInt2) { + switch (parInt1) { + case 0: + parItemStack.stackSize = MathHelper.floor_float((float) parItemStack.stackSize / (float) parSet.size()); + break; + case 1: + parItemStack.stackSize = 1; + break; + case 2: + parItemStack.stackSize = parItemStack.getItem().getItemStackLimit(); + } + + parItemStack.stackSize += parInt2; + } + + /**+ + * Returns true if the player can "drag-spilt" items into this + * slot,. returns true by default. Called to check if the slot + * can be added to a list of Slots to split the held ItemStack + * across. + */ + public boolean canDragIntoSlot(Slot var1) { + return true; + } + + /**+ + * Like the version that takes an inventory. If the given + * TileEntity is not an Inventory, 0 is returned instead. + */ + public static int calcRedstone(TileEntity te) { + return te instanceof IInventory ? calcRedstoneFromInventory((IInventory) te) : 0; + } + + public static int calcRedstoneFromInventory(IInventory inv) { + if (inv == null) { + return 0; + } else { + int i = 0; + float f = 0.0F; + + for (int j = 0; j < inv.getSizeInventory(); ++j) { + ItemStack itemstack = inv.getStackInSlot(j); + if (itemstack != null) { + f += (float) itemstack.stackSize + / (float) Math.min(inv.getInventoryStackLimit(), itemstack.getMaxStackSize()); + ++i; + } + } + + f = f / (float) inv.getSizeInventory(); + return MathHelper.floor_float(f * 14.0F) + (i > 0 ? 1 : 0); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBeacon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBeacon.java new file mode 100644 index 0000000..17b06be --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBeacon.java @@ -0,0 +1,154 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerBeacon extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerBeacon"); + } + + private IInventory tileBeacon; + private final ContainerBeacon.BeaconSlot beaconSlot; + + public ContainerBeacon(IInventory playerInventory, IInventory tileBeaconIn) { + this.tileBeacon = tileBeaconIn; + this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(tileBeaconIn, 0, 136, 110)); + byte b0 = 36; + short short1 = 137; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, b0 + j * 18, short1 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(playerInventory, k, b0 + k * 18, 58 + short1)); + } + + } + + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + icrafting.func_175173_a(this, this.tileBeacon); + } + + public void updateProgressBar(int i, int j) { + this.tileBeacon.setField(i, j); + } + + public IInventory func_180611_e() { + return this.tileBeacon; + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + if (entityplayer != null) { + ItemStack itemstack = this.beaconSlot.decrStackSize(this.beaconSlot.getSlotStackLimit()); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + + } + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.tileBeacon.isUseableByPlayer(entityplayer); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 0) { + if (!this.mergeItemStack(itemstack1, 1, 37, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } else if (!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(itemstack1) + && itemstack1.stackSize == 1) { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) { + return null; + } + } else if (i >= 1 && i < 28) { + if (!this.mergeItemStack(itemstack1, 28, 37, false)) { + return null; + } + } else if (i >= 28 && i < 37) { + if (!this.mergeItemStack(itemstack1, 1, 28, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 1, 37, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } + + class BeaconSlot extends Slot { + public BeaconSlot(IInventory parIInventory, int parInt1, int parInt2, int parInt3) { + super(parIInventory, parInt1, parInt2, parInt3); + } + + public boolean isItemValid(ItemStack itemstack) { + return itemstack == null ? false + : itemstack.getItem() == Items.emerald || itemstack.getItem() == Items.diamond + || itemstack.getItem() == Items.gold_ingot || itemstack.getItem() == Items.iron_ingot; + } + + public int getSlotStackLimit() { + return 1; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBrewingStand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBrewingStand.java new file mode 100644 index 0000000..1a5e427 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBrewingStand.java @@ -0,0 +1,193 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerBrewingStand extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerBrewingStand"); + } + + private IInventory tileBrewingStand; + private final Slot theSlot; + private int brewTime; + + public ContainerBrewingStand(InventoryPlayer playerInventory, IInventory tileBrewingStandIn) { + this.tileBrewingStand = tileBrewingStandIn; + this.addSlotToContainer( + new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 46)); + this.addSlotToContainer( + new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 53)); + this.addSlotToContainer( + new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 2, 102, 46)); + this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(tileBrewingStandIn, 3, 79, 17)); + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + + } + + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + icrafting.func_175173_a(this, this.tileBrewingStand); + } + + /**+ + * Looks for changes made in the container, sends them to every + * listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.brewTime != this.tileBrewingStand.getField(0)) { + icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getField(0)); + } + } + + this.brewTime = this.tileBrewingStand.getField(0); + } + + public void updateProgressBar(int i, int j) { + this.tileBrewingStand.setField(i, j); + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.tileBrewingStand.isUseableByPlayer(entityplayer); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if ((i < 0 || i > 2) && i != 3) { + if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) { + if (!this.mergeItemStack(itemstack1, 3, 4, false)) { + return null; + } + } else if (ContainerBrewingStand.Potion.canHoldPotion(itemstack)) { + if (!this.mergeItemStack(itemstack1, 0, 3, false)) { + return null; + } + } else if (i >= 4 && i < 31) { + if (!this.mergeItemStack(itemstack1, 31, 40, false)) { + return null; + } + } else if (i >= 31 && i < 40) { + if (!this.mergeItemStack(itemstack1, 4, 31, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 4, 40, false)) { + return null; + } + } else { + if (!this.mergeItemStack(itemstack1, 4, 40, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } + + class Ingredient extends Slot { + public Ingredient(IInventory inventoryIn, int index, int xPosition, int yPosition) { + super(inventoryIn, index, xPosition, yPosition); + } + + public boolean isItemValid(ItemStack itemstack) { + return itemstack != null ? itemstack.getItem().isPotionIngredient(itemstack) : false; + } + + public int getSlotStackLimit() { + return 64; + } + } + + static class Potion extends Slot { + private EntityPlayer player; + + public Potion(EntityPlayer playerIn, IInventory inventoryIn, int index, int xPosition, int yPosition) { + super(inventoryIn, index, xPosition, yPosition); + this.player = playerIn; + } + + public boolean isItemValid(ItemStack itemstack) { + return canHoldPotion(itemstack); + } + + public int getSlotStackLimit() { + return 1; + } + + public void onPickupFromSlot(EntityPlayer entityplayer, ItemStack itemstack) { + if (itemstack.getItem() == Items.potionitem && itemstack.getMetadata() > 0) { + this.player.triggerAchievement(AchievementList.potion); + } + + super.onPickupFromSlot(entityplayer, itemstack); + } + + public static boolean canHoldPotion(ItemStack parItemStack) { + return parItemStack != null + && (parItemStack.getItem() == Items.potionitem || parItemStack.getItem() == Items.glass_bottle); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerChest.java new file mode 100644 index 0000000..2c363ec --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerChest.java @@ -0,0 +1,109 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerChest extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerChest"); + } + + private IInventory lowerChestInventory; + private int numRows; + + public ContainerChest(IInventory playerInventory, IInventory chestInventory, EntityPlayer player) { + this.lowerChestInventory = chestInventory; + this.numRows = chestInventory.getSizeInventory() / 9; + chestInventory.openInventory(player); + int i = (this.numRows - 4) * 18; + + for (int j = 0; j < this.numRows; ++j) { + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(chestInventory, k + j * 9, 8 + k * 18, 18 + j * 18)); + } + } + + for (int l = 0; l < 3; ++l) { + for (int j1 = 0; j1 < 9; ++j1) { + this.addSlotToContainer(new Slot(playerInventory, j1 + l * 9 + 9, 8 + j1 * 18, 103 + l * 18 + i)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) { + this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 161 + i)); + } + + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.lowerChestInventory.isUseableByPlayer(entityplayer); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer var1, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i < this.numRows * 9) { + if (!this.mergeItemStack(itemstack1, this.numRows * 9, this.inventorySlots.size(), true)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 0, this.numRows * 9, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.lowerChestInventory.closeInventory(entityplayer); + } + + /**+ + * Return this chest container's lower chest inventory. + */ + public IInventory getLowerChestInventory() { + return this.lowerChestInventory; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerDispenser.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerDispenser.java new file mode 100644 index 0000000..676d82e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerDispenser.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerDispenser extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerDispenser"); + } + + private IInventory dispenserInventory; + + public ContainerDispenser(IInventory playerInventory, IInventory dispenserInventoryIn) { + this.dispenserInventory = dispenserInventoryIn; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + this.addSlotToContainer(new Slot(dispenserInventoryIn, j + i * 3, 62 + j * 18, 17 + i * 18)); + } + } + + for (int k = 0; k < 3; ++k) { + for (int i1 = 0; i1 < 9; ++i1) { + this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18)); + } + } + + for (int l = 0; l < 9; ++l) { + this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142)); + } + + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.dispenserInventory.isUseableByPlayer(entityplayer); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i < 9) { + if (!this.mergeItemStack(itemstack1, 9, 45, true)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 0, 9, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerEnchantment.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerEnchantment.java new file mode 100644 index 0000000..16cf7a6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerEnchantment.java @@ -0,0 +1,374 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerEnchantment extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerEnchantment"); + } + + public IInventory tableInventory; + private World worldPointer; + private BlockPos position; + private EaglercraftRandom rand; + public int xpSeed; + public int[] enchantLevels; + public int[] field_178151_h; + + public ContainerEnchantment(InventoryPlayer playerInv, World worldIn) { + this(playerInv, worldIn, BlockPos.ORIGIN); + } + + public ContainerEnchantment(InventoryPlayer playerInv, World worldIn, BlockPos pos) { + this.tableInventory = new InventoryBasic("Enchant", true, 2) { + public int getInventoryStackLimit() { + return 64; + } + + public void markDirty() { + super.markDirty(); + ContainerEnchantment.this.onCraftMatrixChanged(this); + } + }; + this.rand = new EaglercraftRandom(); + this.enchantLevels = new int[3]; + this.field_178151_h = new int[] { -1, -1, -1 }; + this.worldPointer = worldIn; + this.position = pos; + this.xpSeed = playerInv.player.getXPSeed(); + this.addSlotToContainer(new Slot(this.tableInventory, 0, 15, 47) { + public boolean isItemValid(ItemStack var1) { + return true; + } + + public int getSlotStackLimit() { + return 1; + } + }); + this.addSlotToContainer(new Slot(this.tableInventory, 1, 35, 47) { + public boolean isItemValid(ItemStack itemstack) { + return itemstack.getItem() == Items.dye + && EnumDyeColor.byDyeDamage(itemstack.getMetadata()) == EnumDyeColor.BLUE; + } + }); + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(playerInv, k, 8 + k * 18, 142)); + } + + } + + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + icrafting.sendProgressBarUpdate(this, 3, this.xpSeed & -16); + icrafting.sendProgressBarUpdate(this, 4, this.field_178151_h[0]); + icrafting.sendProgressBarUpdate(this, 5, this.field_178151_h[1]); + icrafting.sendProgressBarUpdate(this, 6, this.field_178151_h[2]); + } + + /**+ + * Looks for changes made in the container, sends them to every + * listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + icrafting.sendProgressBarUpdate(this, 3, this.xpSeed & -16); + icrafting.sendProgressBarUpdate(this, 4, this.field_178151_h[0]); + icrafting.sendProgressBarUpdate(this, 5, this.field_178151_h[1]); + icrafting.sendProgressBarUpdate(this, 6, this.field_178151_h[2]); + } + + } + + public void updateProgressBar(int i, int j) { + if (i >= 0 && i <= 2) { + this.enchantLevels[i] = j; + } else if (i == 3) { + this.xpSeed = j; + } else if (i >= 4 && i <= 6) { + this.field_178151_h[i - 4] = j; + } else { + super.updateProgressBar(i, j); + } + + } + + /**+ + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory iinventory) { + if (iinventory == this.tableInventory) { + ItemStack itemstack = iinventory.getStackInSlot(0); + if (itemstack != null && itemstack.isItemEnchantable()) { + { + int l = 0; + for (int j = -1; j <= 1; ++j) { + for (int k = -1; k <= 1; ++k) { + if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.position.add(k, 0, j)) + && this.worldPointer.isAirBlock(this.position.add(k, 1, j))) { + if (this.worldPointer.getBlockState(this.position.add(k * 2, 0, j * 2)) + .getBlock() == Blocks.bookshelf) { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k * 2, 1, j * 2)) + .getBlock() == Blocks.bookshelf) { + ++l; + } + + if (k != 0 && j != 0) { + if (this.worldPointer.getBlockState(this.position.add(k * 2, 0, j)) + .getBlock() == Blocks.bookshelf) { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k * 2, 1, j)) + .getBlock() == Blocks.bookshelf) { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k, 0, j * 2)) + .getBlock() == Blocks.bookshelf) { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k, 1, j * 2)) + .getBlock() == Blocks.bookshelf) { + ++l; + } + } + } + } + } + + this.rand.setSeed((long) this.xpSeed); + + for (int i1 = 0; i1 < 3; ++i1) { + this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, l, + itemstack); + this.field_178151_h[i1] = -1; + if (this.enchantLevels[i1] < i1 + 1) { + this.enchantLevels[i1] = 0; + } + } + + for (int j1 = 0; j1 < 3; ++j1) { + if (this.enchantLevels[j1] > 0) { + List list = this.func_178148_a(itemstack, j1, this.enchantLevels[j1]); + if (list != null && !list.isEmpty()) { + EnchantmentData enchantmentdata = (EnchantmentData) list + .get(this.rand.nextInt(list.size())); + this.field_178151_h[j1] = enchantmentdata.enchantmentobj.effectId + | enchantmentdata.enchantmentLevel << 8; + } + } + } + + this.detectAndSendChanges(); + } + } else { + for (int i = 0; i < 3; ++i) { + this.enchantLevels[i] = 0; + this.field_178151_h[i] = -1; + } + } + } + + } + + /**+ + * Handles the given Button-click on the server, currently only + * used by enchanting. Name is for legacy. + */ + public boolean enchantItem(EntityPlayer entityplayer, int i) { + ItemStack itemstack = this.tableInventory.getStackInSlot(0); + ItemStack itemstack1 = this.tableInventory.getStackInSlot(1); + int j = i + 1; + if ((itemstack1 == null || itemstack1.stackSize < j) && !entityplayer.capabilities.isCreativeMode) { + return false; + } else if (this.enchantLevels[i] > 0 && itemstack != null + && (entityplayer.experienceLevel >= j && entityplayer.experienceLevel >= this.enchantLevels[i] + || entityplayer.capabilities.isCreativeMode)) { + { + List list = this.func_178148_a(itemstack, i, this.enchantLevels[i]); + boolean flag = itemstack.getItem() == Items.book; + if (list != null) { + entityplayer.removeExperienceLevel(j); + if (flag) { + itemstack.setItem(Items.enchanted_book); + } + + for (int k = 0; k < list.size(); ++k) { + EnchantmentData enchantmentdata = (EnchantmentData) list.get(k); + if (flag) { + Items.enchanted_book.addEnchantment(itemstack, enchantmentdata); + } else { + itemstack.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel); + } + } + + if (!entityplayer.capabilities.isCreativeMode) { + itemstack1.stackSize -= j; + if (itemstack1.stackSize <= 0) { + this.tableInventory.setInventorySlotContents(1, (ItemStack) null); + } + } + + entityplayer.triggerAchievement(StatList.field_181739_W); + this.tableInventory.markDirty(); + this.xpSeed = entityplayer.getXPSeed(); + this.onCraftMatrixChanged(this.tableInventory); + } + } + + return true; + } else { + return false; + } + } + + private List func_178148_a(ItemStack stack, int parInt1, int parInt2) { + this.rand.setSeed((long) (this.xpSeed + parInt1)); + List list = EnchantmentHelper.buildEnchantmentList(this.rand, stack, parInt2); + if (stack.getItem() == Items.book && list != null && list.size() > 1) { + list.remove(this.rand.nextInt(list.size())); + } + + return list; + } + + public int getLapisAmount() { + ItemStack itemstack = this.tableInventory.getStackInSlot(1); + return itemstack == null ? 0 : itemstack.stackSize; + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + { + for (int i = 0; i < this.tableInventory.getSizeInventory(); ++i) { + ItemStack itemstack = this.tableInventory.removeStackFromSlot(i); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.worldPointer.getBlockState(this.position).getBlock() != Blocks.enchanting_table ? false + : entityplayer.getDistanceSq((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, + (double) this.position.getZ() + 0.5D) <= 64.0D; + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 0) { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) { + return null; + } + } else if (i == 1) { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) { + return null; + } + } else if (itemstack1.getItem() == Items.dye + && EnumDyeColor.byDyeDamage(itemstack1.getMetadata()) == EnumDyeColor.BLUE) { + if (!this.mergeItemStack(itemstack1, 1, 2, true)) { + return null; + } + } else { + if (((Slot) this.inventorySlots.get(0)).getHasStack() + || !((Slot) this.inventorySlots.get(0)).isItemValid(itemstack1)) { + return null; + } + + if (itemstack1.hasTagCompound() && itemstack1.stackSize == 1) { + ((Slot) this.inventorySlots.get(0)).putStack(itemstack1.copy()); + itemstack1.stackSize = 0; + } else if (itemstack1.stackSize >= 1) { + ((Slot) this.inventorySlots.get(0)) + .putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata())); + --itemstack1.stackSize; + } + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerFurnace.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerFurnace.java new file mode 100644 index 0000000..096ebd0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerFurnace.java @@ -0,0 +1,162 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotFurnaceFuel; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotFurnaceOutput; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.FurnaceRecipes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityFurnace; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerFurnace extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerFurnace"); + } + + private final IInventory tileFurnace; + private int field_178152_f; + private int field_178153_g; + private int field_178154_h; + private int field_178155_i; + + public ContainerFurnace(InventoryPlayer playerInventory, IInventory furnaceInventory) { + this.tileFurnace = furnaceInventory; + this.addSlotToContainer(new Slot(furnaceInventory, 0, 56, 17)); + this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 1, 56, 53)); + this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, furnaceInventory, 2, 116, 35)); + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + + } + + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + icrafting.func_175173_a(this, this.tileFurnace); + } + + /**+ + * Looks for changes made in the container, sends them to every + * listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.field_178152_f != this.tileFurnace.getField(2)) { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.getField(2)); + } + + if (this.field_178154_h != this.tileFurnace.getField(0)) { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.getField(0)); + } + + if (this.field_178155_i != this.tileFurnace.getField(1)) { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.getField(1)); + } + + if (this.field_178153_g != this.tileFurnace.getField(3)) { + icrafting.sendProgressBarUpdate(this, 3, this.tileFurnace.getField(3)); + } + } + + this.field_178152_f = this.tileFurnace.getField(2); + this.field_178154_h = this.tileFurnace.getField(0); + this.field_178155_i = this.tileFurnace.getField(1); + this.field_178153_g = this.tileFurnace.getField(3); + } + + public void updateProgressBar(int i, int j) { + this.tileFurnace.setField(i, j); + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.tileFurnace.isUseableByPlayer(entityplayer); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 2) { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } else if (i != 1 && i != 0) { + if (FurnaceRecipes.instance().getSmeltingResult(itemstack1) != null) { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) { + return null; + } + } else if (TileEntityFurnace.isItemFuel(itemstack1)) { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) { + return null; + } + } else if (i >= 3 && i < 30) { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) { + return null; + } + } else if (i >= 30 && i < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 3, 39, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHopper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHopper.java new file mode 100644 index 0000000..da3fcbc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHopper.java @@ -0,0 +1,100 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerHopper extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerHopper"); + } + + private final IInventory hopperInventory; + + public ContainerHopper(InventoryPlayer playerInventory, IInventory hopperInventoryIn, EntityPlayer player) { + this.hopperInventory = hopperInventoryIn; + hopperInventoryIn.openInventory(player); + byte b0 = 51; + + for (int i = 0; i < hopperInventoryIn.getSizeInventory(); ++i) { + this.addSlotToContainer(new Slot(hopperInventoryIn, i, 44 + i * 18, 20)); + } + + for (int k = 0; k < 3; ++k) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInventory, j + k * 9 + 9, 8 + j * 18, k * 18 + b0)); + } + } + + for (int l = 0; l < 9; ++l) { + this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 58 + b0)); + } + + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.hopperInventory.isUseableByPlayer(entityplayer); + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer var1, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i < this.hopperInventory.getSizeInventory()) { + if (!this.mergeItemStack(itemstack1, this.hopperInventory.getSizeInventory(), + this.inventorySlots.size(), true)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 0, this.hopperInventory.getSizeInventory(), false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.hopperInventory.closeInventory(entityplayer); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHorseInventory.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHorseInventory.java new file mode 100644 index 0000000..e3a37b0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHorseInventory.java @@ -0,0 +1,133 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerHorseInventory extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerHorseInventory"); + } + + private IInventory horseInventory; + private EntityHorse theHorse; + + public ContainerHorseInventory(IInventory playerInventory, final IInventory horseInventoryIn, + final EntityHorse horse, EntityPlayer player) { + this.horseInventory = horseInventoryIn; + this.theHorse = horse; + byte b0 = 3; + horseInventoryIn.openInventory(player); + int i = (b0 - 4) * 18; + this.addSlotToContainer(new Slot(horseInventoryIn, 0, 8, 18) { + public boolean isItemValid(ItemStack itemstack) { + return super.isItemValid(itemstack) && itemstack.getItem() == Items.saddle && !this.getHasStack(); + } + }); + this.addSlotToContainer(new Slot(horseInventoryIn, 1, 8, 36) { + public boolean isItemValid(ItemStack itemstack) { + return super.isItemValid(itemstack) && horse.canWearArmor() + && EntityHorse.isArmorItem(itemstack.getItem()); + } + + public boolean canBeHovered() { + return horse.canWearArmor(); + } + }); + if (horse.isChested()) { + for (int j = 0; j < b0; ++j) { + for (int k = 0; k < 5; ++k) { + this.addSlotToContainer(new Slot(horseInventoryIn, 2 + k + j * 5, 80 + k * 18, 18 + j * 18)); + } + } + } + + for (int l = 0; l < 3; ++l) { + for (int j1 = 0; j1 < 9; ++j1) { + this.addSlotToContainer(new Slot(playerInventory, j1 + l * 9 + 9, 8 + j1 * 18, 102 + l * 18 + i)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) { + this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 160 + i)); + } + + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.horseInventory.isUseableByPlayer(entityplayer) && this.theHorse.isEntityAlive() + && this.theHorse.getDistanceToEntity(entityplayer) < 8.0F; + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer var1, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i < this.horseInventory.getSizeInventory()) { + if (!this.mergeItemStack(itemstack1, this.horseInventory.getSizeInventory(), this.inventorySlots.size(), + true)) { + return null; + } + } else if (this.getSlot(1).isItemValid(itemstack1) && !this.getSlot(1).getHasStack()) { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) { + return null; + } + } else if (this.getSlot(0).isItemValid(itemstack1)) { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) { + return null; + } + } else if (this.horseInventory.getSizeInventory() <= 2 + || !this.mergeItemStack(itemstack1, 2, this.horseInventory.getSizeInventory(), false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.horseInventory.closeInventory(entityplayer); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerMerchant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerMerchant.java new file mode 100644 index 0000000..bc276e9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerMerchant.java @@ -0,0 +1,165 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotMerchantResult; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerMerchant extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerMerchant"); + } + + private IMerchant theMerchant; + private InventoryMerchant merchantInventory; + private final World theWorld; + + public ContainerMerchant(InventoryPlayer playerInventory, IMerchant merchant, World worldIn) { + this.theMerchant = merchant; + this.theWorld = worldIn; + this.merchantInventory = new InventoryMerchant(playerInventory.player, merchant); + this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53)); + this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53)); + this.addSlotToContainer( + new SlotMerchantResult(playerInventory.player, merchant, this.merchantInventory, 2, 120, 53)); + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + + } + + public InventoryMerchant getMerchantInventory() { + return this.merchantInventory; + } + + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + } + + /**+ + * Looks for changes made in the container, sends them to every + * listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + } + + /**+ + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory iinventory) { + this.merchantInventory.resetRecipeAndSlots(); + super.onCraftMatrixChanged(iinventory); + } + + public void setCurrentRecipeIndex(int currentRecipeIndex) { + this.merchantInventory.setCurrentRecipeIndex(currentRecipeIndex); + } + + public void updateProgressBar(int var1, int var2) { + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.theMerchant.getCustomer() == entityplayer; + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 2) { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } else if (i != 0 && i != 1) { + if (i >= 3 && i < 30) { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) { + return null; + } + } else if (i >= 30 && i < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 3, 39, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.theMerchant.setCustomer((EntityPlayer) null); + super.onContainerClosed(entityplayer); + { + ItemStack itemstack = this.merchantInventory.removeStackFromSlot(0); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + + itemstack = this.merchantInventory.removeStackFromSlot(1); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerPlayer.java new file mode 100644 index 0000000..d0d3058 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerPlayer.java @@ -0,0 +1,195 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCraftResult; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerPlayer extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerPlayer"); + } + + /**+ + * The crafting matrix inventory. + */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); + public IInventory craftResult = new InventoryCraftResult(); + public boolean isLocalWorld; + private final EntityPlayer thePlayer; + + public ContainerPlayer(final InventoryPlayer playerInventory, boolean localWorld, EntityPlayer player) { + this.isLocalWorld = localWorld; + this.thePlayer = player; + this.addSlotToContainer( + new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 144, 36)); + + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 2; ++j) { + this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 2, 88 + j * 18, 26 + i * 18)); + } + } + + for (int k = 0; k < 4; ++k) { + final int kk = k; + this.addSlotToContainer( + new Slot(playerInventory, playerInventory.getSizeInventory() - 1 - kk, 8, 8 + kk * 18) { + public int getSlotStackLimit() { + return 1; + } + + public boolean isItemValid(ItemStack itemstack) { + return itemstack == null ? false + : (itemstack.getItem() instanceof ItemArmor + ? ((ItemArmor) itemstack.getItem()).armorType == kk + : (itemstack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) + && itemstack.getItem() != Items.skull ? false : kk == 0)); + } + + public String getSlotTexture() { + return ItemArmor.EMPTY_SLOT_NAMES[kk]; + } + }); + } + + for (int l = 0; l < 3; ++l) { + for (int j1 = 0; j1 < 9; ++j1) { + this.addSlotToContainer(new Slot(playerInventory, j1 + (l + 1) * 9, 8 + j1 * 18, 84 + l * 18)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) { + this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + /**+ + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory var1) { + this.craftResult.setInventorySlotContents(0, + CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj)); + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + + for (int i = 0; i < 4; ++i) { + ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + + this.craftResult.setInventorySlotContents(0, (ItemStack) null); + } + + public boolean canInteractWith(EntityPlayer var1) { + return true; + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 0) { + if (!this.mergeItemStack(itemstack1, 9, 45, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } else if (i >= 1 && i < 5) { + if (!this.mergeItemStack(itemstack1, 9, 45, false)) { + return null; + } + } else if (i >= 5 && i < 9) { + if (!this.mergeItemStack(itemstack1, 9, 45, false)) { + return null; + } + } else if (itemstack.getItem() instanceof ItemArmor + && !((Slot) this.inventorySlots.get(5 + ((ItemArmor) itemstack.getItem()).armorType)) + .getHasStack()) { + int j = 5 + ((ItemArmor) itemstack.getItem()).armorType; + if (!this.mergeItemStack(itemstack1, j, j + 1, false)) { + return null; + } + } else if (i >= 9 && i < 36) { + if (!this.mergeItemStack(itemstack1, 36, 45, false)) { + return null; + } + } else if (i >= 36 && i < 45) { + if (!this.mergeItemStack(itemstack1, 9, 36, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 9, 45, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } + + /**+ + * Called to determine if the current slot is valid for the + * stack merging (double-click) code. The stack passed in is + * null for the initial slot that was double-clicked. + */ + public boolean canMergeSlot(ItemStack itemstack, Slot slot) { + return slot.inventory != this.craftResult && super.canMergeSlot(itemstack, slot); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerRepair.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerRepair.java new file mode 100644 index 0000000..5f091dd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerRepair.java @@ -0,0 +1,431 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import java.util.Iterator; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockAnvil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ICrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCraftResult; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import org.apache.commons.lang3.StringUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerRepair extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerRepair"); + } + + private static final Logger logger = LogManager.getLogger(); + private IInventory outputSlot; + private IInventory inputSlots; + private World theWorld; + private BlockPos selfPosition; + public int maximumCost; + private int materialCost; + private String repairedItemName; + private final EntityPlayer thePlayer; + + public ContainerRepair(InventoryPlayer playerInventory, World worldIn, EntityPlayer player) { + this(playerInventory, worldIn, BlockPos.ORIGIN, player); + } + + public ContainerRepair(InventoryPlayer playerInventory, final World worldIn, final BlockPos blockPosIn, + EntityPlayer player) { + this.outputSlot = new InventoryCraftResult(); + this.inputSlots = new InventoryBasic("Repair", true, 2) { + public void markDirty() { + super.markDirty(); + ContainerRepair.this.onCraftMatrixChanged(this); + } + }; + this.selfPosition = blockPosIn; + this.theWorld = worldIn; + this.thePlayer = player; + this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); + this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); + this.addSlotToContainer(new Slot(this.outputSlot, 2, 134, 47) { + public boolean isItemValid(ItemStack var1) { + return false; + } + + public boolean canTakeStack(EntityPlayer playerIn) { + return (playerIn.capabilities.isCreativeMode + || playerIn.experienceLevel >= ContainerRepair.this.maximumCost) + && ContainerRepair.this.maximumCost > 0 && this.getHasStack(); + } + + public void onPickupFromSlot(EntityPlayer entityplayer, ItemStack var2) { + if (!entityplayer.capabilities.isCreativeMode) { + entityplayer.addExperienceLevel(-ContainerRepair.this.maximumCost); + } + + ContainerRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack) null); + if (ContainerRepair.this.materialCost > 0) { + ItemStack itemstack = ContainerRepair.this.inputSlots.getStackInSlot(1); + if (itemstack != null && itemstack.stackSize > ContainerRepair.this.materialCost) { + itemstack.stackSize -= ContainerRepair.this.materialCost; + ContainerRepair.this.inputSlots.setInventorySlotContents(1, itemstack); + } else { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack) null); + } + } else { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack) null); + } + + ContainerRepair.this.maximumCost = 0; + IBlockState iblockstate = worldIn.getBlockState(blockPosIn); + if (!entityplayer.capabilities.isCreativeMode && iblockstate.getBlock() == Blocks.anvil + && entityplayer.getRNG().nextFloat() < 0.12F) { + int l = ((Integer) iblockstate.getValue(BlockAnvil.DAMAGE)).intValue(); + ++l; + if (l > 2) { + worldIn.setBlockToAir(blockPosIn); + worldIn.playAuxSFX(1020, blockPosIn, 0); + } else { + worldIn.setBlockState(blockPosIn, + iblockstate.withProperty(BlockAnvil.DAMAGE, Integer.valueOf(l)), 2); + worldIn.playAuxSFX(1021, blockPosIn, 0); + } + } else { + worldIn.playAuxSFX(1021, blockPosIn, 0); + } + + } + }); + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + + } + + /**+ + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory iinventory) { + super.onCraftMatrixChanged(iinventory); + if (iinventory == this.inputSlots) { + this.updateRepairOutput(); + } + + } + + /**+ + * called when the Anvil Input Slot changes, calculates the new + * result and puts it in the output slot + */ + public void updateRepairOutput() { + boolean flag = false; + boolean flag1 = true; + boolean flag2 = true; + boolean flag3 = true; + boolean flag4 = true; + boolean flag5 = true; + boolean flag6 = true; + ItemStack itemstack = this.inputSlots.getStackInSlot(0); + this.maximumCost = 1; + int i = 0; + int j = 0; + byte b0 = 0; + if (itemstack == null) { + this.outputSlot.setInventorySlotContents(0, (ItemStack) null); + this.maximumCost = 0; + } else { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = this.inputSlots.getStackInSlot(1); + Map map = EnchantmentHelper.getEnchantments(itemstack1); + boolean flag7 = false; + j = j + itemstack.getRepairCost() + (itemstack2 == null ? 0 : itemstack2.getRepairCost()); + this.materialCost = 0; + if (itemstack2 != null) { + flag7 = itemstack2.getItem() == Items.enchanted_book + && Items.enchanted_book.getEnchantments(itemstack2).tagCount() > 0; + if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) { + int j2 = Math.min(itemstack1.getItemDamage(), itemstack1.getMaxDamage() / 4); + if (j2 <= 0) { + this.outputSlot.setInventorySlotContents(0, (ItemStack) null); + this.maximumCost = 0; + return; + } + + int l2; + for (l2 = 0; j2 > 0 && l2 < itemstack2.stackSize; ++l2) { + int j3 = itemstack1.getItemDamage() - j2; + itemstack1.setItemDamage(j3); + ++i; + j2 = Math.min(itemstack1.getItemDamage(), itemstack1.getMaxDamage() / 4); + } + + this.materialCost = l2; + } else { + if (!flag7 + && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.isItemStackDamageable())) { + this.outputSlot.setInventorySlotContents(0, (ItemStack) null); + this.maximumCost = 0; + return; + } + + if (itemstack1.isItemStackDamageable() && !flag7) { + int k = itemstack.getMaxDamage() - itemstack.getItemDamage(); + int l = itemstack2.getMaxDamage() - itemstack2.getItemDamage(); + int i1 = l + itemstack1.getMaxDamage() * 12 / 100; + int j1 = k + i1; + int k1 = itemstack1.getMaxDamage() - j1; + if (k1 < 0) { + k1 = 0; + } + + if (k1 < itemstack1.getMetadata()) { + itemstack1.setItemDamage(k1); + i += 2; + } + } + + Map map1 = EnchantmentHelper.getEnchantments(itemstack2); + Iterator iterator1 = map1.keySet().iterator(); + + while (iterator1.hasNext()) { + int i3 = ((Integer) iterator1.next()).intValue(); + Enchantment enchantment = Enchantment.getEnchantmentById(i3); + if (enchantment != null) { + int k3 = map.containsKey(Integer.valueOf(i3)) + ? ((Integer) map.get(Integer.valueOf(i3))).intValue() + : 0; + int l1 = ((Integer) map1.get(Integer.valueOf(i3))).intValue(); + int i4; + if (k3 == l1) { + ++l1; + i4 = l1; + } else { + i4 = Math.max(l1, k3); + } + + l1 = i4; + boolean flag8 = enchantment.canApply(itemstack); + if (this.thePlayer.capabilities.isCreativeMode + || itemstack.getItem() == Items.enchanted_book) { + flag8 = true; + } + + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) { + int i2 = ((Integer) iterator.next()).intValue(); + if (i2 != i3 && !enchantment.canApplyTogether(Enchantment.getEnchantmentById(i2))) { + flag8 = false; + ++i; + } + } + + if (flag8) { + if (l1 > enchantment.getMaxLevel()) { + l1 = enchantment.getMaxLevel(); + } + + map.put(Integer.valueOf(i3), Integer.valueOf(l1)); + int l3 = 0; + switch (enchantment.getWeight()) { + case 1: + l3 = 8; + break; + case 2: + l3 = 4; + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + case 5: + l3 = 2; + break; + case 10: + l3 = 1; + } + + if (flag7) { + l3 = Math.max(1, l3 / 2); + } + + i += l3 * l1; + } + } + } + } + } + + if (StringUtils.isBlank(this.repairedItemName)) { + if (itemstack.hasDisplayName()) { + b0 = 1; + i += b0; + itemstack1.clearCustomName(); + } + } else if (!this.repairedItemName.equals(itemstack.getDisplayName())) { + b0 = 1; + i += b0; + itemstack1.setStackDisplayName(this.repairedItemName); + } + + this.maximumCost = j + i; + if (i <= 0) { + itemstack1 = null; + } + + if (b0 == i && b0 > 0 && this.maximumCost >= 40) { + this.maximumCost = 39; + } + + if (this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) { + itemstack1 = null; + } + + if (itemstack1 != null) { + int k2 = itemstack1.getRepairCost(); + if (itemstack2 != null && k2 < itemstack2.getRepairCost()) { + k2 = itemstack2.getRepairCost(); + } + + k2 = k2 * 2 + 1; + itemstack1.setRepairCost(k2); + EnchantmentHelper.setEnchantments(map, itemstack1); + } + + this.outputSlot.setInventorySlotContents(0, itemstack1); + this.detectAndSendChanges(); + } + } + + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + icrafting.sendProgressBarUpdate(this, 0, this.maximumCost); + } + + public void updateProgressBar(int i, int j) { + if (i == 0) { + this.maximumCost = j; + } + + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + { + for (int i = 0; i < this.inputSlots.getSizeInventory(); ++i) { + ItemStack itemstack = this.inputSlots.removeStackFromSlot(i); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.theWorld.getBlockState(this.selfPosition).getBlock() != Blocks.anvil ? false + : entityplayer.getDistanceSq((double) this.selfPosition.getX() + 0.5D, + (double) this.selfPosition.getY() + 0.5D, (double) this.selfPosition.getZ() + 0.5D) <= 64.0D; + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 2) { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } else if (i != 0 && i != 1) { + if (i >= 3 && i < 39 && !this.mergeItemStack(itemstack1, 0, 2, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 3, 39, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } + + /**+ + * used by the Anvil GUI to update the Item Name being typed by + * the player + */ + public void updateItemName(String newName) { + this.repairedItemName = newName; + if (this.getSlot(2).getHasStack()) { + ItemStack itemstack = this.getSlot(2).getStack(); + if (StringUtils.isBlank(newName)) { + itemstack.clearCustomName(); + } else { + itemstack.setStackDisplayName(this.repairedItemName); + } + } + + this.updateRepairOutput(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerWorkbench.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerWorkbench.java new file mode 100644 index 0000000..192d56b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerWorkbench.java @@ -0,0 +1,158 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCraftResult; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ContainerWorkbench extends Container { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/ContainerWorkbench"); + } + + /**+ + * The crafting matrix inventory (3x3). + */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public IInventory craftResult = new InventoryCraftResult(); + private World worldObj; + private BlockPos pos; + + public ContainerWorkbench(InventoryPlayer playerInventory, World worldIn, BlockPos posIn) { + this.worldObj = worldIn; + this.pos = posIn; + this.addSlotToContainer( + new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35)); + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18)); + } + } + + for (int k = 0; k < 3; ++k) { + for (int i1 = 0; i1 < 9; ++i1) { + this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18)); + } + } + + for (int l = 0; l < 9; ++l) { + this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + /**+ + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory var1) { + this.craftResult.setInventorySlotContents(0, + CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); + } + + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + { + for (int i = 0; i < 9; ++i) { + ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i); + if (itemstack != null) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.worldObj.getBlockState(this.pos).getBlock() != Blocks.crafting_table ? false + : entityplayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + /**+ + * Take a stack from the specified inventory slot. + */ + public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i == 0) { + if (!this.mergeItemStack(itemstack1, 10, 46, true)) { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } else if (i >= 10 && i < 37) { + if (!this.mergeItemStack(itemstack1, 37, 46, false)) { + return null; + } + } else if (i >= 37 && i < 46) { + if (!this.mergeItemStack(itemstack1, 10, 37, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 10, 46, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + + slot.onPickupFromSlot(entityplayer, itemstack1); + } + + return itemstack; + } + + /**+ + * Called to determine if the current slot is valid for the + * stack merging (double-click) code. The stack passed in is + * null for the initial slot that was double-clicked. + */ + public boolean canMergeSlot(ItemStack itemstack, Slot slot) { + return slot.inventory != this.craftResult && super.canMergeSlot(itemstack, slot); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ICrafting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ICrafting.java new file mode 100644 index 0000000..7b08149 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ICrafting.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ICrafting { + /**+ + * update the crafting window inventory with the items in the + * list + */ + void updateCraftingInventory(Container var1, List var2); + + /**+ + * Sends the contents of an inventory slot to the client-side + * Container. This doesn't have to match the actual contents of + * that slot. Args: Container, slot number, slot contents + */ + void sendSlotContents(Container var1, int var2, ItemStack var3); + + /**+ + * Sends two ints to the client-side Container. Used for furnace + * burning time, smelting progress, brewing progress, and + * enchanting level. Normally the first int identifies which + * variable to update, and the second contains the new value. + * Both are truncated to shorts in non-local SMP. + */ + void sendProgressBarUpdate(Container var1, int var2, int var3); + + void func_175173_a(Container var1, IInventory var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInvBasic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInvBasic.java new file mode 100644 index 0000000..bb91df2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInvBasic.java @@ -0,0 +1,31 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IInvBasic { + /**+ + * Called by InventoryBasic.onInventoryChanged() on a array that + * is never filled. + */ + void onInventoryChanged(InventoryBasic var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInventory.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInventory.java new file mode 100644 index 0000000..f853173 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInventory.java @@ -0,0 +1,91 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IWorldNameable; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IInventory extends IWorldNameable { + /**+ + * Returns the number of slots in the inventory. + */ + int getSizeInventory(); + + /**+ + * Returns the stack in the given slot. + */ + ItemStack getStackInSlot(int var1); + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + ItemStack decrStackSize(int var1, int var2); + + /**+ + * Removes a stack from the given slot and returns it. + */ + ItemStack removeStackFromSlot(int var1); + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + void setInventorySlotContents(int var1, ItemStack var2); + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + int getInventoryStackLimit(); + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + void markDirty(); + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + boolean isUseableByPlayer(EntityPlayer var1); + + void openInventory(EntityPlayer var1); + + void closeInventory(EntityPlayer var1); + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + boolean isItemValidForSlot(int var1, ItemStack var2); + + int getField(int var1); + + void setField(int var1, int var2); + + int getFieldCount(); + + void clear(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ISidedInventory.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ISidedInventory.java new file mode 100644 index 0000000..032ef57 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ISidedInventory.java @@ -0,0 +1,41 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ISidedInventory extends IInventory { + int[] getSlotsForFace(EnumFacing var1); + + /**+ + * Returns true if automation can insert the given item in the + * given slot from the given side. Args: slot, item, side + */ + boolean canInsertItem(int var1, ItemStack var2, EnumFacing var3); + + /**+ + * Returns true if automation can extract the given item in the + * given slot from the given side. Args: slot, item, side + */ + boolean canExtractItem(int var1, ItemStack var2, EnumFacing var3); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryBasic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryBasic.java new file mode 100644 index 0000000..c66769f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryBasic.java @@ -0,0 +1,261 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInvBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryBasic implements IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryBasic"); + } + + private String inventoryTitle; + private int slotsCount; + private ItemStack[] inventoryContents; + private List field_70480_d; + private boolean hasCustomName; + + public InventoryBasic(String title, boolean customName, int slotCount) { + this.inventoryTitle = title; + this.hasCustomName = customName; + this.slotsCount = slotCount; + this.inventoryContents = new ItemStack[slotCount]; + } + + public InventoryBasic(IChatComponent title, int slotCount) { + this(title.getUnformattedText(), true, slotCount); + } + + public void func_110134_a(IInvBasic parIInvBasic) { + if (this.field_70480_d == null) { + this.field_70480_d = Lists.newArrayList(); + } + + this.field_70480_d.add(parIInvBasic); + } + + public void func_110132_b(IInvBasic parIInvBasic) { + this.field_70480_d.remove(parIInvBasic); + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return i >= 0 && i < this.inventoryContents.length ? this.inventoryContents[i] : null; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.inventoryContents[i] != null) { + if (this.inventoryContents[i].stackSize <= j) { + ItemStack itemstack1 = this.inventoryContents[i]; + this.inventoryContents[i] = null; + this.markDirty(); + return itemstack1; + } else { + ItemStack itemstack = this.inventoryContents[i].splitStack(j); + if (this.inventoryContents[i].stackSize == 0) { + this.inventoryContents[i] = null; + } + + this.markDirty(); + return itemstack; + } + } else { + return null; + } + } + + public ItemStack func_174894_a(ItemStack stack) { + ItemStack itemstack = stack.copy(); + + for (int i = 0; i < this.slotsCount; ++i) { + ItemStack itemstack1 = this.getStackInSlot(i); + if (itemstack1 == null) { + this.setInventorySlotContents(i, itemstack); + this.markDirty(); + return null; + } + + if (ItemStack.areItemsEqual(itemstack1, itemstack)) { + int j = Math.min(this.getInventoryStackLimit(), itemstack1.getMaxStackSize()); + int k = Math.min(itemstack.stackSize, j - itemstack1.stackSize); + if (k > 0) { + itemstack1.stackSize += k; + itemstack.stackSize -= k; + if (itemstack.stackSize <= 0) { + this.markDirty(); + return null; + } + } + } + } + + if (itemstack.stackSize != stack.stackSize) { + this.markDirty(); + } + + return itemstack; + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.inventoryContents[i] != null) { + ItemStack itemstack = this.inventoryContents[i]; + this.inventoryContents[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.inventoryContents[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.slotsCount; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.inventoryTitle; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.hasCustomName; + } + + /**+ + * Sets the name of this inventory. This is displayed to the + * client on opening. + */ + public void setCustomName(String inventoryTitleIn) { + this.hasCustomName = true; + this.inventoryTitle = inventoryTitleIn; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + if (this.field_70480_d != null) { + for (int i = 0; i < this.field_70480_d.size(); ++i) { + ((IInvBasic) this.field_70480_d.get(i)).onInventoryChanged(this); + } + } + + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer var1) { + return true; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.inventoryContents.length; ++i) { + this.inventoryContents[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCraftResult.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCraftResult.java new file mode 100644 index 0000000..de0be37 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCraftResult.java @@ -0,0 +1,172 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryCraftResult implements IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryCraftResult"); + } + + /**+ + * A list of one item containing the result of the crafting + * formula + */ + private ItemStack[] stackResult = new ItemStack[1]; + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 1; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int var1) { + return this.stackResult[0]; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return "Result"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return false; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int var1, int var2) { + if (this.stackResult[0] != null) { + ItemStack itemstack = this.stackResult[0]; + this.stackResult[0] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int var1) { + if (this.stackResult[0] != null) { + ItemStack itemstack = this.stackResult[0]; + this.stackResult[0] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int var1, ItemStack itemstack) { + this.stackResult[0] = itemstack; + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer var1) { + return true; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.stackResult.length; ++i) { + this.stackResult[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCrafting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCrafting.java new file mode 100644 index 0000000..e741b25 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCrafting.java @@ -0,0 +1,210 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryCrafting implements IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryCrafting"); + } + + private final ItemStack[] stackList; + private final int inventoryWidth; + private final int inventoryHeight; + private final Container eventHandler; + + public InventoryCrafting(Container eventHandlerIn, int width, int height) { + int i = width * height; + this.stackList = new ItemStack[i]; + this.eventHandler = eventHandlerIn; + this.inventoryWidth = width; + this.inventoryHeight = height; + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.stackList.length; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return i >= this.getSizeInventory() ? null : this.stackList[i]; + } + + /**+ + * Returns the itemstack in the slot specified (Top left is 0, + * 0). Args: row, column + */ + public ItemStack getStackInRowAndColumn(int row, int column) { + return row >= 0 && row < this.inventoryWidth && column >= 0 && column <= this.inventoryHeight + ? this.getStackInSlot(row + column * this.inventoryWidth) + : null; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return "container.crafting"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return false; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.stackList[i] != null) { + ItemStack itemstack = this.stackList[i]; + this.stackList[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.stackList[i] != null) { + if (this.stackList[i].stackSize <= j) { + ItemStack itemstack1 = this.stackList[i]; + this.stackList[i] = null; + this.eventHandler.onCraftMatrixChanged(this); + return itemstack1; + } else { + ItemStack itemstack = this.stackList[i].splitStack(j); + if (this.stackList[i].stackSize == 0) { + this.stackList[i] = null; + } + + this.eventHandler.onCraftMatrixChanged(this); + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.stackList[i] = itemstack; + this.eventHandler.onCraftMatrixChanged(this); + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer var1) { + return true; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.stackList.length; ++i) { + this.stackList[i] = null; + } + + } + + public int getHeight() { + return this.inventoryHeight; + } + + public int getWidth() { + return this.inventoryWidth; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryEnderChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryEnderChest.java new file mode 100644 index 0000000..b234e6a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryEnderChest.java @@ -0,0 +1,104 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEnderChest; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryEnderChest extends InventoryBasic { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryEnderChest"); + } + + private TileEntityEnderChest associatedChest; + + public InventoryEnderChest() { + super("container.enderchest", false, 27); + } + + public void setChestTileEntity(TileEntityEnderChest chestTileEntity) { + this.associatedChest = chestTileEntity; + } + + public void loadInventoryFromNBT(NBTTagList parNBTTagList) { + for (int i = 0; i < this.getSizeInventory(); ++i) { + this.setInventorySlotContents(i, (ItemStack) null); + } + + for (int k = 0; k < parNBTTagList.tagCount(); ++k) { + NBTTagCompound nbttagcompound = parNBTTagList.getCompoundTagAt(k); + int j = nbttagcompound.getByte("Slot") & 255; + if (j >= 0 && j < this.getSizeInventory()) { + this.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound)); + } + } + + } + + public NBTTagList saveInventoryToNBT() { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.getSizeInventory(); ++i) { + ItemStack itemstack = this.getStackInSlot(i); + if (itemstack != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte) i); + itemstack.writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.associatedChest != null && !this.associatedChest.canBeUsed(entityplayer) ? false + : super.isUseableByPlayer(entityplayer); + } + + public void openInventory(EntityPlayer entityplayer) { + if (this.associatedChest != null) { + this.associatedChest.openChest(); + } + + super.openInventory(entityplayer); + } + + public void closeInventory(EntityPlayer entityplayer) { + if (this.associatedChest != null) { + this.associatedChest.closeChest(); + } + + super.closeInventory(entityplayer); + this.associatedChest = null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryHelper.java new file mode 100644 index 0000000..3c41e24 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryHelper.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryHelper { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryHelper"); + } + + private static final EaglercraftRandom RANDOM = new EaglercraftRandom(); + + public static void dropInventoryItems(World worldIn, BlockPos pos, IInventory parIInventory) { + func_180174_a(worldIn, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), parIInventory); + } + + public static void func_180176_a(World worldIn, Entity parEntity, IInventory parIInventory) { + func_180174_a(worldIn, parEntity.posX, parEntity.posY, parEntity.posZ, parIInventory); + } + + private static void func_180174_a(World worldIn, double x, double y, double z, IInventory parIInventory) { + for (int i = 0; i < parIInventory.getSizeInventory(); ++i) { + ItemStack itemstack = parIInventory.getStackInSlot(i); + if (itemstack != null) { + spawnItemStack(worldIn, x, y, z, itemstack); + } + } + + } + + private static void spawnItemStack(World worldIn, double x, double y, double z, ItemStack stack) { + float f = RANDOM.nextFloat() * 0.8F + 0.1F; + float f1 = RANDOM.nextFloat() * 0.8F + 0.1F; + float f2 = RANDOM.nextFloat() * 0.8F + 0.1F; + + while (stack.stackSize > 0) { + int i = RANDOM.nextInt(21) + 10; + if (i > stack.stackSize) { + i = stack.stackSize; + } + + stack.stackSize -= i; + EntityItem entityitem = new EntityItem(worldIn, x + (double) f, y + (double) f1, z + (double) f2, + new ItemStack(stack.getItem(), i, stack.getMetadata())); + if (stack.hasTagCompound()) { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = RANDOM.nextGaussian() * (double) f3; + entityitem.motionY = RANDOM.nextGaussian() * (double) f3 + 0.20000000298023224D; + entityitem.motionZ = RANDOM.nextGaussian() * (double) f3; + worldIn.spawnEntityInWorld(entityitem); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryLargeChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryLargeChest.java new file mode 100644 index 0000000..5fc256c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryLargeChest.java @@ -0,0 +1,228 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ILockableContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.LockCode; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryLargeChest implements ILockableContainer { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryLargeChest"); + } + + private String name; + private ILockableContainer upperChest; + private ILockableContainer lowerChest; + + public InventoryLargeChest(String nameIn, ILockableContainer upperChestIn, ILockableContainer lowerChestIn) { + this.name = nameIn; + if (upperChestIn == null) { + upperChestIn = lowerChestIn; + } + + if (lowerChestIn == null) { + lowerChestIn = upperChestIn; + } + + this.upperChest = upperChestIn; + this.lowerChest = lowerChestIn; + if (upperChestIn.isLocked()) { + lowerChestIn.setLockCode(upperChestIn.getLockCode()); + } else if (lowerChestIn.isLocked()) { + upperChestIn.setLockCode(lowerChestIn.getLockCode()); + } + + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory(); + } + + /**+ + * Return whether the given inventory is part of this large + * chest. + */ + public boolean isPartOfLargeChest(IInventory inventoryIn) { + return this.upperChest == inventoryIn || this.lowerChest == inventoryIn; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.upperChest.hasCustomName() ? this.upperChest.getName() + : (this.lowerChest.hasCustomName() ? this.lowerChest.getName() : this.name); + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.upperChest.hasCustomName() || this.lowerChest.hasCustomName(); + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return i >= this.upperChest.getSizeInventory() + ? this.lowerChest.getStackInSlot(i - this.upperChest.getSizeInventory()) + : this.upperChest.getStackInSlot(i); + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + return i >= this.upperChest.getSizeInventory() + ? this.lowerChest.decrStackSize(i - this.upperChest.getSizeInventory(), j) + : this.upperChest.decrStackSize(i, j); + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + return i >= this.upperChest.getSizeInventory() + ? this.lowerChest.removeStackFromSlot(i - this.upperChest.getSizeInventory()) + : this.upperChest.removeStackFromSlot(i); + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + if (i >= this.upperChest.getSizeInventory()) { + this.lowerChest.setInventorySlotContents(i - this.upperChest.getSizeInventory(), itemstack); + } else { + this.upperChest.setInventorySlotContents(i, itemstack); + } + + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return this.upperChest.getInventoryStackLimit(); + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + this.upperChest.markDirty(); + this.lowerChest.markDirty(); + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.upperChest.isUseableByPlayer(entityplayer) && this.lowerChest.isUseableByPlayer(entityplayer); + } + + public void openInventory(EntityPlayer entityplayer) { + this.upperChest.openInventory(entityplayer); + this.lowerChest.openInventory(entityplayer); + } + + public void closeInventory(EntityPlayer entityplayer) { + this.upperChest.closeInventory(entityplayer); + this.lowerChest.closeInventory(entityplayer); + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public boolean isLocked() { + return this.upperChest.isLocked() || this.lowerChest.isLocked(); + } + + public void setLockCode(LockCode lockcode) { + this.upperChest.setLockCode(lockcode); + this.lowerChest.setLockCode(lockcode); + } + + public LockCode getLockCode() { + return this.upperChest.getLockCode(); + } + + public String getGuiID() { + return this.upperChest.getGuiID(); + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer) { + return new ContainerChest(inventoryplayer, this, entityplayer); + } + + public void clear() { + this.upperChest.clear(); + this.lowerChest.clear(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryMerchant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryMerchant.java new file mode 100644 index 0000000..6155a5e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryMerchant.java @@ -0,0 +1,263 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipeList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 InventoryMerchant implements IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/InventoryMerchant"); + } + + private final IMerchant theMerchant; + private ItemStack[] theInventory = new ItemStack[3]; + private final EntityPlayer thePlayer; + private MerchantRecipe currentRecipe; + private int currentRecipeIndex; + + public InventoryMerchant(EntityPlayer thePlayerIn, IMerchant theMerchantIn) { + this.thePlayer = thePlayerIn; + this.theMerchant = theMerchantIn; + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.theInventory.length; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return this.theInventory[i]; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.theInventory[i] != null) { + if (i == 2) { + ItemStack itemstack2 = this.theInventory[i]; + this.theInventory[i] = null; + return itemstack2; + } else if (this.theInventory[i].stackSize <= j) { + ItemStack itemstack1 = this.theInventory[i]; + this.theInventory[i] = null; + if (this.inventoryResetNeededOnSlotChange(i)) { + this.resetRecipeAndSlots(); + } + + return itemstack1; + } else { + ItemStack itemstack = this.theInventory[i].splitStack(j); + if (this.theInventory[i].stackSize == 0) { + this.theInventory[i] = null; + } + + if (this.inventoryResetNeededOnSlotChange(i)) { + this.resetRecipeAndSlots(); + } + + return itemstack; + } + } else { + return null; + } + } + + /**+ + * if par1 slot has changed, does resetRecipeAndSlots need to be + * called? + */ + private boolean inventoryResetNeededOnSlotChange(int parInt1) { + return parInt1 == 0 || parInt1 == 1; + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.theInventory[i] != null) { + ItemStack itemstack = this.theInventory[i]; + this.theInventory[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.theInventory[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + if (this.inventoryResetNeededOnSlotChange(i)) { + this.resetRecipeAndSlots(); + } + + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return "mob.villager"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return false; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.theMerchant.getCustomer() == entityplayer; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + this.resetRecipeAndSlots(); + } + + public void resetRecipeAndSlots() { + this.currentRecipe = null; + ItemStack itemstack = this.theInventory[0]; + ItemStack itemstack1 = this.theInventory[1]; + if (itemstack == null) { + itemstack = itemstack1; + itemstack1 = null; + } + + if (itemstack == null) { + this.setInventorySlotContents(2, (ItemStack) null); + } else { + MerchantRecipeList merchantrecipelist = this.theMerchant.getRecipes(this.thePlayer); + if (merchantrecipelist != null) { + MerchantRecipe merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack, itemstack1, + this.currentRecipeIndex); + if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) { + this.currentRecipe = merchantrecipe; + this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy()); + } else if (itemstack1 != null) { + merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack1, itemstack, this.currentRecipeIndex); + if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) { + this.currentRecipe = merchantrecipe; + this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy()); + } else { + this.setInventorySlotContents(2, (ItemStack) null); + } + } else { + this.setInventorySlotContents(2, (ItemStack) null); + } + } + } + + this.theMerchant.verifySellingItem(this.getStackInSlot(2)); + } + + public MerchantRecipe getCurrentRecipe() { + return this.currentRecipe; + } + + public void setCurrentRecipeIndex(int currentRecipeIndexIn) { + this.currentRecipeIndex = currentRecipeIndexIn; + this.resetRecipeAndSlots(); + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.theInventory.length; ++i) { + this.theInventory[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Slot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Slot.java new file mode 100644 index 0000000..18e51cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Slot.java @@ -0,0 +1,170 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Slot { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/Slot"); + } + + private final int slotIndex; + public final IInventory inventory; + public int slotNumber; + public int xDisplayPosition; + public int yDisplayPosition; + + public Slot(IInventory inventoryIn, int index, int xPosition, int yPosition) { + this.inventory = inventoryIn; + this.slotIndex = index; + this.xDisplayPosition = xPosition; + this.yDisplayPosition = yPosition; + } + + /**+ + * if par2 has more items than par1, + * onCrafting(item,countIncrease) is called + */ + public void onSlotChange(ItemStack parItemStack, ItemStack parItemStack2) { + if (parItemStack != null && parItemStack2 != null) { + if (parItemStack.getItem() == parItemStack2.getItem()) { + int i = parItemStack2.stackSize - parItemStack.stackSize; + if (i > 0) { + this.onCrafting(parItemStack, i); + } + + } + } + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack var1, int var2) { + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack var1) { + } + + public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { + this.onSlotChanged(); + } + + /**+ + * Check if the stack is a valid item for this slot. Always true + * beside for the armor slots. + */ + public boolean isItemValid(ItemStack var1) { + return true; + } + + /**+ + * Helper fnct to get the stack in the slot. + */ + public ItemStack getStack() { + return this.inventory.getStackInSlot(this.slotIndex); + } + + /**+ + * Returns if this slot contains a stack. + */ + public boolean getHasStack() { + return this.getStack() != null; + } + + /**+ + * Helper method to put a stack in the slot. + */ + public void putStack(ItemStack itemstack) { + this.inventory.setInventorySlotContents(this.slotIndex, itemstack); + this.onSlotChanged(); + } + + /**+ + * Called when the stack in a Slot changes + */ + public void onSlotChanged() { + this.inventory.markDirty(); + } + + /**+ + * Returns the maximum stack size for a given slot (usually the + * same as getInventoryStackLimit(), but 1 in the case of armor + * slots) + */ + public int getSlotStackLimit() { + return this.inventory.getInventoryStackLimit(); + } + + public int getItemStackLimit(ItemStack var1) { + return this.getSlotStackLimit(); + } + + public String getSlotTexture() { + return null; + } + + /**+ + * Decrease the size of the stack in slot (first int arg) by the + * amount of the second int arg. Returns the new stack. + */ + public ItemStack decrStackSize(int i) { + return this.inventory.decrStackSize(this.slotIndex, i); + } + + /**+ + * returns true if the slot exists in the given inventory and + * location + */ + public boolean isHere(IInventory iinventory, int i) { + return iinventory == this.inventory && i == this.slotIndex; + } + + /**+ + * Return whether this slot's stack can be taken from this slot. + */ + public boolean canTakeStack(EntityPlayer var1) { + return true; + } + + /**+ + * Actualy only call when we want to render the white square + * effect over the slots. Return always True, except for the + * armor slot of the Donkey/Mule (we can't interact with the + * Undead and Skeleton horses) + */ + public boolean canBeHovered() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotCrafting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotCrafting.java new file mode 100644 index 0000000..75565d2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotCrafting.java @@ -0,0 +1,165 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemHoe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPickaxe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSword; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SlotCrafting extends Slot { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/SlotCrafting"); + } + + private final InventoryCrafting craftMatrix; + private final EntityPlayer thePlayer; + private int amountCrafted; + + public SlotCrafting(EntityPlayer player, InventoryCrafting craftingInventory, IInventory parIInventory, + int slotIndex, int xPosition, int yPosition) { + super(parIInventory, slotIndex, xPosition, yPosition); + this.thePlayer = player; + this.craftMatrix = craftingInventory; + } + + /**+ + * Check if the stack is a valid item for this slot. Always true + * beside for the armor slots. + */ + public boolean isItemValid(ItemStack var1) { + return false; + } + + /**+ + * Decrease the size of the stack in slot (first int arg) by the + * amount of the second int arg. Returns the new stack. + */ + public ItemStack decrStackSize(int i) { + if (this.getHasStack()) { + this.amountCrafted += Math.min(i, this.getStack().stackSize); + } + + return super.decrStackSize(i); + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack itemstack, int i) { + this.amountCrafted += i; + this.onCrafting(itemstack); + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack itemstack) { + if (this.amountCrafted > 0) { + itemstack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); + } + + this.amountCrafted = 0; + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) { + this.thePlayer.triggerAchievement(AchievementList.buildWorkBench); + } + + if (itemstack.getItem() instanceof ItemPickaxe) { + this.thePlayer.triggerAchievement(AchievementList.buildPickaxe); + } + + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.furnace)) { + this.thePlayer.triggerAchievement(AchievementList.buildFurnace); + } + + if (itemstack.getItem() instanceof ItemHoe) { + this.thePlayer.triggerAchievement(AchievementList.buildHoe); + } + + if (itemstack.getItem() == Items.bread) { + this.thePlayer.triggerAchievement(AchievementList.makeBread); + } + + if (itemstack.getItem() == Items.cake) { + this.thePlayer.triggerAchievement(AchievementList.bakeCake); + } + + if (itemstack.getItem() instanceof ItemPickaxe + && ((ItemPickaxe) itemstack.getItem()).getToolMaterial() != Item.ToolMaterial.WOOD) { + this.thePlayer.triggerAchievement(AchievementList.buildBetterPickaxe); + } + + if (itemstack.getItem() instanceof ItemSword) { + this.thePlayer.triggerAchievement(AchievementList.buildSword); + } + + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) { + this.thePlayer.triggerAchievement(AchievementList.enchantments); + } + + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) { + this.thePlayer.triggerAchievement(AchievementList.bookcase); + } + + if (itemstack.getItem() == Items.golden_apple && itemstack.getMetadata() == 1) { + this.thePlayer.triggerAchievement(AchievementList.overpowered); + } + + } + + public void onPickupFromSlot(EntityPlayer entityplayer, ItemStack itemstack) { + this.onCrafting(itemstack); + ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(this.craftMatrix, entityplayer.worldObj); + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); + ItemStack itemstack2 = aitemstack[i]; + if (itemstack1 != null) { + this.craftMatrix.decrStackSize(i, 1); + } + + if (itemstack2 != null) { + if (this.craftMatrix.getStackInSlot(i) == null) { + this.craftMatrix.setInventorySlotContents(i, itemstack2); + } else if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2)) { + this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); + } + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceFuel.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceFuel.java new file mode 100644 index 0000000..48a5e3c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceFuel.java @@ -0,0 +1,56 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityFurnace; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SlotFurnaceFuel extends Slot { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/SlotFurnaceFuel"); + } + + public SlotFurnaceFuel(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) { + super(inventoryIn, slotIndex, xPosition, yPosition); + } + + /**+ + * Check if the stack is a valid item for this slot. Always true + * beside for the armor slots. + */ + public boolean isItemValid(ItemStack itemstack) { + return TileEntityFurnace.isItemFuel(itemstack) || isBucket(itemstack); + } + + public int getItemStackLimit(ItemStack itemstack) { + return isBucket(itemstack) ? 1 : super.getItemStackLimit(itemstack); + } + + public static boolean isBucket(ItemStack parItemStack) { + return parItemStack != null && parItemStack.getItem() != null && parItemStack.getItem() == Items.bucket; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceOutput.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceOutput.java new file mode 100644 index 0000000..de6650f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceOutput.java @@ -0,0 +1,124 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.FurnaceRecipes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SlotFurnaceOutput extends Slot { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/SlotFurnaceOutput"); + } + + private EntityPlayer thePlayer; + private int field_75228_b; + + public SlotFurnaceOutput(EntityPlayer player, IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) { + super(inventoryIn, slotIndex, xPosition, yPosition); + this.thePlayer = player; + } + + /**+ + * Check if the stack is a valid item for this slot. Always true + * beside for the armor slots. + */ + public boolean isItemValid(ItemStack var1) { + return false; + } + + /**+ + * Decrease the size of the stack in slot (first int arg) by the + * amount of the second int arg. Returns the new stack. + */ + public ItemStack decrStackSize(int i) { + if (this.getHasStack()) { + this.field_75228_b += Math.min(i, this.getStack().stackSize); + } + + return super.decrStackSize(i); + } + + public void onPickupFromSlot(EntityPlayer entityplayer, ItemStack itemstack) { + this.onCrafting(itemstack); + super.onPickupFromSlot(entityplayer, itemstack); + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack stack, int amount) { + this.field_75228_b += amount; + this.onCrafting(stack); + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack stack) { + stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); + { + int i = this.field_75228_b; + float f = FurnaceRecipes.instance().getSmeltingExperience(stack); + if (f == 0.0F) { + i = 0; + } else if (f < 1.0F) { + int j = MathHelper.floor_float((float) i * f); + if (j < MathHelper.ceiling_float_int((float) i * f) + && Math.random() < (double) ((float) i * f - (float) j)) { + ++j; + } + + i = j; + } + + while (i > 0) { + int k = EntityXPOrb.getXPSplit(i); + i -= k; + this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, + this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, k)); + } + } + + this.field_75228_b = 0; + if (stack.getItem() == Items.iron_ingot) { + this.thePlayer.triggerAchievement(AchievementList.acquireIron); + } + + if (stack.getItem() == Items.cooked_fish) { + this.thePlayer.triggerAchievement(AchievementList.cookFish); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotMerchantResult.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotMerchantResult.java new file mode 100644 index 0000000..6ef0da7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotMerchantResult.java @@ -0,0 +1,135 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipe; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SlotMerchantResult extends Slot { + + static { + __checkIntegratedContextValid("net/minecraft/inventory/SlotMerchantResult"); + } + + private final InventoryMerchant theMerchantInventory; + private EntityPlayer thePlayer; + private int field_75231_g; + private final IMerchant theMerchant; + + public SlotMerchantResult(EntityPlayer player, IMerchant merchant, InventoryMerchant merchantInventory, + int slotIndex, int xPosition, int yPosition) { + super(merchantInventory, slotIndex, xPosition, yPosition); + this.thePlayer = player; + this.theMerchant = merchant; + this.theMerchantInventory = merchantInventory; + } + + /**+ + * Check if the stack is a valid item for this slot. Always true + * beside for the armor slots. + */ + public boolean isItemValid(ItemStack var1) { + return false; + } + + /**+ + * Decrease the size of the stack in slot (first int arg) by the + * amount of the second int arg. Returns the new stack. + */ + public ItemStack decrStackSize(int i) { + if (this.getHasStack()) { + this.field_75231_g += Math.min(i, this.getStack().stackSize); + } + + return super.decrStackSize(i); + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack itemstack, int i) { + this.field_75231_g += i; + this.onCrafting(itemstack); + } + + /**+ + * the itemStack passed in is the output - ie, iron ingots, and + * pickaxes, not ore and wood. Typically increases an internal + * count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack itemstack) { + itemstack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75231_g); + this.field_75231_g = 0; + } + + public void onPickupFromSlot(EntityPlayer entityplayer, ItemStack itemstack) { + this.onCrafting(itemstack); + MerchantRecipe merchantrecipe = this.theMerchantInventory.getCurrentRecipe(); + if (merchantrecipe != null) { + ItemStack itemstack1 = this.theMerchantInventory.getStackInSlot(0); + ItemStack itemstack2 = this.theMerchantInventory.getStackInSlot(1); + if (this.doTrade(merchantrecipe, itemstack1, itemstack2) + || this.doTrade(merchantrecipe, itemstack2, itemstack1)) { + this.theMerchant.useRecipe(merchantrecipe); + entityplayer.triggerAchievement(StatList.timesTradedWithVillagerStat); + if (itemstack1 != null && itemstack1.stackSize <= 0) { + itemstack1 = null; + } + + if (itemstack2 != null && itemstack2.stackSize <= 0) { + itemstack2 = null; + } + + this.theMerchantInventory.setInventorySlotContents(0, itemstack1); + this.theMerchantInventory.setInventorySlotContents(1, itemstack2); + } + } + + } + + private boolean doTrade(MerchantRecipe trade, ItemStack firstItem, ItemStack secondItem) { + ItemStack itemstack = trade.getItemToBuy(); + ItemStack itemstack1 = trade.getSecondItemToBuy(); + if (firstItem != null && firstItem.getItem() == itemstack.getItem()) { + if (itemstack1 != null && secondItem != null && itemstack1.getItem() == secondItem.getItem()) { + firstItem.stackSize -= itemstack.stackSize; + secondItem.stackSize -= itemstack1.stackSize; + return true; + } + + if (itemstack1 == null && secondItem == null) { + firstItem.stackSize -= itemstack.stackSize; + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumAction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumAction.java new file mode 100644 index 0000000..5fae2d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumAction.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumAction { + NONE, EAT, DRINK, BLOCK, BOW; + + static { + __checkIntegratedContextValid("net/minecraft/item/EnumAction"); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumDyeColor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumDyeColor.java new file mode 100644 index 0000000..0bdd898 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumDyeColor.java @@ -0,0 +1,117 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumDyeColor implements IStringSerializable { + WHITE(0, 15, "white", "white", MapColor.snowColor, EnumChatFormatting.WHITE), + ORANGE(1, 14, "orange", "orange", MapColor.adobeColor, EnumChatFormatting.GOLD), + MAGENTA(2, 13, "magenta", "magenta", MapColor.magentaColor, EnumChatFormatting.AQUA), + LIGHT_BLUE(3, 12, "light_blue", "lightBlue", MapColor.lightBlueColor, EnumChatFormatting.BLUE), + YELLOW(4, 11, "yellow", "yellow", MapColor.yellowColor, EnumChatFormatting.YELLOW), + LIME(5, 10, "lime", "lime", MapColor.limeColor, EnumChatFormatting.GREEN), + PINK(6, 9, "pink", "pink", MapColor.pinkColor, EnumChatFormatting.LIGHT_PURPLE), + GRAY(7, 8, "gray", "gray", MapColor.grayColor, EnumChatFormatting.DARK_GRAY), + SILVER(8, 7, "silver", "silver", MapColor.silverColor, EnumChatFormatting.GRAY), + CYAN(9, 6, "cyan", "cyan", MapColor.cyanColor, EnumChatFormatting.DARK_AQUA), + PURPLE(10, 5, "purple", "purple", MapColor.purpleColor, EnumChatFormatting.DARK_PURPLE), + BLUE(11, 4, "blue", "blue", MapColor.blueColor, EnumChatFormatting.DARK_BLUE), + BROWN(12, 3, "brown", "brown", MapColor.brownColor, EnumChatFormatting.GOLD), + GREEN(13, 2, "green", "green", MapColor.greenColor, EnumChatFormatting.DARK_GREEN), + RED(14, 1, "red", "red", MapColor.redColor, EnumChatFormatting.DARK_RED), + BLACK(15, 0, "black", "black", MapColor.blackColor, EnumChatFormatting.BLACK); + + static { + __checkIntegratedContextValid("net/minecraft/item/EnumDyeColor"); + } + + private static final EnumDyeColor[] META_LOOKUP = new EnumDyeColor[values().length]; + private static final EnumDyeColor[] DYE_DMG_LOOKUP = new EnumDyeColor[values().length]; + private final int meta; + private final int dyeDamage; + private final String name; + private final String unlocalizedName; + private final MapColor mapColor; + private final EnumChatFormatting chatColor; + + private EnumDyeColor(int meta, int dyeDamage, String name, String unlocalizedName, MapColor mapColorIn, + EnumChatFormatting chatColor) { + this.meta = meta; + this.dyeDamage = dyeDamage; + this.name = name; + this.unlocalizedName = unlocalizedName; + this.mapColor = mapColorIn; + this.chatColor = chatColor; + } + + public int getMetadata() { + return this.meta; + } + + public int getDyeDamage() { + return this.dyeDamage; + } + + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + public MapColor getMapColor() { + return this.mapColor; + } + + public static EnumDyeColor byDyeDamage(int damage) { + if (damage < 0 || damage >= DYE_DMG_LOOKUP.length) { + damage = 0; + } + + return DYE_DMG_LOOKUP[damage]; + } + + public static EnumDyeColor byMetadata(int meta) { + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String toString() { + return this.unlocalizedName; + } + + public String getName() { + return this.name; + } + + static { + for (EnumDyeColor enumdyecolor : values()) { + META_LOOKUP[enumdyecolor.getMetadata()] = enumdyecolor; + DYE_DMG_LOOKUP[enumdyecolor.getDyeDamage()] = enumdyecolor; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumRarity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumRarity.java new file mode 100644 index 0000000..3fe3b1f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumRarity.java @@ -0,0 +1,42 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumRarity { + COMMON(EnumChatFormatting.WHITE, "Common"), UNCOMMON(EnumChatFormatting.YELLOW, "Uncommon"), + RARE(EnumChatFormatting.AQUA, "Rare"), EPIC(EnumChatFormatting.LIGHT_PURPLE, "Epic"); + + static { + __checkIntegratedContextValid("net/minecraft/item/EnumRarity"); + } + + public final EnumChatFormatting rarityColor; + public final String rarityName; + + private EnumRarity(EnumChatFormatting color, String name) { + this.rarityColor = color; + this.rarityName = name; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/Item.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/Item.java new file mode 100644 index 0000000..7de3f9c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/Item.java @@ -0,0 +1,1189 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.base.Function; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPrismarine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedSandstone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSandStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWall; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumRarity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemAnvilBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemAppleGold; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemAxe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBucket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBucketMilk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemCarrotOnAStick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemCloth; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemCoal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemColored; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEditableBook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEmptyMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEnchantedBook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEnderEye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEnderPearl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemExpBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFirework; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFireworkCharge; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishingRod; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFlintAndSteel; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemGlassBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemHangingEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemHoe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemLead; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemLilyPad; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMonsterPlacer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMultiTexture; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemNameTag; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPickaxe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPiston; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemRecord; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemRedstone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemReed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSaddle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSeedFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSeeds; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemShears; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSimpleFoiled; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSoup; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSpade; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSword; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemWritableBook; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.RegistryNamespaced; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/Item"); + } + + public static final RegistryNamespaced itemRegistry = new RegistryNamespaced(); + private static final Map BLOCK_TO_ITEM = Maps.newHashMap(); + protected static final EaglercraftUUID itemModifierUUID = EaglercraftUUID + .fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + private CreativeTabs tabToDisplayOn; + /**+ + * The RNG used by the Item subclasses. + */ + protected static EaglercraftRandom itemRand = new EaglercraftRandom(); + /**+ + * Maximum size of the stack. + */ + protected int maxStackSize = 64; + private int maxDamage; + protected boolean bFull3D; + protected boolean hasSubtypes; + private Item containerItem; + private String potionEffect; + private String unlocalizedName; + + public static int getIdFromItem(Item itemIn) { + return itemIn == null ? 0 : itemRegistry.getIDForObject(itemIn); + } + + public static Item getItemById(int id) { + return (Item) itemRegistry.getObjectById(id); + } + + public static Item getItemFromBlock(Block blockIn) { + return (Item) BLOCK_TO_ITEM.get(blockIn); + } + + /**+ + * Tries to get an Item by it's name (e.g. minecraft:apple) or a + * String representation of a numerical ID. If both fail, null + * is returned. + */ + public static Item getByNameOrId(String id) { + Item item = (Item) itemRegistry.getObject(new ResourceLocation(id)); + if (item == null) { + try { + return getItemById(Integer.parseInt(id)); + } catch (NumberFormatException var3) { + ; + } + } + + return item; + } + + /**+ + * Called when an ItemStack with NBT data is read to potentially + * that ItemStack's NBT data + */ + public boolean updateItemStackNBT(NBTTagCompound var1) { + return false; + } + + public Item setMaxStackSize(int maxStackSize) { + this.maxStackSize = maxStackSize; + return this; + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, BlockPos var4, EnumFacing var5, float var6, + float var7, float var8) { + return false; + } + + public float getStrVsBlock(ItemStack var1, Block var2) { + return 1.0F; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer var3) { + return itemstack; + } + + /**+ + * Called when the player finishes using this Item (E.g. + * finishes eating.). Not called when the player stops using the + * Item before the action is complete. + */ + public ItemStack onItemUseFinish(ItemStack itemstack, World var2, EntityPlayer var3) { + return itemstack; + } + + /**+ + * Returns the maximum size of the stack for a specific item. + * *Isn't this more a Set than a Get?* + */ + public int getItemStackLimit() { + return this.maxStackSize; + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int var1) { + return 0; + } + + public boolean getHasSubtypes() { + return this.hasSubtypes; + } + + protected Item setHasSubtypes(boolean hasSubtypes) { + this.hasSubtypes = hasSubtypes; + return this; + } + + /**+ + * Returns the maximum damage an item can take. + */ + public int getMaxDamage() { + return this.maxDamage; + } + + /**+ + * set max damage of an Item + */ + protected Item setMaxDamage(int maxDamageIn) { + this.maxDamage = maxDamageIn; + return this; + } + + public boolean isDamageable() { + return this.maxDamage > 0 && !this.hasSubtypes; + } + + /**+ + * Current implementations of this method in child classes do + * not use the entry argument beside ev. They just raise the + * damage on the stack. + */ + public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { + return false; + } + + /**+ + * Called when a Block is destroyed using this Item. Return true + * to trigger the "Use Item" statistic. + */ + public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, BlockPos var4, EntityLivingBase var5) { + return false; + } + + /**+ + * Check whether this Item can harvest the given Block + */ + public boolean canHarvestBlock(Block var1) { + return false; + } + + /**+ + * Returns true if the item can be used on the given entity, + * e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { + return false; + } + + /**+ + * Sets bFull3D to True and return the object. + */ + public Item setFull3D() { + this.bFull3D = true; + return this; + } + + /**+ + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return this.bFull3D; + } + + /**+ + * Returns true if this item should be rotated by 180 degrees + * around the Y axis when being held in an entities hands. + */ + public boolean shouldRotateAroundWhenRendering() { + return false; + } + + /**+ + * Sets the unlocalized name of this item to the string passed + * as the parameter, prefixed by "item." + */ + public Item setUnlocalizedName(String s) { + this.unlocalizedName = s; + return this; + } + + /**+ + * Translates the unlocalized name of this item, but without the + * .name suffix, so the translation fails and the unlocalized + * name itself is returned. + */ + public String getUnlocalizedNameInefficiently(ItemStack stack) { + String s = this.getUnlocalizedName(stack); + return s == null ? "" : StatCollector.translateToLocal(s); + } + + /**+ + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() { + return "item." + this.unlocalizedName; + } + + /**+ + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName(ItemStack var1) { + return "item." + this.unlocalizedName; + } + + public Item setContainerItem(Item containerItem) { + this.containerItem = containerItem; + return this; + } + + /**+ + * If this function returns true (or the item is damageable), + * the ItemStack's NBT tag will be sent to the client. + */ + public boolean getShareTag() { + return true; + } + + public Item getContainerItem() { + return this.containerItem; + } + + /**+ + * True if this Item has a container item (a.k.a. crafting + * result) + */ + public boolean hasContainerItem() { + return this.containerItem != null; + } + + public int getColorFromItemStack(ItemStack var1, int var2) { + return 16777215; + } + + /**+ + * Called each tick as long the item is on a player inventory. + * Uses by maps to check if is on a player hand and update it's + * contents. + */ + public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5) { + } + + /**+ + * Called when item is crafted/smelted. Used only by maps so + * far. + */ + public void onCreated(ItemStack var1, World var2, EntityPlayer var3) { + } + + /**+ + * false for all Items except sub-classes of ItemMapBase + */ + public boolean isMap() { + return false; + } + + /**+ + * returns the action that specifies what animation to play when + * the items is being used + */ + public EnumAction getItemUseAction(ItemStack var1) { + return EnumAction.NONE; + } + + /**+ + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack var1) { + return 0; + } + + /**+ + * Called when the player stops using an Item (stops holding the + * right mouse button). + */ + public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) { + } + + /**+ + * Sets the string representing this item's effect on a potion + * when used as an ingredient. + */ + protected Item setPotionEffect(String potionEffect) { + this.potionEffect = potionEffect; + return this; + } + + public String getPotionEffect(ItemStack var1) { + return this.potionEffect; + } + + public boolean isPotionIngredient(ItemStack stack) { + return this.getPotionEffect(stack) != null; + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { + } + + public String getItemStackDisplayName(ItemStack itemstack) { + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(itemstack) + ".name")).trim(); + } + + public boolean hasEffect(ItemStack itemstack) { + return itemstack.isItemEnchanted(); + } + + /**+ + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack itemstack) { + return itemstack.isItemEnchanted() ? EnumRarity.RARE : EnumRarity.COMMON; + } + + /**+ + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack var1) { + return this.getItemStackLimit() == 1 && this.isDamageable(); + } + + protected MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, + boolean useLiquids) { + float f = playerIn.rotationPitch; + float f1 = playerIn.rotationYaw; + double d0 = playerIn.posX; + double d1 = playerIn.posY + (double) playerIn.getEyeHeight(); + double d2 = playerIn.posZ; + Vec3 vec3 = new Vec3(d0, d1, d2); + float f2 = MathHelper.cos(-f1 * 0.017453292F - 3.1415927F); + float f3 = MathHelper.sin(-f1 * 0.017453292F - 3.1415927F); + float f4 = -MathHelper.cos(-f * 0.017453292F); + float f5 = MathHelper.sin(-f * 0.017453292F); + float f6 = f3 * f4; + float f7 = f2 * f4; + double d3 = 5.0D; + Vec3 vec31 = vec3.addVector((double) f6 * d3, (double) f5 * d3, (double) f7 * d3); + return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false); + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return 0; + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, 0)); + } + + /**+ + * gets the CreativeTab this item is displayed on + */ + public CreativeTabs getCreativeTab() { + return this.tabToDisplayOn; + } + + /**+ + * returns this; + */ + public Item setCreativeTab(CreativeTabs tab) { + this.tabToDisplayOn = tab; + return this; + } + + /**+ + * Returns true if players can use this item to affect the world + * (e.g. placing blocks, placing ender eyes in portal) when not + * in creative + */ + public boolean canItemEditBlocks() { + return false; + } + + /**+ + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack var1, ItemStack var2) { + return false; + } + + public Multimap getItemAttributeModifiers() { + return HashMultimap.create(); + } + + public static void registerItems() { + registerItemBlock(Blocks.stone, + (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() { + public String apply(ItemStack itemstack) { + return BlockStone.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("stone")); + registerItemBlock(Blocks.grass, new ItemColored(Blocks.grass, false)); + registerItemBlock(Blocks.dirt, + (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, new Function() { + public String apply(ItemStack itemstack) { + return BlockDirt.DirtType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("dirt")); + registerItemBlock(Blocks.cobblestone); + registerItemBlock(Blocks.planks, + (new ItemMultiTexture(Blocks.planks, Blocks.planks, new Function() { + public String apply(ItemStack itemstack) { + return BlockPlanks.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("wood")); + registerItemBlock(Blocks.sapling, + (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, new Function() { + public String apply(ItemStack itemstack) { + return BlockPlanks.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("sapling")); + registerItemBlock(Blocks.bedrock); + registerItemBlock(Blocks.sand, + (new ItemMultiTexture(Blocks.sand, Blocks.sand, new Function() { + public String apply(ItemStack itemstack) { + return BlockSand.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("sand")); + registerItemBlock(Blocks.gravel); + registerItemBlock(Blocks.gold_ore); + registerItemBlock(Blocks.iron_ore); + registerItemBlock(Blocks.coal_ore); + registerItemBlock(Blocks.log, (new ItemMultiTexture(Blocks.log, Blocks.log, new Function() { + public String apply(ItemStack itemstack) { + return BlockPlanks.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("log")); + registerItemBlock(Blocks.log2, + (new ItemMultiTexture(Blocks.log2, Blocks.log2, new Function() { + public String apply(ItemStack itemstack) { + return BlockPlanks.EnumType.byMetadata(itemstack.getMetadata() + 4).getUnlocalizedName(); + } + })).setUnlocalizedName("log")); + registerItemBlock(Blocks.leaves, (new ItemLeaves(Blocks.leaves)).setUnlocalizedName("leaves")); + registerItemBlock(Blocks.leaves2, (new ItemLeaves(Blocks.leaves2)).setUnlocalizedName("leaves")); + registerItemBlock(Blocks.sponge, + (new ItemMultiTexture(Blocks.sponge, Blocks.sponge, new Function() { + public String apply(ItemStack itemstack) { + return (itemstack.getMetadata() & 1) == 1 ? "wet" : "dry"; + } + })).setUnlocalizedName("sponge")); + registerItemBlock(Blocks.glass); + registerItemBlock(Blocks.lapis_ore); + registerItemBlock(Blocks.lapis_block); + registerItemBlock(Blocks.dispenser); + registerItemBlock(Blocks.sandstone, + (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, new Function() { + public String apply(ItemStack itemstack) { + return BlockSandStone.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("sandStone")); + registerItemBlock(Blocks.noteblock); + registerItemBlock(Blocks.golden_rail); + registerItemBlock(Blocks.detector_rail); + registerItemBlock(Blocks.sticky_piston, new ItemPiston(Blocks.sticky_piston)); + registerItemBlock(Blocks.web); + registerItemBlock(Blocks.tallgrass, + (new ItemColored(Blocks.tallgrass, true)).setSubtypeNames(new String[] { "shrub", "grass", "fern" })); + registerItemBlock(Blocks.deadbush); + registerItemBlock(Blocks.piston, new ItemPiston(Blocks.piston)); + registerItemBlock(Blocks.wool, (new ItemCloth(Blocks.wool)).setUnlocalizedName("cloth")); + registerItemBlock(Blocks.yellow_flower, + (new ItemMultiTexture(Blocks.yellow_flower, Blocks.yellow_flower, new Function() { + public String apply(ItemStack itemstack) { + return BlockFlower.EnumFlowerType + .getType(BlockFlower.EnumFlowerColor.YELLOW, itemstack.getMetadata()) + .getUnlocalizedName(); + } + })).setUnlocalizedName("flower")); + registerItemBlock(Blocks.red_flower, + (new ItemMultiTexture(Blocks.red_flower, Blocks.red_flower, new Function() { + public String apply(ItemStack itemstack) { + return BlockFlower.EnumFlowerType + .getType(BlockFlower.EnumFlowerColor.RED, itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("rose")); + registerItemBlock(Blocks.brown_mushroom); + registerItemBlock(Blocks.red_mushroom); + registerItemBlock(Blocks.gold_block); + registerItemBlock(Blocks.iron_block); + registerItemBlock(Blocks.stone_slab, + (new ItemSlab(Blocks.stone_slab, Blocks.stone_slab, Blocks.double_stone_slab)) + .setUnlocalizedName("stoneSlab")); + registerItemBlock(Blocks.brick_block); + registerItemBlock(Blocks.tnt); + registerItemBlock(Blocks.bookshelf); + registerItemBlock(Blocks.mossy_cobblestone); + registerItemBlock(Blocks.obsidian); + registerItemBlock(Blocks.torch); + registerItemBlock(Blocks.mob_spawner); + registerItemBlock(Blocks.oak_stairs); + registerItemBlock(Blocks.chest); + registerItemBlock(Blocks.diamond_ore); + registerItemBlock(Blocks.diamond_block); + registerItemBlock(Blocks.crafting_table); + registerItemBlock(Blocks.farmland); + registerItemBlock(Blocks.furnace); + registerItemBlock(Blocks.lit_furnace); + registerItemBlock(Blocks.ladder); + registerItemBlock(Blocks.rail); + registerItemBlock(Blocks.stone_stairs); + registerItemBlock(Blocks.lever); + registerItemBlock(Blocks.stone_pressure_plate); + registerItemBlock(Blocks.wooden_pressure_plate); + registerItemBlock(Blocks.redstone_ore); + registerItemBlock(Blocks.redstone_torch); + registerItemBlock(Blocks.stone_button); + registerItemBlock(Blocks.snow_layer, new ItemSnow(Blocks.snow_layer)); + registerItemBlock(Blocks.ice); + registerItemBlock(Blocks.snow); + registerItemBlock(Blocks.cactus); + registerItemBlock(Blocks.clay); + registerItemBlock(Blocks.jukebox); + registerItemBlock(Blocks.oak_fence); + registerItemBlock(Blocks.spruce_fence); + registerItemBlock(Blocks.birch_fence); + registerItemBlock(Blocks.jungle_fence); + registerItemBlock(Blocks.dark_oak_fence); + registerItemBlock(Blocks.acacia_fence); + registerItemBlock(Blocks.pumpkin); + registerItemBlock(Blocks.netherrack); + registerItemBlock(Blocks.soul_sand); + registerItemBlock(Blocks.glowstone); + registerItemBlock(Blocks.lit_pumpkin); + registerItemBlock(Blocks.trapdoor); + registerItemBlock(Blocks.monster_egg, + (new ItemMultiTexture(Blocks.monster_egg, Blocks.monster_egg, new Function() { + public String apply(ItemStack itemstack) { + return BlockSilverfish.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("monsterStoneEgg")); + registerItemBlock(Blocks.stonebrick, + (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, new Function() { + public String apply(ItemStack itemstack) { + return BlockStoneBrick.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("stonebricksmooth")); + registerItemBlock(Blocks.brown_mushroom_block); + registerItemBlock(Blocks.red_mushroom_block); + registerItemBlock(Blocks.iron_bars); + registerItemBlock(Blocks.glass_pane); + registerItemBlock(Blocks.melon_block); + registerItemBlock(Blocks.vine, new ItemColored(Blocks.vine, false)); + registerItemBlock(Blocks.oak_fence_gate); + registerItemBlock(Blocks.spruce_fence_gate); + registerItemBlock(Blocks.birch_fence_gate); + registerItemBlock(Blocks.jungle_fence_gate); + registerItemBlock(Blocks.dark_oak_fence_gate); + registerItemBlock(Blocks.acacia_fence_gate); + registerItemBlock(Blocks.brick_stairs); + registerItemBlock(Blocks.stone_brick_stairs); + registerItemBlock(Blocks.mycelium); + registerItemBlock(Blocks.waterlily, new ItemLilyPad(Blocks.waterlily)); + registerItemBlock(Blocks.nether_brick); + registerItemBlock(Blocks.nether_brick_fence); + registerItemBlock(Blocks.nether_brick_stairs); + registerItemBlock(Blocks.enchanting_table); + registerItemBlock(Blocks.end_portal_frame); + registerItemBlock(Blocks.end_stone); + registerItemBlock(Blocks.dragon_egg); + registerItemBlock(Blocks.redstone_lamp); + registerItemBlock(Blocks.wooden_slab, + (new ItemSlab(Blocks.wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab)) + .setUnlocalizedName("woodSlab")); + registerItemBlock(Blocks.sandstone_stairs); + registerItemBlock(Blocks.emerald_ore); + registerItemBlock(Blocks.ender_chest); + registerItemBlock(Blocks.tripwire_hook); + registerItemBlock(Blocks.emerald_block); + registerItemBlock(Blocks.spruce_stairs); + registerItemBlock(Blocks.birch_stairs); + registerItemBlock(Blocks.jungle_stairs); + registerItemBlock(Blocks.command_block); + registerItemBlock(Blocks.beacon); + registerItemBlock(Blocks.cobblestone_wall, (new ItemMultiTexture(Blocks.cobblestone_wall, + Blocks.cobblestone_wall, new Function() { + public String apply(ItemStack itemstack) { + return BlockWall.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("cobbleWall")); + registerItemBlock(Blocks.wooden_button); + registerItemBlock(Blocks.anvil, (new ItemAnvilBlock(Blocks.anvil)).setUnlocalizedName("anvil")); + registerItemBlock(Blocks.trapped_chest); + registerItemBlock(Blocks.light_weighted_pressure_plate); + registerItemBlock(Blocks.heavy_weighted_pressure_plate); + registerItemBlock(Blocks.daylight_detector); + registerItemBlock(Blocks.redstone_block); + registerItemBlock(Blocks.quartz_ore); + registerItemBlock(Blocks.hopper); + registerItemBlock(Blocks.quartz_block, (new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, + new String[] { "default", "chiseled", "lines" })).setUnlocalizedName("quartzBlock")); + registerItemBlock(Blocks.quartz_stairs); + registerItemBlock(Blocks.activator_rail); + registerItemBlock(Blocks.dropper); + registerItemBlock(Blocks.stained_hardened_clay, + (new ItemCloth(Blocks.stained_hardened_clay)).setUnlocalizedName("clayHardenedStained")); + registerItemBlock(Blocks.barrier); + registerItemBlock(Blocks.iron_trapdoor); + registerItemBlock(Blocks.hay_block); + registerItemBlock(Blocks.carpet, (new ItemCloth(Blocks.carpet)).setUnlocalizedName("woolCarpet")); + registerItemBlock(Blocks.hardened_clay); + registerItemBlock(Blocks.coal_block); + registerItemBlock(Blocks.packed_ice); + registerItemBlock(Blocks.acacia_stairs); + registerItemBlock(Blocks.dark_oak_stairs); + registerItemBlock(Blocks.slime_block); + registerItemBlock(Blocks.double_plant, + (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, new Function() { + public String apply(ItemStack itemstack) { + return BlockDoublePlant.EnumPlantType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("doublePlant")); + registerItemBlock(Blocks.stained_glass, + (new ItemCloth(Blocks.stained_glass)).setUnlocalizedName("stainedGlass")); + registerItemBlock(Blocks.stained_glass_pane, + (new ItemCloth(Blocks.stained_glass_pane)).setUnlocalizedName("stainedGlassPane")); + registerItemBlock(Blocks.prismarine, + (new ItemMultiTexture(Blocks.prismarine, Blocks.prismarine, new Function() { + public String apply(ItemStack itemstack) { + return BlockPrismarine.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("prismarine")); + registerItemBlock(Blocks.sea_lantern); + registerItemBlock(Blocks.red_sandstone, + (new ItemMultiTexture(Blocks.red_sandstone, Blocks.red_sandstone, new Function() { + public String apply(ItemStack itemstack) { + return BlockRedSandstone.EnumType.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("redSandStone")); + registerItemBlock(Blocks.red_sandstone_stairs); + registerItemBlock(Blocks.stone_slab2, + (new ItemSlab(Blocks.stone_slab2, Blocks.stone_slab2, Blocks.double_stone_slab2)) + .setUnlocalizedName("stoneSlab2")); + registerItem(256, (String) "iron_shovel", + (new ItemSpade(Item.ToolMaterial.IRON)).setUnlocalizedName("shovelIron")); + registerItem(257, (String) "iron_pickaxe", + (new ItemPickaxe(Item.ToolMaterial.IRON)).setUnlocalizedName("pickaxeIron")); + registerItem(258, (String) "iron_axe", (new ItemAxe(Item.ToolMaterial.IRON)).setUnlocalizedName("hatchetIron")); + registerItem(259, (String) "flint_and_steel", (new ItemFlintAndSteel()).setUnlocalizedName("flintAndSteel")); + registerItem(260, (String) "apple", (new ItemFood(4, 0.3F, false)).setUnlocalizedName("apple")); + registerItem(261, (String) "bow", (new ItemBow()).setUnlocalizedName("bow")); + registerItem(262, (String) "arrow", + (new Item()).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat)); + registerItem(263, (String) "coal", (new ItemCoal()).setUnlocalizedName("coal")); + registerItem(264, (String) "diamond", + (new Item()).setUnlocalizedName("diamond").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(265, (String) "iron_ingot", + (new Item()).setUnlocalizedName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(266, (String) "gold_ingot", + (new Item()).setUnlocalizedName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(267, (String) "iron_sword", + (new ItemSword(Item.ToolMaterial.IRON)).setUnlocalizedName("swordIron")); + registerItem(268, (String) "wooden_sword", + (new ItemSword(Item.ToolMaterial.WOOD)).setUnlocalizedName("swordWood")); + registerItem(269, (String) "wooden_shovel", + (new ItemSpade(Item.ToolMaterial.WOOD)).setUnlocalizedName("shovelWood")); + registerItem(270, (String) "wooden_pickaxe", + (new ItemPickaxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("pickaxeWood")); + registerItem(271, (String) "wooden_axe", + (new ItemAxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hatchetWood")); + registerItem(272, (String) "stone_sword", + (new ItemSword(Item.ToolMaterial.STONE)).setUnlocalizedName("swordStone")); + registerItem(273, (String) "stone_shovel", + (new ItemSpade(Item.ToolMaterial.STONE)).setUnlocalizedName("shovelStone")); + registerItem(274, (String) "stone_pickaxe", + (new ItemPickaxe(Item.ToolMaterial.STONE)).setUnlocalizedName("pickaxeStone")); + registerItem(275, (String) "stone_axe", + (new ItemAxe(Item.ToolMaterial.STONE)).setUnlocalizedName("hatchetStone")); + registerItem(276, (String) "diamond_sword", + (new ItemSword(Item.ToolMaterial.EMERALD)).setUnlocalizedName("swordDiamond")); + registerItem(277, (String) "diamond_shovel", + (new ItemSpade(Item.ToolMaterial.EMERALD)).setUnlocalizedName("shovelDiamond")); + registerItem(278, (String) "diamond_pickaxe", + (new ItemPickaxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("pickaxeDiamond")); + registerItem(279, (String) "diamond_axe", + (new ItemAxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hatchetDiamond")); + registerItem(280, (String) "stick", + (new Item()).setFull3D().setUnlocalizedName("stick").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(281, (String) "bowl", + (new Item()).setUnlocalizedName("bowl").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(282, (String) "mushroom_stew", (new ItemSoup(6)).setUnlocalizedName("mushroomStew")); + registerItem(283, (String) "golden_sword", + (new ItemSword(Item.ToolMaterial.GOLD)).setUnlocalizedName("swordGold")); + registerItem(284, (String) "golden_shovel", + (new ItemSpade(Item.ToolMaterial.GOLD)).setUnlocalizedName("shovelGold")); + registerItem(285, (String) "golden_pickaxe", + (new ItemPickaxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("pickaxeGold")); + registerItem(286, (String) "golden_axe", + (new ItemAxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hatchetGold")); + registerItem(287, (String) "string", + (new ItemReed(Blocks.tripwire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(288, (String) "feather", + (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(289, (String) "gunpowder", (new Item()).setUnlocalizedName("sulphur") + .setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(290, (String) "wooden_hoe", (new ItemHoe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hoeWood")); + registerItem(291, (String) "stone_hoe", (new ItemHoe(Item.ToolMaterial.STONE)).setUnlocalizedName("hoeStone")); + registerItem(292, (String) "iron_hoe", (new ItemHoe(Item.ToolMaterial.IRON)).setUnlocalizedName("hoeIron")); + registerItem(293, (String) "diamond_hoe", + (new ItemHoe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hoeDiamond")); + registerItem(294, (String) "golden_hoe", (new ItemHoe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hoeGold")); + registerItem(295, (String) "wheat_seeds", + (new ItemSeeds(Blocks.wheat, Blocks.farmland)).setUnlocalizedName("seeds")); + registerItem(296, (String) "wheat", + (new Item()).setUnlocalizedName("wheat").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(297, (String) "bread", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("bread")); + registerItem(298, (String) "leather_helmet", + (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 0)).setUnlocalizedName("helmetCloth")); + registerItem(299, (String) "leather_chestplate", + (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 1)).setUnlocalizedName("chestplateCloth")); + registerItem(300, (String) "leather_leggings", + (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 2)).setUnlocalizedName("leggingsCloth")); + registerItem(301, (String) "leather_boots", + (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 3)).setUnlocalizedName("bootsCloth")); + registerItem(302, (String) "chainmail_helmet", + (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 0)).setUnlocalizedName("helmetChain")); + registerItem(303, (String) "chainmail_chestplate", + (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 1)).setUnlocalizedName("chestplateChain")); + registerItem(304, (String) "chainmail_leggings", + (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 2)).setUnlocalizedName("leggingsChain")); + registerItem(305, (String) "chainmail_boots", + (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 3)).setUnlocalizedName("bootsChain")); + registerItem(306, (String) "iron_helmet", + (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 0)).setUnlocalizedName("helmetIron")); + registerItem(307, (String) "iron_chestplate", + (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 1)).setUnlocalizedName("chestplateIron")); + registerItem(308, (String) "iron_leggings", + (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 2)).setUnlocalizedName("leggingsIron")); + registerItem(309, (String) "iron_boots", + (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 3)).setUnlocalizedName("bootsIron")); + registerItem(310, (String) "diamond_helmet", + (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)).setUnlocalizedName("helmetDiamond")); + registerItem(311, (String) "diamond_chestplate", + (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 1)).setUnlocalizedName("chestplateDiamond")); + registerItem(312, (String) "diamond_leggings", + (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 2)).setUnlocalizedName("leggingsDiamond")); + registerItem(313, (String) "diamond_boots", + (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)).setUnlocalizedName("bootsDiamond")); + registerItem(314, (String) "golden_helmet", + (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 0)).setUnlocalizedName("helmetGold")); + registerItem(315, (String) "golden_chestplate", + (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold")); + registerItem(316, (String) "golden_leggings", + (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold")); + registerItem(317, (String) "golden_boots", + (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold")); + registerItem(318, (String) "flint", + (new Item()).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(319, (String) "porkchop", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("porkchopRaw")); + registerItem(320, (String) "cooked_porkchop", + (new ItemFood(8, 0.8F, true)).setUnlocalizedName("porkchopCooked")); + registerItem(321, (String) "painting", + (new ItemHangingEntity(EntityPainting.class)).setUnlocalizedName("painting")); + registerItem(322, (String) "golden_apple", (new ItemAppleGold(4, 1.2F, false)).setAlwaysEdible() + .setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("appleGold")); + registerItem(323, (String) "sign", (new ItemSign()).setUnlocalizedName("sign")); + registerItem(324, (String) "wooden_door", (new ItemDoor(Blocks.oak_door)).setUnlocalizedName("doorOak")); + Item item = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16); + registerItem(325, (String) "bucket", item); + registerItem(326, (String) "water_bucket", + (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(item)); + registerItem(327, (String) "lava_bucket", + (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(item)); + registerItem(328, (String) "minecart", + (new ItemMinecart(EntityMinecart.EnumMinecartType.RIDEABLE)).setUnlocalizedName("minecart")); + registerItem(329, (String) "saddle", (new ItemSaddle()).setUnlocalizedName("saddle")); + registerItem(330, (String) "iron_door", (new ItemDoor(Blocks.iron_door)).setUnlocalizedName("doorIron")); + registerItem(331, (String) "redstone", + (new ItemRedstone()).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect)); + registerItem(332, (String) "snowball", (new ItemSnowball()).setUnlocalizedName("snowball")); + registerItem(333, (String) "boat", (new ItemBoat()).setUnlocalizedName("boat")); + registerItem(334, (String) "leather", + (new Item()).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(335, (String) "milk_bucket", + (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(item)); + registerItem(336, (String) "brick", + (new Item()).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(337, (String) "clay_ball", + (new Item()).setUnlocalizedName("clay").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(338, (String) "reeds", + (new ItemReed(Blocks.reeds)).setUnlocalizedName("reeds").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(339, (String) "paper", + (new Item()).setUnlocalizedName("paper").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(340, (String) "book", + (new ItemBook()).setUnlocalizedName("book").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(341, (String) "slime_ball", + (new Item()).setUnlocalizedName("slimeball").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(342, (String) "chest_minecart", + (new ItemMinecart(EntityMinecart.EnumMinecartType.CHEST)).setUnlocalizedName("minecartChest")); + registerItem(343, (String) "furnace_minecart", + (new ItemMinecart(EntityMinecart.EnumMinecartType.FURNACE)).setUnlocalizedName("minecartFurnace")); + registerItem(344, (String) "egg", (new ItemEgg()).setUnlocalizedName("egg")); + registerItem(345, (String) "compass", + (new Item()).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools)); + registerItem(346, (String) "fishing_rod", (new ItemFishingRod()).setUnlocalizedName("fishingRod")); + registerItem(347, (String) "clock", + (new Item()).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools)); + registerItem(348, (String) "glowstone_dust", (new Item()).setUnlocalizedName("yellowDust") + .setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(349, (String) "fish", (new ItemFishFood(false)).setUnlocalizedName("fish").setHasSubtypes(true)); + registerItem(350, (String) "cooked_fish", + (new ItemFishFood(true)).setUnlocalizedName("fish").setHasSubtypes(true)); + registerItem(351, (String) "dye", (new ItemDye()).setUnlocalizedName("dyePowder")); + registerItem(352, (String) "bone", + (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc)); + registerItem(353, (String) "sugar", (new Item()).setUnlocalizedName("sugar") + .setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(354, (String) "cake", (new ItemReed(Blocks.cake)).setMaxStackSize(1).setUnlocalizedName("cake") + .setCreativeTab(CreativeTabs.tabFood)); + registerItem(355, (String) "bed", (new ItemBed()).setMaxStackSize(1).setUnlocalizedName("bed")); + registerItem(356, (String) "repeater", (new ItemReed(Blocks.unpowered_repeater)).setUnlocalizedName("diode") + .setCreativeTab(CreativeTabs.tabRedstone)); + registerItem(357, (String) "cookie", (new ItemFood(2, 0.1F, false)).setUnlocalizedName("cookie")); + registerItem(358, (String) "filled_map", (new ItemMap()).setUnlocalizedName("map")); + registerItem(359, (String) "shears", (new ItemShears()).setUnlocalizedName("shears")); + registerItem(360, (String) "melon", (new ItemFood(2, 0.3F, false)).setUnlocalizedName("melon")); + registerItem(361, (String) "pumpkin_seeds", + (new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland)).setUnlocalizedName("seeds_pumpkin")); + registerItem(362, (String) "melon_seeds", + (new ItemSeeds(Blocks.melon_stem, Blocks.farmland)).setUnlocalizedName("seeds_melon")); + registerItem(363, (String) "beef", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("beefRaw")); + registerItem(364, (String) "cooked_beef", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("beefCooked")); + registerItem(365, (String) "chicken", (new ItemFood(2, 0.3F, true)) + .setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("chickenRaw")); + registerItem(366, (String) "cooked_chicken", (new ItemFood(6, 0.6F, true)).setUnlocalizedName("chickenCooked")); + registerItem(367, (String) "rotten_flesh", (new ItemFood(4, 0.1F, true)) + .setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh")); + registerItem(368, (String) "ender_pearl", (new ItemEnderPearl()).setUnlocalizedName("enderPearl")); + registerItem(369, (String) "blaze_rod", + (new Item()).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setFull3D()); + registerItem(370, (String) "ghast_tear", (new Item()).setUnlocalizedName("ghastTear") + .setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(371, (String) "gold_nugget", + (new Item()).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(372, (String) "nether_wart", (new ItemSeeds(Blocks.nether_wart, Blocks.soul_sand)) + .setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4")); + registerItem(373, (String) "potion", (new ItemPotion()).setUnlocalizedName("potion")); + registerItem(374, (String) "glass_bottle", (new ItemGlassBottle()).setUnlocalizedName("glassBottle")); + registerItem(375, (String) "spider_eye", + (new ItemFood(2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F) + .setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect)); + registerItem(376, (String) "fermented_spider_eye", (new Item()).setUnlocalizedName("fermentedSpiderEye") + .setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(377, (String) "blaze_powder", (new Item()).setUnlocalizedName("blazePowder") + .setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(378, (String) "magma_cream", (new Item()).setUnlocalizedName("magmaCream") + .setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(379, (String) "brewing_stand", (new ItemReed(Blocks.brewing_stand)) + .setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(380, (String) "cauldron", + (new ItemReed(Blocks.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(381, (String) "ender_eye", (new ItemEnderEye()).setUnlocalizedName("eyeOfEnder")); + registerItem(382, (String) "speckled_melon", (new Item()).setUnlocalizedName("speckledMelon") + .setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(383, (String) "spawn_egg", (new ItemMonsterPlacer()).setUnlocalizedName("monsterPlacer")); + registerItem(384, (String) "experience_bottle", (new ItemExpBottle()).setUnlocalizedName("expBottle")); + registerItem(385, (String) "fire_charge", (new ItemFireball()).setUnlocalizedName("fireball")); + registerItem(386, (String) "writable_book", + (new ItemWritableBook()).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(387, (String) "written_book", + (new ItemEditableBook()).setUnlocalizedName("writtenBook").setMaxStackSize(16)); + registerItem(388, (String) "emerald", + (new Item()).setUnlocalizedName("emerald").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(389, (String) "item_frame", + (new ItemHangingEntity(EntityItemFrame.class)).setUnlocalizedName("frame")); + registerItem(390, (String) "flower_pot", (new ItemReed(Blocks.flower_pot)).setUnlocalizedName("flowerPot") + .setCreativeTab(CreativeTabs.tabDecorations)); + registerItem(391, (String) "carrot", + (new ItemSeedFood(3, 0.6F, Blocks.carrots, Blocks.farmland)).setUnlocalizedName("carrots")); + registerItem(392, (String) "potato", + (new ItemSeedFood(1, 0.3F, Blocks.potatoes, Blocks.farmland)).setUnlocalizedName("potato")); + registerItem(393, (String) "baked_potato", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("potatoBaked")); + registerItem(394, (String) "poisonous_potato", (new ItemFood(2, 0.3F, false)) + .setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous")); + registerItem(395, (String) "map", (new ItemEmptyMap()).setUnlocalizedName("emptyMap")); + registerItem(396, (String) "golden_carrot", (new ItemFood(6, 1.2F, false)).setUnlocalizedName("carrotGolden") + .setPotionEffect(PotionHelper.goldenCarrotEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(397, (String) "skull", (new ItemSkull()).setUnlocalizedName("skull")); + registerItem(398, (String) "carrot_on_a_stick", + (new ItemCarrotOnAStick()).setUnlocalizedName("carrotOnAStick")); + registerItem(399, (String) "nether_star", + (new ItemSimpleFoiled()).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(400, (String) "pumpkin_pie", + (new ItemFood(8, 0.3F, false)).setUnlocalizedName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood)); + registerItem(401, (String) "fireworks", (new ItemFirework()).setUnlocalizedName("fireworks")); + registerItem(402, (String) "firework_charge", + (new ItemFireworkCharge()).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(403, (String) "enchanted_book", + (new ItemEnchantedBook()).setMaxStackSize(1).setUnlocalizedName("enchantedBook")); + registerItem(404, (String) "comparator", (new ItemReed(Blocks.unpowered_comparator)) + .setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone)); + registerItem(405, (String) "netherbrick", + (new Item()).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(406, (String) "quartz", + (new Item()).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(407, (String) "tnt_minecart", + (new ItemMinecart(EntityMinecart.EnumMinecartType.TNT)).setUnlocalizedName("minecartTnt")); + registerItem(408, (String) "hopper_minecart", + (new ItemMinecart(EntityMinecart.EnumMinecartType.HOPPER)).setUnlocalizedName("minecartHopper")); + registerItem(409, (String) "prismarine_shard", + (new Item()).setUnlocalizedName("prismarineShard").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(410, (String) "prismarine_crystals", + (new Item()).setUnlocalizedName("prismarineCrystals").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(411, (String) "rabbit", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("rabbitRaw")); + registerItem(412, (String) "cooked_rabbit", (new ItemFood(5, 0.6F, true)).setUnlocalizedName("rabbitCooked")); + registerItem(413, (String) "rabbit_stew", (new ItemSoup(10)).setUnlocalizedName("rabbitStew")); + registerItem(414, (String) "rabbit_foot", (new Item()).setUnlocalizedName("rabbitFoot") + .setPotionEffect(PotionHelper.rabbitFootEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(415, (String) "rabbit_hide", + (new Item()).setUnlocalizedName("rabbitHide").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(416, (String) "armor_stand", + (new ItemArmorStand()).setUnlocalizedName("armorStand").setMaxStackSize(16)); + registerItem(417, (String) "iron_horse_armor", (new Item()).setUnlocalizedName("horsearmormetal") + .setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc)); + registerItem(418, (String) "golden_horse_armor", (new Item()).setUnlocalizedName("horsearmorgold") + .setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc)); + registerItem(419, (String) "diamond_horse_armor", (new Item()).setUnlocalizedName("horsearmordiamond") + .setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc)); + registerItem(420, (String) "lead", (new ItemLead()).setUnlocalizedName("leash")); + registerItem(421, (String) "name_tag", (new ItemNameTag()).setUnlocalizedName("nameTag")); + registerItem(422, (String) "command_block_minecart", + (new ItemMinecart(EntityMinecart.EnumMinecartType.COMMAND_BLOCK)) + .setUnlocalizedName("minecartCommandBlock").setCreativeTab((CreativeTabs) null)); + registerItem(423, (String) "mutton", (new ItemFood(2, 0.3F, true)).setUnlocalizedName("muttonRaw")); + registerItem(424, (String) "cooked_mutton", (new ItemFood(6, 0.8F, true)).setUnlocalizedName("muttonCooked")); + registerItem(425, (String) "banner", (new ItemBanner()).setUnlocalizedName("banner")); + registerItem(427, (String) "spruce_door", (new ItemDoor(Blocks.spruce_door)).setUnlocalizedName("doorSpruce")); + registerItem(428, (String) "birch_door", (new ItemDoor(Blocks.birch_door)).setUnlocalizedName("doorBirch")); + registerItem(429, (String) "jungle_door", (new ItemDoor(Blocks.jungle_door)).setUnlocalizedName("doorJungle")); + registerItem(430, (String) "acacia_door", (new ItemDoor(Blocks.acacia_door)).setUnlocalizedName("doorAcacia")); + registerItem(431, (String) "dark_oak_door", + (new ItemDoor(Blocks.dark_oak_door)).setUnlocalizedName("doorDarkOak")); + registerItem(2256, (String) "record_13", (new ItemRecord("13")).setUnlocalizedName("record")); + registerItem(2257, (String) "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record")); + registerItem(2258, (String) "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record")); + registerItem(2259, (String) "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record")); + registerItem(2260, (String) "record_far", (new ItemRecord("far")).setUnlocalizedName("record")); + registerItem(2261, (String) "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record")); + registerItem(2262, (String) "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record")); + registerItem(2263, (String) "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record")); + registerItem(2264, (String) "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record")); + registerItem(2265, (String) "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record")); + registerItem(2266, (String) "record_11", (new ItemRecord("11")).setUnlocalizedName("record")); + registerItem(2267, (String) "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record")); + } + + /**+ + * Register the given Item as the ItemBlock for the given Block. + */ + private static void registerItemBlock(Block blockIn) { + registerItemBlock(blockIn, new ItemBlock(blockIn)); + } + + /**+ + * Register the given Item as the ItemBlock for the given Block. + */ + protected static void registerItemBlock(Block blockIn, Item itemIn) { + registerItem(Block.getIdFromBlock(blockIn), (ResourceLocation) Block.blockRegistry.getNameForObject(blockIn), + itemIn); + BLOCK_TO_ITEM.put(blockIn, itemIn); + } + + private static void registerItem(int id, String textualID, Item itemIn) { + registerItem(id, new ResourceLocation(textualID), itemIn); + } + + private static void registerItem(int id, ResourceLocation textualID, Item itemIn) { + itemRegistry.register(id, textualID, itemIn); + } + + public static enum ToolMaterial { + WOOD(0, 59, 2.0F, 0.0F, 15), STONE(1, 131, 4.0F, 1.0F, 5), IRON(2, 250, 6.0F, 2.0F, 14), + EMERALD(3, 1561, 8.0F, 3.0F, 10), GOLD(0, 32, 12.0F, 0.0F, 22); + + private final int harvestLevel; + private final int maxUses; + private final float efficiencyOnProperMaterial; + private final float damageVsEntity; + private final int enchantability; + + private ToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, + int enchantability) { + this.harvestLevel = harvestLevel; + this.maxUses = maxUses; + this.efficiencyOnProperMaterial = efficiency; + this.damageVsEntity = damageVsEntity; + this.enchantability = enchantability; + } + + public int getMaxUses() { + return this.maxUses; + } + + public float getEfficiencyOnProperMaterial() { + return this.efficiencyOnProperMaterial; + } + + public float getDamageVsEntity() { + return this.damageVsEntity; + } + + public int getHarvestLevel() { + return this.harvestLevel; + } + + public int getEnchantability() { + return this.enchantability; + } + + public Item getRepairItem() { + return this == WOOD ? Item.getItemFromBlock(Blocks.planks) + : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) + : (this == GOLD ? Items.gold_ingot + : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAnvilBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAnvilBlock.java new file mode 100644 index 0000000..8ccbb86 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAnvilBlock.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMultiTexture; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemAnvilBlock extends ItemMultiTexture { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemAnvilBlock"); + } + + public ItemAnvilBlock(Block block) { + super(block, block, new String[] { "intact", "slightlyDamaged", "veryDamaged" }); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i << 2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAppleGold.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAppleGold.java new file mode 100644 index 0000000..bb71524 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAppleGold.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumRarity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemAppleGold extends ItemFood { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemAppleGold"); + } + + public ItemAppleGold(int amount, float saturation, boolean isWolfFood) { + super(amount, saturation, isWolfFood); + this.setHasSubtypes(true); + } + + public boolean hasEffect(ItemStack itemstack) { + return itemstack.getMetadata() > 0; + } + + /**+ + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack itemstack) { + return itemstack.getMetadata() == 0 ? EnumRarity.RARE : EnumRarity.EPIC; + } + + protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.addPotionEffect(new PotionEffect(Potion.absorption.id, 2400, 0)); + + if (itemstack.getMetadata() > 0) { + { + entityplayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); + entityplayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); + entityplayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + } + } else { + super.onFoodEaten(itemstack, world, entityplayer); + } + + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, 0)); + list.add(new ItemStack(item, 1, 1)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmor.java new file mode 100644 index 0000000..54b8717 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmor.java @@ -0,0 +1,260 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.base.Predicates; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBehaviorDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemArmor extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemArmor"); + } + + /**+ + * Holds the 'base' maxDamage that each armorType have. + */ + private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; + public static final String[] EMPTY_SLOT_NAMES = new String[] { "minecraft:items/empty_armor_slot_helmet", + "minecraft:items/empty_armor_slot_chestplate", "minecraft:items/empty_armor_slot_leggings", + "minecraft:items/empty_armor_slot_boots" }; + private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDefaultDispenseItem() { + protected ItemStack dispenseStack(IBlockSource iblocksource, ItemStack itemstack) { + BlockPos blockpos = iblocksource.getBlockPos() + .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + AxisAlignedBB axisalignedbb = new AxisAlignedBB((double) i, (double) j, (double) k, (double) (i + 1), + (double) (j + 1), (double) (k + 1)); + List list = iblocksource.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb, + Predicates.and(EntitySelectors.NOT_SPECTATING, new EntitySelectors.ArmoredMob(itemstack))); + if (list.size() > 0) { + EntityLivingBase entitylivingbase = (EntityLivingBase) list.get(0); + int l = entitylivingbase instanceof EntityPlayer ? 1 : 0; + int i1 = EntityLiving.getArmorPosition(itemstack); + ItemStack itemstack1 = itemstack.copy(); + itemstack1.stackSize = 1; + entitylivingbase.setCurrentItemOrArmor(i1 - l, itemstack1); + if (entitylivingbase instanceof EntityLiving) { + ((EntityLiving) entitylivingbase).setEquipmentDropChance(i1, 2.0F); + } + + --itemstack.stackSize; + return itemstack; + } else { + return super.dispenseStack(iblocksource, itemstack); + } + } + }; + public final int armorType; + public final int damageReduceAmount; + public final int renderIndex; + private final ItemArmor.ArmorMaterial material; + + public ItemArmor(ItemArmor.ArmorMaterial material, int renderIndex, int armorType) { + this.material = material; + this.armorType = armorType; + this.renderIndex = renderIndex; + this.damageReduceAmount = material.getDamageReductionAmount(armorType); + this.setMaxDamage(material.getDurability(armorType)); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabCombat); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserBehavior); + } + + public int getColorFromItemStack(ItemStack itemstack, int i) { + if (i > 0) { + return 16777215; + } else { + int j = this.getColor(itemstack); + if (j < 0) { + j = 16777215; + } + + return j; + } + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return this.material.getEnchantability(); + } + + /**+ + * Return the armor material for this armor item. + */ + public ItemArmor.ArmorMaterial getArmorMaterial() { + return this.material; + } + + /**+ + * Return whether the specified armor ItemStack has a color. + */ + public boolean hasColor(ItemStack parItemStack) { + return this.material != ItemArmor.ArmorMaterial.LEATHER ? false + : (!parItemStack.hasTagCompound() ? false + : (!parItemStack.getTagCompound().hasKey("display", 10) ? false + : parItemStack.getTagCompound().getCompoundTag("display").hasKey("color", 3))); + } + + /**+ + * Return the color for the specified armor ItemStack. + */ + public int getColor(ItemStack stack) { + if (this.material != ItemArmor.ArmorMaterial.LEATHER) { + return -1; + } else { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + if (nbttagcompound != null) { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + if (nbttagcompound1 != null && nbttagcompound1.hasKey("color", 3)) { + return nbttagcompound1.getInteger("color"); + } + } + + return 10511680; + } + } + + /**+ + * Remove the color from the specified armor ItemStack. + */ + public void removeColor(ItemStack stack) { + if (this.material == ItemArmor.ArmorMaterial.LEATHER) { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + if (nbttagcompound != null) { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + if (nbttagcompound1.hasKey("color")) { + nbttagcompound1.removeTag("color"); + } + + } + } + } + + /**+ + * Sets the color of the specified armor ItemStack + */ + public void setColor(ItemStack stack, int color) { + if (this.material != ItemArmor.ArmorMaterial.LEATHER) { + throw new UnsupportedOperationException("Can\'t dye non-leather!"); + } else { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + if (nbttagcompound == null) { + nbttagcompound = new NBTTagCompound(); + stack.setTagCompound(nbttagcompound); + } + + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + if (!nbttagcompound.hasKey("display", 10)) { + nbttagcompound.setTag("display", nbttagcompound1); + } + + nbttagcompound1.setInteger("color", color); + } + } + + /**+ + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack itemstack, ItemStack itemstack1) { + return this.material.getRepairItem() == itemstack1.getItem() ? true + : super.getIsRepairable(itemstack, itemstack1); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) { + int i = EntityLiving.getArmorPosition(itemstack) - 1; + ItemStack itemstack1 = entityplayer.getCurrentArmor(i); + if (itemstack1 == null) { + entityplayer.setCurrentItemOrArmor(i, itemstack.copy()); + itemstack.stackSize = 0; + } + + return itemstack; + } + + public static enum ArmorMaterial { + LEATHER("leather", 5, new int[] { 1, 3, 2, 1 }, 15), CHAIN("chainmail", 15, new int[] { 2, 5, 4, 1 }, 12), + IRON("iron", 15, new int[] { 2, 6, 5, 2 }, 9), GOLD("gold", 7, new int[] { 2, 5, 3, 1 }, 25), + DIAMOND("diamond", 33, new int[] { 3, 8, 6, 3 }, 10); + + private final String name; + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + + private ArmorMaterial(String name, int maxDamage, int[] reductionAmounts, int enchantability) { + this.name = name; + this.maxDamageFactor = maxDamage; + this.damageReductionAmountArray = reductionAmounts; + this.enchantability = enchantability; + } + + public int getDurability(int armorType) { + return ItemArmor.maxDamageArray[armorType] * this.maxDamageFactor; + } + + public int getDamageReductionAmount(int armorType) { + return this.damageReductionAmountArray[armorType]; + } + + public int getEnchantability() { + return this.enchantability; + } + + public Item getRepairItem() { + return this == LEATHER ? Items.leather + : (this == CHAIN ? Items.iron_ingot + : (this == GOLD ? Items.gold_ingot + : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null)))); + } + + public String getName() { + return this.name; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmorStand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmorStand.java new file mode 100644 index 0000000..d91d890 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmorStand.java @@ -0,0 +1,120 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Rotations; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemArmorStand extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemArmorStand"); + } + + public ItemArmorStand() { + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing == EnumFacing.DOWN) { + return false; + } else { + boolean flag = world.getBlockState(blockpos).getBlock().isReplaceable(world, blockpos); + BlockPos blockpos1 = flag ? blockpos : blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos1, enumfacing, itemstack)) { + return false; + } else { + BlockPos blockpos2 = blockpos1.up(); + boolean flag1 = !world.isAirBlock(blockpos1) + && !world.getBlockState(blockpos1).getBlock().isReplaceable(world, blockpos1); + flag1 = flag1 | (!world.isAirBlock(blockpos2) + && !world.getBlockState(blockpos2).getBlock().isReplaceable(world, blockpos2)); + if (flag1) { + return false; + } else { + double d0 = (double) blockpos1.getX(); + double d1 = (double) blockpos1.getY(); + double d2 = (double) blockpos1.getZ(); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity) null, + AxisAlignedBB.fromBounds(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D)); + if (list.size() > 0) { + return false; + } else { + { + world.setBlockToAir(blockpos1); + world.setBlockToAir(blockpos2); + EntityArmorStand entityarmorstand = new EntityArmorStand(world, d0 + 0.5D, d1, d2 + 0.5D); + float f = (float) MathHelper.floor_float( + (MathHelper.wrapAngleTo180_float(entityplayer.rotationYaw - 180.0F) + 22.5F) + / 45.0F) + * 45.0F; + entityarmorstand.setLocationAndAngles(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F); + this.applyRandomRotations(entityarmorstand, world.rand); + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + if (nbttagcompound != null && nbttagcompound.hasKey("EntityTag", 10)) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entityarmorstand.writeToNBTOptional(nbttagcompound1); + nbttagcompound1.merge(nbttagcompound.getCompoundTag("EntityTag")); + entityarmorstand.readFromNBT(nbttagcompound1); + } + + world.spawnEntityInWorld(entityarmorstand); + } + + --itemstack.stackSize; + return true; + } + } + } + } + } + + private void applyRandomRotations(EntityArmorStand armorStand, EaglercraftRandom rand) { + Rotations rotations = armorStand.getHeadRotation(); + float f = rand.nextFloat() * 5.0F; + float f1 = rand.nextFloat() * 20.0F - 10.0F; + Rotations rotations1 = new Rotations(rotations.getX() + f, rotations.getY() + f1, rotations.getZ()); + armorStand.setHeadRotation(rotations1); + rotations = armorStand.getBodyRotation(); + f = rand.nextFloat() * 10.0F - 5.0F; + rotations1 = new Rotations(rotations.getX(), rotations.getY() + f, rotations.getZ()); + armorStand.setBodyRotation(rotations1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAxe.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAxe.java new file mode 100644 index 0000000..9a72c0d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAxe.java @@ -0,0 +1,56 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemTool; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemAxe extends ItemTool { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemAxe"); + } + + private static Set EFFECTIVE_ON = null; + + public static void doBootstrap() { + EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, + Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder }); + } + + protected ItemAxe(Item.ToolMaterial material) { + super(3.0F, material, EFFECTIVE_ON); + } + + public float getStrVsBlock(ItemStack itemstack, Block block) { + return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants + && block.getMaterial() != Material.vine ? super.getStrVsBlock(itemstack, block) + : this.efficiencyOnProperMaterial; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBanner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBanner.java new file mode 100644 index 0000000..50d3a36 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBanner.java @@ -0,0 +1,171 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStandingSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWallSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBanner extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBanner"); + } + + public ItemBanner() { + super(Blocks.standing_banner); + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing == EnumFacing.DOWN) { + return false; + } else if (!world.getBlockState(blockpos).getBlock().getMaterial().isSolid()) { + return false; + } else { + blockpos = blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else if (!Blocks.standing_banner.canPlaceBlockAt(world, blockpos)) { + return false; + } else { + if (enumfacing == EnumFacing.UP) { + int i = MathHelper + .floor_double((double) ((entityplayer.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; + world.setBlockState(blockpos, Blocks.standing_banner.getDefaultState() + .withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3); + } else { + world.setBlockState(blockpos, + Blocks.wall_banner.getDefaultState().withProperty(BlockWallSign.FACING, enumfacing), 3); + } + + --itemstack.stackSize; + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBanner) { + ((TileEntityBanner) tileentity).setItemValues(itemstack); + } + + return true; + } + } + } + + public String getItemStackDisplayName(ItemStack itemstack) { + String s = "item.banner."; + EnumDyeColor enumdyecolor = this.getBaseColor(itemstack); + s = s + enumdyecolor.getUnlocalizedName() + ".name"; + return StatCollector.translateToLocal(s); + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack itemstack, EntityPlayer var2, List list, boolean var4) { + NBTTagCompound nbttagcompound = itemstack.getSubCompound("BlockEntityTag", false); + if (nbttagcompound != null && nbttagcompound.hasKey("Patterns")) { + NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10); + + for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color")); + TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern + .getPatternByID(nbttagcompound1.getString("Pattern")); + if (tileentitybanner$enumbannerpattern != null) { + list.add(StatCollector + .translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + + enumdyecolor.getUnlocalizedName())); + } + } + + } + } + + public int getColorFromItemStack(ItemStack itemstack, int i) { + if (i == 0) { + return 16777215; + } else { + EnumDyeColor enumdyecolor = this.getBaseColor(itemstack); + return enumdyecolor.getMapColor().colorValue; + } + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + TileEntityBanner.func_181020_a(nbttagcompound, enumdyecolor.getDyeDamage(), (NBTTagList) null); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("BlockEntityTag", nbttagcompound); + ItemStack itemstack = new ItemStack(item, 1, enumdyecolor.getDyeDamage()); + itemstack.setTagCompound(nbttagcompound1); + list.add(itemstack); + } + + } + + /**+ + * gets the CreativeTab this item is displayed on + */ + public CreativeTabs getCreativeTab() { + return CreativeTabs.tabDecorations; + } + + private EnumDyeColor getBaseColor(ItemStack stack) { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + EnumDyeColor enumdyecolor = null; + if (nbttagcompound != null && nbttagcompound.hasKey("Base")) { + enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound.getInteger("Base")); + } else { + enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata()); + } + + return enumdyecolor; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBed.java new file mode 100644 index 0000000..262857f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBed.java @@ -0,0 +1,92 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBed extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBed"); + } + + public ItemBed() { + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing != EnumFacing.UP) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + boolean flag = block.isReplaceable(world, blockpos); + if (!flag) { + blockpos = blockpos.up(); + } + + int i = MathHelper.floor_double((double) (entityplayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + EnumFacing enumfacing1 = EnumFacing.getHorizontal(i); + BlockPos blockpos1 = blockpos.offset(enumfacing1); + if (entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack) + && entityplayer.canPlayerEdit(blockpos1, enumfacing, itemstack)) { + boolean flag1 = world.getBlockState(blockpos1).getBlock().isReplaceable(world, blockpos1); + boolean flag2 = flag || world.isAirBlock(blockpos); + boolean flag3 = flag1 || world.isAirBlock(blockpos1); + if (flag2 && flag3 && World.doesBlockHaveSolidTopSurface(world, blockpos.down()) + && World.doesBlockHaveSolidTopSurface(world, blockpos1.down())) { + IBlockState iblockstate1 = Blocks.bed.getDefaultState() + .withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)) + .withProperty(BlockBed.FACING, enumfacing1) + .withProperty(BlockBed.PART, BlockBed.EnumPartType.FOOT); + if (world.setBlockState(blockpos, iblockstate1, 3)) { + IBlockState iblockstate2 = iblockstate1.withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD); + world.setBlockState(blockpos1, iblockstate2, 3); + } + + --itemstack.stackSize; + return true; + } else { + return false; + } + } else { + return false; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBlock.java new file mode 100644 index 0000000..42bf190 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBlock.java @@ -0,0 +1,179 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBlock extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBlock"); + } + + protected final Block block; + + public ItemBlock(Block block) { + this.block = block; + } + + /**+ + * Sets the unlocalized name of this item to the string passed + * as the parameter, prefixed by "item." + */ + public ItemBlock setUnlocalizedName(String unlocalizedName) { + super.setUnlocalizedName(unlocalizedName); + return this; + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float f, float f1, float f2) { + IBlockState iblockstate = world.getBlockState(blockpos); + Block blockx = iblockstate.getBlock(); + if (!blockx.isReplaceable(world, blockpos)) { + blockpos = blockpos.offset(enumfacing); + } + + if (itemstack.stackSize == 0) { + return false; + } else if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else if (world.canBlockBePlaced(this.block, blockpos, false, enumfacing, (Entity) null, itemstack)) { + int i = this.getMetadata(itemstack.getMetadata()); + IBlockState iblockstate1 = this.block.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, + entityplayer); + if (world.setBlockState(blockpos, iblockstate1, 3)) { + iblockstate1 = world.getBlockState(blockpos); + if (iblockstate1.getBlock() == this.block) { + setTileEntityNBT(world, entityplayer, blockpos, itemstack); + this.block.onBlockPlacedBy(world, blockpos, iblockstate1, entityplayer, itemstack); + } + + world.playSoundEffect((double) ((float) blockpos.getX() + 0.5F), + (double) ((float) blockpos.getY() + 0.5F), (double) ((float) blockpos.getZ() + 0.5F), + this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, + this.block.stepSound.getFrequency() * 0.8F); + --itemstack.stackSize; + } + + return true; + } else { + return false; + } + } + + public static boolean setTileEntityNBT(World worldIn, EntityPlayer pos, BlockPos stack, ItemStack parItemStack) { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + if (minecraftserver == null) { + return false; + } else { + if (parItemStack.hasTagCompound() && parItemStack.getTagCompound().hasKey("BlockEntityTag", 10)) { + TileEntity tileentity = worldIn.getTileEntity(stack); + if (tileentity != null) { + if (tileentity.func_183000_F() + && !minecraftserver.getConfigurationManager().canSendCommands(pos.getGameProfile())) { + return false; + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttagcompound.copy(); + tileentity.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound2 = (NBTTagCompound) parItemStack.getTagCompound() + .getTag("BlockEntityTag"); + nbttagcompound.merge(nbttagcompound2); + nbttagcompound.setInteger("x", stack.getX()); + nbttagcompound.setInteger("y", stack.getY()); + nbttagcompound.setInteger("z", stack.getZ()); + if (!nbttagcompound.equals(nbttagcompound1)) { + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + return true; + } + } + } + + return false; + } + } + + public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing, EntityPlayer var4, + ItemStack itemstack) { + Block blockx = world.getBlockState(blockpos).getBlock(); + if (blockx == Blocks.snow_layer) { + enumfacing = EnumFacing.UP; + } else if (!blockx.isReplaceable(world, blockpos)) { + blockpos = blockpos.offset(enumfacing); + } + + return world.canBlockBePlaced(this.block, blockpos, false, enumfacing, (Entity) null, itemstack); + } + + /**+ + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName(ItemStack var1) { + return this.block.getUnlocalizedName(); + } + + /**+ + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() { + return this.block.getUnlocalizedName(); + } + + /**+ + * gets the CreativeTab this item is displayed on + */ + public CreativeTabs getCreativeTab() { + return this.block.getCreativeTabToDisplayOn(); + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs creativetabs, List list) { + this.block.getSubBlocks(item, creativetabs, list); + } + + public Block getBlock() { + return this.block; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBoat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBoat.java new file mode 100644 index 0000000..ea99add --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBoat.java @@ -0,0 +1,128 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityBoat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBoat extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBoat"); + } + + public ItemBoat() { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + float f = 1.0F; + float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer.prevRotationPitch) * f; + float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw) * f; + double d0 = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX) * (double) f; + double d1 = entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * (double) f + + (double) entityplayer.getEyeHeight(); + double d2 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ) * (double) f; + Vec3 vec3 = new Vec3(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F); + float f4 = MathHelper.sin(-f2 * 0.017453292F - 3.1415927F); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); + MovingObjectPosition movingobjectposition = world.rayTraceBlocks(vec3, vec31, true); + if (movingobjectposition == null) { + return itemstack; + } else { + Vec3 vec32 = entityplayer.getLook(f); + boolean flag = false; + float f9 = 1.0F; + List list = world.getEntitiesWithinAABBExcludingEntity(entityplayer, + entityplayer.getEntityBoundingBox() + .addCoord(vec32.xCoord * d3, vec32.yCoord * d3, vec32.zCoord * d3) + .expand((double) f9, (double) f9, (double) f9)); + + for (int i = 0; i < list.size(); ++i) { + Entity entity = (Entity) list.get(i); + if (entity.canBeCollidedWith()) { + float f10 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.getEntityBoundingBox().expand((double) f10, (double) f10, + (double) f10); + if (axisalignedbb.isVecInside(vec3)) { + flag = true; + } + } + } + + if (flag) { + return itemstack; + } else { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = movingobjectposition.getBlockPos(); + if (world.getBlockState(blockpos).getBlock() == Blocks.snow_layer) { + blockpos = blockpos.down(); + } + + EntityBoat entityboat = new EntityBoat(world, (double) ((float) blockpos.getX() + 0.5F), + (double) ((float) blockpos.getY() + 1.0F), (double) ((float) blockpos.getZ() + 0.5F)); + entityboat.rotationYaw = (float) (((MathHelper + .floor_double((double) (entityplayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); + if (!world.getCollidingBoundingBoxes(entityboat, + entityboat.getEntityBoundingBox().expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { + return itemstack; + } + + world.spawnEntityInWorld(entityboat); + + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + + return itemstack; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBook.java new file mode 100644 index 0000000..9ede788 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBook.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBook extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBook"); + } + + /**+ + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack stack) { + return stack.stackSize == 1; + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBow.java new file mode 100644 index 0000000..0e6e7d8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBow.java @@ -0,0 +1,147 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBow extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBow"); + } + + public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" }; + + public ItemBow() { + this.maxStackSize = 1; + this.setMaxDamage(384); + this.setCreativeTab(CreativeTabs.tabCombat); + } + + /**+ + * Called when the player stops using an Item (stops holding the + * right mouse button). + */ + public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft) { + boolean flag = playerIn.capabilities.isCreativeMode + || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0; + if (flag || playerIn.inventory.hasItem(Items.arrow)) { + int i = this.getMaxItemUseDuration(stack) - timeLeft; + float f = (float) i / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + if ((double) f < 0.1D) { + return; + } + + if (f > 1.0F) { + f = 1.0F; + } + + EntityArrow entityarrow = new EntityArrow(worldIn, playerIn, f * 2.0F); + if (f == 1.0F) { + entityarrow.setIsCritical(true); + } + + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, stack); + if (j > 0) { + entityarrow.setDamage(entityarrow.getDamage() + (double) j * 0.5D + 0.5D); + } + + int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, stack); + if (k > 0) { + entityarrow.setKnockbackStrength(k); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, stack) > 0) { + entityarrow.setFire(100); + } + + stack.damageItem(1, playerIn); + worldIn.playSoundAtEntity(playerIn, "random.bow", 1.0F, + 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + if (flag) { + entityarrow.canBePickedUp = 2; + } else { + playerIn.inventory.consumeInventoryItem(Items.arrow); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + worldIn.spawnEntityInWorld(entityarrow); + } + + } + + /**+ + * Called when the player finishes using this Item (E.g. + * finishes eating.). Not called when the player stops using the + * Item before the action is complete. + */ + public ItemStack onItemUseFinish(ItemStack itemstack, World var2, EntityPlayer var3) { + return itemstack; + } + + /**+ + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack var1) { + return 72000; + } + + /**+ + * returns the action that specifies what animation to play when + * the items is being used + */ + public EnumAction getItemUseAction(ItemStack var1) { + return EnumAction.BOW; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) { + if (entityplayer.capabilities.isCreativeMode || entityplayer.inventory.hasItem(Items.arrow)) { + entityplayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); + } + + return itemstack; + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucket.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucket.java new file mode 100644 index 0000000..38da9a5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucket.java @@ -0,0 +1,160 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBucket extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBucket"); + } + + private Block isFull; + + public ItemBucket(Block containedBlock) { + this.maxStackSize = 1; + this.isFull = containedBlock; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + boolean flag = this.isFull == Blocks.air; + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityplayer, flag); + if (movingobjectposition == null) { + return itemstack; + } else { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = movingobjectposition.getBlockPos(); + if (!world.isBlockModifiable(entityplayer, blockpos)) { + return itemstack; + } + + if (flag) { + if (!entityplayer.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), + movingobjectposition.sideHit, itemstack)) { + return itemstack; + } + + IBlockState iblockstate = world.getBlockState(blockpos); + Material material = iblockstate.getBlock().getMaterial(); + if (material == Material.water + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) { + world.setBlockToAir(blockpos); + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return this.fillBucket(itemstack, entityplayer, Items.water_bucket); + } + + if (material == Material.lava + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) { + world.setBlockToAir(blockpos); + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return this.fillBucket(itemstack, entityplayer, Items.lava_bucket); + } + } else { + if (this.isFull == Blocks.air) { + return new ItemStack(Items.bucket); + } + + BlockPos blockpos1 = blockpos.offset(movingobjectposition.sideHit); + if (!entityplayer.canPlayerEdit(blockpos1, movingobjectposition.sideHit, itemstack)) { + return itemstack; + } + + if (this.tryPlaceContainedLiquid(world, blockpos1) && !entityplayer.capabilities.isCreativeMode) { + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return new ItemStack(Items.bucket); + } + } + } + + return itemstack; + } + } + + private ItemStack fillBucket(ItemStack emptyBuckets, EntityPlayer player, Item fullBucket) { + if (player.capabilities.isCreativeMode) { + return emptyBuckets; + } else if (--emptyBuckets.stackSize <= 0) { + return new ItemStack(fullBucket); + } else { + if (!player.inventory.addItemStackToInventory(new ItemStack(fullBucket))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(fullBucket, 1, 0), false); + } + + return emptyBuckets; + } + } + + public boolean tryPlaceContainedLiquid(World worldIn, BlockPos pos) { + if (this.isFull == Blocks.air) { + return false; + } else { + Material material = worldIn.getBlockState(pos).getBlock().getMaterial(); + boolean flag = !material.isSolid(); + if (!worldIn.isAirBlock(pos) && !flag) { + return false; + } else { + if (worldIn.provider.doesWaterVaporize() && this.isFull == Blocks.flowing_water) { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + worldIn.playSoundEffect((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), + (double) ((float) k + 0.5F), "random.fizz", 0.5F, + 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + + for (int l = 0; l < 8; ++l) { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) i + Math.random(), + (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D, new int[0]); + } + } else { + if (flag && !material.isLiquid()) { + worldIn.destroyBlock(pos, true); + } + + worldIn.setBlockState(pos, this.isFull.getDefaultState(), 3); + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucketMilk.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucketMilk.java new file mode 100644 index 0000000..13921e8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucketMilk.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemBucketMilk extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemBucketMilk"); + } + + public ItemBucketMilk() { + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called when the player finishes using this Item (E.g. + * finishes eating.). Not called when the player stops using the + * Item before the action is complete. + */ + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) { + if (!playerIn.capabilities.isCreativeMode) { + --stack.stackSize; + } + + playerIn.clearActivePotions(); + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return stack.stackSize <= 0 ? new ItemStack(Items.bucket) : stack; + } + + /**+ + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack stack) { + return 32; + } + + /**+ + * returns the action that specifies what animation to play when + * the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) { + return EnumAction.DRINK; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCarrotOnAStick.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCarrotOnAStick.java new file mode 100644 index 0000000..39a587e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCarrotOnAStick.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityPig; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemCarrotOnAStick extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemCarrotOnAStick"); + } + + public ItemCarrotOnAStick() { + this.setCreativeTab(CreativeTabs.tabTransport); + this.setMaxStackSize(1); + this.setMaxDamage(25); + } + + /**+ + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /**+ + * Returns true if this item should be rotated by 180 degrees + * around the Y axis when being held in an entities hands. + */ + public boolean shouldRotateAroundWhenRendering() { + return true; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) { + if (entityplayer.isRiding() && entityplayer.ridingEntity instanceof EntityPig) { + EntityPig entitypig = (EntityPig) entityplayer.ridingEntity; + if (entitypig.getAIControlledByPlayer().isControlledByPlayer() + && itemstack.getMaxDamage() - itemstack.getMetadata() >= 7) { + entitypig.getAIControlledByPlayer().boostSpeed(); + itemstack.damageItem(7, entityplayer); + if (itemstack.stackSize == 0) { + ItemStack itemstack1 = new ItemStack(Items.fishing_rod); + itemstack1.setTagCompound(itemstack.getTagCompound()); + return itemstack1; + } + } + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCloth.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCloth.java new file mode 100644 index 0000000..b6f62a9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCloth.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemCloth extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemCloth"); + } + + public ItemCloth(Block block) { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i; + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + return super.getUnlocalizedName() + "." + EnumDyeColor.byMetadata(itemstack.getMetadata()).getUnlocalizedName(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCoal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCoal.java new file mode 100644 index 0000000..76ccb6e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCoal.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemCoal extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemCoal"); + } + + public ItemCoal() { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + return itemstack.getMetadata() == 1 ? "item.charcoal" : "item.coal"; + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + list.add(new ItemStack(item, 1, 0)); + list.add(new ItemStack(item, 1, 1)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemColored.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemColored.java new file mode 100644 index 0000000..1ccc0cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemColored.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemColored extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemColored"); + } + + private final Block coloredBlock; + private String[] subtypeNames; + + public ItemColored(Block block, boolean hasSubtypes) { + super(block); + this.coloredBlock = block; + if (hasSubtypes) { + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + } + + public int getColorFromItemStack(ItemStack itemstack, int var2) { + return this.coloredBlock.getRenderColor(this.coloredBlock.getStateFromMeta(itemstack.getMetadata())); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i; + } + + public ItemColored setSubtypeNames(String[] names) { + this.subtypeNames = names; + return this; + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + if (this.subtypeNames == null) { + return super.getUnlocalizedName(itemstack); + } else { + int i = itemstack.getMetadata(); + return i >= 0 && i < this.subtypeNames.length + ? super.getUnlocalizedName(itemstack) + "." + this.subtypeNames[i] + : super.getUnlocalizedName(itemstack); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoor.java new file mode 100644 index 0000000..91d13d9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoor.java @@ -0,0 +1,99 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemDoor extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemDoor"); + } + + private Block block; + + public ItemDoor(Block block) { + this.block = block; + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing != EnumFacing.UP) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + Block blockx = iblockstate.getBlock(); + if (!blockx.isReplaceable(world, blockpos)) { + blockpos = blockpos.offset(enumfacing); + } + + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else if (!this.block.canPlaceBlockAt(world, blockpos)) { + return false; + } else { + placeDoor(world, blockpos, EnumFacing.fromAngle((double) entityplayer.rotationYaw), this.block); + --itemstack.stackSize; + return true; + } + } + } + + public static void placeDoor(World worldIn, BlockPos pos, EnumFacing facing, Block door) { + BlockPos blockpos = pos.offset(facing.rotateY()); + BlockPos blockpos1 = pos.offset(facing.rotateYCCW()); + int i = (worldIn.getBlockState(blockpos1).getBlock().isNormalCube() ? 1 : 0) + + (worldIn.getBlockState(blockpos1.up()).getBlock().isNormalCube() ? 1 : 0); + int j = (worldIn.getBlockState(blockpos).getBlock().isNormalCube() ? 1 : 0) + + (worldIn.getBlockState(blockpos.up()).getBlock().isNormalCube() ? 1 : 0); + boolean flag = worldIn.getBlockState(blockpos1).getBlock() == door + || worldIn.getBlockState(blockpos1.up()).getBlock() == door; + boolean flag1 = worldIn.getBlockState(blockpos).getBlock() == door + || worldIn.getBlockState(blockpos.up()).getBlock() == door; + boolean flag2 = false; + if (flag && !flag1 || j > i) { + flag2 = true; + } + + BlockPos blockpos2 = pos.up(); + IBlockState iblockstate = door.getDefaultState().withProperty(BlockDoor.FACING, facing).withProperty( + BlockDoor.HINGE, flag2 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT); + worldIn.setBlockState(pos, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2); + worldIn.setBlockState(blockpos2, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2); + worldIn.notifyNeighborsOfStateChange(pos, door); + worldIn.notifyNeighborsOfStateChange(blockpos2, door); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoublePlant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoublePlant.java new file mode 100644 index 0000000..7af5df3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoublePlant.java @@ -0,0 +1,50 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.base.Function; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMultiTexture; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerGrass; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemDoublePlant extends ItemMultiTexture { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemDoublePlant"); + } + + public ItemDoublePlant(Block block, Block block2, Function nameFunction) { + super(block, block2, nameFunction); + } + + public int getColorFromItemStack(ItemStack itemstack, int i) { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType + .byMetadata(itemstack.getMetadata()); + return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS + && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN + ? super.getColorFromItemStack(itemstack, i) + : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDye.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDye.java new file mode 100644 index 0000000..38dfe55 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDye.java @@ -0,0 +1,184 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.IGrowable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemDye extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemDye"); + } + + public static final int[] dyeColors = new int[] { 1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, + 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320 }; + + public ItemDye() { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + int i = itemstack.getMetadata(); + return super.getUnlocalizedName() + "." + EnumDyeColor.byDyeDamage(i).getUnlocalizedName(); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float f, float f1, float f2) { + if (!entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)) { + return false; + } else { + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(itemstack.getMetadata()); + if (enumdyecolor == EnumDyeColor.WHITE) { + if (applyBonemeal(itemstack, world, blockpos)) { + world.playAuxSFX(2005, blockpos, 0); + return true; + } + } else if (enumdyecolor == EnumDyeColor.BROWN) { + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (block == Blocks.log && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE) { + if (enumfacing == EnumFacing.DOWN) { + return false; + } + + if (enumfacing == EnumFacing.UP) { + return false; + } + + blockpos = blockpos.offset(enumfacing); + if (world.isAirBlock(blockpos)) { + IBlockState iblockstate1 = Blocks.cocoa.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, 0, + entityplayer); + world.setBlockState(blockpos, iblockstate1, 2); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + } + + return true; + } + } + + return false; + } + } + + public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target) { + IBlockState iblockstate = worldIn.getBlockState(target); + if (iblockstate.getBlock() instanceof IGrowable) { + IGrowable igrowable = (IGrowable) iblockstate.getBlock(); + if (igrowable.canGrow(worldIn, target, iblockstate, false)) { + { + if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate)) { + igrowable.grow(worldIn, worldIn.rand, target, iblockstate); + } + + --stack.stackSize; + } + + return true; + } + } + + return false; + } + + public static void spawnBonemealParticles(World worldIn, BlockPos pos, int amount) { + if (amount == 0) { + amount = 15; + } + + Block block = worldIn.getBlockState(pos).getBlock(); + if (block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(worldIn, pos); + + for (int i = 0; i < amount; ++i) { + double d0 = itemRand.nextGaussian() * 0.02D; + double d1 = itemRand.nextGaussian() * 0.02D; + double d2 = itemRand.nextGaussian() * 0.02D; + worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, + (double) ((float) pos.getX() + itemRand.nextFloat()), + (double) pos.getY() + (double) itemRand.nextFloat() * block.getBlockBoundsMaxY(), + (double) ((float) pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); + } + + } + } + + /**+ + * Returns true if the item can be used on the given entity, + * e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer var2, EntityLivingBase entitylivingbase) { + if (entitylivingbase instanceof EntitySheep) { + EntitySheep entitysheep = (EntitySheep) entitylivingbase; + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(itemstack.getMetadata()); + if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor) { + entitysheep.setFleeceColor(enumdyecolor); + --itemstack.stackSize; + } + + return true; + } else { + return false; + } + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + for (int i = 0; i < 16; ++i) { + list.add(new ItemStack(item, 1, i)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEditableBook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEditableBook.java new file mode 100644 index 0000000..552dae3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEditableBook.java @@ -0,0 +1,155 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemWritableBook; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2FPacketSetSlot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentProcessor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemEditableBook extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemEditableBook"); + } + + public ItemEditableBook() { + this.setMaxStackSize(1); + } + + public static boolean validBookTagContents(NBTTagCompound nbt) { + if (!ItemWritableBook.isNBTValid(nbt)) { + return false; + } else if (!nbt.hasKey("title", 8)) { + return false; + } else { + String s = nbt.getString("title"); + return s != null && s.length() <= 32 ? nbt.hasKey("author", 8) : false; + } + } + + /**+ + * Gets the generation of the book (how many times it has been + * cloned) + */ + public static int getGeneration(ItemStack book) { + return book.getTagCompound().getInteger("generation"); + } + + public String getItemStackDisplayName(ItemStack itemstack) { + if (itemstack.hasTagCompound()) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + String s = nbttagcompound.getString("title"); + if (!StringUtils.isNullOrEmpty(s)) { + return s; + } + } + + return super.getItemStackDisplayName(itemstack); + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack itemstack, EntityPlayer var2, List list, boolean var4) { + if (itemstack.hasTagCompound()) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + String s = nbttagcompound.getString("author"); + if (!StringUtils.isNullOrEmpty(s)) { + list.add(EnumChatFormatting.GRAY + + StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] { s })); + } + + list.add(EnumChatFormatting.GRAY + + StatCollector.translateToLocal("book.generation." + nbttagcompound.getInteger("generation"))); + } + + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + this.resolveContents(itemstack, entityplayer); + + entityplayer.displayGUIBook(itemstack); + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } + + private void resolveContents(ItemStack stack, EntityPlayer player) { + if (stack != null && stack.getTagCompound() != null) { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + if (!nbttagcompound.getBoolean("resolved")) { + nbttagcompound.setBoolean("resolved", true); + if (validBookTagContents(nbttagcompound)) { + NBTTagList nbttaglist = nbttagcompound.getTagList("pages", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + String s = nbttaglist.getStringTagAt(i); + + IChatComponent ichatcomponent; + try { + ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + ichatcomponent = ChatComponentProcessor.processComponent(player, ichatcomponent, player); + } catch (Exception var9) { + ichatcomponent = new ChatComponentText(s); + } + + nbttaglist.set(i, new NBTTagString(IChatComponent.Serializer.componentToJson(ichatcomponent))); + } + + nbttagcompound.setTag("pages", nbttaglist); + if (player instanceof EntityPlayerMP && player.getCurrentEquippedItem() == stack) { + Slot slot = player.openContainer.getSlotFromInventory(player.inventory, + player.inventory.currentItem); + ((EntityPlayerMP) player).playerNetServerHandler + .sendPacket(new S2FPacketSetSlot(0, slot.slotNumber, stack)); + } + + } + } + } + } + + public boolean hasEffect(ItemStack var1) { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEgg.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEgg.java new file mode 100644 index 0000000..93a2d48 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEgg.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityEgg; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemEgg extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemEgg"); + } + + public ItemEgg() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntityEgg(world, entityplayer)); + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEmptyMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEmptyMap.java new file mode 100644 index 0000000..823d2c9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEmptyMap.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMapBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.MapData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemEmptyMap extends ItemMapBase { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemEmptyMap"); + } + + protected ItemEmptyMap() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + ItemStack itemstack1 = new ItemStack(Items.filled_map, 1, world.getUniqueDataId("map")); + String s = "map_" + itemstack1.getMetadata(); + MapData mapdata = new MapData(s); + world.setItemData(s, mapdata); + mapdata.scale = 0; + mapdata.calculateMapCenter(entityplayer.posX, entityplayer.posZ, mapdata.scale); + mapdata.dimension = (byte) world.provider.getDimensionId(); + mapdata.markDirty(); + --itemstack.stackSize; + if (itemstack.stackSize <= 0) { + return itemstack1; + } else { + if (!entityplayer.inventory.addItemStackToInventory(itemstack1.copy())) { + entityplayer.dropPlayerItemWithRandomChoice(itemstack1, false); + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnchantedBook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnchantedBook.java new file mode 100644 index 0000000..50c0d07 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnchantedBook.java @@ -0,0 +1,147 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumRarity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemEnchantedBook extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemEnchantedBook"); + } + + public boolean hasEffect(ItemStack var1) { + return true; + } + + /**+ + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack var1) { + return false; + } + + /**+ + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack itemstack) { + return this.getEnchantments(itemstack).tagCount() > 0 ? EnumRarity.UNCOMMON : super.getRarity(itemstack); + } + + public NBTTagList getEnchantments(ItemStack stack) { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + return nbttagcompound != null && nbttagcompound.hasKey("StoredEnchantments", 9) + ? (NBTTagList) nbttagcompound.getTag("StoredEnchantments") + : new NBTTagList(); + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) { + super.addInformation(itemstack, entityplayer, list, flag); + NBTTagList nbttaglist = this.getEnchantments(itemstack); + if (nbttaglist != null) { + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + if (Enchantment.getEnchantmentById(short1) != null) { + list.add(Enchantment.getEnchantmentById(short1).getTranslatedName(short2)); + } + } + } + + } + + /**+ + * Adds an stored enchantment to an enchanted book ItemStack + */ + public void addEnchantment(ItemStack stack, EnchantmentData enchantment) { + NBTTagList nbttaglist = this.getEnchantments(stack); + boolean flag = true; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + if (nbttagcompound.getShort("id") == enchantment.enchantmentobj.effectId) { + if (nbttagcompound.getShort("lvl") < enchantment.enchantmentLevel) { + nbttagcompound.setShort("lvl", (short) enchantment.enchantmentLevel); + } + + flag = false; + break; + } + } + + if (flag) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setShort("id", (short) enchantment.enchantmentobj.effectId); + nbttagcompound1.setShort("lvl", (short) enchantment.enchantmentLevel); + nbttaglist.appendTag(nbttagcompound1); + } + + if (!stack.hasTagCompound()) { + stack.setTagCompound(new NBTTagCompound()); + } + + stack.getTagCompound().setTag("StoredEnchantments", nbttaglist); + } + + /**+ + * Returns the ItemStack of an enchanted version of this item. + */ + public ItemStack getEnchantedItemStack(EnchantmentData data) { + ItemStack itemstack = new ItemStack(this); + this.addEnchantment(itemstack, data); + return itemstack; + } + + public void getAll(Enchantment enchantment, List list) { + for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) { + list.add(this.getEnchantedItemStack(new EnchantmentData(enchantment, i))); + } + + } + + public WeightedRandomChestContent getRandom(EaglercraftRandom rand) { + return this.getRandom(rand, 1, 1, 1); + } + + public WeightedRandomChestContent getRandom(EaglercraftRandom rand, int minChance, int maxChance, int weight) { + ItemStack itemstack = new ItemStack(Items.book, 1, 0); + EnchantmentHelper.addRandomEnchantment(rand, itemstack, 30); + return new WeightedRandomChestContent(itemstack, minChance, maxChance, weight); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderEye.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderEye.java new file mode 100644 index 0000000..f8e59fc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderEye.java @@ -0,0 +1,177 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEndPortalFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderEye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemEnderEye extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemEnderEye"); + } + + public ItemEnderEye() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + IBlockState iblockstate = world.getBlockState(blockpos); + if (entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack) + && iblockstate.getBlock() == Blocks.end_portal_frame + && !((Boolean) iblockstate.getValue(BlockEndPortalFrame.EYE)).booleanValue()) { + { + world.setBlockState(blockpos, iblockstate.withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(true)), + 2); + world.updateComparatorOutputLevel(blockpos, Blocks.end_portal_frame); + --itemstack.stackSize; + + for (int i = 0; i < 16; ++i) { + double d0 = (double) ((float) blockpos.getX() + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double d1 = (double) ((float) blockpos.getY() + 0.8125F); + double d2 = (double) ((float) blockpos.getZ() + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + EnumFacing enumfacing1 = (EnumFacing) iblockstate.getValue(BlockEndPortalFrame.FACING); + int l = 0; + int j = 0; + boolean flag1 = false; + boolean flag = true; + EnumFacing enumfacing2 = enumfacing1.rotateY(); + + for (int k = -2; k <= 2; ++k) { + BlockPos blockpos2 = blockpos.offset(enumfacing2, k); + IBlockState iblockstate1 = world.getBlockState(blockpos2); + if (iblockstate1.getBlock() == Blocks.end_portal_frame) { + if (!((Boolean) iblockstate1.getValue(BlockEndPortalFrame.EYE)).booleanValue()) { + flag = false; + break; + } + + j = k; + if (!flag1) { + l = k; + flag1 = true; + } + } + } + + if (flag && j == l + 2) { + BlockPos blockpos1 = blockpos.offset(enumfacing1, 4); + + for (int i1 = l; i1 <= j; ++i1) { + BlockPos blockpos3 = blockpos1.offset(enumfacing2, i1); + IBlockState iblockstate3 = world.getBlockState(blockpos3); + if (iblockstate3.getBlock() != Blocks.end_portal_frame + || !((Boolean) iblockstate3.getValue(BlockEndPortalFrame.EYE)).booleanValue()) { + flag = false; + break; + } + } + + for (int j1 = l - 1; j1 <= j + 1; j1 += 4) { + blockpos1 = blockpos.offset(enumfacing2, j1); + + for (int l1 = 1; l1 <= 3; ++l1) { + BlockPos blockpos4 = blockpos1.offset(enumfacing1, l1); + IBlockState iblockstate2 = world.getBlockState(blockpos4); + if (iblockstate2.getBlock() != Blocks.end_portal_frame + || !((Boolean) iblockstate2.getValue(BlockEndPortalFrame.EYE)).booleanValue()) { + flag = false; + break; + } + } + } + + if (flag) { + for (int k1 = l; k1 <= j; ++k1) { + blockpos1 = blockpos.offset(enumfacing2, k1); + + for (int i2 = 1; i2 <= 3; ++i2) { + BlockPos blockpos5 = blockpos1.offset(enumfacing1, i2); + world.setBlockState(blockpos5, Blocks.end_portal.getDefaultState(), 2); + } + } + } + } + + return true; + } + } else { + return false; + } + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityplayer, false); + if (movingobjectposition != null + && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK + && world.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.end_portal_frame) { + return itemstack; + } else { + { + BlockPos blockpos = world.getStrongholdPos("Stronghold", new BlockPos(entityplayer)); + if (blockpos != null) { + EntityEnderEye entityendereye = new EntityEnderEye(world, entityplayer.posX, entityplayer.posY, + entityplayer.posZ); + entityendereye.moveTowards(blockpos); + world.spawnEntityInWorld(entityendereye); + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, + 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.playAuxSFXAtEntity((EntityPlayer) null, 1002, new BlockPos(entityplayer), 0); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + + return itemstack; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderPearl.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderPearl.java new file mode 100644 index 0000000..f961af0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderPearl.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderPearl; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemEnderPearl extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemEnderPearl"); + } + + public ItemEnderPearl() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (entityplayer.capabilities.isCreativeMode) { + return itemstack; + } else { + --itemstack.stackSize; + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntityEnderPearl(world, entityplayer)); + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemExpBottle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemExpBottle.java new file mode 100644 index 0000000..911e179 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemExpBottle.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityExpBottle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemExpBottle extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemExpBottle"); + } + + public ItemExpBottle() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public boolean hasEffect(ItemStack var1) { + return true; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntityExpBottle(world, entityplayer)); + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireball.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireball.java new file mode 100644 index 0000000..5fe5abf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireball.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFireball extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFireball"); + } + + public ItemFireball() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + { + blockpos = blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else { + if (world.getBlockState(blockpos).getBlock().getMaterial() == Material.air) { + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "item.fireCharge.use", 1.0F, + (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2F + 1.0F); + world.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFirework.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFirework.java new file mode 100644 index 0000000..7124b29 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFirework.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityFireworkRocket; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFireworkCharge; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFirework extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFirework"); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing var5, float f, float f1, float f2) { + { + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(world, + (double) ((float) blockpos.getX() + f), (double) ((float) blockpos.getY() + f1), + (double) ((float) blockpos.getZ() + f2), itemstack); + world.spawnEntityInWorld(entityfireworkrocket); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + return true; + } + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack itemstack, EntityPlayer var2, List list, boolean var4) { + if (itemstack.hasTagCompound()) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound().getCompoundTag("Fireworks"); + if (nbttagcompound != null) { + if (nbttagcompound.hasKey("Flight", 99)) { + list.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + + nbttagcompound.getByte("Flight")); + } + + NBTTagList nbttaglist = nbttagcompound.getTagList("Explosions", 10); + if (nbttaglist != null && nbttaglist.tagCount() > 0) { + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + ArrayList arraylist = Lists.newArrayList(); + ItemFireworkCharge.addExplosionInfo(nbttagcompound1, arraylist); + if (arraylist.size() > 0) { + for (int j = 1; j < arraylist.size(); ++j) { + arraylist.set(j, " " + (String) arraylist.get(j)); + } + + list.addAll(arraylist); + } + } + } + + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireworkCharge.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireworkCharge.java new file mode 100644 index 0000000..e638f31 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireworkCharge.java @@ -0,0 +1,178 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagIntArray; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFireworkCharge extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFireworkCharge"); + } + + public int getColorFromItemStack(ItemStack itemstack, int i) { + if (i != 1) { + return super.getColorFromItemStack(itemstack, i); + } else { + NBTBase nbtbase = getExplosionTag(itemstack, "Colors"); + if (!(nbtbase instanceof NBTTagIntArray)) { + return 9079434; + } else { + NBTTagIntArray nbttagintarray = (NBTTagIntArray) nbtbase; + int[] aint = nbttagintarray.getIntArray(); + if (aint.length == 1) { + return aint[0]; + } else { + int j = 0; + int k = 0; + int l = 0; + + for (int i1 : aint) { + j += (i1 & 16711680) >> 16; + k += (i1 & '\uff00') >> 8; + l += (i1 & 255) >> 0; + } + + j = j / aint.length; + k = k / aint.length; + l = l / aint.length; + return j << 16 | k << 8 | l; + } + } + } + } + + public static NBTBase getExplosionTag(ItemStack stack, String key) { + if (stack.hasTagCompound()) { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("Explosion"); + if (nbttagcompound != null) { + return nbttagcompound.getTag(key); + } + } + + return null; + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack itemstack, EntityPlayer var2, List list, boolean var4) { + if (itemstack.hasTagCompound()) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound().getCompoundTag("Explosion"); + if (nbttagcompound != null) { + addExplosionInfo(nbttagcompound, list); + } + } + + } + + public static void addExplosionInfo(NBTTagCompound nbt, List tooltip) { + byte b0 = nbt.getByte("Type"); + if (b0 >= 0 && b0 <= 4) { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.type." + b0).trim()); + } else { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); + } + + int[] aint = nbt.getIntArray("Colors"); + if (aint.length > 0) { + boolean flag = true; + String s = ""; + + for (int i : aint) { + if (!flag) { + s = s + ", "; + } + + flag = false; + boolean flag1 = false; + + for (int j = 0; j < ItemDye.dyeColors.length; ++j) { + if (i == ItemDye.dyeColors[j]) { + flag1 = true; + s = s + StatCollector.translateToLocal( + "item.fireworksCharge." + EnumDyeColor.byDyeDamage(j).getUnlocalizedName()); + break; + } + } + + if (!flag1) { + s = s + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + tooltip.add(s); + } + + int[] aint1 = nbt.getIntArray("FadeColors"); + if (aint1.length > 0) { + boolean flag2 = true; + String s1 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; + + for (int l : aint1) { + if (!flag2) { + s1 = s1 + ", "; + } + + flag2 = false; + boolean flag5 = false; + + for (int k = 0; k < 16; ++k) { + if (l == ItemDye.dyeColors[k]) { + flag5 = true; + s1 = s1 + StatCollector.translateToLocal( + "item.fireworksCharge." + EnumDyeColor.byDyeDamage(k).getUnlocalizedName()); + break; + } + } + + if (!flag5) { + s1 = s1 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + tooltip.add(s1); + } + + boolean flag3 = nbt.getBoolean("Trail"); + if (flag3) { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); + } + + boolean flag4 = nbt.getBoolean("Flicker"); + if (flag4) { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishFood.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishFood.java new file mode 100644 index 0000000..77a7778 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishFood.java @@ -0,0 +1,188 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFishFood extends ItemFood { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFishFood"); + } + + private final boolean cooked; + + public ItemFishFood(boolean cooked) { + super(0, 0.0F, false); + this.cooked = cooked; + } + + public int getHealAmount(ItemStack stack) { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + return this.cooked && itemfishfood$fishtype.canCook() ? itemfishfood$fishtype.getCookedHealAmount() + : itemfishfood$fishtype.getUncookedHealAmount(); + } + + public float getSaturationModifier(ItemStack stack) { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + return this.cooked && itemfishfood$fishtype.canCook() ? itemfishfood$fishtype.getCookedSaturationModifier() + : itemfishfood$fishtype.getUncookedSaturationModifier(); + } + + public String getPotionEffect(ItemStack stack) { + return ItemFishFood.FishType.byItemStack(stack) == ItemFishFood.FishType.PUFFERFISH + ? PotionHelper.pufferfishEffect + : null; + } + + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + if (itemfishfood$fishtype == ItemFishFood.FishType.PUFFERFISH) { + player.addPotionEffect(new PotionEffect(Potion.poison.id, 1200, 3)); + player.addPotionEffect(new PotionEffect(Potion.hunger.id, 300, 2)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 1)); + } + + super.onFoodEaten(stack, worldIn, player); + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item var1, CreativeTabs var2, List list) { + for (ItemFishFood.FishType itemfishfood$fishtype : ItemFishFood.FishType.values()) { + if (!this.cooked || itemfishfood$fishtype.canCook()) { + list.add(new ItemStack(this, 1, itemfishfood$fishtype.getMetadata())); + } + } + + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(itemstack); + return this.getUnlocalizedName() + "." + itemfishfood$fishtype.getUnlocalizedName() + "." + + (this.cooked && itemfishfood$fishtype.canCook() ? "cooked" : "raw"); + } + + public static enum FishType { + COD(0, "cod", 2, 0.1F, 5, 0.6F), SALMON(1, "salmon", 2, 0.1F, 6, 0.8F), CLOWNFISH(2, "clownfish", 1, 0.1F), + PUFFERFISH(3, "pufferfish", 1, 0.1F); + + private static final Map META_LOOKUP = Maps.newHashMap(); + private final int meta; + private final String unlocalizedName; + private final int uncookedHealAmount; + private final float uncookedSaturationModifier; + private final int cookedHealAmount; + private final float cookedSaturationModifier; + private boolean cookable = false; + + private FishType(int meta, String unlocalizedName, int uncookedHeal, float uncookedSaturation, int cookedHeal, + float cookedSaturation) { + this.meta = meta; + this.unlocalizedName = unlocalizedName; + this.uncookedHealAmount = uncookedHeal; + this.uncookedSaturationModifier = uncookedSaturation; + this.cookedHealAmount = cookedHeal; + this.cookedSaturationModifier = cookedSaturation; + this.cookable = true; + } + + private FishType(int meta, String unlocalizedName, int uncookedHeal, float uncookedSaturation) { + this.meta = meta; + this.unlocalizedName = unlocalizedName; + this.uncookedHealAmount = uncookedHeal; + this.uncookedSaturationModifier = uncookedSaturation; + this.cookedHealAmount = 0; + this.cookedSaturationModifier = 0.0F; + this.cookable = false; + } + + public int getMetadata() { + return this.meta; + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName() { + return this.unlocalizedName; + } + + public int getUncookedHealAmount() { + return this.uncookedHealAmount; + } + + public float getUncookedSaturationModifier() { + return this.uncookedSaturationModifier; + } + + public int getCookedHealAmount() { + return this.cookedHealAmount; + } + + public float getCookedSaturationModifier() { + return this.cookedSaturationModifier; + } + + public boolean canCook() { + return this.cookable; + } + + public static ItemFishFood.FishType byMetadata(int meta) { + ItemFishFood.FishType itemfishfood$fishtype = (ItemFishFood.FishType) META_LOOKUP + .get(Integer.valueOf(meta)); + return itemfishfood$fishtype == null ? COD : itemfishfood$fishtype; + } + + public static ItemFishFood.FishType byItemStack(ItemStack stack) { + return stack.getItem() instanceof ItemFishFood ? byMetadata(stack.getMetadata()) : COD; + } + + static { + for (ItemFishFood.FishType itemfishfood$fishtype : values()) { + META_LOOKUP.put(Integer.valueOf(itemfishfood$fishtype.getMetadata()), itemfishfood$fishtype); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishingRod.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishingRod.java new file mode 100644 index 0000000..e2b2b52 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishingRod.java @@ -0,0 +1,94 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFishHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFishingRod extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFishingRod"); + } + + public ItemFishingRod() { + this.setMaxDamage(64); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /**+ + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /**+ + * Returns true if this item should be rotated by 180 degrees + * around the Y axis when being held in an entities hands. + */ + public boolean shouldRotateAroundWhenRendering() { + return true; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (entityplayer.fishEntity != null) { + int i = entityplayer.fishEntity.handleHookRetraction(); + itemstack.damageItem(i, entityplayer); + entityplayer.swingItem(); + } else { + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntityFishHook(world, entityplayer)); + + entityplayer.swingItem(); + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + + return itemstack; + } + + /**+ + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack itemstack) { + return super.isItemTool(itemstack); + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFlintAndSteel.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFlintAndSteel.java new file mode 100644 index 0000000..d359a60 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFlintAndSteel.java @@ -0,0 +1,66 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFlintAndSteel extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFlintAndSteel"); + } + + public ItemFlintAndSteel() { + this.maxStackSize = 1; + this.setMaxDamage(64); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + blockpos = blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else { + if (world.getBlockState(blockpos).getBlock().getMaterial() == Material.air) { + world.playSoundEffect((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + world.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + + itemstack.damageItem(1, entityplayer); + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFood.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFood.java new file mode 100644 index 0000000..fb94966 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFood.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemFood extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemFood"); + } + + public final int itemUseDuration; + private final int healAmount; + private final float saturationModifier; + private final boolean isWolfsFavoriteMeat; + private boolean alwaysEdible; + private int potionId; + private int potionDuration; + private int potionAmplifier; + private float potionEffectProbability; + + public ItemFood(int amount, float saturation, boolean isWolfFood) { + this.itemUseDuration = 32; + this.healAmount = amount; + this.isWolfsFavoriteMeat = isWolfFood; + this.saturationModifier = saturation; + this.setCreativeTab(CreativeTabs.tabFood); + } + + public ItemFood(int amount, boolean isWolfFood) { + this(amount, 0.6F, isWolfFood); + } + + /**+ + * Called when the player finishes using this Item (E.g. + * finishes eating.). Not called when the player stops using the + * Item before the action is complete. + */ + public ItemStack onItemUseFinish(ItemStack itemstack, World world, EntityPlayer entityplayer) { + --itemstack.stackSize; + entityplayer.getFoodStats().addStats(this, itemstack); + world.playSoundAtEntity(entityplayer, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F); + this.onFoodEaten(itemstack, world, entityplayer); + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } + + protected void onFoodEaten(ItemStack var1, World world, EntityPlayer entityplayer) { + if (this.potionId > 0 && world.rand.nextFloat() < this.potionEffectProbability) { + entityplayer + .addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); + } + + } + + /**+ + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack var1) { + return 32; + } + + /**+ + * returns the action that specifies what animation to play when + * the items is being used + */ + public EnumAction getItemUseAction(ItemStack var1) { + return EnumAction.EAT; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) { + if (entityplayer.canEat(this.alwaysEdible)) { + entityplayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); + } + + return itemstack; + } + + public int getHealAmount(ItemStack var1) { + return this.healAmount; + } + + public float getSaturationModifier(ItemStack var1) { + return this.saturationModifier; + } + + /**+ + * Whether wolves like this food (true for raw and cooked + * porkchop). + */ + public boolean isWolfsFavoriteMeat() { + return this.isWolfsFavoriteMeat; + } + + /**+ + * sets a potion effect on the item. Args: int potionId, int + * duration (will be multiplied by 20), int amplifier, float + * probability of effect happening + */ + public ItemFood setPotionEffect(int id, int duration, int amplifier, float probability) { + this.potionId = id; + this.potionDuration = duration; + this.potionAmplifier = amplifier; + this.potionEffectProbability = probability; + return this; + } + + /**+ + * Set the field 'alwaysEdible' to true, and make the food + * edible even if the player don't need to eat. + */ + public ItemFood setAlwaysEdible() { + this.alwaysEdible = true; + return this; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemGlassBottle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemGlassBottle.java new file mode 100644 index 0000000..2c1ba9d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemGlassBottle.java @@ -0,0 +1,82 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemGlassBottle extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemGlassBottle"); + } + + public ItemGlassBottle() { + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityplayer, true); + if (movingobjectposition == null) { + return itemstack; + } else { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = movingobjectposition.getBlockPos(); + if (!world.isBlockModifiable(entityplayer, blockpos)) { + return itemstack; + } + + if (!entityplayer.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), + movingobjectposition.sideHit, itemstack)) { + return itemstack; + } + + if (world.getBlockState(blockpos).getBlock().getMaterial() == Material.water) { + --itemstack.stackSize; + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + if (itemstack.stackSize <= 0) { + return new ItemStack(Items.potionitem); + } + + if (!entityplayer.inventory.addItemStackToInventory(new ItemStack(Items.potionitem))) { + entityplayer.dropPlayerItemWithRandomChoice(new ItemStack(Items.potionitem, 1, 0), false); + } + } + } + + return itemstack; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHangingEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHangingEntity.java new file mode 100644 index 0000000..d29444c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHangingEntity.java @@ -0,0 +1,80 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityHanging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemHangingEntity extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemHangingEntity"); + } + + private final Class hangingEntityClass; + + public ItemHangingEntity(Class entityClass) { + this.hangingEntityClass = entityClass; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing == EnumFacing.DOWN) { + return false; + } else if (enumfacing == EnumFacing.UP) { + return false; + } else { + BlockPos blockpos1 = blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos1, enumfacing, itemstack)) { + return false; + } else { + EntityHanging entityhanging = this.createEntity(world, blockpos1, enumfacing); + if (entityhanging != null && entityhanging.onValidSurface()) { + world.spawnEntityInWorld(entityhanging); + --itemstack.stackSize; + } + + return true; + } + } + } + + private EntityHanging createEntity(World worldIn, BlockPos pos, EnumFacing clickedSide) { + return (EntityHanging) (this.hangingEntityClass == EntityPainting.class + ? new EntityPainting(worldIn, pos, clickedSide) + : (this.hangingEntityClass == EntityItemFrame.class ? new EntityItemFrame(worldIn, pos, clickedSide) + : null)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHoe.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHoe.java new file mode 100644 index 0000000..88943d3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHoe.java @@ -0,0 +1,112 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemHoe extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemHoe"); + } + + protected Item.ToolMaterial theToolMaterial; + + public ItemHoe(Item.ToolMaterial material) { + this.theToolMaterial = material; + this.maxStackSize = 1; + this.setMaxDamage(material.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (!entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if (enumfacing != EnumFacing.DOWN + && world.getBlockState(blockpos.up()).getBlock().getMaterial() == Material.air) { + if (block == Blocks.grass) { + return this.useHoe(itemstack, entityplayer, world, blockpos, Blocks.farmland.getDefaultState()); + } + + if (block == Blocks.dirt) { + switch ((BlockDirt.DirtType) iblockstate.getValue(BlockDirt.VARIANT)) { + case DIRT: + return this.useHoe(itemstack, entityplayer, world, blockpos, Blocks.farmland.getDefaultState()); + case COARSE_DIRT: + return this.useHoe(itemstack, entityplayer, world, blockpos, + Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); + } + } + } + + return false; + } + } + + protected boolean useHoe(ItemStack stack, EntityPlayer player, World worldIn, BlockPos target, + IBlockState newState) { + worldIn.playSoundEffect((double) ((float) target.getX() + 0.5F), (double) ((float) target.getY() + 0.5F), + (double) ((float) target.getZ() + 0.5F), newState.getBlock().stepSound.getStepSound(), + (newState.getBlock().stepSound.getVolume() + 1.0F) / 2.0F, + newState.getBlock().stepSound.getFrequency() * 0.8F); + { + worldIn.setBlockState(target, newState); + stack.damageItem(1, player); + return true; + } + } + + /**+ + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /**+ + * Returns the name of the material this tool is made from as it + * is declared in EnumToolMaterial (meaning diamond would return + * "EMERALD") + */ + public String getMaterialName() { + return this.theToolMaterial.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLead.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLead.java new file mode 100644 index 0000000..57d97c7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLead.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLeashKnot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemLead extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemLead"); + } + + public ItemLead() { + this.setCreativeTab(CreativeTabs.tabTools); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack var1, EntityPlayer entityplayer, World world, BlockPos blockpos, EnumFacing var5, + float var6, float var7, float var8) { + Block block = world.getBlockState(blockpos).getBlock(); + if (block instanceof BlockFence) { + { + attachToFence(entityplayer, world, blockpos); + return true; + } + } else { + return false; + } + } + + public static boolean attachToFence(EntityPlayer player, World worldIn, BlockPos fence) { + EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(worldIn, fence); + boolean flag = false; + double d0 = 7.0D; + int i = fence.getX(); + int j = fence.getY(); + int k = fence.getZ(); + + for (EntityLiving entityliving : worldIn.getEntitiesWithinAABB(EntityLiving.class, + new AxisAlignedBB((double) i - d0, (double) j - d0, (double) k - d0, (double) i + d0, (double) j + d0, + (double) k + d0))) { + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == player) { + if (entityleashknot == null) { + entityleashknot = EntityLeashKnot.createKnot(worldIn, fence); + } + + entityliving.setLeashedToEntity(entityleashknot, true); + flag = true; + } + } + + return flag; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLeaves.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLeaves.java new file mode 100644 index 0000000..062bca4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLeaves.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemLeaves extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemLeaves"); + } + + private final BlockLeaves leaves; + + public ItemLeaves(BlockLeaves block) { + super(block); + this.leaves = block; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int damage) { + return damage | 4; + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) { + return this.leaves.getRenderColor(this.leaves.getStateFromMeta(stack.getMetadata())); + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName() + "." + this.leaves.getWoodType(stack.getMetadata()).getUnlocalizedName(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLilyPad.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLilyPad.java new file mode 100644 index 0000000..4008cd2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLilyPad.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemColored; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemLilyPad extends ItemColored { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemLilyPad"); + } + + public ItemLilyPad(Block block) { + super(block, false); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityplayer, true); + if (movingobjectposition == null) { + return itemstack; + } else { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = movingobjectposition.getBlockPos(); + if (!world.isBlockModifiable(entityplayer, blockpos)) { + return itemstack; + } + + if (!entityplayer.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), + movingobjectposition.sideHit, itemstack)) { + return itemstack; + } + + BlockPos blockpos1 = blockpos.up(); + IBlockState iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock().getMaterial() == Material.water + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 + && world.isAirBlock(blockpos1)) { + world.setBlockState(blockpos1, Blocks.waterlily.getDefaultState()); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + + return itemstack; + } + } + + public int getColorFromItemStack(ItemStack itemstack, int var2) { + return Blocks.waterlily.getRenderColor(Blocks.waterlily.getStateFromMeta(itemstack.getMetadata())); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMap.java new file mode 100644 index 0000000..f25cde6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMap.java @@ -0,0 +1,282 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Iterables; +import com.google.common.collect.Multisets; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.MapColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemMapBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.MapData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemMap extends ItemMapBase { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemMap"); + } + + protected ItemMap() { + this.setHasSubtypes(true); + } + + public static MapData loadMapData(int mapId, World worldIn) { + String s = "map_" + mapId; + MapData mapdata = (MapData) worldIn.loadItemData(MapData.class, s); + if (mapdata == null) { + mapdata = new MapData(s); + worldIn.setItemData(s, mapdata); + } + + return mapdata; + } + + public MapData getMapData(ItemStack stack, World worldIn) { + String s = "map_" + stack.getMetadata(); + MapData mapdata = (MapData) worldIn.loadItemData(MapData.class, s); + if (mapdata == null) { + stack.setItemDamage(worldIn.getUniqueDataId("map")); + s = "map_" + stack.getMetadata(); + mapdata = new MapData(s); + mapdata.scale = 3; + mapdata.calculateMapCenter((double) worldIn.getWorldInfo().getSpawnX(), + (double) worldIn.getWorldInfo().getSpawnZ(), mapdata.scale); + mapdata.dimension = (byte) worldIn.provider.getDimensionId(); + mapdata.markDirty(); + worldIn.setItemData(s, mapdata); + } + + return mapdata; + } + + public void updateMapData(World worldIn, Entity viewer, MapData data) { + if (worldIn.provider.getDimensionId() == data.dimension && viewer instanceof EntityPlayer) { + int i = 1 << data.scale; + int j = data.xCenter; + int k = data.zCenter; + int l = MathHelper.floor_double(viewer.posX - (double) j) / i + 64; + int i1 = MathHelper.floor_double(viewer.posZ - (double) k) / i + 64; + int j1 = 128 / i; + if (worldIn.provider.getHasNoSky()) { + j1 /= 2; + } + + MapData.MapInfo mapdata$mapinfo = data.getMapInfo((EntityPlayer) viewer); + ++mapdata$mapinfo.field_82569_d; + boolean flag = false; + + for (int k1 = l - j1 + 1; k1 < l + j1; ++k1) { + if ((k1 & 15) == (mapdata$mapinfo.field_82569_d & 15) || flag) { + flag = false; + double d0 = 0.0D; + + for (int l1 = i1 - j1 - 1; l1 < i1 + j1; ++l1) { + if (k1 >= 0 && l1 >= -1 && k1 < 128 && l1 < 128) { + int i2 = k1 - l; + int j2 = l1 - i1; + boolean flag1 = i2 * i2 + j2 * j2 > (j1 - 2) * (j1 - 2); + int k2 = (j / i + k1 - 64) * i; + int l2 = (k / i + l1 - 64) * i; + HashMultiset hashmultiset = HashMultiset.create(); + Chunk chunk = worldIn.getChunkFromBlockCoords(new BlockPos(k2, 0, l2)); + if (!chunk.isEmpty()) { + int i3 = k2 & 15; + int j3 = l2 & 15; + int k3 = 0; + double d1 = 0.0D; + if (worldIn.provider.getHasNoSky()) { + int l3 = k2 + l2 * 231871; + l3 = l3 * l3 * 31287121 + l3 * 11; + if ((l3 >> 20 & 1) == 0) { + hashmultiset.add(Blocks.dirt.getMapColor(Blocks.dirt.getDefaultState() + .withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)), 10); + } else { + hashmultiset.add( + Blocks.stone.getMapColor(Blocks.stone.getDefaultState() + .withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE)), + 100); + } + + d1 = 100.0D; + } else { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i4 = 0; i4 < i; ++i4) { + for (int j4 = 0; j4 < i; ++j4) { + int k4 = chunk.getHeightValue(i4 + i3, j4 + j3) + 1; + IBlockState iblockstate = Blocks.air.getDefaultState(); + if (k4 > 1) { + label541: { + while (true) { + --k4; + iblockstate = chunk.getBlockState(blockpos$mutableblockpos + .func_181079_c(i4 + i3, k4, j4 + j3)); + if (iblockstate.getBlock() + .getMapColor(iblockstate) != MapColor.airColor + || k4 <= 0) { + break; + } + } + + if (k4 > 0 && iblockstate.getBlock().getMaterial().isLiquid()) { + int l4 = k4 - 1; + + while (true) { + Block block = chunk.getBlock(i4 + i3, l4--, j4 + j3); + ++k3; + if (l4 <= 0 || !block.getMaterial().isLiquid()) { + break label541; + } + } + } + } + } + + d1 += (double) k4 / (double) (i * i); + hashmultiset.add(iblockstate.getBlock().getMapColor(iblockstate)); + } + } + } + + k3 = k3 / (i * i); + double d2 = (d1 - d0) * 4.0D / (double) (i + 4) + + ((double) (k1 + l1 & 1) - 0.5D) * 0.4D; + byte b0 = 1; + if (d2 > 0.6D) { + b0 = 2; + } + + if (d2 < -0.6D) { + b0 = 0; + } + + MapColor mapcolor = (MapColor) Iterables + .getFirst(Multisets.copyHighestCountFirst(hashmultiset), MapColor.airColor); + if (mapcolor == MapColor.waterColor) { + d2 = (double) k3 * 0.1D + (double) (k1 + l1 & 1) * 0.2D; + b0 = 1; + if (d2 < 0.5D) { + b0 = 2; + } + + if (d2 > 0.9D) { + b0 = 0; + } + } + + d0 = d1; + if (l1 >= 0 && i2 * i2 + j2 * j2 < j1 * j1 && (!flag1 || (k1 + l1 & 1) != 0)) { + byte b1 = data.colors[k1 + l1 * 128]; + byte b2 = (byte) (mapcolor.colorIndex * 4 + b0); + if (b1 != b2) { + data.colors[k1 + l1 * 128] = b2; + data.updateMapData(k1, l1); + flag = true; + } + } + } + } + } + } + } + + } + } + + /**+ + * Called each tick as long the item is on a player inventory. + * Uses by maps to check if is on a player hand and update it's + * contents. + */ + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { + { + MapData mapdata = this.getMapData(stack, worldIn); + if (entityIn instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) entityIn; + mapdata.updateVisiblePlayers(entityplayer, stack); + } + + if (isSelected) { + this.updateMapData(worldIn, entityIn, mapdata); + } + + } + } + + public Packet createMapDataPacket(ItemStack stack, World worldIn, EntityPlayer player) { + return this.getMapData(stack, worldIn).getMapPacket(stack, worldIn, player); + } + + /**+ + * Called when item is crafted/smelted. Used only by maps so + * far. + */ + public void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn) { + if (stack.hasTagCompound() && stack.getTagCompound().getBoolean("map_is_scaling")) { + MapData mapdata = Items.filled_map.getMapData(stack, worldIn); + stack.setItemDamage(worldIn.getUniqueDataId("map")); + MapData mapdata1 = new MapData("map_" + stack.getMetadata()); + mapdata1.scale = (byte) (mapdata.scale + 1); + if (mapdata1.scale > 4) { + mapdata1.scale = 4; + } + + mapdata1.calculateMapCenter((double) mapdata.xCenter, (double) mapdata.zCenter, mapdata1.scale); + mapdata1.dimension = mapdata.dimension; + mapdata1.markDirty(); + worldIn.setItemData("map_" + stack.getMetadata(), mapdata1); + } + + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) { + MapData mapdata = this.getMapData(stack, playerIn.worldObj); + if (advanced) { + if (mapdata == null) { + tooltip.add("Unknown map"); + } else { + tooltip.add("Scaling at 1:" + (1 << mapdata.scale)); + tooltip.add("(Level " + mapdata.scale + "/" + 4 + ")"); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMapBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMapBase.java new file mode 100644 index 0000000..3f8f16c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMapBase.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemMapBase extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemMapBase"); + } + + /**+ + * false for all Items except sub-classes of ItemMapBase + */ + public boolean isMap() { + return true; + } + + public Packet createMapDataPacket(ItemStack var1, World var2, EntityPlayer var3) { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMinecart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMinecart.java new file mode 100644 index 0000000..8323fa1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMinecart.java @@ -0,0 +1,146 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBehaviorDispenseItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.dispenser.IBlockSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemMinecart extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemMinecart"); + } + + private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + World world = source.getWorld(); + double d0 = source.getX() + (double) enumfacing.getFrontOffsetX() * 1.125D; + double d1 = Math.floor(source.getY()) + (double) enumfacing.getFrontOffsetY(); + double d2 = source.getZ() + (double) enumfacing.getFrontOffsetZ() * 1.125D; + BlockPos blockpos = source.getBlockPos().offset(enumfacing); + IBlockState iblockstate = world.getBlockState(blockpos); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate + .getBlock() instanceof BlockRailBase + ? (BlockRailBase.EnumRailDirection) iblockstate + .getValue(((BlockRailBase) iblockstate.getBlock()).getShapeProperty()) + : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + double d3; + if (BlockRailBase.isRailBlock(iblockstate)) { + if (blockrailbase$enumraildirection.isAscending()) { + d3 = 0.6D; + } else { + d3 = 0.1D; + } + } else { + if (iblockstate.getBlock().getMaterial() != Material.air + || !BlockRailBase.isRailBlock(world.getBlockState(blockpos.down()))) { + return this.behaviourDefaultDispenseItem.dispense(source, stack); + } + + IBlockState iblockstate1 = world.getBlockState(blockpos.down()); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1 + .getBlock() instanceof BlockRailBase + ? (BlockRailBase.EnumRailDirection) iblockstate1 + .getValue(((BlockRailBase) iblockstate1.getBlock()).getShapeProperty()) + : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + if (enumfacing != EnumFacing.DOWN && blockrailbase$enumraildirection1.isAscending()) { + d3 = -0.4D; + } else { + d3 = -0.9D; + } + } + + EntityMinecart entityminecart = EntityMinecart.func_180458_a(world, d0, d1 + d3, d2, + ((ItemMinecart) stack.getItem()).minecartType); + if (stack.hasDisplayName()) { + entityminecart.setCustomNameTag(stack.getDisplayName()); + } + + world.spawnEntityInWorld(entityminecart); + stack.splitStack(1); + return stack; + } + + protected void playDispenseSound(IBlockSource source) { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + }; + private final EntityMinecart.EnumMinecartType minecartType; + + public ItemMinecart(EntityMinecart.EnumMinecartType type) { + this.maxStackSize = 1; + this.minecartType = type; + this.setCreativeTab(CreativeTabs.tabTransport); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, + float hitX, float hitY, float hitZ) { + IBlockState iblockstate = worldIn.getBlockState(pos); + if (BlockRailBase.isRailBlock(iblockstate)) { + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate + .getBlock() instanceof BlockRailBase + ? (BlockRailBase.EnumRailDirection) iblockstate + .getValue(((BlockRailBase) iblockstate.getBlock()).getShapeProperty()) + : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + double d0 = 0.0D; + if (blockrailbase$enumraildirection.isAscending()) { + d0 = 0.5D; + } + + EntityMinecart entityminecart = EntityMinecart.func_180458_a(worldIn, (double) pos.getX() + 0.5D, + (double) pos.getY() + 0.0625D + d0, (double) pos.getZ() + 0.5D, this.minecartType); + if (stack.hasDisplayName()) { + entityminecart.setCustomNameTag(stack.getDisplayName()); + } + + worldIn.spawnEntityInWorld(entityminecart); + } + + --stack.stackSize; + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMonsterPlacer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMonsterPlacer.java new file mode 100644 index 0000000..bdb8b1c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMonsterPlacer.java @@ -0,0 +1,208 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemMonsterPlacer extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemMonsterPlacer"); + } + + public ItemMonsterPlacer() { + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public String getItemStackDisplayName(ItemStack itemstack) { + String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); + String s1 = EntityList.getStringFromID(itemstack.getMetadata()); + if (s1 != null) { + s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name"); + } + + return s; + } + + public int getColorFromItemStack(ItemStack itemstack, int i) { + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo) EntityList.entityEggs + .get(Integer.valueOf(itemstack.getMetadata())); + return entitylist$entityegginfo != null + ? (i == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor) + : 16777215; + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (!entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock() == Blocks.mob_spawner) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityMobSpawner) { + MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner) tileentity).getSpawnerBaseLogic(); + mobspawnerbaselogic.setEntityName(EntityList.getStringFromID(itemstack.getMetadata())); + tileentity.markDirty(); + world.markBlockForUpdate(blockpos); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + return true; + } + } + + blockpos = blockpos.offset(enumfacing); + double d0 = 0.0D; + if (enumfacing == EnumFacing.UP && iblockstate instanceof BlockFence) { + d0 = 0.5D; + } + + Entity entity = spawnCreature(world, itemstack.getMetadata(), (double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + d0, (double) blockpos.getZ() + 0.5D); + if (entity != null) { + if (entity instanceof EntityLivingBase && itemstack.hasDisplayName()) { + entity.setCustomNameTag(itemstack.getDisplayName()); + } + + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + } + + return true; + } + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityplayer, + true); + if (movingobjectposition == null) { + return itemstack; + } else { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = movingobjectposition.getBlockPos(); + if (!world.isBlockModifiable(entityplayer, blockpos)) { + return itemstack; + } + + if (!entityplayer.canPlayerEdit(blockpos, movingobjectposition.sideHit, itemstack)) { + return itemstack; + } + + if (world.getBlockState(blockpos).getBlock() instanceof BlockLiquid) { + Entity entity = spawnCreature(world, itemstack.getMetadata(), (double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + 0.5D, (double) blockpos.getZ() + 0.5D); + if (entity != null) { + if (entity instanceof EntityLivingBase && itemstack.hasDisplayName()) { + ((EntityLiving) entity).setCustomNameTag(itemstack.getDisplayName()); + } + + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + } + + return itemstack; + } + } + } + + /**+ + * Spawns the creature specified by the egg's type in the + * location specified by the last three parameters. Parameters: + * world, entityID, x, y, z. + */ + public static Entity spawnCreature(World worldIn, int entityID, double x, double y, double z) { + if (!EntityList.entityEggs.containsKey(Integer.valueOf(entityID))) { + return null; + } else { + Entity entity = null; + + for (int i = 0; i < 1; ++i) { + entity = EntityList.createEntityByID(entityID, worldIn); + if (entity instanceof EntityLivingBase) { + EntityLiving entityliving = (EntityLiving) entity; + entity.setLocationAndAngles(x, y, z, + MathHelper.wrapAngleTo180_float(worldIn.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), + (IEntityLivingData) null); + worldIn.spawnEntityInWorld(entity); + entityliving.playLivingSound(); + } + } + + return entity; + } + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values()) { + list.add(new ItemStack(item, 1, entitylist$entityegginfo.spawnedID)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMultiTexture.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMultiTexture.java new file mode 100644 index 0000000..3ba3ccc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMultiTexture.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.base.Function; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemMultiTexture extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemMultiTexture"); + } + + protected final Block theBlock; + protected final Function nameFunction; + + public ItemMultiTexture(Block block, Block block2, Function nameFunction) { + super(block); + this.theBlock = block2; + this.nameFunction = nameFunction; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public ItemMultiTexture(Block block, Block block2, final String[] namesByMeta) { + this(block, block2, new Function() { + public String apply(ItemStack parItemStack) { + int i = parItemStack.getMetadata(); + if (i < 0 || i >= namesByMeta.length) { + i = 0; + } + + return namesByMeta[i]; + } + }); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i; + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + return super.getUnlocalizedName() + "." + (String) this.nameFunction.apply(itemstack); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemNameTag.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemNameTag.java new file mode 100644 index 0000000..a3ff067 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemNameTag.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemNameTag extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemNameTag"); + } + + public ItemNameTag() { + this.setCreativeTab(CreativeTabs.tabTools); + } + + /**+ + * Returns true if the item can be used on the given entity, + * e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) { + if (!stack.hasDisplayName()) { + return false; + } else if (target instanceof EntityLiving) { + EntityLiving entityliving = (EntityLiving) target; + entityliving.setCustomNameTag(stack.getDisplayName()); + entityliving.enablePersistence(); + --stack.stackSize; + return true; + } else { + return super.itemInteractionForEntity(stack, playerIn, target); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPickaxe.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPickaxe.java new file mode 100644 index 0000000..839fad6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPickaxe.java @@ -0,0 +1,82 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemTool; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemPickaxe extends ItemTool { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemPickaxe"); + } + + private static Set EFFECTIVE_ON = null; + + public static void doBootstrap() { + EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, + Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder }); + } + + protected ItemPickaxe(Item.ToolMaterial material) { + super(2.0F, material, EFFECTIVE_ON); + } + + /**+ + * Check whether this Item can harvest the given Block + */ + public boolean canHarvestBlock(Block blockIn) { + return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 + : (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore + ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block + ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore + ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore + ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore + ? (blockIn != Blocks.redstone_ore + && blockIn != Blocks.lit_redstone_ore + ? (blockIn.getMaterial() == Material.rock ? true + : (blockIn + .getMaterial() == Material.iron + ? true + : blockIn + .getMaterial() == Material.anvil)) + : this.toolMaterial.getHarvestLevel() >= 2) + : this.toolMaterial.getHarvestLevel() >= 1) + : this.toolMaterial.getHarvestLevel() >= 1) + : this.toolMaterial.getHarvestLevel() >= 2) + : this.toolMaterial.getHarvestLevel() >= 2) + : this.toolMaterial.getHarvestLevel() >= 2); + } + + public float getStrVsBlock(ItemStack stack, Block block) { + return block.getMaterial() != Material.iron && block.getMaterial() != Material.anvil + && block.getMaterial() != Material.rock ? super.getStrVsBlock(stack, block) + : this.efficiencyOnProperMaterial; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPiston.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPiston.java new file mode 100644 index 0000000..f850e0e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPiston.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemPiston extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemPiston"); + } + + public ItemPiston(Block block) { + super(block); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int var1) { + return 7; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPotion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPotion.java new file mode 100644 index 0000000..637aca7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPotion.java @@ -0,0 +1,356 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemPotion extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemPotion"); + } + + private Map> effectCache = Maps.newHashMap(); + private static final Map, Integer> SUB_ITEMS_CACHE = Maps.newLinkedHashMap(); + + public ItemPotion() { + this.setMaxStackSize(1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /**+ + * Returns a list of effects for the specified potion damage + * value. + */ + public List getEffects(ItemStack stack) { + if (stack.hasTagCompound() && stack.getTagCompound().hasKey("CustomPotionEffects", 9)) { + ArrayList arraylist = Lists.newArrayList(); + NBTTagList nbttaglist = stack.getTagCompound().getTagList("CustomPotionEffects", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound); + if (potioneffect != null) { + arraylist.add(potioneffect); + } + } + + return arraylist; + } else { + List list = (List) this.effectCache.get(Integer.valueOf(stack.getMetadata())); + if (list == null) { + list = PotionHelper.getPotionEffects(stack.getMetadata(), false); + this.effectCache.put(Integer.valueOf(stack.getMetadata()), list); + } + + return list; + } + } + + /**+ + * Returns a list of effects for the specified potion damage + * value. + */ + public List getEffects(int meta) { + List list = (List) this.effectCache.get(Integer.valueOf(meta)); + if (list == null) { + list = PotionHelper.getPotionEffects(meta, false); + this.effectCache.put(Integer.valueOf(meta), list); + } + + return list; + } + + /**+ + * Called when the player finishes using this Item (E.g. + * finishes eating.). Not called when the player stops using the + * Item before the action is complete. + */ + public ItemStack onItemUseFinish(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + { + List list = this.getEffects(itemstack); + if (list != null) { + for (PotionEffect potioneffect : (List) list) { + entityplayer.addPotionEffect(new PotionEffect(potioneffect)); + } + } + } + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + if (!entityplayer.capabilities.isCreativeMode) { + if (itemstack.stackSize <= 0) { + return new ItemStack(Items.glass_bottle); + } + + entityplayer.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); + } + + return itemstack; + } + + /**+ + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack var1) { + return 32; + } + + /**+ + * returns the action that specifies what animation to play when + * the items is being used + */ + public EnumAction getItemUseAction(ItemStack var1) { + return EnumAction.DRINK; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (isSplash(itemstack.getMetadata())) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntityPotion(world, entityplayer, itemstack)); + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } else { + entityplayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); + return itemstack; + } + } + + /**+ + * returns wether or not a potion is a throwable splash potion + * based on damage value + */ + public static boolean isSplash(int meta) { + return (meta & 16384) != 0; + } + + public int getColorFromDamage(int meta) { + return PotionHelper.getLiquidColor(meta, false); + } + + public int getColorFromItemStack(ItemStack itemstack, int i) { + return i > 0 ? 16777215 : this.getColorFromDamage(itemstack.getMetadata()); + } + + public boolean isEffectInstant(int meta) { + List list = this.getEffects(meta); + if (list != null && !list.isEmpty()) { + for (PotionEffect potioneffect : (List) list) { + if (Potion.potionTypes[potioneffect.getPotionID()].isInstant()) { + return true; + } + } + + return false; + } else { + return false; + } + } + + public String getItemStackDisplayName(ItemStack stack) { + if (stack.getMetadata() == 0) { + return StatCollector.translateToLocal("item.emptyPotion.name").trim(); + } else { + String s = ""; + if (isSplash(stack.getMetadata())) { + s = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " "; + } + + List list = Items.potionitem.getEffects(stack); + if (list != null && !list.isEmpty()) { + String s2 = ((PotionEffect) list.get(0)).getEffectName(); + s2 = s2 + ".postfix"; + return s + StatCollector.translateToLocal(s2).trim(); + } else { + String s1 = PotionHelper.getPotionPrefix(stack.getMetadata()); + return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(stack); + } + } + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack itemstack, EntityPlayer var2, List list, boolean var4) { + if (itemstack.getMetadata() != 0) { + List list1 = Items.potionitem.getEffects(itemstack); + HashMultimap hashmultimap = HashMultimap.create(); + if (list1 != null && !list1.isEmpty()) { + for (PotionEffect potioneffect : (List) list1) { + String s1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); + Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; + Map map = potion.getAttributeModifierMap(); + if (map != null && map.size() > 0) { + for (Entry entry : (Set>) map.entrySet()) { + AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); + AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), + potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), + attributemodifier.getOperation()); + hashmultimap.put(((IAttribute) entry.getKey()).getAttributeUnlocalizedName(), + attributemodifier1); + } + } + + if (potioneffect.getAmplifier() > 0) { + s1 = s1 + " " + StatCollector.translateToLocal("potion.potency." + potioneffect.getAmplifier()) + .trim(); + } + + if (potioneffect.getDuration() > 20) { + s1 = s1 + " (" + Potion.getDurationString(potioneffect) + ")"; + } + + if (potion.isBadEffect()) { + list.add(EnumChatFormatting.RED + s1); + } else { + list.add(EnumChatFormatting.GRAY + s1); + } + } + } else { + String s = StatCollector.translateToLocal("potion.empty").trim(); + list.add(EnumChatFormatting.GRAY + s); + } + + if (!hashmultimap.isEmpty()) { + list.add(""); + list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); + + for (Entry entry1 : (Set>) hashmultimap.entries()) { + AttributeModifier attributemodifier2 = (AttributeModifier) entry1.getValue(); + double d0 = attributemodifier2.getAmount(); + double d1; + if (attributemodifier2.getOperation() != 1 && attributemodifier2.getOperation() != 2) { + d1 = attributemodifier2.getAmount(); + } else { + d1 = attributemodifier2.getAmount() * 100.0D; + } + + if (d0 > 0.0D) { + list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted( + "attribute.modifier.plus." + attributemodifier2.getOperation(), + new Object[] { ItemStack.DECIMALFORMAT.format(d1), StatCollector + .translateToLocal("attribute.name." + (String) entry1.getKey()) })); + } else if (d0 < 0.0D) { + d1 = d1 * -1.0D; + list.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted( + "attribute.modifier.take." + attributemodifier2.getOperation(), + new Object[] { ItemStack.DECIMALFORMAT.format(d1), StatCollector + .translateToLocal("attribute.name." + (String) entry1.getKey()) })); + } + } + } + + } + } + + public boolean hasEffect(ItemStack stack) { + List list = this.getEffects(stack); + return list != null && !list.isEmpty(); + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { + super.getSubItems(itemIn, tab, subItems); + if (SUB_ITEMS_CACHE.isEmpty()) { + for (int i = 0; i <= 15; ++i) { + for (int j = 0; j <= 1; ++j) { + int k; + if (j == 0) { + k = i | 8192; + } else { + k = i | 16384; + } + + for (int l = 0; l <= 2; ++l) { + int i1 = k; + if (l != 0) { + if (l == 1) { + i1 = k | 32; + } else if (l == 2) { + i1 = k | 64; + } + } + + List list = PotionHelper.getPotionEffects(i1, false); + if (list != null && !list.isEmpty()) { + SUB_ITEMS_CACHE.put(list, Integer.valueOf(i1)); + } + } + } + } + } + + Iterator iterator = SUB_ITEMS_CACHE.values().iterator(); + + while (iterator.hasNext()) { + int j1 = ((Integer) iterator.next()).intValue(); + subItems.add(new ItemStack(itemIn, 1, j1)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRecord.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRecord.java new file mode 100644 index 0000000..6ff35cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRecord.java @@ -0,0 +1,103 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockJukebox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumRarity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemRecord extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemRecord"); + } + + private static final Map RECORDS = Maps.newHashMap(); + public final String recordName; + + protected ItemRecord(String name) { + this.recordName = name; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabMisc); + RECORDS.put("records." + name, this); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing var5, float var6, float var7, float var8) { + IBlockState iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock() == Blocks.jukebox + && !((Boolean) iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue()) { + { + ((BlockJukebox) Blocks.jukebox).insertRecord(world, blockpos, iblockstate, itemstack); + world.playAuxSFXAtEntity((EntityPlayer) null, 1005, blockpos, Item.getIdFromItem(this)); + --itemstack.stackSize; + entityplayer.triggerAchievement(StatList.field_181740_X); + return true; + } + } else { + return false; + } + } + + /**+ + * allows items to add custom lines of information to the + * mouseover description + */ + public void addInformation(ItemStack var1, EntityPlayer var2, List list, boolean var4) { + list.add(this.getRecordNameLocal()); + } + + public String getRecordNameLocal() { + return StatCollector.translateToLocal("item.record." + this.recordName + ".desc"); + } + + /**+ + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack stack) { + return EnumRarity.RARE; + } + + /**+ + * Return the record item corresponding to the given name. + */ + public static ItemRecord getRecord(String name) { + return (ItemRecord) RECORDS.get(name); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRedstone.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRedstone.java new file mode 100644 index 0000000..847b01c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRedstone.java @@ -0,0 +1,68 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemRedstone extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemRedstone"); + } + + public ItemRedstone() { + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + boolean flag = world.getBlockState(blockpos).getBlock().isReplaceable(world, blockpos); + BlockPos blockpos1 = flag ? blockpos : blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos1, enumfacing, itemstack)) { + return false; + } else { + Block block = world.getBlockState(blockpos1).getBlock(); + if (!world.canBlockBePlaced(block, blockpos1, false, enumfacing, (Entity) null, itemstack)) { + return false; + } else if (Blocks.redstone_wire.canPlaceBlockAt(world, blockpos1)) { + --itemstack.stackSize; + world.setBlockState(blockpos1, Blocks.redstone_wire.getDefaultState()); + return true; + } else { + return false; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemReed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemReed.java new file mode 100644 index 0000000..86960a2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemReed.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemReed extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemReed"); + } + + private Block block; + + public ItemReed(Block block) { + this.block = block; + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float f, float f1, float f2) { + IBlockState iblockstate = world.getBlockState(blockpos); + Block blockx = iblockstate.getBlock(); + if (blockx == Blocks.snow_layer && ((Integer) iblockstate.getValue(BlockSnow.LAYERS)).intValue() < 1) { + enumfacing = EnumFacing.UP; + } else if (!blockx.isReplaceable(world, blockpos)) { + blockpos = blockpos.offset(enumfacing); + } + + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else if (itemstack.stackSize == 0) { + return false; + } else { + if (world.canBlockBePlaced(this.block, blockpos, false, enumfacing, (Entity) null, itemstack)) { + IBlockState iblockstate1 = this.block.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, 0, + entityplayer); + if (world.setBlockState(blockpos, iblockstate1, 3)) { + iblockstate1 = world.getBlockState(blockpos); + if (iblockstate1.getBlock() == this.block) { + ItemBlock.setTileEntityNBT(world, entityplayer, blockpos, itemstack); + iblockstate1.getBlock().onBlockPlacedBy(world, blockpos, iblockstate1, entityplayer, itemstack); + } + + world.playSoundEffect((double) ((float) blockpos.getX() + 0.5F), + (double) ((float) blockpos.getY() + 0.5F), (double) ((float) blockpos.getZ() + 0.5F), + this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, + this.block.stepSound.getFrequency() * 0.8F); + --itemstack.stackSize; + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSaddle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSaddle.java new file mode 100644 index 0000000..44c22e2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSaddle.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityPig; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSaddle extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSaddle"); + } + + public ItemSaddle() { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /**+ + * Returns true if the item can be used on the given entity, + * e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer var2, EntityLivingBase entitylivingbase) { + if (entitylivingbase instanceof EntityPig) { + EntityPig entitypig = (EntityPig) entitylivingbase; + if (!entitypig.getSaddled() && !entitypig.isChild()) { + entitypig.setSaddled(true); + entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F); + --itemstack.stackSize; + } + + return true; + } else { + return false; + } + } + + /**+ + * Current implementations of this method in child classes do + * not use the entry argument beside ev. They just raise the + * damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { + this.itemInteractionForEntity(stack, (EntityPlayer) null, target); + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeedFood.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeedFood.java new file mode 100644 index 0000000..dd5cbf8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeedFood.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSeedFood extends ItemFood { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSeedFood"); + } + + private Block crops; + private Block soilId; + + public ItemSeedFood(int healAmount, float saturation, Block crops, Block soil) { + super(healAmount, saturation, false); + this.crops = crops; + this.soilId = soil; + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing != EnumFacing.UP) { + return false; + } else if (!entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)) { + return false; + } else if (world.getBlockState(blockpos).getBlock() == this.soilId && world.isAirBlock(blockpos.up())) { + world.setBlockState(blockpos.up(), this.crops.getDefaultState()); + --itemstack.stackSize; + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeeds.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeeds.java new file mode 100644 index 0000000..3b2d4e1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeeds.java @@ -0,0 +1,66 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSeeds extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSeeds"); + } + + private Block crops; + private Block soilBlockID; + + public ItemSeeds(Block crops, Block soil) { + this.crops = crops; + this.soilBlockID = soil; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing != EnumFacing.UP) { + return false; + } else if (!entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)) { + return false; + } else if (world.getBlockState(blockpos).getBlock() == this.soilBlockID && world.isAirBlock(blockpos.up())) { + world.setBlockState(blockpos.up(), this.crops.getDefaultState()); + --itemstack.stackSize; + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemShears.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemShears.java new file mode 100644 index 0000000..ad95702 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemShears.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemShears extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemShears"); + } + + public ItemShears() { + this.setMaxStackSize(1); + this.setMaxDamage(238); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /**+ + * Called when a Block is destroyed using this Item. Return true + * to trigger the "Use Item" statistic. + */ + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, + EntityLivingBase playerIn) { + if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass + && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool) { + return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); + } else { + stack.damageItem(1, playerIn); + return true; + } + } + + /**+ + * Check whether this Item can harvest the given Block + */ + public boolean canHarvestBlock(Block block) { + return block == Blocks.web || block == Blocks.redstone_wire || block == Blocks.tripwire; + } + + public float getStrVsBlock(ItemStack itemstack, Block block) { + return block != Blocks.web && block.getMaterial() != Material.leaves + ? (block == Blocks.wool ? 5.0F : super.getStrVsBlock(itemstack, block)) + : 15.0F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSign.java new file mode 100644 index 0000000..e22af7c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSign.java @@ -0,0 +1,88 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStandingSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWallSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSign extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSign"); + } + + public ItemSign() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing == EnumFacing.DOWN) { + return false; + } else if (!world.getBlockState(blockpos).getBlock().getMaterial().isSolid()) { + return false; + } else { + blockpos = blockpos.offset(enumfacing); + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else if (!Blocks.standing_sign.canPlaceBlockAt(world, blockpos)) { + return false; + } else { + if (enumfacing == EnumFacing.UP) { + int i = MathHelper + .floor_double((double) ((entityplayer.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; + world.setBlockState(blockpos, Blocks.standing_sign.getDefaultState() + .withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3); + } else { + world.setBlockState(blockpos, + Blocks.wall_sign.getDefaultState().withProperty(BlockWallSign.FACING, enumfacing), 3); + } + + --itemstack.stackSize; + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntitySign + && !ItemBlock.setTileEntityNBT(world, entityplayer, blockpos, itemstack)) { + entityplayer.openEditSign((TileEntitySign) tileentity); + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSimpleFoiled.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSimpleFoiled.java new file mode 100644 index 0000000..88604ac --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSimpleFoiled.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSimpleFoiled extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSimpleFoiled"); + } + + public boolean hasEffect(ItemStack var1) { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSkull.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSkull.java new file mode 100644 index 0000000..621379b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSkull.java @@ -0,0 +1,194 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSkull extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSkull"); + } + + private static final String[] skullTypes = new String[] { "skeleton", "wither", "zombie", "char", "creeper" }; + + public ItemSkull() { + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float var6, float var7, float var8) { + if (enumfacing == EnumFacing.DOWN) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + boolean flag = block.isReplaceable(world, blockpos); + if (!flag) { + if (!world.getBlockState(blockpos).getBlock().getMaterial().isSolid()) { + return false; + } + + blockpos = blockpos.offset(enumfacing); + } + + if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else if (!Blocks.skull.canPlaceBlockAt(world, blockpos)) { + return false; + } else { + { + world.setBlockState(blockpos, + Blocks.skull.getDefaultState().withProperty(BlockSkull.FACING, enumfacing), 3); + int i = 0; + if (enumfacing == EnumFacing.UP) { + i = MathHelper.floor_double((double) (entityplayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; + } + + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntitySkull) { + TileEntitySkull tileentityskull = (TileEntitySkull) tileentity; + if (itemstack.getMetadata() == 3) { + GameProfile gameprofile = null; + if (itemstack.hasTagCompound()) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + if (nbttagcompound.hasKey("SkullOwner", 10)) { + gameprofile = NBTUtil + .readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } else if (nbttagcompound.hasKey("SkullOwner", 8) + && nbttagcompound.getString("SkullOwner").length() > 0) { + gameprofile = new GameProfile((EaglercraftUUID) null, + nbttagcompound.getString("SkullOwner")); + } + } + + tileentityskull.setPlayerProfile(gameprofile); + } else { + tileentityskull.setType(itemstack.getMetadata()); + } + + tileentityskull.setSkullRotation(i); + Blocks.skull.checkWitherSpawn(world, blockpos, tileentityskull); + } + + --itemstack.stackSize; + } + + return true; + } + } + } + + /**+ + * returns a list of items with the same ID, but different meta + * (eg: dye returns 16 items) + */ + public void getSubItems(Item item, CreativeTabs var2, List list) { + for (int i = 0; i < skullTypes.length; ++i) { + list.add(new ItemStack(item, 1, i)); + } + + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i; + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + int i = itemstack.getMetadata(); + if (i < 0 || i >= skullTypes.length) { + i = 0; + } + + return super.getUnlocalizedName() + "." + skullTypes[i]; + } + + public String getItemStackDisplayName(ItemStack itemstack) { + if (itemstack.getMetadata() == 3 && itemstack.hasTagCompound()) { + if (itemstack.getTagCompound().hasKey("SkullOwner", 8)) { + return StatCollector.translateToLocalFormatted("item.skull.player.name", + new Object[] { itemstack.getTagCompound().getString("SkullOwner") }); + } + + if (itemstack.getTagCompound().hasKey("SkullOwner", 10)) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound().getCompoundTag("SkullOwner"); + if (nbttagcompound.hasKey("Name", 8)) { + return StatCollector.translateToLocalFormatted("item.skull.player.name", + new Object[] { nbttagcompound.getString("Name") }); + } + } + } + + return super.getItemStackDisplayName(itemstack); + } + + /**+ + * Called when an ItemStack with NBT data is read to potentially + * that ItemStack's NBT data + */ + public boolean updateItemStackNBT(NBTTagCompound nbt) { + super.updateItemStackNBT(nbt); + if (nbt.hasKey("SkullOwner", 8) && nbt.getString("SkullOwner").length() > 0) { + GameProfile gameprofile = new GameProfile((EaglercraftUUID) null, nbt.getString("SkullOwner")); + gameprofile = TileEntitySkull.updateGameprofile(gameprofile); + nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSlab.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSlab.java new file mode 100644 index 0000000..b6b51d2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSlab.java @@ -0,0 +1,154 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.IProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSlab extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSlab"); + } + + private final BlockSlab singleSlab; + private final BlockSlab doubleSlab; + + public ItemSlab(Block block, BlockSlab singleSlab, BlockSlab doubleSlab) { + super(block); + this.singleSlab = singleSlab; + this.doubleSlab = doubleSlab; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i; + } + + /**+ + * Returns the unlocalized name of this item. This version + * accepts an ItemStack so different stacks can have different + * names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack itemstack) { + return this.singleSlab.getUnlocalizedName(itemstack.getMetadata()); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float f, float f1, float f2) { + if (itemstack.stackSize == 0) { + return false; + } else if (!entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack)) { + return false; + } else { + Object object = this.singleSlab.getVariant(itemstack); + IBlockState iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock() == this.singleSlab) { + IProperty iproperty = this.singleSlab.getVariantProperty(); + Comparable comparable = iblockstate.getValue(iproperty); + BlockSlab.EnumBlockHalf blockslab$enumblockhalf = (BlockSlab.EnumBlockHalf) iblockstate + .getValue(BlockSlab.HALF); + if ((enumfacing == EnumFacing.UP && blockslab$enumblockhalf == BlockSlab.EnumBlockHalf.BOTTOM + || enumfacing == EnumFacing.DOWN && blockslab$enumblockhalf == BlockSlab.EnumBlockHalf.TOP) + && comparable == object) { + IBlockState iblockstate1 = this.doubleSlab.getDefaultState().withProperty(iproperty, comparable); + if (world.checkNoEntityCollision( + this.doubleSlab.getCollisionBoundingBox(world, blockpos, iblockstate1)) + && world.setBlockState(blockpos, iblockstate1, 3)) { + world.playSoundEffect((double) ((float) blockpos.getX() + 0.5F), + (double) ((float) blockpos.getY() + 0.5F), (double) ((float) blockpos.getZ() + 0.5F), + this.doubleSlab.stepSound.getPlaceSound(), + (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, + this.doubleSlab.stepSound.getFrequency() * 0.8F); + --itemstack.stackSize; + } + + return true; + } + } + + return this.tryPlace(itemstack, world, blockpos.offset(enumfacing), object) ? true + : super.onItemUse(itemstack, entityplayer, world, blockpos, enumfacing, f, f1, f2); + } + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, + ItemStack stack) { + BlockPos blockpos = pos; + IProperty iproperty = this.singleSlab.getVariantProperty(); + Object object = this.singleSlab.getVariant(stack); + IBlockState iblockstate = worldIn.getBlockState(pos); + if (iblockstate.getBlock() == this.singleSlab) { + boolean flag = iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP; + if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) + && object == iblockstate.getValue(iproperty)) { + return true; + } + } + + pos = pos.offset(side); + IBlockState iblockstate1 = worldIn.getBlockState(pos); + return iblockstate1.getBlock() == this.singleSlab && object == iblockstate1.getValue(iproperty) ? true + : super.canPlaceBlockOnSide(worldIn, blockpos, side, player, stack); + } + + private boolean tryPlace(ItemStack stack, World worldIn, BlockPos pos, Object variantInStack) { + IBlockState iblockstate = worldIn.getBlockState(pos); + if (iblockstate.getBlock() == this.singleSlab) { + Comparable comparable = iblockstate.getValue(this.singleSlab.getVariantProperty()); + if (comparable == variantInStack) { + IBlockState iblockstate1 = this.doubleSlab.getDefaultState() + .withProperty((IProperty) this.singleSlab.getVariantProperty(), comparable); + if (worldIn.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(worldIn, pos, iblockstate1)) + && worldIn.setBlockState(pos, iblockstate1, 3)) { + worldIn.playSoundEffect((double) ((float) pos.getX() + 0.5F), (double) ((float) pos.getY() + 0.5F), + (double) ((float) pos.getZ() + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), + (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, + this.doubleSlab.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + } + + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnow.java new file mode 100644 index 0000000..2f9e2af --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnow.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSnow extends ItemBlock { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSnow"); + } + + public ItemSnow(Block block) { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /**+ + * Called when a Block is right-clicked with this Item + */ + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, + EnumFacing enumfacing, float f, float f1, float f2) { + if (itemstack.stackSize == 0) { + return false; + } else if (!entityplayer.canPlayerEdit(blockpos, enumfacing, itemstack)) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + BlockPos blockpos1 = blockpos; + if ((enumfacing != EnumFacing.UP || block != this.block) && !block.isReplaceable(world, blockpos)) { + blockpos1 = blockpos.offset(enumfacing); + iblockstate = world.getBlockState(blockpos1); + block = iblockstate.getBlock(); + } + + if (block == this.block) { + int i = ((Integer) iblockstate.getValue(BlockSnow.LAYERS)).intValue(); + if (i <= 7) { + IBlockState iblockstate1 = iblockstate.withProperty(BlockSnow.LAYERS, Integer.valueOf(i + 1)); + AxisAlignedBB axisalignedbb = this.block.getCollisionBoundingBox(world, blockpos1, iblockstate1); + if (axisalignedbb != null && world.checkNoEntityCollision(axisalignedbb) + && world.setBlockState(blockpos1, iblockstate1, 2)) { + world.playSoundEffect((double) ((float) blockpos1.getX() + 0.5F), + (double) ((float) blockpos1.getY() + 0.5F), (double) ((float) blockpos1.getZ() + 0.5F), + this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, + this.block.stepSound.getFrequency() * 0.8F); + --itemstack.stackSize; + return true; + } + } + } + + return super.onItemUse(itemstack, entityplayer, world, blockpos1, enumfacing, f, f1, f2); + } + } + + /**+ + * Converts the given ItemStack damage value into a metadata + * value to be placed in the world when this Item is placed as a + * Block (mostly used with ItemBlocks). + */ + public int getMetadata(int i) { + return i; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnowball.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnowball.java new file mode 100644 index 0000000..8166eb6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnowball.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntitySnowball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSnowball extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSnowball"); + } + + public ItemSnowball() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + + world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntitySnowball(world, entityplayer)); + + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSoup.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSoup.java new file mode 100644 index 0000000..10c21f0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSoup.java @@ -0,0 +1,51 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSoup extends ItemFood { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSoup"); + } + + public ItemSoup(int healAmount) { + super(healAmount, false); + this.setMaxStackSize(1); + } + + /**+ + * Called when the player finishes using this Item (E.g. + * finishes eating.). Not called when the player stops using the + * Item before the action is complete. + */ + public ItemStack onItemUseFinish(ItemStack itemstack, World world, EntityPlayer entityplayer) { + super.onItemUseFinish(itemstack, world, entityplayer); + return new ItemStack(Items.bowl); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSpade.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSpade.java new file mode 100644 index 0000000..4cbc605 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSpade.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemTool; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSpade extends ItemTool { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSpade"); + } + + private static Set EFFECTIVE_ON = null; + + public static void doBootstrap() { + EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.clay, Blocks.dirt, Blocks.farmland, Blocks.grass, + Blocks.gravel, Blocks.mycelium, Blocks.sand, Blocks.snow, Blocks.snow_layer, Blocks.soul_sand }); + } + + public ItemSpade(Item.ToolMaterial material) { + super(1.0F, material, EFFECTIVE_ON); + } + + /**+ + * Check whether this Item can harvest the given Block + */ + public boolean canHarvestBlock(Block block) { + return block == Blocks.snow_layer ? true : block == Blocks.snow; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemStack.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemStack.java new file mode 100644 index 0000000..d982a26 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemStack.java @@ -0,0 +1,949 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.HString; + +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.Enchantment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentDurability; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.HoverEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumRarity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBow; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class ItemStack { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemStack"); + } + + public static final DecimalFormat DECIMALFORMAT = new DecimalFormat("#.###"); + public int stackSize; + public int animationsToGo; + private Item item; + private NBTTagCompound stackTagCompound; + private int itemDamage; + private EntityItemFrame itemFrame; + private Block canDestroyCacheBlock; + private boolean canDestroyCacheResult; + private Block canPlaceOnCacheBlock; + private boolean canPlaceOnCacheResult; + + public ItemStack(Block blockIn) { + this((Block) blockIn, 1); + } + + public ItemStack(Block blockIn, int amount) { + this((Block) blockIn, amount, 0); + } + + public ItemStack(Block blockIn, int amount, int meta) { + this(Item.getItemFromBlock(blockIn), amount, meta); + } + + public ItemStack(Item itemIn) { + this((Item) itemIn, 1); + } + + public ItemStack(Item itemIn, int amount) { + this((Item) itemIn, amount, 0); + } + + public ItemStack(Item itemIn, int amount, int meta) { + this.canDestroyCacheBlock = null; + this.canDestroyCacheResult = false; + this.canPlaceOnCacheBlock = null; + this.canPlaceOnCacheResult = false; + this.item = itemIn; + this.stackSize = amount; + this.itemDamage = meta; + if (this.itemDamage < 0) { + this.itemDamage = 0; + } + + } + + public static ItemStack loadItemStackFromNBT(NBTTagCompound nbt) { + ItemStack itemstack = new ItemStack(); + itemstack.readFromNBT(nbt); + return itemstack.getItem() != null ? itemstack : null; + } + + private ItemStack() { + this.canDestroyCacheBlock = null; + this.canDestroyCacheResult = false; + this.canPlaceOnCacheBlock = null; + this.canPlaceOnCacheResult = false; + } + + /**+ + * Splits off a stack of the given amount of this stack and + * reduces this stack by the amount. + */ + public ItemStack splitStack(int amount) { + ItemStack itemstack = new ItemStack(this.item, amount, this.itemDamage); + if (this.stackTagCompound != null) { + itemstack.stackTagCompound = (NBTTagCompound) this.stackTagCompound.copy(); + } + + this.stackSize -= amount; + return itemstack; + } + + /**+ + * Returns the object corresponding to the stack. + */ + public Item getItem() { + return this.item; + } + + /**+ + * Called when the player uses this ItemStack on a Block + * (right-click). Places blocks, etc. (Legacy name: + * tryPlaceItemIntoWorld) + */ + public boolean onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, + float hitY, float hitZ) { + boolean flag = this.getItem().onItemUse(this, playerIn, worldIn, pos, side, hitX, hitY, hitZ); + if (flag) { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this.item)]); + } + + return flag; + } + + public float getStrVsBlock(Block blockIn) { + return this.getItem().getStrVsBlock(this, blockIn); + } + + /**+ + * Called whenever this item stack is equipped and right + * clicked. Returns the new item stack to put in the position + * where this item is. Args: world, player + */ + public ItemStack useItemRightClick(World worldIn, EntityPlayer playerIn) { + return this.getItem().onItemRightClick(this, worldIn, playerIn); + } + + /**+ + * Called when the item in use count reach 0, e.g. item food + * eaten. Return the new ItemStack. Args : world, entity + */ + public ItemStack onItemUseFinish(World worldIn, EntityPlayer playerIn) { + return this.getItem().onItemUseFinish(this, worldIn, playerIn); + } + + /**+ + * Write the stack fields to a NBT object. Return the new NBT + * object. + */ + public NBTTagCompound writeToNBT(NBTTagCompound nbt) { + ResourceLocation resourcelocation = (ResourceLocation) Item.itemRegistry.getNameForObject(this.item); + nbt.setString("id", resourcelocation == null ? "minecraft:air" : resourcelocation.toString()); + nbt.setByte("Count", (byte) this.stackSize); + nbt.setShort("Damage", (short) this.itemDamage); + if (this.stackTagCompound != null) { + nbt.setTag("tag", this.stackTagCompound); + } + + return nbt; + } + + /**+ + * Read the stack fields from a NBT object. + */ + public void readFromNBT(NBTTagCompound nbt) { + if (nbt.hasKey("id", 8)) { + this.item = Item.getByNameOrId(nbt.getString("id")); + } else { + this.item = Item.getItemById(nbt.getShort("id")); + } + + this.stackSize = nbt.getByte("Count"); + this.itemDamage = nbt.getShort("Damage"); + if (this.itemDamage < 0) { + this.itemDamage = 0; + } + + if (nbt.hasKey("tag", 10)) { + this.stackTagCompound = nbt.getCompoundTag("tag"); + if (this.item != null) { + this.item.updateItemStackNBT(this.stackTagCompound); + } + } + + } + + /**+ + * Returns maximum size of the stack. + */ + public int getMaxStackSize() { + return this.getItem().getItemStackLimit(); + } + + /**+ + * Returns true if the ItemStack can hold 2 or more units of the + * item. + */ + public boolean isStackable() { + return this.getMaxStackSize() > 1 && (!this.isItemStackDamageable() || !this.isItemDamaged()); + } + + /**+ + * true if this itemStack is damageable + */ + public boolean isItemStackDamageable() { + return this.item == null ? false + : (this.item.getMaxDamage() <= 0 ? false + : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable")); + } + + public boolean getHasSubtypes() { + return this.item.getHasSubtypes(); + } + + /**+ + * returns true when a damageable item is damaged + */ + public boolean isItemDamaged() { + return this.isItemStackDamageable() && this.itemDamage > 0; + } + + public int getItemDamage() { + return this.itemDamage; + } + + public int getMetadata() { + return this.itemDamage; + } + + public void setItemDamage(int meta) { + this.itemDamage = meta; + if (this.itemDamage < 0) { + this.itemDamage = 0; + } + + } + + /**+ + * Returns the max damage an item in the stack can take. + */ + public int getMaxDamage() { + return this.item.getMaxDamage(); + } + + /**+ + * Attempts to damage the ItemStack with par1 amount of damage, + * If the ItemStack has the Unbreaking enchantment there is a + * chance for each point of damage to be negated. Returns true + * if it takes more damage than getMaxDamage(). Returns false + * otherwise or if the ItemStack can't be damaged or if all + * points of damage are negated. + */ + public boolean attemptDamageItem(int amount, EaglercraftRandom rand) { + if (!this.isItemStackDamageable()) { + return false; + } else { + if (amount > 0) { + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, this); + int j = 0; + + for (int k = 0; i > 0 && k < amount; ++k) { + if (EnchantmentDurability.negateDamage(this, i, rand)) { + ++j; + } + } + + amount -= j; + if (amount <= 0) { + return false; + } + } + + this.itemDamage += amount; + return this.itemDamage > this.getMaxDamage(); + } + } + + /**+ + * Damages the item in the ItemStack + */ + public void damageItem(int amount, EntityLivingBase entityIn) { + if (!(entityIn instanceof EntityPlayer) || !((EntityPlayer) entityIn).capabilities.isCreativeMode) { + if (this.isItemStackDamageable()) { + if (this.attemptDamageItem(amount, entityIn.getRNG())) { + entityIn.renderBrokenItemStack(this); + --this.stackSize; + if (entityIn instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) entityIn; + entityplayer.triggerAchievement(StatList.objectBreakStats[Item.getIdFromItem(this.item)]); + if (this.stackSize == 0 && this.getItem() instanceof ItemBow) { + entityplayer.destroyCurrentEquippedItem(); + } + } + + if (this.stackSize < 0) { + this.stackSize = 0; + } + + this.itemDamage = 0; + } + + } + } + } + + /**+ + * Calls the corresponding fct in di + */ + public void hitEntity(EntityLivingBase entityIn, EntityPlayer playerIn) { + boolean flag = this.item.hitEntity(this, entityIn, playerIn); + if (flag) { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this.item)]); + } + + } + + /**+ + * Called when a Block is destroyed using this ItemStack + */ + public void onBlockDestroyed(World worldIn, Block blockIn, BlockPos pos, EntityPlayer playerIn) { + boolean flag = this.item.onBlockDestroyed(this, worldIn, blockIn, pos, playerIn); + if (flag) { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this.item)]); + } + + } + + /**+ + * Check whether the given Block can be harvested using this + * ItemStack. + */ + public boolean canHarvestBlock(Block blockIn) { + return this.item.canHarvestBlock(blockIn); + } + + public boolean interactWithEntity(EntityPlayer playerIn, EntityLivingBase entityIn) { + return this.item.itemInteractionForEntity(this, playerIn, entityIn); + } + + /**+ + * Returns a new stack with the same properties. + */ + public ItemStack copy() { + ItemStack itemstack = new ItemStack(this.item, this.stackSize, this.itemDamage); + if (this.stackTagCompound != null) { + itemstack.stackTagCompound = (NBTTagCompound) this.stackTagCompound.copy(); + } + + return itemstack; + } + + public static boolean areItemStackTagsEqual(ItemStack stackA, ItemStack stackB) { + return stackA == null + && stackB == null + ? true + : (stackA != null && stackB != null + ? (stackA.stackTagCompound == null && stackB.stackTagCompound != null ? false + : stackA.stackTagCompound == null + || stackA.stackTagCompound.equals(stackB.stackTagCompound)) + : false); + } + + /**+ + * compares ItemStack argument1 with ItemStack argument2; + * returns true if both ItemStacks are equal + */ + public static boolean areItemStacksEqual(ItemStack stackA, ItemStack stackB) { + return stackA == null && stackB == null ? true + : (stackA != null && stackB != null ? stackA.isItemStackEqual(stackB) : false); + } + + /**+ + * compares ItemStack argument to the instance ItemStack; + * returns true if both ItemStacks are equal + */ + private boolean isItemStackEqual(ItemStack other) { + return this.stackSize != other.stackSize ? false + : (this.item != other.item ? false + : (this.itemDamage != other.itemDamage ? false + : (this.stackTagCompound == null && other.stackTagCompound != null ? false + : this.stackTagCompound == null + || this.stackTagCompound.equals(other.stackTagCompound)))); + } + + /**+ + * Compares Item and damage value of the two stacks + */ + public static boolean areItemsEqual(ItemStack stackA, ItemStack stackB) { + return stackA == null && stackB == null ? true + : (stackA != null && stackB != null ? stackA.isItemEqual(stackB) : false); + } + + /**+ + * compares ItemStack argument to the instance ItemStack; + * returns true if the Items contained in both ItemStacks are + * equal + */ + public boolean isItemEqual(ItemStack other) { + return other != null && this.item == other.item && this.itemDamage == other.itemDamage; + } + + public String getUnlocalizedName() { + return this.item.getUnlocalizedName(this); + } + + /**+ + * Creates a copy of a ItemStack, a null parameters will return + * a null. + */ + public static ItemStack copyItemStack(ItemStack stack) { + return stack == null ? null : stack.copy(); + } + + public String toString() { + return this.stackSize + "x" + this.item.getUnlocalizedName() + "@" + this.itemDamage; + } + + /**+ + * Called each tick as long the ItemStack in on player + * inventory. Used to progress the pickup animation and update + * maps. + */ + public void updateAnimation(World worldIn, Entity entityIn, int inventorySlot, boolean isCurrentItem) { + if (this.animationsToGo > 0) { + --this.animationsToGo; + } + + this.item.onUpdate(this, worldIn, entityIn, inventorySlot, isCurrentItem); + } + + public void onCrafting(World worldIn, EntityPlayer playerIn, int amount) { + playerIn.addStat(StatList.objectCraftStats[Item.getIdFromItem(this.item)], amount); + this.item.onCreated(this, worldIn, playerIn); + } + + public boolean getIsItemStackEqual(ItemStack parItemStack) { + return this.isItemStackEqual(parItemStack); + } + + public int getMaxItemUseDuration() { + return this.getItem().getMaxItemUseDuration(this); + } + + public EnumAction getItemUseAction() { + return this.getItem().getItemUseAction(this); + } + + /**+ + * Called when the player releases the use item button. Args: + * world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(World worldIn, EntityPlayer playerIn, int timeLeft) { + this.getItem().onPlayerStoppedUsing(this, worldIn, playerIn, timeLeft); + } + + /**+ + * Returns true if the ItemStack has an NBTTagCompound. + * Currently used to store enchantments. + */ + public boolean hasTagCompound() { + return this.stackTagCompound != null; + } + + /**+ + * Returns the NBTTagCompound of the ItemStack. + */ + public NBTTagCompound getTagCompound() { + return this.stackTagCompound; + } + + /**+ + * Get an NBTTagCompound from this stack's NBT data. + */ + public NBTTagCompound getSubCompound(String key, boolean create) { + if (this.stackTagCompound != null && this.stackTagCompound.hasKey(key, 10)) { + return this.stackTagCompound.getCompoundTag(key); + } else if (create) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.setTagInfo(key, nbttagcompound); + return nbttagcompound; + } else { + return null; + } + } + + public NBTTagList getEnchantmentTagList() { + return this.stackTagCompound == null ? null : this.stackTagCompound.getTagList("ench", 10); + } + + /**+ + * Assigns a NBTTagCompound to the ItemStack, minecraft + * validates that only non-stackable items can have it. + */ + public void setTagCompound(NBTTagCompound nbt) { + this.stackTagCompound = nbt; + } + + /**+ + * returns the display name of the itemstack + */ + public String getDisplayName() { + String s = this.getItem().getItemStackDisplayName(this); + if (this.stackTagCompound != null && this.stackTagCompound.hasKey("display", 10)) { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + if (nbttagcompound.hasKey("Name", 8)) { + s = nbttagcompound.getString("Name"); + } + } + + return s; + } + + public ItemStack setStackDisplayName(String displayName) { + if (this.stackTagCompound == null) { + this.stackTagCompound = new NBTTagCompound(); + } + + if (!this.stackTagCompound.hasKey("display", 10)) { + this.stackTagCompound.setTag("display", new NBTTagCompound()); + } + + this.stackTagCompound.getCompoundTag("display").setString("Name", displayName); + return this; + } + + /**+ + * Clear any custom name set for this ItemStack + */ + public void clearCustomName() { + if (this.stackTagCompound != null) { + if (this.stackTagCompound.hasKey("display", 10)) { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + nbttagcompound.removeTag("Name"); + if (nbttagcompound.hasNoTags()) { + this.stackTagCompound.removeTag("display"); + if (this.stackTagCompound.hasNoTags()) { + this.setTagCompound((NBTTagCompound) null); + } + } + + } + } + } + + /**+ + * Returns true if the itemstack has a display name + */ + public boolean hasDisplayName() { + return this.stackTagCompound == null ? false + : (!this.stackTagCompound.hasKey("display", 10) ? false + : this.stackTagCompound.getCompoundTag("display").hasKey("Name", 8)); + } + + /**+ + * Return a list of strings containing information about the + * item + */ + public List getTooltip(EntityPlayer playerIn, boolean advanced) { + ArrayList arraylist = Lists.newArrayList(); + String s = this.getDisplayName(); + if (this.hasDisplayName()) { + s = EnumChatFormatting.ITALIC + s; + } + + s = s + EnumChatFormatting.RESET; + if (advanced) { + String s1 = ""; + if (s.length() > 0) { + s = s + " ("; + s1 = ")"; + } + + int i = Item.getIdFromItem(this.item); + if (this.getHasSubtypes()) { + s = s + HString.format("#%04d/%d%s", + new Object[] { Integer.valueOf(i), Integer.valueOf(this.itemDamage), s1 }); + } else { + s = s + HString.format("#%04d%s", new Object[] { Integer.valueOf(i), s1 }); + } + } else if (!this.hasDisplayName() && this.item == Items.filled_map) { + s = s + " #" + this.itemDamage; + } + + arraylist.add(s); + int k = 0; + if (this.hasTagCompound() && this.stackTagCompound.hasKey("HideFlags", 99)) { + k = this.stackTagCompound.getInteger("HideFlags"); + } + + if ((k & 32) == 0) { + this.item.addInformation(this, playerIn, arraylist, advanced); + } + + if (this.hasTagCompound()) { + if ((k & 1) == 0) { + NBTTagList nbttaglist = this.getEnchantmentTagList(); + if (nbttaglist != null) { + for (int j = 0; j < nbttaglist.tagCount(); ++j) { + short short1 = nbttaglist.getCompoundTagAt(j).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(j).getShort("lvl"); + if (Enchantment.getEnchantmentById(short1) != null) { + arraylist.add(Enchantment.getEnchantmentById(short1).getTranslatedName(short2)); + } + } + } + } + + if (this.stackTagCompound.hasKey("display", 10)) { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + if (nbttagcompound.hasKey("color", 3)) { + if (advanced) { + arraylist.add( + "Color: #" + Integer.toHexString(nbttagcompound.getInteger("color")).toUpperCase()); + } else { + arraylist.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); + } + } + + if (nbttagcompound.getTagId("Lore") == 9) { + NBTTagList nbttaglist1 = nbttagcompound.getTagList("Lore", 8); + if (nbttaglist1.tagCount() > 0) { + for (int l = 0; l < nbttaglist1.tagCount(); ++l) { + arraylist.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + + nbttaglist1.getStringTagAt(l)); + } + } + } + } + } + + Multimap multimap = this.getAttributeModifiers(); + if (!multimap.isEmpty() && (k & 2) == 0) { + arraylist.add(""); + + for (Entry entry : (Collection) multimap.entries()) { + AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); + double d0 = attributemodifier.getAmount(); + if (attributemodifier.getID() == Item.itemModifierUUID) { + d0 += (double) EnchantmentHelper.func_152377_a(this, EnumCreatureAttribute.UNDEFINED); + } + + double d1; + if (attributemodifier.getOperation() != 1 && attributemodifier.getOperation() != 2) { + d1 = d0; + } else { + d1 = d0 * 100.0D; + } + + if (d0 > 0.0D) { + arraylist.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted( + "attribute.modifier.plus." + attributemodifier.getOperation(), + new Object[] { DECIMALFORMAT.format(d1), + StatCollector.translateToLocal("attribute.name." + (String) entry.getKey()) })); + } else if (d0 < 0.0D) { + d1 = d1 * -1.0D; + arraylist.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted( + "attribute.modifier.take." + attributemodifier.getOperation(), + new Object[] { DECIMALFORMAT.format(d1), + StatCollector.translateToLocal("attribute.name." + (String) entry.getKey()) })); + } + } + } + + if (this.hasTagCompound() && this.getTagCompound().getBoolean("Unbreakable") && (k & 4) == 0) { + arraylist.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal("item.unbreakable")); + } + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanDestroy", 9) && (k & 8) == 0) { + NBTTagList nbttaglist2 = this.stackTagCompound.getTagList("CanDestroy", 8); + if (nbttaglist2.tagCount() > 0) { + arraylist.add(""); + arraylist.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.canBreak")); + + for (int i1 = 0; i1 < nbttaglist2.tagCount(); ++i1) { + Block block = Block.getBlockFromName(nbttaglist2.getStringTagAt(i1)); + if (block != null) { + arraylist.add(EnumChatFormatting.DARK_GRAY + block.getLocalizedName()); + } else { + arraylist.add(EnumChatFormatting.DARK_GRAY + "missingno"); + } + } + } + } + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanPlaceOn", 9) && (k & 16) == 0) { + NBTTagList nbttaglist3 = this.stackTagCompound.getTagList("CanPlaceOn", 8); + if (nbttaglist3.tagCount() > 0) { + arraylist.add(""); + arraylist.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.canPlace")); + + for (int j1 = 0; j1 < nbttaglist3.tagCount(); ++j1) { + Block block1 = Block.getBlockFromName(nbttaglist3.getStringTagAt(j1)); + if (block1 != null) { + arraylist.add(EnumChatFormatting.DARK_GRAY + block1.getLocalizedName()); + } else { + arraylist.add(EnumChatFormatting.DARK_GRAY + "missingno"); + } + } + } + } + + if (advanced) { + if (this.isItemDamaged()) { + arraylist.add( + "Durability: " + (this.getMaxDamage() - this.getItemDamage()) + " / " + this.getMaxDamage()); + } + + arraylist.add(EnumChatFormatting.DARK_GRAY + + ((ResourceLocation) Item.itemRegistry.getNameForObject(this.item)).toString()); + if (this.hasTagCompound()) { + arraylist.add( + EnumChatFormatting.DARK_GRAY + "NBT: " + this.getTagCompound().getKeySet().size() + " tag(s)"); + } + } + + return arraylist; + } + + public boolean hasEffect() { + return this.getItem().hasEffect(this); + } + + public EnumRarity getRarity() { + return this.getItem().getRarity(this); + } + + /**+ + * True if it is a tool and has no enchantments to begin with + */ + public boolean isItemEnchantable() { + return !this.getItem().isItemTool(this) ? false : !this.isItemEnchanted(); + } + + /**+ + * Adds an enchantment with a desired level on the ItemStack. + */ + public void addEnchantment(Enchantment ench, int level) { + if (this.stackTagCompound == null) { + this.setTagCompound(new NBTTagCompound()); + } + + if (!this.stackTagCompound.hasKey("ench", 9)) { + this.stackTagCompound.setTag("ench", new NBTTagList()); + } + + NBTTagList nbttaglist = this.stackTagCompound.getTagList("ench", 10); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setShort("id", (short) ench.effectId); + nbttagcompound.setShort("lvl", (short) ((byte) level)); + nbttaglist.appendTag(nbttagcompound); + } + + /**+ + * True if the item has enchantment data + */ + public boolean isItemEnchanted() { + return this.stackTagCompound != null && this.stackTagCompound.hasKey("ench", 9); + } + + public void setTagInfo(String key, NBTBase value) { + if (this.stackTagCompound == null) { + this.setTagCompound(new NBTTagCompound()); + } + + this.stackTagCompound.setTag(key, value); + } + + public boolean canEditBlocks() { + return this.getItem().canItemEditBlocks(); + } + + /**+ + * Return whether this stack is on an item frame. + */ + public boolean isOnItemFrame() { + return this.itemFrame != null; + } + + /**+ + * Set the item frame this stack is on. + */ + public void setItemFrame(EntityItemFrame frame) { + this.itemFrame = frame; + } + + /**+ + * Return the item frame this stack is on. Returns null if not + * on an item frame. + */ + public EntityItemFrame getItemFrame() { + return this.itemFrame; + } + + /**+ + * Get this stack's repair cost, or 0 if no repair cost is + * defined. + */ + public int getRepairCost() { + return this.hasTagCompound() && this.stackTagCompound.hasKey("RepairCost", 3) + ? this.stackTagCompound.getInteger("RepairCost") + : 0; + } + + /**+ + * Set this stack's repair cost. + */ + public void setRepairCost(int cost) { + if (!this.hasTagCompound()) { + this.stackTagCompound = new NBTTagCompound(); + } + + this.stackTagCompound.setInteger("RepairCost", cost); + } + + public Multimap getAttributeModifiers() { + Object object; + if (this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers", 9)) { + object = HashMultimap.create(); + NBTTagList nbttaglist = this.stackTagCompound.getTagList("AttributeModifiers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + AttributeModifier attributemodifier = SharedMonsterAttributes + .readAttributeModifierFromNBT(nbttagcompound); + if (attributemodifier != null && attributemodifier.getID().getLeastSignificantBits() != 0L + && attributemodifier.getID().getMostSignificantBits() != 0L) { + ((Multimap) object).put(nbttagcompound.getString("AttributeName"), attributemodifier); + } + } + } else { + object = this.getItem().getItemAttributeModifiers(); + } + + return (Multimap) object; + } + + public void setItem(Item newItem) { + this.item = newItem; + } + + /**+ + * Get a ChatComponent for this Item's display name that shows + * this Item on hover + */ + public IChatComponent getChatComponent() { + ChatComponentText chatcomponenttext = new ChatComponentText(this.getDisplayName()); + if (this.hasDisplayName()) { + chatcomponenttext.getChatStyle().setItalic(Boolean.valueOf(true)); + } + + IChatComponent ichatcomponent = (new ChatComponentText("[")).appendSibling(chatcomponenttext).appendText("]"); + if (this.item != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + ichatcomponent.getChatStyle().setChatHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString()))); + ichatcomponent.getChatStyle().setColor(this.getRarity().rarityColor); + } + + return ichatcomponent; + } + + public boolean canDestroy(Block blockIn) { + if (blockIn == this.canDestroyCacheBlock) { + return this.canDestroyCacheResult; + } else { + this.canDestroyCacheBlock = blockIn; + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanDestroy", 9)) { + NBTTagList nbttaglist = this.stackTagCompound.getTagList("CanDestroy", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + Block block = Block.getBlockFromName(nbttaglist.getStringTagAt(i)); + if (block == blockIn) { + this.canDestroyCacheResult = true; + return true; + } + } + } + + this.canDestroyCacheResult = false; + return false; + } + } + + public boolean canPlaceOn(Block blockIn) { + if (blockIn == this.canPlaceOnCacheBlock) { + return this.canPlaceOnCacheResult; + } else { + this.canPlaceOnCacheBlock = blockIn; + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanPlaceOn", 9)) { + NBTTagList nbttaglist = this.stackTagCompound.getTagList("CanPlaceOn", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + Block block = Block.getBlockFromName(nbttaglist.getStringTagAt(i)); + if (block == blockIn) { + this.canPlaceOnCacheResult = true; + return true; + } + } + } + + this.canPlaceOnCacheResult = false; + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSword.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSword.java new file mode 100644 index 0000000..61b3895 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSword.java @@ -0,0 +1,164 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Multimap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemSword extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemSword"); + } + + private float attackDamage; + private final Item.ToolMaterial material; + + public ItemSword(Item.ToolMaterial material) { + this.material = material; + this.maxStackSize = 1; + this.setMaxDamage(material.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabCombat); + this.attackDamage = 4.0F + material.getDamageVsEntity(); + } + + /**+ + * Returns the amount of damage this item will deal. One heart + * of damage is equal to 2 damage points. + */ + public float getDamageVsEntity() { + return this.material.getDamageVsEntity(); + } + + public float getStrVsBlock(ItemStack var1, Block block) { + if (block == Blocks.web) { + return 15.0F; + } else { + Material materialx = block.getMaterial(); + return materialx != Material.plants && materialx != Material.vine && materialx != Material.coral + && materialx != Material.leaves && materialx != Material.gourd ? 1.0F : 1.5F; + } + } + + /**+ + * Current implementations of this method in child classes do + * not use the entry argument beside ev. They just raise the + * damage on the stack. + */ + public boolean hitEntity(ItemStack itemstack, EntityLivingBase var2, EntityLivingBase entitylivingbase) { + itemstack.damageItem(1, entitylivingbase); + return true; + } + + /**+ + * Called when a Block is destroyed using this Item. Return true + * to trigger the "Use Item" statistic. + */ + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos blockpos, + EntityLivingBase entitylivingbase) { + if ((double) block.getBlockHardness(world, blockpos) != 0.0D) { + itemstack.damageItem(2, entitylivingbase); + } + + return true; + } + + /**+ + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /**+ + * returns the action that specifies what animation to play when + * the items is being used + */ + public EnumAction getItemUseAction(ItemStack var1) { + return EnumAction.BLOCK; + } + + /**+ + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack var1) { + return 72000; + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) { + entityplayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); + return itemstack; + } + + /**+ + * Check whether this Item can harvest the given Block + */ + public boolean canHarvestBlock(Block block) { + return block == Blocks.web; + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return this.material.getEnchantability(); + } + + /**+ + * Return the name for this tool's material. + */ + public String getToolMaterialName() { + return this.material.toString(); + } + + /**+ + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { + return this.material.getRepairItem() == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); + } + + public Multimap getItemAttributeModifiers() { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), + new AttributeModifier(itemModifierUUID, "Weapon modifier", (double) this.attackDamage, 0)); + return multimap; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemTool.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemTool.java new file mode 100644 index 0000000..f6399c0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemTool.java @@ -0,0 +1,125 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import com.google.common.collect.Multimap; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.creativetab.CreativeTabs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemTool extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemTool"); + } + + private Set effectiveBlocks; + protected float efficiencyOnProperMaterial = 4.0F; + private float damageVsEntity; + protected Item.ToolMaterial toolMaterial; + + protected ItemTool(float attackDamage, Item.ToolMaterial material, Set effectiveBlocks) { + this.toolMaterial = material; + this.effectiveBlocks = effectiveBlocks; + this.maxStackSize = 1; + this.setMaxDamage(material.getMaxUses()); + this.efficiencyOnProperMaterial = material.getEfficiencyOnProperMaterial(); + this.damageVsEntity = attackDamage + material.getDamageVsEntity(); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public float getStrVsBlock(ItemStack var1, Block block) { + return this.effectiveBlocks.contains(block) ? this.efficiencyOnProperMaterial : 1.0F; + } + + /**+ + * Current implementations of this method in child classes do + * not use the entry argument beside ev. They just raise the + * damage on the stack. + */ + public boolean hitEntity(ItemStack itemstack, EntityLivingBase var2, EntityLivingBase entitylivingbase) { + itemstack.damageItem(2, entitylivingbase); + return true; + } + + /**+ + * Called when a Block is destroyed using this Item. Return true + * to trigger the "Use Item" statistic. + */ + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos blockpos, + EntityLivingBase entitylivingbase) { + if ((double) block.getBlockHardness(world, blockpos) != 0.0D) { + itemstack.damageItem(1, entitylivingbase); + } + + return true; + } + + /**+ + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + public Item.ToolMaterial getToolMaterial() { + return this.toolMaterial; + } + + /**+ + * Return the enchantability factor of the item, most of the + * time is based on material. + */ + public int getItemEnchantability() { + return this.toolMaterial.getEnchantability(); + } + + /**+ + * Return the name for this tool's material. + */ + public String getToolMaterialName() { + return this.toolMaterial.toString(); + } + + /**+ + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack itemstack, ItemStack itemstack1) { + return this.toolMaterial.getRepairItem() == itemstack1.getItem() ? true + : super.getIsRepairable(itemstack, itemstack1); + } + + public Multimap getItemAttributeModifiers() { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), + new AttributeModifier(itemModifierUUID, "Tool modifier", (double) this.damageVsEntity, 0)); + return multimap; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemWritableBook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemWritableBook.java new file mode 100644 index 0000000..f48753a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemWritableBook.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemWritableBook extends Item { + + static { + __checkIntegratedContextValid("net/minecraft/item/ItemWritableBook"); + } + + public ItemWritableBook() { + this.setMaxStackSize(1); + } + + /**+ + * Called whenever this item is equipped and the right mouse + * button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) { + entityplayer.displayGUIBook(itemstack); + entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemstack; + } + + /**+ + * this method returns true if the book's NBT Tag List "pages" + * is valid + */ + public static boolean isNBTValid(NBTTagCompound nbt) { + if (nbt == null) { + return false; + } else if (!nbt.hasKey("pages", 9)) { + return false; + } else { + NBTTagList nbttaglist = nbt.getTagList("pages", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + String s = nbttaglist.getStringTagAt(i); + if (s == null) { + return false; + } + + if (s.length() > 32767) { + return false; + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/CraftingManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/CraftingManager.java new file mode 100644 index 0000000..0d1ba78 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/CraftingManager.java @@ -0,0 +1,530 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlabNew; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWall; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipeBookCloning; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipeFireworks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipeRepairItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesArmorDyes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesBanners; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesDyes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesIngots; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesMapCloning; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesMapExtending; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesTools; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.RecipesWeapons; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.ShapedRecipes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.ShapelessRecipes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CraftingManager { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/CraftingManager"); + } + + /**+ + * The static instance of this class + */ + private static final CraftingManager instance = new CraftingManager(); + /**+ + * A list of all the recipes added + */ + private final List recipes = Lists.newArrayList(); + + /**+ + * Returns the static instance of this class + */ + public static CraftingManager getInstance() { + return instance; + } + + private CraftingManager() { + (new RecipesTools()).addRecipes(this); + (new RecipesWeapons()).addRecipes(this); + (new RecipesIngots()).addRecipes(this); + (new RecipesFood()).addRecipes(this); + (new RecipesCrafting()).addRecipes(this); + (new RecipesArmor()).addRecipes(this); + (new RecipesDyes()).addRecipes(this); + this.recipes.add(new RecipesArmorDyes()); + this.recipes.add(new RecipeBookCloning()); + this.recipes.add(new RecipesMapCloning()); + this.recipes.add(new RecipesMapExtending()); + this.recipes.add(new RecipeFireworks()); + this.recipes.add(new RecipeRepairItem()); + (new RecipesBanners()).addRecipes(this); + this.addRecipe(new ItemStack(Items.paper, 3), new Object[] { "###", Character.valueOf('#'), Items.reeds }); + this.addShapelessRecipe(new ItemStack(Items.book, 1), + new Object[] { Items.paper, Items.paper, Items.paper, Items.leather }); + this.addShapelessRecipe(new ItemStack(Items.writable_book, 1), new Object[] { Items.book, + new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), Items.feather }); + this.addRecipe(new ItemStack(Blocks.oak_fence, 3), + new Object[] { "W#W", "W#W", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.birch_fence, 3), + new Object[] { "W#W", "W#W", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.spruce_fence, 3), + new Object[] { "W#W", "W#W", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.jungle_fence, 3), + new Object[] { "W#W", "W#W", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.acacia_fence, 3), + new Object[] { "W#W", "W#W", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.dark_oak_fence, 3), + new Object[] { "W#W", "W#W", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, BlockWall.EnumType.NORMAL.getMetadata()), + new Object[] { "###", "###", Character.valueOf('#'), Blocks.cobblestone }); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, BlockWall.EnumType.MOSSY.getMetadata()), + new Object[] { "###", "###", Character.valueOf('#'), Blocks.mossy_cobblestone }); + this.addRecipe(new ItemStack(Blocks.nether_brick_fence, 6), + new Object[] { "###", "###", Character.valueOf('#'), Blocks.nether_brick }); + this.addRecipe(new ItemStack(Blocks.oak_fence_gate, 1), + new Object[] { "#W#", "#W#", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.birch_fence_gate, 1), + new Object[] { "#W#", "#W#", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.spruce_fence_gate, 1), + new Object[] { "#W#", "#W#", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.jungle_fence_gate, 1), + new Object[] { "#W#", "#W#", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.acacia_fence_gate, 1), + new Object[] { "#W#", "#W#", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.dark_oak_fence_gate, 1), + new Object[] { "#W#", "#W#", Character.valueOf('#'), Items.stick, Character.valueOf('W'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.jukebox, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), + Blocks.planks, Character.valueOf('X'), Items.diamond }); + this.addRecipe(new ItemStack(Items.lead, 2), new Object[] { "~~ ", "~O ", " ~", Character.valueOf('~'), + Items.string, Character.valueOf('O'), Items.slime_ball }); + this.addRecipe(new ItemStack(Blocks.noteblock, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), + Blocks.planks, Character.valueOf('X'), Items.redstone }); + this.addRecipe(new ItemStack(Blocks.bookshelf, 1), new Object[] { "###", "XXX", "###", Character.valueOf('#'), + Blocks.planks, Character.valueOf('X'), Items.book }); + this.addRecipe(new ItemStack(Blocks.snow, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.snowball }); + this.addRecipe(new ItemStack(Blocks.snow_layer, 6), + new Object[] { "###", Character.valueOf('#'), Blocks.snow }); + this.addRecipe(new ItemStack(Blocks.clay, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.clay_ball }); + this.addRecipe(new ItemStack(Blocks.brick_block, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.brick }); + this.addRecipe(new ItemStack(Blocks.glowstone, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.glowstone_dust }); + this.addRecipe(new ItemStack(Blocks.quartz_block, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.quartz }); + this.addRecipe(new ItemStack(Blocks.wool, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.string }); + this.addRecipe(new ItemStack(Blocks.tnt, 1), new Object[] { "X#X", "#X#", "X#X", Character.valueOf('X'), + Items.gunpowder, Character.valueOf('#'), Blocks.sand }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.COBBLESTONE.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.cobblestone }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.STONE.getMetadata()), new Object[] { + "###", Character.valueOf('#'), new ItemStack(Blocks.stone, BlockStone.EnumType.STONE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.SAND.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.sandstone }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.BRICK.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.brick_block }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.stonebrick }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.NETHERBRICK.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.nether_brick }); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.QUARTZ.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.quartz_block }); + this.addRecipe(new ItemStack(Blocks.stone_slab2, 6, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata()), + new Object[] { "###", Character.valueOf('#'), Blocks.red_sandstone }); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 0), new Object[] { "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, BlockPlanks.EnumType.BIRCH.getMetadata()), + new Object[] { "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, BlockPlanks.EnumType.SPRUCE.getMetadata()), + new Object[] { "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, BlockPlanks.EnumType.JUNGLE.getMetadata()), + new Object[] { "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4), + new Object[] { "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4), + new Object[] { "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.ladder, 3), + new Object[] { "# #", "###", "# #", Character.valueOf('#'), Items.stick }); + this.addRecipe(new ItemStack(Items.oak_door, 3), new Object[] { "##", "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Items.spruce_door, 3), new Object[] { "##", "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()) }); + this.addRecipe(new ItemStack(Items.birch_door, 3), new Object[] { "##", "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata()) }); + this.addRecipe(new ItemStack(Items.jungle_door, 3), new Object[] { "##", "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()) }); + this.addRecipe(new ItemStack(Items.acacia_door, 3), new Object[] { "##", "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.ACACIA.getMetadata()) }); + this.addRecipe(new ItemStack(Items.dark_oak_door, 3), new Object[] { "##", "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.trapdoor, 2), + new Object[] { "###", "###", Character.valueOf('#'), Blocks.planks }); + this.addRecipe(new ItemStack(Items.iron_door, 3), + new Object[] { "##", "##", "##", Character.valueOf('#'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Blocks.iron_trapdoor, 1), + new Object[] { "##", "##", Character.valueOf('#'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Items.sign, 3), new Object[] { "###", "###", " X ", Character.valueOf('#'), + Blocks.planks, Character.valueOf('X'), Items.stick }); + this.addRecipe(new ItemStack(Items.cake, 1), + new Object[] { "AAA", "BEB", "CCC", Character.valueOf('A'), Items.milk_bucket, Character.valueOf('B'), + Items.sugar, Character.valueOf('C'), Items.wheat, Character.valueOf('E'), Items.egg }); + this.addRecipe(new ItemStack(Items.sugar, 1), new Object[] { "#", Character.valueOf('#'), Items.reeds }); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.OAK.getMetadata()), new Object[] { "#", + Character.valueOf('#'), new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.SPRUCE.getMetadata()), new Object[] { "#", + Character.valueOf('#'), new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.BIRCH.getMetadata()), new Object[] { "#", + Character.valueOf('#'), new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.BIRCH.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.JUNGLE.getMetadata()), new Object[] { "#", + Character.valueOf('#'), new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.planks, 4, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4), + new Object[] { "#", Character.valueOf('#'), + new ItemStack(Blocks.log2, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.planks, 4, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4), + new Object[] { "#", Character.valueOf('#'), + new ItemStack(Blocks.log2, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Items.stick, 4), new Object[] { "#", "#", Character.valueOf('#'), Blocks.planks }); + this.addRecipe(new ItemStack(Blocks.torch, 4), + new Object[] { "X", "#", Character.valueOf('X'), Items.coal, Character.valueOf('#'), Items.stick }); + this.addRecipe(new ItemStack(Blocks.torch, 4), new Object[] { "X", "#", Character.valueOf('X'), + new ItemStack(Items.coal, 1, 1), Character.valueOf('#'), Items.stick }); + this.addRecipe(new ItemStack(Items.bowl, 4), + new Object[] { "# #", " # ", Character.valueOf('#'), Blocks.planks }); + this.addRecipe(new ItemStack(Items.glass_bottle, 3), + new Object[] { "# #", " # ", Character.valueOf('#'), Blocks.glass }); + this.addRecipe(new ItemStack(Blocks.rail, 16), new Object[] { "X X", "X#X", "X X", Character.valueOf('X'), + Items.iron_ingot, Character.valueOf('#'), Items.stick }); + this.addRecipe(new ItemStack(Blocks.golden_rail, 6), new Object[] { "X X", "X#X", "XRX", Character.valueOf('X'), + Items.gold_ingot, Character.valueOf('R'), Items.redstone, Character.valueOf('#'), Items.stick }); + this.addRecipe(new ItemStack(Blocks.activator_rail, 6), + new Object[] { "XSX", "X#X", "XSX", Character.valueOf('X'), Items.iron_ingot, Character.valueOf('#'), + Blocks.redstone_torch, Character.valueOf('S'), Items.stick }); + this.addRecipe(new ItemStack(Blocks.detector_rail, 6), + new Object[] { "X X", "X#X", "XRX", Character.valueOf('X'), Items.iron_ingot, Character.valueOf('R'), + Items.redstone, Character.valueOf('#'), Blocks.stone_pressure_plate }); + this.addRecipe(new ItemStack(Items.minecart, 1), + new Object[] { "# #", "###", Character.valueOf('#'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Items.cauldron, 1), + new Object[] { "# #", "# #", "###", Character.valueOf('#'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Items.brewing_stand, 1), new Object[] { " B ", "###", Character.valueOf('#'), + Blocks.cobblestone, Character.valueOf('B'), Items.blaze_rod }); + this.addRecipe(new ItemStack(Blocks.lit_pumpkin, 1), new Object[] { "A", "B", Character.valueOf('A'), + Blocks.pumpkin, Character.valueOf('B'), Blocks.torch }); + this.addRecipe(new ItemStack(Items.chest_minecart, 1), new Object[] { "A", "B", Character.valueOf('A'), + Blocks.chest, Character.valueOf('B'), Items.minecart }); + this.addRecipe(new ItemStack(Items.furnace_minecart, 1), new Object[] { "A", "B", Character.valueOf('A'), + Blocks.furnace, Character.valueOf('B'), Items.minecart }); + this.addRecipe(new ItemStack(Items.tnt_minecart, 1), + new Object[] { "A", "B", Character.valueOf('A'), Blocks.tnt, Character.valueOf('B'), Items.minecart }); + this.addRecipe(new ItemStack(Items.hopper_minecart, 1), new Object[] { "A", "B", Character.valueOf('A'), + Blocks.hopper, Character.valueOf('B'), Items.minecart }); + this.addRecipe(new ItemStack(Items.boat, 1), + new Object[] { "# #", "###", Character.valueOf('#'), Blocks.planks }); + this.addRecipe(new ItemStack(Items.bucket, 1), + new Object[] { "# #", " # ", Character.valueOf('#'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Items.flower_pot, 1), + new Object[] { "# #", " # ", Character.valueOf('#'), Items.brick }); + this.addShapelessRecipe(new ItemStack(Items.flint_and_steel, 1), + new Object[] { new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1) }); + this.addRecipe(new ItemStack(Items.bread, 1), new Object[] { "###", Character.valueOf('#'), Items.wheat }); + this.addRecipe(new ItemStack(Blocks.oak_stairs, 4), new Object[] { "# ", "## ", "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.birch_stairs, 4), new Object[] { "# ", "## ", "###", + Character.valueOf('#'), new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.spruce_stairs, 4), new Object[] { "# ", "## ", "###", + Character.valueOf('#'), new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.jungle_stairs, 4), new Object[] { "# ", "## ", "###", + Character.valueOf('#'), new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.acacia_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Blocks.dark_oak_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), + new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4) }); + this.addRecipe(new ItemStack(Items.fishing_rod, 1), new Object[] { " #", " #X", "# X", Character.valueOf('#'), + Items.stick, Character.valueOf('X'), Items.string }); + this.addRecipe(new ItemStack(Items.carrot_on_a_stick, 1), new Object[] { "# ", " X", Character.valueOf('#'), + Items.fishing_rod, Character.valueOf('X'), Items.carrot }); + this.addRecipe(new ItemStack(Blocks.stone_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.cobblestone }); + this.addRecipe(new ItemStack(Blocks.brick_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.brick_block }); + this.addRecipe(new ItemStack(Blocks.stone_brick_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.stonebrick }); + this.addRecipe(new ItemStack(Blocks.nether_brick_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.nether_brick }); + this.addRecipe(new ItemStack(Blocks.sandstone_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.sandstone }); + this.addRecipe(new ItemStack(Blocks.red_sandstone_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.red_sandstone }); + this.addRecipe(new ItemStack(Blocks.quartz_stairs, 4), + new Object[] { "# ", "## ", "###", Character.valueOf('#'), Blocks.quartz_block }); + this.addRecipe(new ItemStack(Items.painting, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), + Items.stick, Character.valueOf('X'), Blocks.wool }); + this.addRecipe(new ItemStack(Items.item_frame, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), + Items.stick, Character.valueOf('X'), Items.leather }); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 0), new Object[] { "###", "#X#", "###", + Character.valueOf('#'), Items.gold_ingot, Character.valueOf('X'), Items.apple }); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 1), new Object[] { "###", "#X#", "###", + Character.valueOf('#'), Blocks.gold_block, Character.valueOf('X'), Items.apple }); + this.addRecipe(new ItemStack(Items.golden_carrot, 1, 0), new Object[] { "###", "#X#", "###", + Character.valueOf('#'), Items.gold_nugget, Character.valueOf('X'), Items.carrot }); + this.addRecipe(new ItemStack(Items.speckled_melon, 1), new Object[] { "###", "#X#", "###", + Character.valueOf('#'), Items.gold_nugget, Character.valueOf('X'), Items.melon }); + this.addRecipe(new ItemStack(Blocks.lever, 1), new Object[] { "X", "#", Character.valueOf('#'), + Blocks.cobblestone, Character.valueOf('X'), Items.stick }); + this.addRecipe(new ItemStack(Blocks.tripwire_hook, 2), new Object[] { "I", "S", "#", Character.valueOf('#'), + Blocks.planks, Character.valueOf('S'), Items.stick, Character.valueOf('I'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Blocks.redstone_torch, 1), + new Object[] { "X", "#", Character.valueOf('#'), Items.stick, Character.valueOf('X'), Items.redstone }); + this.addRecipe(new ItemStack(Items.repeater, 1), + new Object[] { "#X#", "III", Character.valueOf('#'), Blocks.redstone_torch, Character.valueOf('X'), + Items.redstone, Character.valueOf('I'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata()) }); + this.addRecipe(new ItemStack(Items.comparator, 1), + new Object[] { " # ", "#X#", "III", Character.valueOf('#'), Blocks.redstone_torch, + Character.valueOf('X'), Items.quartz, Character.valueOf('I'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata()) }); + this.addRecipe(new ItemStack(Items.clock, 1), new Object[] { " # ", "#X#", " # ", Character.valueOf('#'), + Items.gold_ingot, Character.valueOf('X'), Items.redstone }); + this.addRecipe(new ItemStack(Items.compass, 1), new Object[] { " # ", "#X#", " # ", Character.valueOf('#'), + Items.iron_ingot, Character.valueOf('X'), Items.redstone }); + this.addRecipe(new ItemStack(Items.map, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), + Items.paper, Character.valueOf('X'), Items.compass }); + this.addRecipe(new ItemStack(Blocks.stone_button, 1), new Object[] { "#", Character.valueOf('#'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.wooden_button, 1), + new Object[] { "#", Character.valueOf('#'), Blocks.planks }); + this.addRecipe(new ItemStack(Blocks.stone_pressure_plate, 1), new Object[] { "##", Character.valueOf('#'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata()) }); + this.addRecipe(new ItemStack(Blocks.wooden_pressure_plate, 1), + new Object[] { "##", Character.valueOf('#'), Blocks.planks }); + this.addRecipe(new ItemStack(Blocks.heavy_weighted_pressure_plate, 1), + new Object[] { "##", Character.valueOf('#'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Blocks.light_weighted_pressure_plate, 1), + new Object[] { "##", Character.valueOf('#'), Items.gold_ingot }); + this.addRecipe(new ItemStack(Blocks.dispenser, 1), new Object[] { "###", "#X#", "#R#", Character.valueOf('#'), + Blocks.cobblestone, Character.valueOf('X'), Items.bow, Character.valueOf('R'), Items.redstone }); + this.addRecipe(new ItemStack(Blocks.dropper, 1), new Object[] { "###", "# #", "#R#", Character.valueOf('#'), + Blocks.cobblestone, Character.valueOf('R'), Items.redstone }); + this.addRecipe(new ItemStack(Blocks.piston, 1), + new Object[] { "TTT", "#X#", "#R#", Character.valueOf('#'), Blocks.cobblestone, Character.valueOf('X'), + Items.iron_ingot, Character.valueOf('R'), Items.redstone, Character.valueOf('T'), + Blocks.planks }); + this.addRecipe(new ItemStack(Blocks.sticky_piston, 1), new Object[] { "S", "P", Character.valueOf('S'), + Items.slime_ball, Character.valueOf('P'), Blocks.piston }); + this.addRecipe(new ItemStack(Items.bed, 1), new Object[] { "###", "XXX", Character.valueOf('#'), Blocks.wool, + Character.valueOf('X'), Blocks.planks }); + this.addRecipe(new ItemStack(Blocks.enchanting_table, 1), + new Object[] { " B ", "D#D", "###", Character.valueOf('#'), Blocks.obsidian, Character.valueOf('B'), + Items.book, Character.valueOf('D'), Items.diamond }); + this.addRecipe(new ItemStack(Blocks.anvil, 1), new Object[] { "III", " i ", "iii", Character.valueOf('I'), + Blocks.iron_block, Character.valueOf('i'), Items.iron_ingot }); + this.addRecipe(new ItemStack(Items.leather), + new Object[] { "##", "##", Character.valueOf('#'), Items.rabbit_hide }); + this.addShapelessRecipe(new ItemStack(Items.ender_eye, 1), + new Object[] { Items.ender_pearl, Items.blaze_powder }); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), + new Object[] { Items.gunpowder, Items.blaze_powder, Items.coal }); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), + new Object[] { Items.gunpowder, Items.blaze_powder, new ItemStack(Items.coal, 1, 1) }); + this.addRecipe(new ItemStack(Blocks.daylight_detector), + new Object[] { "GGG", "QQQ", "WWW", Character.valueOf('G'), Blocks.glass, Character.valueOf('Q'), + Items.quartz, Character.valueOf('W'), Blocks.wooden_slab }); + this.addRecipe(new ItemStack(Blocks.hopper), new Object[] { "I I", "ICI", " I ", Character.valueOf('I'), + Items.iron_ingot, Character.valueOf('C'), Blocks.chest }); + this.addRecipe(new ItemStack(Items.armor_stand, 1), + new Object[] { "///", " / ", "/_/", Character.valueOf('/'), Items.stick, Character.valueOf('_'), + new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.STONE.getMetadata()) }); + Collections.sort(this.recipes, new Comparator() { + public int compare(IRecipe parIRecipe, IRecipe parIRecipe2) { + return parIRecipe instanceof ShapelessRecipes && parIRecipe2 instanceof ShapedRecipes ? 1 + : (parIRecipe2 instanceof ShapelessRecipes && parIRecipe instanceof ShapedRecipes ? -1 + : (parIRecipe2.getRecipeSize() < parIRecipe.getRecipeSize() ? -1 + : (parIRecipe2.getRecipeSize() > parIRecipe.getRecipeSize() ? 1 : 0))); + } + }); + } + + /**+ + * Adds an IRecipe to the list of crafting recipes. + */ + public ShapedRecipes addRecipe(ItemStack stack, Object... recipeComponents) { + String s = ""; + int i = 0; + int j = 0; + int k = 0; + if (recipeComponents[i] instanceof String[]) { + String[] astring = (String[]) ((String[]) recipeComponents[i++]); + + for (int l = 0; l < astring.length; ++l) { + String s2 = astring[l]; + ++k; + j = s2.length(); + s = s + s2; + } + } else { + while (recipeComponents[i] instanceof String) { + String s1 = (String) recipeComponents[i++]; + ++k; + j = s1.length(); + s = s + s1; + } + } + + HashMap hashmap; + for (hashmap = Maps.newHashMap(); i < recipeComponents.length; i += 2) { + Character character = (Character) recipeComponents[i]; + ItemStack itemstack = null; + if (recipeComponents[i + 1] instanceof Item) { + itemstack = new ItemStack((Item) recipeComponents[i + 1]); + } else if (recipeComponents[i + 1] instanceof Block) { + itemstack = new ItemStack((Block) recipeComponents[i + 1], 1, 32767); + } else if (recipeComponents[i + 1] instanceof ItemStack) { + itemstack = (ItemStack) recipeComponents[i + 1]; + } + + hashmap.put(character, itemstack); + } + + ItemStack[] aitemstack = new ItemStack[j * k]; + + for (int i1 = 0; i1 < j * k; ++i1) { + char c0 = s.charAt(i1); + if (hashmap.containsKey(Character.valueOf(c0))) { + aitemstack[i1] = ((ItemStack) hashmap.get(Character.valueOf(c0))).copy(); + } else { + aitemstack[i1] = null; + } + } + + ShapedRecipes shapedrecipes = new ShapedRecipes(j, k, aitemstack, stack); + this.recipes.add(shapedrecipes); + return shapedrecipes; + } + + /**+ + * Adds a shapeless crafting recipe to the the game. + */ + public void addShapelessRecipe(ItemStack stack, Object... recipeComponents) { + ArrayList arraylist = Lists.newArrayList(); + + for (Object object : recipeComponents) { + if (object instanceof ItemStack) { + arraylist.add(((ItemStack) object).copy()); + } else if (object instanceof Item) { + arraylist.add(new ItemStack((Item) object)); + } else { + if (!(object instanceof Block)) { + throw new IllegalArgumentException( + "Invalid shapeless recipe: unknown type " + object.getClass().getName() + "!"); + } + + arraylist.add(new ItemStack((Block) object)); + } + } + + this.recipes.add(new ShapelessRecipes(stack, arraylist)); + } + + /**+ + * Adds an IRecipe to the list of crafting recipes. + */ + public void addRecipe(IRecipe recipe) { + this.recipes.add(recipe); + } + + /**+ + * Retrieves an ItemStack that has multiple recipes for it. + */ + public ItemStack findMatchingRecipe(InventoryCrafting worldIn, World parWorld) { + for (IRecipe irecipe : this.recipes) { + if (irecipe.matches(worldIn, parWorld)) { + return irecipe.getCraftingResult(worldIn); + } + } + + return null; + } + + public ItemStack[] func_180303_b(InventoryCrafting worldIn, World parWorld) { + for (IRecipe irecipe : this.recipes) { + if (irecipe.matches(worldIn, parWorld)) { + return irecipe.getRemainingItems(worldIn); + } + } + + ItemStack[] aitemstack = new ItemStack[worldIn.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + aitemstack[i] = worldIn.getStackInSlot(i); + } + + return aitemstack; + } + + /**+ + * returns the List<> of all recipes + */ + public List getRecipeList() { + return this.recipes; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/FurnaceRecipes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/FurnaceRecipes.java new file mode 100644 index 0000000..508c5e3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/FurnaceRecipes.java @@ -0,0 +1,151 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFishFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 FurnaceRecipes { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/FurnaceRecipes"); + } + + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); + private Map smeltingList = Maps.newHashMap(); + private Map experienceList = Maps.newHashMap(); + + /**+ + * Returns an instance of FurnaceRecipes. + */ + public static FurnaceRecipes instance() { + return smeltingBase; + } + + private FurnaceRecipes() { + this.addSmeltingRecipeForBlock(Blocks.iron_ore, new ItemStack(Items.iron_ingot), 0.7F); + this.addSmeltingRecipeForBlock(Blocks.gold_ore, new ItemStack(Items.gold_ingot), 1.0F); + this.addSmeltingRecipeForBlock(Blocks.diamond_ore, new ItemStack(Items.diamond), 1.0F); + this.addSmeltingRecipeForBlock(Blocks.sand, new ItemStack(Blocks.glass), 0.1F); + this.addSmelting(Items.porkchop, new ItemStack(Items.cooked_porkchop), 0.35F); + this.addSmelting(Items.beef, new ItemStack(Items.cooked_beef), 0.35F); + this.addSmelting(Items.chicken, new ItemStack(Items.cooked_chicken), 0.35F); + this.addSmelting(Items.rabbit, new ItemStack(Items.cooked_rabbit), 0.35F); + this.addSmelting(Items.mutton, new ItemStack(Items.cooked_mutton), 0.35F); + this.addSmeltingRecipeForBlock(Blocks.cobblestone, new ItemStack(Blocks.stone), 0.1F); + this.addSmeltingRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.DEFAULT_META), + new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CRACKED_META), 0.1F); + this.addSmelting(Items.clay_ball, new ItemStack(Items.brick), 0.3F); + this.addSmeltingRecipeForBlock(Blocks.clay, new ItemStack(Blocks.hardened_clay), 0.35F); + this.addSmeltingRecipeForBlock(Blocks.cactus, new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage()), + 0.2F); + this.addSmeltingRecipeForBlock(Blocks.log, new ItemStack(Items.coal, 1, 1), 0.15F); + this.addSmeltingRecipeForBlock(Blocks.log2, new ItemStack(Items.coal, 1, 1), 0.15F); + this.addSmeltingRecipeForBlock(Blocks.emerald_ore, new ItemStack(Items.emerald), 1.0F); + this.addSmelting(Items.potato, new ItemStack(Items.baked_potato), 0.35F); + this.addSmeltingRecipeForBlock(Blocks.netherrack, new ItemStack(Items.netherbrick), 0.1F); + this.addSmeltingRecipe(new ItemStack(Blocks.sponge, 1, 1), new ItemStack(Blocks.sponge, 1, 0), 0.15F); + + for (ItemFishFood.FishType itemfishfood$fishtype : ItemFishFood.FishType.values()) { + if (itemfishfood$fishtype.canCook()) { + this.addSmeltingRecipe(new ItemStack(Items.fish, 1, itemfishfood$fishtype.getMetadata()), + new ItemStack(Items.cooked_fish, 1, itemfishfood$fishtype.getMetadata()), 0.35F); + } + } + + this.addSmeltingRecipeForBlock(Blocks.coal_ore, new ItemStack(Items.coal), 0.1F); + this.addSmeltingRecipeForBlock(Blocks.redstone_ore, new ItemStack(Items.redstone), 0.7F); + this.addSmeltingRecipeForBlock(Blocks.lapis_ore, new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + 0.2F); + this.addSmeltingRecipeForBlock(Blocks.quartz_ore, new ItemStack(Items.quartz), 0.2F); + } + + /**+ + * Adds a smelting recipe, where the input item is an instance + * of Block. + */ + public void addSmeltingRecipeForBlock(Block input, ItemStack stack, float experience) { + this.addSmelting(Item.getItemFromBlock(input), stack, experience); + } + + /**+ + * Adds a smelting recipe using an Item as the input item. + */ + public void addSmelting(Item input, ItemStack stack, float experience) { + this.addSmeltingRecipe(new ItemStack(input, 1, 32767), stack, experience); + } + + /**+ + * Adds a smelting recipe using an ItemStack as the input for + * the recipe. + */ + public void addSmeltingRecipe(ItemStack input, ItemStack stack, float experience) { + this.smeltingList.put(input, stack); + this.experienceList.put(stack, Float.valueOf(experience)); + } + + /**+ + * Returns the smelting result of an item. + */ + public ItemStack getSmeltingResult(ItemStack stack) { + for (Entry entry : this.smeltingList.entrySet()) { + if (this.compareItemStacks(stack, (ItemStack) entry.getKey())) { + return (ItemStack) entry.getValue(); + } + } + + return null; + } + + /**+ + * Compares two itemstacks to ensure that they are the same. + * This checks both the item and the metadata of the item. + */ + private boolean compareItemStacks(ItemStack stack1, ItemStack stack2) { + return stack2.getItem() == stack1.getItem() + && (stack2.getMetadata() == 32767 || stack2.getMetadata() == stack1.getMetadata()); + } + + public Map getSmeltingList() { + return this.smeltingList; + } + + public float getSmeltingExperience(ItemStack stack) { + for (Entry entry : this.experienceList.entrySet()) { + if (this.compareItemStacks(stack, (ItemStack) entry.getKey())) { + return ((Float) entry.getValue()).floatValue(); + } + } + + return 0.0F; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/IRecipe.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/IRecipe.java new file mode 100644 index 0000000..e8f1a82 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/IRecipe.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IRecipe { + /**+ + * Used to check if a recipe matches current crafting inventory + */ + boolean matches(InventoryCrafting var1, World var2); + + /**+ + * Returns an Item that is the result of this recipe + */ + ItemStack getCraftingResult(InventoryCrafting var1); + + /**+ + * Returns the size of the recipe area + */ + int getRecipeSize(); + + ItemStack getRecipeOutput(); + + ItemStack[] getRemainingItems(InventoryCrafting var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeBookCloning.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeBookCloning.java new file mode 100644 index 0000000..ea8477c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeBookCloning.java @@ -0,0 +1,132 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEditableBook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipeBookCloning implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipeBookCloning"); + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inventorycrafting.getSizeInventory(); ++j) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(j); + if (itemstack1 != null) { + if (itemstack1.getItem() == Items.written_book) { + if (itemstack != null) { + return false; + } + + itemstack = itemstack1; + } else { + if (itemstack1.getItem() != Items.writable_book) { + return false; + } + + ++i; + } + } + } + + return itemstack != null && i > 0; + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inventorycrafting.getSizeInventory(); ++j) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(j); + if (itemstack1 != null) { + if (itemstack1.getItem() == Items.written_book) { + if (itemstack != null) { + return null; + } + + itemstack = itemstack1; + } else { + if (itemstack1.getItem() != Items.writable_book) { + return null; + } + + ++i; + } + } + } + + if (itemstack != null && i >= 1 && ItemEditableBook.getGeneration(itemstack) < 2) { + ItemStack itemstack2 = new ItemStack(Items.written_book, i); + itemstack2.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + itemstack2.getTagCompound().setInteger("generation", ItemEditableBook.getGeneration(itemstack) + 1); + if (itemstack.hasDisplayName()) { + itemstack2.setStackDisplayName(itemstack.getDisplayName()); + } + + return itemstack2; + } else { + return null; + } + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 9; + } + + public ItemStack getRecipeOutput() { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem() instanceof ItemEditableBook) { + aitemstack[i] = itemstack; + break; + } + } + + return aitemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeFireworks.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeFireworks.java new file mode 100644 index 0000000..4eb8a0a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeFireworks.java @@ -0,0 +1,220 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDye; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipeFireworks implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipeFireworks"); + } + + private ItemStack field_92102_a; + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + this.field_92102_a = null; + int i = 0; + int j = 0; + int k = 0; + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = 0; k1 < inventorycrafting.getSizeInventory(); ++k1) { + ItemStack itemstack = inventorycrafting.getStackInSlot(k1); + if (itemstack != null) { + if (itemstack.getItem() == Items.gunpowder) { + ++j; + } else if (itemstack.getItem() == Items.firework_charge) { + ++l; + } else if (itemstack.getItem() == Items.dye) { + ++k; + } else if (itemstack.getItem() == Items.paper) { + ++i; + } else if (itemstack.getItem() == Items.glowstone_dust) { + ++i1; + } else if (itemstack.getItem() == Items.diamond) { + ++i1; + } else if (itemstack.getItem() == Items.fire_charge) { + ++j1; + } else if (itemstack.getItem() == Items.feather) { + ++j1; + } else if (itemstack.getItem() == Items.gold_nugget) { + ++j1; + } else { + if (itemstack.getItem() != Items.skull) { + return false; + } + + ++j1; + } + } + } + + i1 = i1 + k + j1; + if (j <= 3 && i <= 1) { + if (j >= 1 && i == 1 && i1 == 0) { + this.field_92102_a = new ItemStack(Items.fireworks); + if (l > 0) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + for (int k2 = 0; k2 < inventorycrafting.getSizeInventory(); ++k2) { + ItemStack itemstack3 = inventorycrafting.getStackInSlot(k2); + if (itemstack3 != null && itemstack3.getItem() == Items.firework_charge + && itemstack3.hasTagCompound() && itemstack3.getTagCompound().hasKey("Explosion", 10)) { + nbttaglist.appendTag(itemstack3.getTagCompound().getCompoundTag("Explosion")); + } + } + + nbttagcompound3.setTag("Explosions", nbttaglist); + nbttagcompound3.setByte("Flight", (byte) j); + nbttagcompound1.setTag("Fireworks", nbttagcompound3); + this.field_92102_a.setTagCompound(nbttagcompound1); + } + + return true; + } else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1) { + this.field_92102_a = new ItemStack(Items.firework_charge); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + byte b0 = 0; + ArrayList arraylist = Lists.newArrayList(); + + for (int l1 = 0; l1 < inventorycrafting.getSizeInventory(); ++l1) { + ItemStack itemstack2 = inventorycrafting.getStackInSlot(l1); + if (itemstack2 != null) { + if (itemstack2.getItem() == Items.dye) { + arraylist.add(Integer.valueOf(ItemDye.dyeColors[itemstack2.getMetadata() & 15])); + } else if (itemstack2.getItem() == Items.glowstone_dust) { + nbttagcompound2.setBoolean("Flicker", true); + } else if (itemstack2.getItem() == Items.diamond) { + nbttagcompound2.setBoolean("Trail", true); + } else if (itemstack2.getItem() == Items.fire_charge) { + b0 = 1; + } else if (itemstack2.getItem() == Items.feather) { + b0 = 4; + } else if (itemstack2.getItem() == Items.gold_nugget) { + b0 = 2; + } else if (itemstack2.getItem() == Items.skull) { + b0 = 3; + } + } + } + + int[] aint1 = new int[arraylist.size()]; + + for (int l2 = 0; l2 < aint1.length; ++l2) { + aint1[l2] = ((Integer) arraylist.get(l2)).intValue(); + } + + nbttagcompound2.setIntArray("Colors", aint1); + nbttagcompound2.setByte("Type", b0); + nbttagcompound.setTag("Explosion", nbttagcompound2); + this.field_92102_a.setTagCompound(nbttagcompound); + return true; + } else if (j == 0 && i == 0 && l == 1 && k > 0 && k == i1) { + ArrayList arraylist1 = Lists.newArrayList(); + + for (int i2 = 0; i2 < inventorycrafting.getSizeInventory(); ++i2) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(i2); + if (itemstack1 != null) { + if (itemstack1.getItem() == Items.dye) { + arraylist1.add(Integer.valueOf(ItemDye.dyeColors[itemstack1.getMetadata() & 15])); + } else if (itemstack1.getItem() == Items.firework_charge) { + this.field_92102_a = itemstack1.copy(); + this.field_92102_a.stackSize = 1; + } + } + } + + int[] aint = new int[arraylist1.size()]; + + for (int j2 = 0; j2 < aint.length; ++j2) { + aint[j2] = ((Integer) arraylist1.get(j2)).intValue(); + } + + if (this.field_92102_a != null && this.field_92102_a.hasTagCompound()) { + NBTTagCompound nbttagcompound4 = this.field_92102_a.getTagCompound().getCompoundTag("Explosion"); + if (nbttagcompound4 == null) { + return false; + } else { + nbttagcompound4.setIntArray("FadeColors", aint); + return true; + } + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting var1) { + return this.field_92102_a.copy(); + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 10; + } + + public ItemStack getRecipeOutput() { + return this.field_92102_a; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeRepairItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeRepairItem.java new file mode 100644 index 0000000..bfd0638 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeRepairItem.java @@ -0,0 +1,126 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipeRepairItem implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipeRepairItem"); + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null) { + arraylist.add(itemstack); + if (arraylist.size() > 1) { + ItemStack itemstack1 = (ItemStack) arraylist.get(0); + if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 + || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable()) { + return false; + } + } + } + } + + return arraylist.size() == 2; + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null) { + arraylist.add(itemstack); + if (arraylist.size() > 1) { + ItemStack itemstack1 = (ItemStack) arraylist.get(0); + if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 + || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable()) { + return null; + } + } + } + } + + if (arraylist.size() == 2) { + ItemStack itemstack2 = (ItemStack) arraylist.get(0); + ItemStack itemstack3 = (ItemStack) arraylist.get(1); + if (itemstack2.getItem() == itemstack3.getItem() && itemstack2.stackSize == 1 && itemstack3.stackSize == 1 + && itemstack2.getItem().isDamageable()) { + Item item = itemstack2.getItem(); + int j = item.getMaxDamage() - itemstack2.getItemDamage(); + int k = item.getMaxDamage() - itemstack3.getItemDamage(); + int l = j + k + item.getMaxDamage() * 5 / 100; + int i1 = item.getMaxDamage() - l; + if (i1 < 0) { + i1 = 0; + } + + return new ItemStack(itemstack2.getItem(), 1, i1); + } + } + + return null; + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 4; + } + + public ItemStack getRecipeOutput() { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmor.java new file mode 100644 index 0000000..e7aa1f5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmor.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesArmor { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesArmor"); + } + + private String[][] recipePatterns = new String[][] { { "XXX", "X X" }, { "X X", "XXX", "XXX" }, + { "XXX", "X X", "X X" }, { "X X", "X X" } }; + private Item[][] recipeItems = new Item[][] { { Items.leather, Items.iron_ingot, Items.diamond, Items.gold_ingot }, + { Items.leather_helmet, Items.iron_helmet, Items.diamond_helmet, Items.golden_helmet }, + { Items.leather_chestplate, Items.iron_chestplate, Items.diamond_chestplate, Items.golden_chestplate }, + { Items.leather_leggings, Items.iron_leggings, Items.diamond_leggings, Items.golden_leggings }, + { Items.leather_boots, Items.iron_boots, Items.diamond_boots, Items.golden_boots } }; + + /**+ + * Adds the armor recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager craftManager) { + for (int i = 0; i < this.recipeItems[0].length; ++i) { + Item item = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) { + Item item1 = this.recipeItems[j + 1][i]; + craftManager.addRecipe(new ItemStack(item1), + new Object[] { this.recipePatterns[j], Character.valueOf('X'), item }); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmorDyes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmorDyes.java new file mode 100644 index 0000000..eca1f80 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmorDyes.java @@ -0,0 +1,163 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemArmor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesArmorDyes implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesArmorDyes"); + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inv, World worldIn) { + ItemStack itemstack = null; + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < inv.getSizeInventory(); ++i) { + ItemStack itemstack1 = inv.getStackInSlot(i); + if (itemstack1 != null) { + if (itemstack1.getItem() instanceof ItemArmor) { + ItemArmor itemarmor = (ItemArmor) itemstack1.getItem(); + if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null) { + return false; + } + + itemstack = itemstack1; + } else { + if (itemstack1.getItem() != Items.dye) { + return false; + } + + arraylist.add(itemstack1); + } + } + } + + return itemstack != null && !arraylist.isEmpty(); + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting inv) { + ItemStack itemstack = null; + int[] aint = new int[3]; + int i = 0; + int j = 0; + ItemArmor itemarmor = null; + + for (int k = 0; k < inv.getSizeInventory(); ++k) { + ItemStack itemstack1 = inv.getStackInSlot(k); + if (itemstack1 != null) { + if (itemstack1.getItem() instanceof ItemArmor) { + itemarmor = (ItemArmor) itemstack1.getItem(); + if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null) { + return null; + } + + itemstack = itemstack1.copy(); + itemstack.stackSize = 1; + if (itemarmor.hasColor(itemstack1)) { + int l = itemarmor.getColor(itemstack); + float f = (float) (l >> 16 & 255) / 255.0F; + float f1 = (float) (l >> 8 & 255) / 255.0F; + float f2 = (float) (l & 255) / 255.0F; + i = (int) ((float) i + Math.max(f, Math.max(f1, f2)) * 255.0F); + aint[0] = (int) ((float) aint[0] + f * 255.0F); + aint[1] = (int) ((float) aint[1] + f1 * 255.0F); + aint[2] = (int) ((float) aint[2] + f2 * 255.0F); + ++j; + } + } else { + if (itemstack1.getItem() != Items.dye) { + return null; + } + + float[] afloat = EntitySheep.func_175513_a(EnumDyeColor.byDyeDamage(itemstack1.getMetadata())); + int l1 = (int) (afloat[0] * 255.0F); + int i2 = (int) (afloat[1] * 255.0F); + int j2 = (int) (afloat[2] * 255.0F); + i += Math.max(l1, Math.max(i2, j2)); + aint[0] += l1; + aint[1] += i2; + aint[2] += j2; + ++j; + } + } + } + + if (itemarmor == null) { + return null; + } else { + int i1 = aint[0] / j; + int j1 = aint[1] / j; + int k1 = aint[2] / j; + float f3 = (float) i / (float) j; + float f4 = (float) Math.max(i1, Math.max(j1, k1)); + i1 = (int) ((float) i1 * f3 / f4); + j1 = (int) ((float) j1 * f3 / f4); + k1 = (int) ((float) k1 * f3 / f4); + int k2 = (i1 << 8) + j1; + k2 = (k2 << 8) + k1; + itemarmor.setColor(itemstack, k2); + return itemstack; + } + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 10; + } + + public ItemStack getRecipeOutput() { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inv.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesBanners.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesBanners.java new file mode 100644 index 0000000..e06f8e4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesBanners.java @@ -0,0 +1,321 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesBanners { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesBanners"); + } + + /**+ + * Adds the banner recipes to the CraftingManager. + */ + void addRecipes(CraftingManager parCraftingManager) { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { + parCraftingManager.addRecipe(new ItemStack(Items.banner, 1, enumdyecolor.getDyeDamage()), + new Object[] { "###", "###", " | ", Character.valueOf('#'), + new ItemStack(Blocks.wool, 1, enumdyecolor.getMetadata()), Character.valueOf('|'), + Items.stick }); + } + + parCraftingManager.addRecipe(new RecipesBanners.RecipeDuplicatePattern()); + parCraftingManager.addRecipe(new RecipesBanners.RecipeAddPattern()); + } + + static class RecipeAddPattern implements IRecipe { + private RecipeAddPattern() { + } + + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + boolean flag = false; + + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem() == Items.banner) { + if (flag) { + return false; + } + + if (TileEntityBanner.getPatterns(itemstack) >= 6) { + return false; + } + + flag = true; + } + } + + if (!flag) { + return false; + } else { + return this.func_179533_c(inventorycrafting) != null; + } + } + + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + ItemStack itemstack = null; + + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(i); + if (itemstack1 != null && itemstack1.getItem() == Items.banner) { + itemstack = itemstack1.copy(); + itemstack.stackSize = 1; + break; + } + } + + TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = this + .func_179533_c(inventorycrafting); + if (tileentitybanner$enumbannerpattern != null) { + int k = 0; + + for (int j = 0; j < inventorycrafting.getSizeInventory(); ++j) { + ItemStack itemstack2 = inventorycrafting.getStackInSlot(j); + if (itemstack2 != null && itemstack2.getItem() == Items.dye) { + k = itemstack2.getMetadata(); + break; + } + } + + NBTTagCompound nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true); + NBTTagList nbttaglist = null; + if (nbttagcompound1.hasKey("Patterns", 9)) { + nbttaglist = nbttagcompound1.getTagList("Patterns", 10); + } else { + nbttaglist = new NBTTagList(); + nbttagcompound1.setTag("Patterns", nbttaglist); + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID()); + nbttagcompound.setInteger("Color", k); + nbttaglist.appendTag(nbttagcompound); + } + + return itemstack; + } + + public int getRecipeSize() { + return 10; + } + + public ItemStack getRecipeOutput() { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } + + private TileEntityBanner.EnumBannerPattern func_179533_c(InventoryCrafting parInventoryCrafting) { + for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : TileEntityBanner.EnumBannerPattern + .values()) { + if (tileentitybanner$enumbannerpattern.hasValidCrafting()) { + boolean flag = true; + if (tileentitybanner$enumbannerpattern.hasCraftingStack()) { + boolean flag1 = false; + boolean flag2 = false; + + for (int i = 0; i < parInventoryCrafting.getSizeInventory() && flag; ++i) { + ItemStack itemstack = parInventoryCrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem() != Items.banner) { + if (itemstack.getItem() == Items.dye) { + if (flag2) { + flag = false; + break; + } + + flag2 = true; + } else { + if (flag1 || !itemstack + .isItemEqual(tileentitybanner$enumbannerpattern.getCraftingStack())) { + flag = false; + break; + } + + flag1 = true; + } + } + } + + if (!flag1) { + flag = false; + } + } else if (parInventoryCrafting + .getSizeInventory() == tileentitybanner$enumbannerpattern.getCraftingLayers().length + * tileentitybanner$enumbannerpattern.getCraftingLayers()[0].length()) { + int j = -1; + + for (int k = 0; k < parInventoryCrafting.getSizeInventory() && flag; ++k) { + int l = k / 3; + int i1 = k % 3; + ItemStack itemstack1 = parInventoryCrafting.getStackInSlot(k); + if (itemstack1 != null && itemstack1.getItem() != Items.banner) { + if (itemstack1.getItem() != Items.dye) { + flag = false; + break; + } + + if (j != -1 && j != itemstack1.getMetadata()) { + flag = false; + break; + } + + if (tileentitybanner$enumbannerpattern.getCraftingLayers()[l].charAt(i1) == 32) { + flag = false; + break; + } + + j = itemstack1.getMetadata(); + } else if (tileentitybanner$enumbannerpattern.getCraftingLayers()[l].charAt(i1) != 32) { + flag = false; + break; + } + } + } else { + flag = false; + } + + if (flag) { + return tileentitybanner$enumbannerpattern; + } + } + } + + return null; + } + } + + static class RecipeDuplicatePattern implements IRecipe { + private RecipeDuplicatePattern() { + } + + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + ItemStack itemstack = null; + ItemStack itemstack1 = null; + + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack2 = inventorycrafting.getStackInSlot(i); + if (itemstack2 != null) { + if (itemstack2.getItem() != Items.banner) { + return false; + } + + if (itemstack != null && itemstack1 != null) { + return false; + } + + int j = TileEntityBanner.getBaseColor(itemstack2); + boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0; + if (itemstack != null) { + if (flag) { + return false; + } + + if (j != TileEntityBanner.getBaseColor(itemstack)) { + return false; + } + + itemstack1 = itemstack2; + } else if (itemstack1 != null) { + if (!flag) { + return false; + } + + if (j != TileEntityBanner.getBaseColor(itemstack1)) { + return false; + } + + itemstack = itemstack2; + } else if (flag) { + itemstack = itemstack2; + } else { + itemstack1 = itemstack2; + } + } + } + + return itemstack != null && itemstack1 != null; + } + + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && TileEntityBanner.getPatterns(itemstack) > 0) { + ItemStack itemstack1 = itemstack.copy(); + itemstack1.stackSize = 1; + return itemstack1; + } + } + + return null; + } + + public int getRecipeSize() { + return 2; + } + + public ItemStack getRecipeOutput() { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null) { + if (itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } else if (itemstack.hasTagCompound() && TileEntityBanner.getPatterns(itemstack) > 0) { + aitemstack[i] = itemstack.copy(); + aitemstack[i].stackSize = 1; + } + } + } + + return aitemstack; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesCrafting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesCrafting.java new file mode 100644 index 0000000..97b9dad --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesCrafting.java @@ -0,0 +1,138 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPrismarine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockQuartz; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRedSandstone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSandStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlabNew; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesCrafting { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesCrafting"); + } + + /**+ + * Adds the crafting recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager parCraftingManager) { + parCraftingManager.addRecipe(new ItemStack(Blocks.chest), + new Object[] { "###", "# #", "###", Character.valueOf('#'), Blocks.planks }); + parCraftingManager.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] { "#-", Character.valueOf('#'), + Blocks.chest, Character.valueOf('-'), Blocks.tripwire_hook }); + parCraftingManager.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] { "###", "#E#", "###", + Character.valueOf('#'), Blocks.obsidian, Character.valueOf('E'), Items.ender_eye }); + parCraftingManager.addRecipe(new ItemStack(Blocks.furnace), + new Object[] { "###", "# #", "###", Character.valueOf('#'), Blocks.cobblestone }); + parCraftingManager.addRecipe(new ItemStack(Blocks.crafting_table), + new Object[] { "##", "##", Character.valueOf('#'), Blocks.planks }); + parCraftingManager.addRecipe(new ItemStack(Blocks.sandstone), new Object[] { "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.sand, 1, BlockSand.EnumType.SAND.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.red_sandstone), new Object[] { "##", "##", + Character.valueOf('#'), new ItemStack(Blocks.sand, 1, BlockSand.EnumType.RED_SAND.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.sandstone, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), + new Object[] { "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.DEFAULT.getMetadata()) }); + parCraftingManager.addRecipe( + new ItemStack(Blocks.red_sandstone, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), + new Object[] { "##", "##", Character.valueOf('#'), + new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), + new Object[] { "#", "#", Character.valueOf('#'), + new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SAND.getMetadata()) }); + parCraftingManager.addRecipe( + new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), + new Object[] { "#", "#", Character.valueOf('#'), + new ItemStack(Blocks.stone_slab2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), + new Object[] { "#", "#", Character.valueOf('#'), + new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.quartz_block, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), + new Object[] { "#", "#", Character.valueOf('#'), + new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.DEFAULT.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] { "##", "##", + Character.valueOf('#'), new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CHISELED_META), + new Object[] { "#", "#", Character.valueOf('#'), + new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.MOSSY_META), + new Object[] { Blocks.stonebrick, Blocks.vine }); + parCraftingManager.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone, 1), + new Object[] { Blocks.cobblestone, Blocks.vine }); + parCraftingManager.addRecipe(new ItemStack(Blocks.iron_bars, 16), + new Object[] { "###", "###", Character.valueOf('#'), Items.iron_ingot }); + parCraftingManager.addRecipe(new ItemStack(Blocks.glass_pane, 16), + new Object[] { "###", "###", Character.valueOf('#'), Blocks.glass }); + parCraftingManager.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] { " R ", "RGR", " R ", + Character.valueOf('R'), Items.redstone, Character.valueOf('G'), Blocks.glowstone }); + parCraftingManager.addRecipe(new ItemStack(Blocks.beacon, 1), + new Object[] { "GGG", "GSG", "OOO", Character.valueOf('G'), Blocks.glass, Character.valueOf('S'), + Items.nether_star, Character.valueOf('O'), Blocks.obsidian }); + parCraftingManager.addRecipe(new ItemStack(Blocks.nether_brick, 1), + new Object[] { "NN", "NN", Character.valueOf('N'), Items.netherbrick }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.DIORITE.getMetadata()), + new Object[] { "CQ", "QC", Character.valueOf('C'), Blocks.cobblestone, Character.valueOf('Q'), + Items.quartz }); + parCraftingManager.addShapelessRecipe(new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()), + new Object[] { new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), + Items.quartz }); + parCraftingManager.addShapelessRecipe( + new ItemStack(Blocks.stone, 2, BlockStone.EnumType.ANDESITE.getMetadata()), + new Object[] { new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), + Blocks.cobblestone }); + parCraftingManager.addRecipe(new ItemStack(Blocks.dirt, 4, BlockDirt.DirtType.COARSE_DIRT.getMetadata()), + new Object[] { "DG", "GD", Character.valueOf('D'), + new ItemStack(Blocks.dirt, 1, BlockDirt.DirtType.DIRT.getMetadata()), Character.valueOf('G'), + Blocks.gravel }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), + new Object[] { "SS", "SS", Character.valueOf('S'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), + new Object[] { "SS", "SS", Character.valueOf('S'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), + new Object[] { "SS", "SS", Character.valueOf('S'), + new ItemStack(Blocks.stone, 1, BlockStone.EnumType.ANDESITE.getMetadata()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.ROUGH_META), + new Object[] { "SS", "SS", Character.valueOf('S'), Items.prismarine_shard }); + parCraftingManager.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.BRICKS_META), + new Object[] { "SSS", "SSS", "SSS", Character.valueOf('S'), Items.prismarine_shard }); + parCraftingManager.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.DARK_META), + new Object[] { "SSS", "SIS", "SSS", Character.valueOf('S'), Items.prismarine_shard, + Character.valueOf('I'), new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.sea_lantern, 1, 0), new Object[] { "SCS", "CCC", "SCS", + Character.valueOf('S'), Items.prismarine_shard, Character.valueOf('C'), Items.prismarine_crystals }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesDyes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesDyes.java new file mode 100644 index 0000000..22dfc34 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesDyes.java @@ -0,0 +1,139 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesDyes { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesDyes"); + } + + /**+ + * Adds the dye recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager parCraftingManager) { + for (int i = 0; i < 16; ++i) { + parCraftingManager.addShapelessRecipe(new ItemStack(Blocks.wool, 1, i), new Object[] { + new ItemStack(Items.dye, 1, 15 - i), new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stained_hardened_clay, 8, 15 - i), + new Object[] { "###", "#X#", "###", Character.valueOf('#'), new ItemStack(Blocks.hardened_clay), + Character.valueOf('X'), new ItemStack(Items.dye, 1, i) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stained_glass, 8, 15 - i), + new Object[] { "###", "#X#", "###", Character.valueOf('#'), new ItemStack(Blocks.glass), + Character.valueOf('X'), new ItemStack(Items.dye, 1, i) }); + parCraftingManager.addRecipe(new ItemStack(Blocks.stained_glass_pane, 16, i), + new Object[] { "###", "###", Character.valueOf('#'), new ItemStack(Blocks.stained_glass, 1, i) }); + } + + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.YELLOW.getDyeDamage()), + new Object[] { + new ItemStack(Blocks.yellow_flower, 1, BlockFlower.EnumFlowerType.DANDELION.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.POPPY.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 3, EnumDyeColor.WHITE.getDyeDamage()), + new Object[] { Items.bone }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.PINK.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.ORANGE.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.YELLOW.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.LIME.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.GRAY.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.SILVER.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.GRAY.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 3, EnumDyeColor.SILVER.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.LIGHT_BLUE.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.CYAN.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.PURPLE.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.MAGENTA.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.PURPLE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.PINK.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 3, EnumDyeColor.MAGENTA.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.PINK.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 4, EnumDyeColor.MAGENTA.getDyeDamage()), + new Object[] { new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.LIGHT_BLUE.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.BLUE_ORCHID.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.MAGENTA.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.ALLIUM.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.SILVER.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.HOUSTONIA.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.RED_TULIP.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.ORANGE.getDyeDamage()), + new Object[] { + new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.ORANGE_TULIP.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.SILVER.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.WHITE_TULIP.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.PINK.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.PINK_TULIP.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.SILVER.getDyeDamage()), + new Object[] { new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.OXEYE_DAISY.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.YELLOW.getDyeDamage()), + new Object[] { + new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.SUNFLOWER.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.MAGENTA.getDyeDamage()), + new Object[] { + new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.SYRINGA.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.RED.getDyeDamage()), + new Object[] { new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.ROSE.getMeta()) }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.PINK.getDyeDamage()), + new Object[] { + new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.PAEONIA.getMeta()) }); + + for (int j = 0; j < 16; ++j) { + parCraftingManager.addRecipe(new ItemStack(Blocks.carpet, 3, j), + new Object[] { "##", Character.valueOf('#'), new ItemStack(Blocks.wool, 1, j) }); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesFood.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesFood.java new file mode 100644 index 0000000..9eb0c8f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesFood.java @@ -0,0 +1,67 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesFood { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesFood"); + } + + /**+ + * Adds the food recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager parCraftingManager) { + parCraftingManager.addShapelessRecipe(new ItemStack(Items.mushroom_stew), + new Object[] { Blocks.brown_mushroom, Blocks.red_mushroom, Items.bowl }); + parCraftingManager.addRecipe(new ItemStack(Items.cookie, 8), new Object[] { "#X#", Character.valueOf('X'), + new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage()), Character.valueOf('#'), Items.wheat }); + parCraftingManager.addRecipe(new ItemStack(Items.rabbit_stew), + new Object[] { " R ", "CPM", " B ", Character.valueOf('R'), new ItemStack(Items.cooked_rabbit), + Character.valueOf('C'), Items.carrot, Character.valueOf('P'), Items.baked_potato, + Character.valueOf('M'), Blocks.brown_mushroom, Character.valueOf('B'), Items.bowl }); + parCraftingManager.addRecipe(new ItemStack(Items.rabbit_stew), + new Object[] { " R ", "CPD", " B ", Character.valueOf('R'), new ItemStack(Items.cooked_rabbit), + Character.valueOf('C'), Items.carrot, Character.valueOf('P'), Items.baked_potato, + Character.valueOf('D'), Blocks.red_mushroom, Character.valueOf('B'), Items.bowl }); + parCraftingManager.addRecipe(new ItemStack(Blocks.melon_block), + new Object[] { "MMM", "MMM", "MMM", Character.valueOf('M'), Items.melon }); + parCraftingManager.addRecipe(new ItemStack(Items.melon_seeds), + new Object[] { "M", Character.valueOf('M'), Items.melon }); + parCraftingManager.addRecipe(new ItemStack(Items.pumpkin_seeds, 4), + new Object[] { "M", Character.valueOf('M'), Blocks.pumpkin }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.pumpkin_pie), + new Object[] { Blocks.pumpkin, Items.sugar, Items.egg }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.fermented_spider_eye), + new Object[] { Items.spider_eye, Blocks.brown_mushroom, Items.sugar }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.blaze_powder, 2), new Object[] { Items.blaze_rod }); + parCraftingManager.addShapelessRecipe(new ItemStack(Items.magma_cream), + new Object[] { Items.blaze_powder, Items.slime_ball }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesIngots.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesIngots.java new file mode 100644 index 0000000..9f6b4d6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesIngots.java @@ -0,0 +1,64 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesIngots { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesIngots"); + } + + private Object[][] recipeItems = new Object[][] { { Blocks.gold_block, new ItemStack(Items.gold_ingot, 9) }, + { Blocks.iron_block, new ItemStack(Items.iron_ingot, 9) }, + { Blocks.diamond_block, new ItemStack(Items.diamond, 9) }, + { Blocks.emerald_block, new ItemStack(Items.emerald, 9) }, + { Blocks.lapis_block, new ItemStack(Items.dye, 9, EnumDyeColor.BLUE.getDyeDamage()) }, + { Blocks.redstone_block, new ItemStack(Items.redstone, 9) }, + { Blocks.coal_block, new ItemStack(Items.coal, 9, 0) }, { Blocks.hay_block, new ItemStack(Items.wheat, 9) }, + { Blocks.slime_block, new ItemStack(Items.slime_ball, 9) } }; + + /**+ + * Adds the ingot recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager parCraftingManager) { + for (int i = 0; i < this.recipeItems.length; ++i) { + Block block = (Block) this.recipeItems[i][0]; + ItemStack itemstack = (ItemStack) this.recipeItems[i][1]; + parCraftingManager.addRecipe(new ItemStack(block), + new Object[] { "###", "###", "###", Character.valueOf('#'), itemstack }); + parCraftingManager.addRecipe(itemstack, new Object[] { "#", Character.valueOf('#'), block }); + } + + parCraftingManager.addRecipe(new ItemStack(Items.gold_ingot), + new Object[] { "###", "###", "###", Character.valueOf('#'), Items.gold_nugget }); + parCraftingManager.addRecipe(new ItemStack(Items.gold_nugget, 9), + new Object[] { "#", Character.valueOf('#'), Items.gold_ingot }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapCloning.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapCloning.java new file mode 100644 index 0000000..f0caac5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapCloning.java @@ -0,0 +1,127 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesMapCloning implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesMapCloning"); + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inventorycrafting.getSizeInventory(); ++j) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(j); + if (itemstack1 != null) { + if (itemstack1.getItem() == Items.filled_map) { + if (itemstack != null) { + return false; + } + + itemstack = itemstack1; + } else { + if (itemstack1.getItem() != Items.map) { + return false; + } + + ++i; + } + } + } + + return itemstack != null && i > 0; + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inventorycrafting.getSizeInventory(); ++j) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(j); + if (itemstack1 != null) { + if (itemstack1.getItem() == Items.filled_map) { + if (itemstack != null) { + return null; + } + + itemstack = itemstack1; + } else { + if (itemstack1.getItem() != Items.map) { + return null; + } + + ++i; + } + } + } + + if (itemstack != null && i >= 1) { + ItemStack itemstack2 = new ItemStack(Items.filled_map, i + 1, itemstack.getMetadata()); + if (itemstack.hasDisplayName()) { + itemstack2.setStackDisplayName(itemstack.getDisplayName()); + } + + return itemstack2; + } else { + return null; + } + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 9; + } + + public ItemStack getRecipeOutput() { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapExtending.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapExtending.java new file mode 100644 index 0000000..ec91115 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapExtending.java @@ -0,0 +1,95 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.MapData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesMapExtending extends ShapedRecipes { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesMapExtending"); + } + + public RecipesMapExtending() { + super(3, 3, + new ItemStack[] { new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), + new ItemStack(Items.paper), new ItemStack(Items.filled_map, 0, 32767), + new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), + new ItemStack(Items.paper) }, + new ItemStack(Items.map, 0, 0)); + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World world) { + if (!super.matches(inventorycrafting, world)) { + return false; + } else { + ItemStack itemstack = null; + + for (int i = 0; i < inventorycrafting.getSizeInventory() && itemstack == null; ++i) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(i); + if (itemstack1 != null && itemstack1.getItem() == Items.filled_map) { + itemstack = itemstack1; + } + } + + if (itemstack == null) { + return false; + } else { + MapData mapdata = Items.filled_map.getMapData(itemstack, world); + return mapdata == null ? false : mapdata.scale < 4; + } + } + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + ItemStack itemstack = null; + + for (int i = 0; i < inventorycrafting.getSizeInventory() && itemstack == null; ++i) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(i); + if (itemstack1 != null && itemstack1.getItem() == Items.filled_map) { + itemstack = itemstack1; + } + } + + itemstack = itemstack.copy(); + itemstack.stackSize = 1; + if (itemstack.getTagCompound() == null) { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.getTagCompound().setBoolean("map_is_scaling", true); + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesTools.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesTools.java new file mode 100644 index 0000000..7d64039 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesTools.java @@ -0,0 +1,64 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesTools { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesTools"); + } + + private String[][] recipePatterns = new String[][] { { "XXX", " # ", " # " }, { "X", "#", "#" }, + { "XX", "X#", " #" }, { "XX", " #", " #" } }; + private Object[][] recipeItems = new Object[][] { + { Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot }, + { Items.wooden_pickaxe, Items.stone_pickaxe, Items.iron_pickaxe, Items.diamond_pickaxe, + Items.golden_pickaxe }, + { Items.wooden_shovel, Items.stone_shovel, Items.iron_shovel, Items.diamond_shovel, Items.golden_shovel }, + { Items.wooden_axe, Items.stone_axe, Items.iron_axe, Items.diamond_axe, Items.golden_axe }, + { Items.wooden_hoe, Items.stone_hoe, Items.iron_hoe, Items.diamond_hoe, Items.golden_hoe } }; + + /**+ + * Adds the tool recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager parCraftingManager) { + for (int i = 0; i < this.recipeItems[0].length; ++i) { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) { + Item item = (Item) this.recipeItems[j + 1][i]; + parCraftingManager.addRecipe(new ItemStack(item), new Object[] { this.recipePatterns[j], + Character.valueOf('#'), Items.stick, Character.valueOf('X'), object }); + } + } + + parCraftingManager.addRecipe(new ItemStack(Items.shears), + new Object[] { " #", "# ", Character.valueOf('#'), Items.iron_ingot }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesWeapons.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesWeapons.java new file mode 100644 index 0000000..9c7e8c3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesWeapons.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RecipesWeapons { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/RecipesWeapons"); + } + + private String[][] recipePatterns = new String[][] { { "X", "X", "#" } }; + private Object[][] recipeItems = new Object[][] { + { Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot }, + { Items.wooden_sword, Items.stone_sword, Items.iron_sword, Items.diamond_sword, Items.golden_sword } }; + + /**+ + * Adds the weapon recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager parCraftingManager) { + for (int i = 0; i < this.recipeItems[0].length; ++i) { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) { + Item item = (Item) this.recipeItems[j + 1][i]; + parCraftingManager.addRecipe(new ItemStack(item), new Object[] { this.recipePatterns[j], + Character.valueOf('#'), Items.stick, Character.valueOf('X'), object }); + } + } + + parCraftingManager.addRecipe(new ItemStack(Items.bow, 1), new Object[] { " #X", "# X", " #X", + Character.valueOf('X'), Items.string, Character.valueOf('#'), Items.stick }); + parCraftingManager.addRecipe(new ItemStack(Items.arrow, 4), + new Object[] { "X", "#", "Y", Character.valueOf('Y'), Items.feather, Character.valueOf('X'), + Items.flint, Character.valueOf('#'), Items.stick }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapedRecipes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapedRecipes.java new file mode 100644 index 0000000..ab94b51 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapedRecipes.java @@ -0,0 +1,147 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ShapedRecipes implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/ShapedRecipes"); + } + + private final int recipeWidth; + private final int recipeHeight; + private final ItemStack[] recipeItems; + private final ItemStack recipeOutput; + private boolean copyIngredientNBT; + + public ShapedRecipes(int width, int height, ItemStack[] parArrayOfItemStack, ItemStack output) { + this.recipeWidth = width; + this.recipeHeight = height; + this.recipeItems = parArrayOfItemStack; + this.recipeOutput = output; + } + + public ItemStack getRecipeOutput() { + return this.recipeOutput; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + for (int i = 0; i <= 3 - this.recipeWidth; ++i) { + for (int j = 0; j <= 3 - this.recipeHeight; ++j) { + if (this.checkMatch(inventorycrafting, i, j, true)) { + return true; + } + + if (this.checkMatch(inventorycrafting, i, j, false)) { + return true; + } + } + } + + return false; + } + + /**+ + * Checks if the region of a crafting inventory is match for the + * recipe. + */ + private boolean checkMatch(InventoryCrafting parInventoryCrafting, int parInt1, int parInt2, boolean parFlag) { + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + int k = i - parInt1; + int l = j - parInt2; + ItemStack itemstack = null; + if (k >= 0 && l >= 0 && k < this.recipeWidth && l < this.recipeHeight) { + if (parFlag) { + itemstack = this.recipeItems[this.recipeWidth - k - 1 + l * this.recipeWidth]; + } else { + itemstack = this.recipeItems[k + l * this.recipeWidth]; + } + } + + ItemStack itemstack1 = parInventoryCrafting.getStackInRowAndColumn(i, j); + if (itemstack1 != null || itemstack != null) { + if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) { + return false; + } + + if (itemstack.getItem() != itemstack1.getItem()) { + return false; + } + + if (itemstack.getMetadata() != 32767 && itemstack.getMetadata() != itemstack1.getMetadata()) { + return false; + } + } + } + } + + return true; + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) { + ItemStack itemstack = this.getRecipeOutput().copy(); + if (this.copyIngredientNBT) { + for (int i = 0; i < inventorycrafting.getSizeInventory(); ++i) { + ItemStack itemstack1 = inventorycrafting.getStackInSlot(i); + if (itemstack1 != null && itemstack1.hasTagCompound()) { + itemstack.setTagCompound((NBTTagCompound) itemstack1.getTagCompound().copy()); + } + } + } + + return itemstack; + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return this.recipeWidth * this.recipeHeight; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapelessRecipes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapelessRecipes.java new file mode 100644 index 0000000..5507b73 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapelessRecipes.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ShapelessRecipes implements IRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/item/crafting/ShapelessRecipes"); + } + + private final ItemStack recipeOutput; + private final List recipeItems; + + public ShapelessRecipes(ItemStack output, List inputList) { + this.recipeOutput = output; + this.recipeItems = inputList; + } + + public ItemStack getRecipeOutput() { + return this.recipeOutput; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inventorycrafting) { + ItemStack[] aitemstack = new ItemStack[inventorycrafting.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inventorycrafting.getStackInSlot(i); + if (itemstack != null && itemstack.getItem().hasContainerItem()) { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } + + /**+ + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting inventorycrafting, World var2) { + ArrayList arraylist = Lists.newArrayList(this.recipeItems); + + for (int i = 0; i < inventorycrafting.getHeight(); ++i) { + for (int j = 0; j < inventorycrafting.getWidth(); ++j) { + ItemStack itemstack = inventorycrafting.getStackInRowAndColumn(j, i); + if (itemstack != null) { + boolean flag = false; + + for (ItemStack itemstack1 : (ArrayList) arraylist) { + if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getMetadata() == 32767 + || itemstack.getMetadata() == itemstack1.getMetadata())) { + flag = true; + arraylist.remove(itemstack1); + break; + } + } + + if (!flag) { + return false; + } + } + } + } + + return arraylist.isEmpty(); + } + + /**+ + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting var1) { + return this.recipeOutput.copy(); + } + + /**+ + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return this.recipeItems.size(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumConnectionState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumConnectionState.java new file mode 100644 index 0000000..baef100 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumConnectionState.java @@ -0,0 +1,343 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.Maps; + +import java.util.Collection; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.EnumPacketDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake.client.C00Handshake; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client.C00PacketLoginStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S00PacketDisconnect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S03PacketEnableCompression; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C00PacketKeepAlive; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C01PacketChatMessage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C02PacketUseEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C03PacketPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0APacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0BPacketEntityAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0CPacketInput; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0EPacketClickWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C11PacketEnchantItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C12PacketUpdateSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C14PacketTabComplete; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C15PacketClientSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C16PacketClientStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C17PacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C18PacketSpectate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C19PacketResourcePackStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S00PacketKeepAlive; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S01PacketJoinGame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S02PacketChat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S07PacketRespawn; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0APacketUseBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0BPacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0DPacketCollectItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S14PacketEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1FPacketSetExperience; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S20PacketEntityProperties; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S21PacketChunkData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S23PacketBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S24PacketBlockAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S27PacketExplosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S28PacketEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S29PacketSoundEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2APacketParticles; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2FPacketSetSlot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S30PacketWindowItems; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S31PacketWindowProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S33PacketUpdateSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S34PacketMaps; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S37PacketStatistics; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3APacketTabComplete; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3EPacketTeams; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S40PacketDisconnect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S42PacketCombatEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S43PacketCamera; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S44PacketWorldBorder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S45PacketTitle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S46PacketSetCompressionLevel; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumConnectionState { + HANDSHAKING(-1) { + { + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00Handshake.class); + } + }, + PLAY(0) { + { + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketKeepAlive.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketJoinGame.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S02PacketChat.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S03PacketTimeUpdate.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S04PacketEntityEquipment.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S05PacketSpawnPosition.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S06PacketUpdateHealth.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S07PacketRespawn.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S08PacketPlayerPosLook.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S09PacketHeldItemChange.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0APacketUseBed.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0BPacketAnimation.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0CPacketSpawnPlayer.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0DPacketCollectItem.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0EPacketSpawnObject.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0FPacketSpawnMob.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S10PacketSpawnPainting.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S11PacketSpawnExperienceOrb.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S12PacketEntityVelocity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S13PacketDestroyEntities.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S15PacketEntityRelMove.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S16PacketEntityLook.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S17PacketEntityLookMove.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S18PacketEntityTeleport.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S19PacketEntityHeadLook.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S19PacketEntityStatus.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1BPacketEntityAttach.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1CPacketEntityMetadata.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1DPacketEntityEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1EPacketRemoveEntityEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1FPacketSetExperience.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S20PacketEntityProperties.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S21PacketChunkData.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S22PacketMultiBlockChange.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S23PacketBlockChange.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S24PacketBlockAction.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S25PacketBlockBreakAnim.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S26PacketMapChunkBulk.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S27PacketExplosion.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S28PacketEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S29PacketSoundEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2APacketParticles.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2BPacketChangeGameState.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2CPacketSpawnGlobalEntity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2DPacketOpenWindow.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2EPacketCloseWindow.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2FPacketSetSlot.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S30PacketWindowItems.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S31PacketWindowProperty.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S32PacketConfirmTransaction.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S33PacketUpdateSign.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S34PacketMaps.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S35PacketUpdateTileEntity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S36PacketSignEditorOpen.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S37PacketStatistics.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S38PacketPlayerListItem.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S39PacketPlayerAbilities.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3APacketTabComplete.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3BPacketScoreboardObjective.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3CPacketUpdateScore.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3DPacketDisplayScoreboard.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3EPacketTeams.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3FPacketCustomPayload.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S40PacketDisconnect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S41PacketServerDifficulty.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S42PacketCombatEvent.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S43PacketCamera.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S44PacketWorldBorder.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S45PacketTitle.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S46PacketSetCompressionLevel.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S47PacketPlayerListHeaderFooter.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S48PacketResourcePackSend.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S49PacketUpdateEntityNBT.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketKeepAlive.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketChatMessage.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C02PacketUseEntity.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C04PacketPlayerPosition.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C05PacketPlayerLook.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C06PacketPlayerPosLook.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C07PacketPlayerDigging.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C08PacketPlayerBlockPlacement.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C09PacketHeldItemChange.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0APacketAnimation.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0BPacketEntityAction.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0CPacketInput.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0DPacketCloseWindow.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0EPacketClickWindow.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0FPacketConfirmTransaction.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C10PacketCreativeInventoryAction.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C11PacketEnchantItem.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C12PacketUpdateSign.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C13PacketPlayerAbilities.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C14PacketTabComplete.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C15PacketClientSettings.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C16PacketClientStatus.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C17PacketCustomPayload.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C18PacketSpectate.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C19PacketResourcePackStatus.class); + } + }, + LOGIN(2) { + { + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketDisconnect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketEncryptionRequest.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S02PacketLoginSuccess.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S03PacketEnableCompression.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketLoginStart.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketEncryptionResponse.class); + } + }; + + static { + __checkIntegratedContextValid("net/minecraft/network/EnumConnectionState"); + } + + private static int field_181136_e = -1; + private static int field_181137_f = 2; + private static final EnumConnectionState[] STATES_BY_ID = new EnumConnectionState[field_181137_f - field_181136_e + + 1]; + private static final Map, EnumConnectionState> STATES_BY_CLASS = Maps.newHashMap(); + private final int id; + private final Map>> directionMaps; + + private EnumConnectionState(int protocolId) { + this.directionMaps = Maps.newEnumMap(EnumPacketDirection.class); + this.id = protocolId; + } + + protected EnumConnectionState registerPacket(EnumPacketDirection direction, Class packetClass) { + Object object = (BiMap) this.directionMaps.get(direction); + if (object == null) { + object = HashBiMap.create(); + this.directionMaps.put(direction, (BiMap>) object); + } + + if (((BiMap) object).containsValue(packetClass)) { + String s = direction + " packet " + packetClass + " is already known to ID " + + ((BiMap) object).inverse().get(packetClass); + LogManager.getLogger().fatal(s); + throw new IllegalArgumentException(s); + } else { + ((BiMap) object).put(Integer.valueOf(((BiMap) object).size()), packetClass); + return this; + } + } + + public Integer getPacketId(EnumPacketDirection direction, Packet packetIn) { + return (Integer) ((BiMap) this.directionMaps.get(direction)).inverse().get(packetIn.getClass()); + } + + public Packet getPacket(EnumPacketDirection direction, int packetId) + throws IllegalAccessException, InstantiationException { + Class oclass = (Class) ((BiMap) this.directionMaps.get(direction)).get(Integer.valueOf(packetId)); + return oclass == null ? null : (Packet) oclass.newInstance(); + } + + public int getId() { + return this.id; + } + + public static EnumConnectionState getById(int stateId) { + return stateId >= field_181136_e && stateId <= field_181137_f ? STATES_BY_ID[stateId - field_181136_e] : null; + } + + public static EnumConnectionState getFromPacket(Packet packetIn) { + return (EnumConnectionState) STATES_BY_CLASS.get(packetIn.getClass()); + } + + static { + for (EnumConnectionState enumconnectionstate : values()) { + int i = enumconnectionstate.getId(); + if (i < field_181136_e || i > field_181137_f) { + throw new Error("Invalid protocol ID " + Integer.toString(i)); + } + + STATES_BY_ID[i - field_181136_e] = enumconnectionstate; + + for (EnumPacketDirection enumpacketdirection : enumconnectionstate.directionMaps.keySet()) { + for (Class oclass : (Collection) ((BiMap) enumconnectionstate.directionMaps + .get(enumpacketdirection)).values()) { + if (STATES_BY_CLASS.containsKey(oclass) && STATES_BY_CLASS.get(oclass) != enumconnectionstate) { + throw new Error("Packet " + oclass + " is already assigned to protocol " + + STATES_BY_CLASS.get(oclass) + " - can\'t reassign to " + enumconnectionstate); + } + + try { + oclass.newInstance(); + } catch (Throwable var10) { + throw new Error("Packet " + oclass + " fails instantiation checks! " + oclass); + } + + STATES_BY_CLASS.put(oclass, enumconnectionstate); + } + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumPacketDirection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumPacketDirection.java new file mode 100644 index 0000000..2c13202 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumPacketDirection.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumPacketDirection { + SERVERBOUND, CLIENTBOUND; + + static { + __checkIntegratedContextValid("net/minecraft/network/EnumPacketDirection"); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/INetHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/INetHandler.java new file mode 100644 index 0000000..9bfa5f7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/INetHandler.java @@ -0,0 +1,31 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INetHandler { + /**+ + * Invoked when disconnecting, the parameter is a ChatComponent + * describing the reason for termination + */ + void onDisconnect(IChatComponent var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/NetHandlerPlayServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/NetHandlerPlayServer.java new file mode 100644 index 0000000..d681123 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/NetHandlerPlayServer.java @@ -0,0 +1,1267 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; + +import com.google.common.collect.Lists; +import com.google.common.primitives.Doubles; +import com.google.common.primitives.Floats; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.Set; +import java.util.concurrent.Callable; + +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityMinecartCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerMerchant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerRepair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Slot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemEditableBook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemWritableBook; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C00PacketKeepAlive; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C01PacketChatMessage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C02PacketUseEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C03PacketPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0APacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0BPacketEntityAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0CPacketInput; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0EPacketClickWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C11PacketEnchantItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C12PacketUpdateSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C14PacketTabComplete; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C15PacketClientSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C16PacketClientStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C17PacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C18PacketSpectate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C19PacketResourcePackStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S00PacketKeepAlive; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S02PacketChat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S07PacketRespawn; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S23PacketBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2FPacketSetSlot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3APacketTabComplete; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S40PacketDisconnect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatAllowedCharacters; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IntHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.socket.IntegratedServerPlayerNetworkManager; + +import org.apache.commons.lang3.StringUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NetHandlerPlayServer implements INetHandlerPlayServer, ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/network/NetHandlerPlayServer"); + } + + private static final Logger logger = LogManager.getLogger(); + public final IntegratedServerPlayerNetworkManager netManager; + private final MinecraftServer serverController; + public EntityPlayerMP playerEntity; + private int networkTickCount; + private int field_175090_f; + private int floatingTickCount; + private boolean field_147366_g; + private int field_147378_h; + private long lastPingTime; + private long lastSentPingPacket; + private int chatSpamThresholdCount; + private int itemDropThreshold; + private IntHashMap field_147372_n = new IntHashMap(); + private double lastPosX; + private double lastPosY; + private double lastPosZ; + private boolean hasMoved = true; + private boolean hasDisconnected = false; + + public NetHandlerPlayServer(MinecraftServer server, IntegratedServerPlayerNetworkManager networkManagerIn, + EntityPlayerMP playerIn) { + this.serverController = server; + this.netManager = networkManagerIn; + networkManagerIn.setNetHandler(this); + this.playerEntity = playerIn; + playerIn.playerNetServerHandler = this; + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + this.field_147366_g = false; + ++this.networkTickCount; + this.serverController.theProfiler.startSection("keepAlive"); + if ((long) this.networkTickCount - this.lastSentPingPacket > 40L) { + this.lastSentPingPacket = (long) this.networkTickCount; + this.lastPingTime = this.currentTimeMillis(); + this.field_147378_h = (int) this.lastPingTime; + this.sendPacket(new S00PacketKeepAlive(this.field_147378_h)); + } + + this.serverController.theProfiler.endSection(); + if (this.chatSpamThresholdCount > 0) { + --this.chatSpamThresholdCount; + } + + if (this.itemDropThreshold > 0) { + --this.itemDropThreshold; + } + + if (this.playerEntity.getLastActiveTime() > 0L && this.serverController.getMaxPlayerIdleMinutes() > 0 + && MinecraftServer.getCurrentTimeMillis() - this.playerEntity + .getLastActiveTime() > (long) (this.serverController.getMaxPlayerIdleMinutes() * 1000 * 60)) { + this.kickPlayerFromServer("You have been idle for too long!"); + } + + } + + public IntegratedServerPlayerNetworkManager getNetworkManager() { + return this.netManager; + } + + /**+ + * Kick a player from the server with a reason + */ + public void kickPlayerFromServer(String reason) { + final ChatComponentText chatcomponenttext = new ChatComponentText(reason); + this.netManager.sendPacket(new S40PacketDisconnect(chatcomponenttext)); + this.netManager.closeChannel(chatcomponenttext); + } + + /**+ + * Processes player movement input. Includes walking, strafing, + * jumping, sneaking; excludes riding and toggling + * flying/sprinting + */ + public void processInput(C0CPacketInput c0cpacketinput) { + this.playerEntity.setEntityActionState(c0cpacketinput.getStrafeSpeed(), c0cpacketinput.getForwardSpeed(), + c0cpacketinput.isJumping(), c0cpacketinput.isSneaking()); + } + + private boolean func_183006_b(C03PacketPlayer parC03PacketPlayer) { + return !Doubles.isFinite(parC03PacketPlayer.getPositionX()) + || !Doubles.isFinite(parC03PacketPlayer.getPositionY()) + || !Doubles.isFinite(parC03PacketPlayer.getPositionZ()) + || !Floats.isFinite(parC03PacketPlayer.getPitch()) || !Floats.isFinite(parC03PacketPlayer.getYaw()); + } + + /**+ + * Processes clients perspective on player positioning and/or + * orientation + */ + public void processPlayer(C03PacketPlayer c03packetplayer) { + if (this.func_183006_b(c03packetplayer)) { + this.kickPlayerFromServer("Invalid move packet received"); + } else { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + this.field_147366_g = true; + if (!this.playerEntity.playerConqueredTheEnd) { + double d0 = this.playerEntity.posX; + double d1 = this.playerEntity.posY; + double d2 = this.playerEntity.posZ; + double d3 = 0.0D; + double d4 = c03packetplayer.getPositionX() - this.lastPosX; + double d5 = c03packetplayer.getPositionY() - this.lastPosY; + double d6 = c03packetplayer.getPositionZ() - this.lastPosZ; + if (c03packetplayer.isMoving()) { + d3 = d4 * d4 + d5 * d5 + d6 * d6; + if (!this.hasMoved && d3 < 0.25D) { + this.hasMoved = true; + } + } + + if (this.hasMoved) { + this.field_175090_f = this.networkTickCount; + if (this.playerEntity.ridingEntity != null) { + float f4 = this.playerEntity.rotationYaw; + float f = this.playerEntity.rotationPitch; + this.playerEntity.ridingEntity.updateRiderPosition(); + double d16 = this.playerEntity.posX; + double d17 = this.playerEntity.posY; + double d18 = this.playerEntity.posZ; + if (c03packetplayer.getRotating()) { + f4 = c03packetplayer.getYaw(); + f = c03packetplayer.getPitch(); + } + + this.playerEntity.onGround = c03packetplayer.isOnGround(); + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(d16, d17, d18, f4, f); + if (this.playerEntity.ridingEntity != null) { + this.playerEntity.ridingEntity.updateRiderPosition(); + } + + this.serverController.getConfigurationManager() + .serverUpdateMountedMovingPlayer(this.playerEntity); + if (this.playerEntity.ridingEntity != null) { + if (d3 > 4.0D) { + Entity entity = this.playerEntity.ridingEntity; + this.playerEntity.playerNetServerHandler + .sendPacket(new S18PacketEntityTeleport(entity)); + this.setPlayerLocation(this.playerEntity.posX, this.playerEntity.posY, + this.playerEntity.posZ, this.playerEntity.rotationYaw, + this.playerEntity.rotationPitch); + } + + this.playerEntity.ridingEntity.isAirBorne = true; + } + + if (this.hasMoved) { + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + } + + worldserver.updateEntity(this.playerEntity); + return; + } + + if (this.playerEntity.isPlayerSleeping()) { + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, + this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + worldserver.updateEntity(this.playerEntity); + return; + } + + double d7 = this.playerEntity.posY; + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + double d8 = this.playerEntity.posX; + double d9 = this.playerEntity.posY; + double d10 = this.playerEntity.posZ; + float f1 = this.playerEntity.rotationYaw; + float f2 = this.playerEntity.rotationPitch; + if (c03packetplayer.isMoving() && c03packetplayer.getPositionY() == -999.0D) { + c03packetplayer.setMoving(false); + } + + if (c03packetplayer.isMoving()) { + d8 = c03packetplayer.getPositionX(); + d9 = c03packetplayer.getPositionY(); + d10 = c03packetplayer.getPositionZ(); + if (Math.abs(c03packetplayer.getPositionX()) > 3.0E7D + || Math.abs(c03packetplayer.getPositionZ()) > 3.0E7D) { + this.kickPlayerFromServer("Illegal position"); + return; + } + } + + if (c03packetplayer.getRotating()) { + f1 = c03packetplayer.getYaw(); + f2 = c03packetplayer.getPitch(); + } + + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + if (!this.hasMoved) { + return; + } + + double d11 = d8 - this.playerEntity.posX; + double d12 = d9 - this.playerEntity.posY; + double d13 = d10 - this.playerEntity.posZ; + double d14 = this.playerEntity.motionX * this.playerEntity.motionX + + this.playerEntity.motionY * this.playerEntity.motionY + + this.playerEntity.motionZ * this.playerEntity.motionZ; + double d15 = d11 * d11 + d12 * d12 + d13 * d13; + if (d15 - d14 > 100.0D && (!this.serverController.isSinglePlayer() + || !this.serverController.getServerOwner().equals(this.playerEntity.getName()))) { + logger.warn(this.playerEntity.getName() + " moved too quickly! " + d11 + "," + d12 + "," + d13 + + " (" + d11 + ", " + d12 + ", " + d13 + ")"); + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, + this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + return; + } + + float f3 = 0.0625F; + boolean flag = worldserver.getCollidingBoundingBoxes(this.playerEntity, + this.playerEntity.getEntityBoundingBox().contract((double) f3, (double) f3, (double) f3)) + .isEmpty(); + if (this.playerEntity.onGround && !c03packetplayer.isOnGround() && d12 > 0.0D) { + this.playerEntity.jump(); + } + + this.playerEntity.moveEntity(d11, d12, d13); + this.playerEntity.onGround = c03packetplayer.isOnGround(); + d11 = d8 - this.playerEntity.posX; + d12 = d9 - this.playerEntity.posY; + if (d12 > -0.5D || d12 < 0.5D) { + d12 = 0.0D; + } + + d13 = d10 - this.playerEntity.posZ; + d15 = d11 * d11 + d12 * d12 + d13 * d13; + boolean flag1 = false; + if (d15 > 0.0625D && !this.playerEntity.isPlayerSleeping() + && !this.playerEntity.theItemInWorldManager.isCreative()) { + flag1 = true; + logger.warn(this.playerEntity.getName() + " moved wrongly!"); + } + + this.playerEntity.setPositionAndRotation(d8, d9, d10, f1, f2); + this.playerEntity.addMovementStat(this.playerEntity.posX - d0, this.playerEntity.posY - d1, + this.playerEntity.posZ - d2); + if (!this.playerEntity.noClip) { + boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity + .getEntityBoundingBox().contract((double) f3, (double) f3, (double) f3)).isEmpty(); + if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + return; + } + } + + AxisAlignedBB axisalignedbb = this.playerEntity.getEntityBoundingBox() + .expand((double) f3, (double) f3, (double) f3).addCoord(0.0D, -0.55D, 0.0D); + if (!this.serverController.isFlightAllowed() && !this.playerEntity.capabilities.allowFlying + && !worldserver.checkBlockCollision(axisalignedbb)) { + if (d12 >= -0.03125D) { + ++this.floatingTickCount; + if (this.floatingTickCount > 80) { + logger.warn(this.playerEntity.getName() + " was kicked for floating too long!"); + this.kickPlayerFromServer("Flying is not enabled on this server"); + return; + } + } + } else { + this.floatingTickCount = 0; + } + + this.playerEntity.onGround = c03packetplayer.isOnGround(); + this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + this.playerEntity.handleFalling(this.playerEntity.posY - d7, c03packetplayer.isOnGround()); + } else if (this.networkTickCount - this.field_175090_f > 20) { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, + this.playerEntity.rotationPitch); + } + + } + } + } + + public void setPlayerLocation(double x, double y, double z, float yaw, float pitch) { + this.setPlayerLocation(x, y, z, yaw, pitch, Collections.emptySet()); + } + + public void setPlayerLocation(double x, double y, double z, float yaw, float pitch, + Set relativeSet) { + this.hasMoved = false; + this.lastPosX = x; + this.lastPosY = y; + this.lastPosZ = z; + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.X)) { + this.lastPosX += this.playerEntity.posX; + } + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Y)) { + this.lastPosY += this.playerEntity.posY; + } + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Z)) { + this.lastPosZ += this.playerEntity.posZ; + } + + float f = yaw; + float f1 = pitch; + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT)) { + f = yaw + this.playerEntity.rotationYaw; + } + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.X_ROT)) { + f1 = pitch + this.playerEntity.rotationPitch; + } + + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, f, f1); + this.playerEntity.playerNetServerHandler + .sendPacket(new S08PacketPlayerPosLook(x, y, z, yaw, pitch, relativeSet)); + } + + /**+ + * Processes the player initiating/stopping digging on a + * particular spot, as well as a player dropping items?. (0: + * initiated, 1: reinitiated, 2? , 3-4 drop item (respectively + * without or with player control), 5: stopped; x,y,z, side + * clicked on;) + */ + public void processPlayerDigging(C07PacketPlayerDigging c07packetplayerdigging) { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + BlockPos blockpos = c07packetplayerdigging.getPosition(); + this.playerEntity.markPlayerActive(); + switch (c07packetplayerdigging.getStatus()) { + case DROP_ITEM: + if (!this.playerEntity.isSpectator()) { + this.playerEntity.dropOneItem(false); + } + + return; + case DROP_ALL_ITEMS: + if (!this.playerEntity.isSpectator()) { + this.playerEntity.dropOneItem(true); + } + + return; + case RELEASE_USE_ITEM: + this.playerEntity.stopUsingItem(); + return; + case START_DESTROY_BLOCK: + case ABORT_DESTROY_BLOCK: + case STOP_DESTROY_BLOCK: + double d0 = this.playerEntity.posX - ((double) blockpos.getX() + 0.5D); + double d1 = this.playerEntity.posY - ((double) blockpos.getY() + 0.5D) + 1.5D; + double d2 = this.playerEntity.posZ - ((double) blockpos.getZ() + 0.5D); + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + if (d3 > 36.0D) { + return; + } else if (blockpos.getY() >= this.serverController.getBuildLimit()) { + return; + } else { + if (c07packetplayerdigging.getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) { + if (!this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) + && worldserver.getWorldBorder().contains(blockpos)) { + this.playerEntity.theItemInWorldManager.onBlockClicked(blockpos, + c07packetplayerdigging.getFacing()); + } else { + this.playerEntity.playerNetServerHandler + .sendPacket(new S23PacketBlockChange(worldserver, blockpos)); + } + } else { + if (c07packetplayerdigging.getStatus() == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK) { + this.playerEntity.theItemInWorldManager.blockRemoving(blockpos); + } else if (c07packetplayerdigging + .getStatus() == C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK) { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(); + } + + if (worldserver.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { + this.playerEntity.playerNetServerHandler + .sendPacket(new S23PacketBlockChange(worldserver, blockpos)); + } + } + + return; + } + default: + throw new IllegalArgumentException("Invalid player action"); + } + } + + /**+ + * Processes block placement and block activation (anvil, + * furnace, etc.) + */ + public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement c08packetplayerblockplacement) { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); + boolean flag = false; + BlockPos blockpos = c08packetplayerblockplacement.getPosition(); + EnumFacing enumfacing = EnumFacing.getFront(c08packetplayerblockplacement.getPlacedBlockDirection()); + this.playerEntity.markPlayerActive(); + if (c08packetplayerblockplacement.getPlacedBlockDirection() == 255) { + if (itemstack == null) { + return; + } + + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); + } else if (blockpos.getY() < this.serverController.getBuildLimit() - 1 + || enumfacing != EnumFacing.UP && blockpos.getY() < this.serverController.getBuildLimit()) { + if (this.hasMoved + && this.playerEntity.getDistanceSq((double) blockpos.getX() + 0.5D, (double) blockpos.getY() + 0.5D, + (double) blockpos.getZ() + 0.5D) < 64.0D + && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) + && worldserver.getWorldBorder().contains(blockpos)) { + this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, + itemstack, blockpos, enumfacing, c08packetplayerblockplacement.getPlacedBlockOffsetX(), + c08packetplayerblockplacement.getPlacedBlockOffsetY(), + c08packetplayerblockplacement.getPlacedBlockOffsetZ()); + } + + flag = true; + } else { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("build.tooHigh", + new Object[] { Integer.valueOf(this.serverController.getBuildLimit()) }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + this.playerEntity.playerNetServerHandler.sendPacket(new S02PacketChat(chatcomponenttranslation)); + flag = true; + } + + if (flag) { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(worldserver, blockpos)); + this.playerEntity.playerNetServerHandler + .sendPacket(new S23PacketBlockChange(worldserver, blockpos.offset(enumfacing))); + } + + itemstack = this.playerEntity.inventory.getCurrentItem(); + if (itemstack != null && itemstack.stackSize == 0) { + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = null; + itemstack = null; + } + + if (itemstack == null || itemstack.getMaxItemUseDuration() == 0) { + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack + .copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, + this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.isChangingQuantityOnly = false; + if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), + c08packetplayerblockplacement.getStack())) { + this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, + this.playerEntity.inventory.getCurrentItem())); + } + } + + } + + public void handleSpectate(C18PacketSpectate c18packetspectate) { + if (this.playerEntity.isSpectator()) { + Entity entity = null; + + for (WorldServer worldserver : this.serverController.worldServers) { + if (worldserver != null) { + entity = c18packetspectate.getEntity(worldserver); + if (entity != null) { + break; + } + } + } + + if (entity != null) { + this.playerEntity.setSpectatingEntity(this.playerEntity); + this.playerEntity.mountEntity((Entity) null); + if (entity.worldObj != this.playerEntity.worldObj) { + WorldServer worldserver1 = this.playerEntity.getServerForPlayer(); + WorldServer worldserver2 = (WorldServer) entity.worldObj; + this.playerEntity.dimension = entity.dimension; + this.sendPacket(new S07PacketRespawn(this.playerEntity.dimension, worldserver1.getDifficulty(), + worldserver1.getWorldInfo().getTerrainType(), + this.playerEntity.theItemInWorldManager.getGameType())); + worldserver1.removePlayerEntityDangerously(this.playerEntity); + this.playerEntity.isDead = false; + this.playerEntity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, + entity.rotationPitch); + if (this.playerEntity.isEntityAlive()) { + worldserver1.updateEntityWithOptionalForce(this.playerEntity, false); + worldserver2.spawnEntityInWorld(this.playerEntity); + worldserver2.updateEntityWithOptionalForce(this.playerEntity, false); + } + + this.playerEntity.setWorld(worldserver2); + this.serverController.getConfigurationManager().preparePlayer(this.playerEntity, worldserver1); + this.playerEntity.setPositionAndUpdate(entity.posX, entity.posY, entity.posZ); + this.playerEntity.theItemInWorldManager.setWorld(worldserver2); + this.serverController.getConfigurationManager().updateTimeAndWeatherForPlayer(this.playerEntity, + worldserver2); + this.serverController.getConfigurationManager().syncPlayerInventory(this.playerEntity); + } else { + this.playerEntity.setPositionAndUpdate(entity.posX, entity.posY, entity.posZ); + } + } + } + + } + + public void handleResourcePackStatus(C19PacketResourcePackStatus var1) { + } + + /**+ + * Invoked when disconnecting, the parameter is a ChatComponent + * describing the reason for termination + */ + public void onDisconnect(IChatComponent ichatcomponent) { + if (!hasDisconnected) { + hasDisconnected = true; + logger.info(this.playerEntity.getName() + " lost connection: " + ichatcomponent); + this.serverController.refreshStatusNextTick(); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.left", + new Object[] { this.playerEntity.getDisplayName() }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.serverController.getConfigurationManager().sendChatMsg(chatcomponenttranslation); + this.playerEntity.mountEntityAndWakeUp(); + this.serverController.getConfigurationManager().playerLoggedOut(this.playerEntity); + if (this.playerEntity.getName().equals(this.serverController.getServerOwner())) { + logger.info("Stopping singleplayer server as player logged out"); + this.serverController.initiateShutdown(); + } + } + } + + public void sendPacket(final Packet packetIn) { + if (packetIn instanceof S02PacketChat) { + S02PacketChat s02packetchat = (S02PacketChat) packetIn; + EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility = this.playerEntity.getChatVisibility(); + if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.HIDDEN) { + return; + } + + if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.SYSTEM && !s02packetchat.isChat()) { + return; + } + } + + try { + this.netManager.sendPacket(packetIn); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Sending packet"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Packet being sent"); + crashreportcategory.addCrashSectionCallable("Packet class", new Callable() { + public String call() throws Exception { + return packetIn.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + + /**+ + * Updates which quickbar slot is selected + */ + public void processHeldItemChange(C09PacketHeldItemChange c09packethelditemchange) { + if (c09packethelditemchange.getSlotId() >= 0 + && c09packethelditemchange.getSlotId() < InventoryPlayer.getHotbarSize()) { + this.playerEntity.inventory.currentItem = c09packethelditemchange.getSlotId(); + this.playerEntity.markPlayerActive(); + } else { + logger.warn(this.playerEntity.getName() + " tried to set an invalid carried item"); + } + } + + /**+ + * Process chat messages (broadcast back to clients) and + * commands (executes) + */ + public void processChatMessage(C01PacketChatMessage c01packetchatmessage) { + if (this.playerEntity.getChatVisibility() == EntityPlayer.EnumChatVisibility.HIDDEN) { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.cannotSend", + new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + this.sendPacket(new S02PacketChat(chatcomponenttranslation)); + } else { + this.playerEntity.markPlayerActive(); + String s = c01packetchatmessage.getMessage(); + s = StringUtils.normalizeSpace(s); + + for (int i = 0; i < s.length(); ++i) { + if (!ChatAllowedCharacters.isAllowedCharacter(s.charAt(i))) { + this.kickPlayerFromServer("Illegal characters in chat"); + return; + } + } + + if (s.startsWith("/")) { + this.handleSlashCommand(s); + } else { + if (this.serverController.worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + s = net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils + .translateControlCodesAlternate(s); + } + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", + new Object[] { this.playerEntity.getDisplayName(), s }); + this.serverController.getConfigurationManager().sendChatMsgImpl(chatcomponenttranslation1, false); + } + + this.chatSpamThresholdCount += 20; + if (this.chatSpamThresholdCount > 200 && !this.serverController.getConfigurationManager() + .canSendCommands(this.playerEntity.getGameProfile())) { + this.kickPlayerFromServer("disconnect.spam"); + } + + } + } + + /**+ + * Handle commands that start with a / + */ + private void handleSlashCommand(String command) { + this.serverController.getCommandManager().executeCommand(this.playerEntity, command); + } + + public void handleAnimation(C0APacketAnimation c0apacketanimation) { + this.playerEntity.markPlayerActive(); + this.playerEntity.swingItem(); + } + + /**+ + * Processes a range of action-types: sneaking, sprinting, + * waking from sleep, opening the inventory or setting jump + * height of the horse the player is riding + */ + public void processEntityAction(C0BPacketEntityAction c0bpacketentityaction) { + this.playerEntity.markPlayerActive(); + switch (c0bpacketentityaction.getAction()) { + case START_SNEAKING: + this.playerEntity.setSneaking(true); + break; + case STOP_SNEAKING: + this.playerEntity.setSneaking(false); + break; + case START_SPRINTING: + this.playerEntity.setSprinting(true); + break; + case STOP_SPRINTING: + this.playerEntity.setSprinting(false); + break; + case STOP_SLEEPING: + this.playerEntity.wakeUpPlayer(false, true, true); + this.hasMoved = false; + break; + case RIDING_JUMP: + if (this.playerEntity.ridingEntity instanceof EntityHorse) { + ((EntityHorse) this.playerEntity.ridingEntity).setJumpPower(c0bpacketentityaction.getAuxData()); + } + break; + case OPEN_INVENTORY: + if (this.playerEntity.ridingEntity instanceof EntityHorse) { + ((EntityHorse) this.playerEntity.ridingEntity).openGUI(this.playerEntity); + } + break; + default: + throw new IllegalArgumentException("Invalid client command!"); + } + + } + + /**+ + * Processes interactions ((un)leashing, opening command block + * GUI) and attacks on an entity with players currently equipped + * item + */ + public void processUseEntity(C02PacketUseEntity c02packetuseentity) { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + Entity entity = c02packetuseentity.getEntityFromWorld(worldserver); + this.playerEntity.markPlayerActive(); + if (entity != null) { + boolean flag = this.playerEntity.canEntityBeSeen(entity); + double d0 = 36.0D; + if (!flag) { + d0 = 9.0D; + } + + if (this.playerEntity.getDistanceSqToEntity(entity) < d0) { + if (c02packetuseentity.getAction() == C02PacketUseEntity.Action.INTERACT) { + this.playerEntity.interactWith(entity); + } else if (c02packetuseentity.getAction() == C02PacketUseEntity.Action.INTERACT_AT) { + entity.interactAt(this.playerEntity, c02packetuseentity.getHitVec()); + } else if (c02packetuseentity.getAction() == C02PacketUseEntity.Action.ATTACK) { + if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow + || entity == this.playerEntity) { + this.kickPlayerFromServer("Attempting to attack an invalid entity"); + this.serverController.logWarning( + "Player " + this.playerEntity.getName() + " tried to attack an invalid entity"); + return; + } + + this.playerEntity.attackTargetEntityWithCurrentItem(entity); + } + } + } + + } + + /**+ + * Processes the client status updates: respawn attempt from + * player, opening statistics or achievements, or acquiring + * 'open inventory' achievement + */ + public void processClientStatus(C16PacketClientStatus c16packetclientstatus) { + this.playerEntity.markPlayerActive(); + C16PacketClientStatus.EnumState c16packetclientstatus$enumstate = c16packetclientstatus.getStatus(); + switch (c16packetclientstatus$enumstate) { + case PERFORM_RESPAWN: + if (this.playerEntity.playerConqueredTheEnd) { + this.playerEntity = this.serverController.getConfigurationManager() + .recreatePlayerEntity(this.playerEntity, 0, true); + } else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { + if (this.serverController.isSinglePlayer() + && this.playerEntity.getName().equals(this.serverController.getServerOwner())) { + this.playerEntity.playerNetServerHandler + .kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + this.serverController.deleteWorldAndStopServer(); + } else { + this.playerEntity.playerNetServerHandler + .kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + } + } else { + if (this.playerEntity.getHealth() > 0.0F) { + return; + } + + this.playerEntity = this.serverController.getConfigurationManager() + .recreatePlayerEntity(this.playerEntity, 0, false); + } + break; + case REQUEST_STATS: + this.playerEntity.getStatFile().func_150876_a(this.playerEntity); + break; + case OPEN_INVENTORY_ACHIEVEMENT: + this.playerEntity.triggerAchievement(AchievementList.openInventory); + } + + } + + /**+ + * Processes the client closing windows (container) + */ + public void processCloseWindow(C0DPacketCloseWindow c0dpacketclosewindow) { + this.playerEntity.closeContainer(); + } + + /**+ + * Executes a container/inventory slot manipulation as indicated + * by the packet. Sends the serverside result if they didn't + * match the indicated result and prevents further manipulation + * by the player until he confirms that it has the same open + * container/inventory + */ + public void processClickWindow(C0EPacketClickWindow c0epacketclickwindow) { + this.playerEntity.markPlayerActive(); + if (this.playerEntity.openContainer.windowId == c0epacketclickwindow.getWindowId() + && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { + if (this.playerEntity.isSpectator()) { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i) { + arraylist.add(((Slot) this.playerEntity.openContainer.inventorySlots.get(i)).getStack()); + } + + this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, arraylist); + } else { + ItemStack itemstack = this.playerEntity.openContainer.slotClick(c0epacketclickwindow.getSlotId(), + c0epacketclickwindow.getUsedButton(), c0epacketclickwindow.getMode(), this.playerEntity); + if (ItemStack.areItemStacksEqual(c0epacketclickwindow.getClickedItem(), itemstack)) { + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction( + c0epacketclickwindow.getWindowId(), c0epacketclickwindow.getActionNumber(), true)); + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); + this.playerEntity.isChangingQuantityOnly = false; + } else { + this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, + Short.valueOf(c0epacketclickwindow.getActionNumber())); + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction( + c0epacketclickwindow.getWindowId(), c0epacketclickwindow.getActionNumber(), false)); + this.playerEntity.openContainer.setCanCraft(this.playerEntity, false); + ArrayList arraylist1 = Lists.newArrayList(); + + for (int j = 0; j < this.playerEntity.openContainer.inventorySlots.size(); ++j) { + arraylist1.add(((Slot) this.playerEntity.openContainer.inventorySlots.get(j)).getStack()); + } + + this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, arraylist1); + } + } + } + + } + + /**+ + * Enchants the item identified by the packet given some + * convoluted conditions (matching window, which + * should/shouldn't be in use?) + */ + public void processEnchantItem(C11PacketEnchantItem c11packetenchantitem) { + this.playerEntity.markPlayerActive(); + if (this.playerEntity.openContainer.windowId == c11packetenchantitem.getWindowId() + && this.playerEntity.openContainer.getCanCraft(this.playerEntity) && !this.playerEntity.isSpectator()) { + this.playerEntity.openContainer.enchantItem(this.playerEntity, c11packetenchantitem.getButton()); + this.playerEntity.openContainer.detectAndSendChanges(); + } + + } + + /**+ + * Update the server with an ItemStack in a slot. + */ + public void processCreativeInventoryAction(C10PacketCreativeInventoryAction c10packetcreativeinventoryaction) { + if (this.playerEntity.theItemInWorldManager.isCreative()) { + boolean flag = c10packetcreativeinventoryaction.getSlotId() < 0; + ItemStack itemstack = c10packetcreativeinventoryaction.getStack(); + if (itemstack != null && itemstack.hasTagCompound() + && itemstack.getTagCompound().hasKey("BlockEntityTag", 10)) { + NBTTagCompound nbttagcompound = itemstack.getTagCompound().getCompoundTag("BlockEntityTag"); + if (nbttagcompound.hasKey("x") && nbttagcompound.hasKey("y") && nbttagcompound.hasKey("z")) { + BlockPos blockpos = new BlockPos(nbttagcompound.getInteger("x"), nbttagcompound.getInteger("y"), + nbttagcompound.getInteger("z")); + TileEntity tileentity = this.playerEntity.worldObj.getTileEntity(blockpos); + if (tileentity != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound1); + nbttagcompound1.removeTag("x"); + nbttagcompound1.removeTag("y"); + nbttagcompound1.removeTag("z"); + itemstack.setTagInfo("BlockEntityTag", nbttagcompound1); + } + } + } + + boolean flag1 = c10packetcreativeinventoryaction.getSlotId() >= 1 + && c10packetcreativeinventoryaction.getSlotId() < 36 + InventoryPlayer.getHotbarSize(); + boolean flag2 = itemstack == null || itemstack.getItem() != null; + boolean flag3 = itemstack == null + || itemstack.getMetadata() >= 0 && itemstack.stackSize <= 64 && itemstack.stackSize > 0; + if (flag1 && flag2 && flag3) { + if (itemstack == null) { + this.playerEntity.inventoryContainer.putStackInSlot(c10packetcreativeinventoryaction.getSlotId(), + (ItemStack) null); + } else { + this.playerEntity.inventoryContainer.putStackInSlot(c10packetcreativeinventoryaction.getSlotId(), + itemstack); + } + + this.playerEntity.inventoryContainer.setCanCraft(this.playerEntity, true); + } else if (flag && flag2 && flag3 && this.itemDropThreshold < 200) { + this.itemDropThreshold += 20; + EntityItem entityitem = this.playerEntity.dropPlayerItemWithRandomChoice(itemstack, true); + if (entityitem != null) { + entityitem.setAgeToCreativeDespawnTime(); + } + } + } + + } + + /**+ + * Received in response to the server requesting to confirm that + * the client-side open container matches the servers' after a + * mismatched container-slot manipulation. It will unlock the + * player's ability to manipulate the container contents + */ + public void processConfirmTransaction(C0FPacketConfirmTransaction c0fpacketconfirmtransaction) { + Short oshort = (Short) this.field_147372_n.lookup(this.playerEntity.openContainer.windowId); + if (oshort != null && c0fpacketconfirmtransaction.getUid() == oshort.shortValue() + && this.playerEntity.openContainer.windowId == c0fpacketconfirmtransaction.getWindowId() + && !this.playerEntity.openContainer.getCanCraft(this.playerEntity) + && !this.playerEntity.isSpectator()) { + this.playerEntity.openContainer.setCanCraft(this.playerEntity, true); + } + + } + + public void processUpdateSign(C12PacketUpdateSign c12packetupdatesign) { + this.playerEntity.markPlayerActive(); + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + BlockPos blockpos = c12packetupdatesign.getPosition(); + if (worldserver.isBlockLoaded(blockpos)) { + TileEntity tileentity = worldserver.getTileEntity(blockpos); + if (!(tileentity instanceof TileEntitySign)) { + return; + } + + TileEntitySign tileentitysign = (TileEntitySign) tileentity; + if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity) { + this.serverController.logWarning( + "Player " + this.playerEntity.getName() + " just tried to change non-editable sign"); + return; + } + + IChatComponent[] aichatcomponent = c12packetupdatesign.getLines(); + + for (int i = 0; i < aichatcomponent.length; ++i) { + String s = EnumChatFormatting.getTextWithoutFormattingCodes(aichatcomponent[i].getUnformattedText()); + if (this.serverController.worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + s = net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils + .translateControlCodesAlternate(s); + } + tileentitysign.signText[i] = new ChatComponentText(s); + } + + tileentitysign.markDirty(); + worldserver.markBlockForUpdate(blockpos); + } + + } + + /**+ + * Updates a players' ping statistics + */ + public void processKeepAlive(C00PacketKeepAlive c00packetkeepalive) { + if (c00packetkeepalive.getKey() == this.field_147378_h) { + int i = (int) (this.currentTimeMillis() - this.lastPingTime); + this.playerEntity.ping = (this.playerEntity.ping * 3 + i) / 4; + } + + } + + private long currentTimeMillis() { + return System.nanoTime() / 1000000L; + } + + /**+ + * Processes a player starting/stopping flying + */ + public void processPlayerAbilities(C13PacketPlayerAbilities c13packetplayerabilities) { + this.playerEntity.capabilities.isFlying = c13packetplayerabilities.isFlying() + && this.playerEntity.capabilities.allowFlying; + } + + /**+ + * Retrieves possible tab completions for the requested command + * string and sends them to the client + */ + public void processTabComplete(C14PacketTabComplete c14packettabcomplete) { + ArrayList arraylist = Lists.newArrayList(); + + for (String s : this.serverController.getTabCompletions(this.playerEntity, c14packettabcomplete.getMessage(), + c14packettabcomplete.getTargetBlock())) { + arraylist.add(s); + } + + this.playerEntity.playerNetServerHandler + .sendPacket(new S3APacketTabComplete((String[]) arraylist.toArray(new String[arraylist.size()]))); + } + + /**+ + * Updates serverside copy of client settings: language, render + * distance, chat visibility, chat colours, difficulty, and + * whether to show the cape + */ + public void processClientSettings(C15PacketClientSettings c15packetclientsettings) { + this.playerEntity.handleClientSettings(c15packetclientsettings); + } + + /**+ + * Synchronizes serverside and clientside book contents and + * signing + */ + public void processVanilla250Packet(C17PacketCustomPayload c17packetcustompayload) { + if ("MC|BEdit".equals(c17packetcustompayload.getChannelName())) { + PacketBuffer packetbuffer3 = c17packetcustompayload.getBufferData(); + + try { + ItemStack itemstack1 = packetbuffer3.readItemStackFromBuffer_server(); + if (itemstack1 != null) { + if (!ItemWritableBook.isNBTValid(itemstack1.getTagCompound())) { + throw new IOException("Invalid book tag!"); + } + + ItemStack itemstack3 = this.playerEntity.inventory.getCurrentItem(); + if (itemstack3 == null) { + return; + } + + if (itemstack1.getItem() == Items.writable_book && itemstack1.getItem() == itemstack3.getItem()) { + itemstack3.setTagInfo("pages", itemstack1.getTagCompound().getTagList("pages", 8)); + } + + return; + } + } catch (Exception exception3) { + logger.error("Couldn\'t handle book info", exception3); + logger.error(exception3); + return; + } + + return; + } else if ("MC|BSign".equals(c17packetcustompayload.getChannelName())) { + PacketBuffer packetbuffer2 = c17packetcustompayload.getBufferData(); + + try { + ItemStack itemstack = packetbuffer2.readItemStackFromBuffer_server(); + if (itemstack != null) { + if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound())) { + throw new IOException("Invalid book tag!"); + } + + ItemStack itemstack2 = this.playerEntity.inventory.getCurrentItem(); + if (itemstack2 == null) { + return; + } + + if (itemstack.getItem() == Items.written_book && itemstack2.getItem() == Items.writable_book) { + itemstack2.setTagInfo("author", new NBTTagString(this.playerEntity.getName())); + itemstack2.setTagInfo("title", new NBTTagString(itemstack.getTagCompound().getString("title"))); + itemstack2.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8)); + itemstack2.setItem(Items.written_book); + } + + return; + } + } catch (Exception exception4) { + logger.error("Couldn\'t sign book", exception4); + logger.error(exception4); + return; + } + + return; + } else if ("MC|TrSel".equals(c17packetcustompayload.getChannelName())) { + try { + int i = c17packetcustompayload.getBufferData().readInt(); + Container container = this.playerEntity.openContainer; + if (container instanceof ContainerMerchant) { + ((ContainerMerchant) container).setCurrentRecipeIndex(i); + } + } catch (Exception exception2) { + logger.error("Couldn\'t select trade", exception2); + } + } else if ("MC|AdvCdm".equals(c17packetcustompayload.getChannelName())) { + if (!this.serverController.isCommandBlockEnabled()) { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notEnabled", new Object[0])); + } else if (this.playerEntity.canCommandSenderUseCommand(2, "") + && this.playerEntity.capabilities.isCreativeMode) { + PacketBuffer packetbuffer = c17packetcustompayload.getBufferData(); + + try { + byte b0 = packetbuffer.readByte(); + CommandBlockLogic commandblocklogic = null; + if (b0 == 0) { + TileEntity tileentity = this.playerEntity.worldObj.getTileEntity( + new BlockPos(packetbuffer.readInt(), packetbuffer.readInt(), packetbuffer.readInt())); + if (tileentity instanceof TileEntityCommandBlock) { + commandblocklogic = ((TileEntityCommandBlock) tileentity).getCommandBlockLogic(); + } + } else if (b0 == 1) { + Entity entity = this.playerEntity.worldObj.getEntityByID(packetbuffer.readInt()); + if (entity instanceof EntityMinecartCommandBlock) { + commandblocklogic = ((EntityMinecartCommandBlock) entity).getCommandBlockLogic(); + } + } + + String s1 = packetbuffer.readStringFromBuffer(packetbuffer.readableBytes()); + boolean flag = packetbuffer.readBoolean(); + if (commandblocklogic != null) { + commandblocklogic.setCommand(s1); + commandblocklogic.setTrackOutput(flag); + if (!flag) { + commandblocklogic.setLastOutput((IChatComponent) null); + } + + commandblocklogic.updateCommand(); + this.playerEntity.addChatMessage( + new ChatComponentTranslation("advMode.setCommand.success", new Object[] { s1 })); + } + } catch (Exception exception1) { + logger.error("Couldn\'t set command block", exception1); + } + } else { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notAllowed", new Object[0])); + } + } else if ("MC|Beacon".equals(c17packetcustompayload.getChannelName())) { + if (this.playerEntity.openContainer instanceof ContainerBeacon) { + try { + PacketBuffer packetbuffer1 = c17packetcustompayload.getBufferData(); + int j = packetbuffer1.readInt(); + int k = packetbuffer1.readInt(); + ContainerBeacon containerbeacon = (ContainerBeacon) this.playerEntity.openContainer; + Slot slot = containerbeacon.getSlot(0); + if (slot.getHasStack()) { + slot.decrStackSize(1); + IInventory iinventory = containerbeacon.func_180611_e(); + iinventory.setField(1, j); + iinventory.setField(2, k); + iinventory.markDirty(); + } + } catch (Exception exception) { + logger.error("Couldn\'t set beacon", exception); + } + } + } else if ("MC|ItemName".equals(c17packetcustompayload.getChannelName()) + && this.playerEntity.openContainer instanceof ContainerRepair) { + ContainerRepair containerrepair = (ContainerRepair) this.playerEntity.openContainer; + if (c17packetcustompayload.getBufferData() != null + && c17packetcustompayload.getBufferData().readableBytes() >= 1) { + String s = ChatAllowedCharacters + .filterAllowedCharacters(c17packetcustompayload.getBufferData().readStringFromBuffer(32767)); + if (s.length() <= 30) { + if (this.serverController.worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("colorCodes")) { + s = net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils + .translateControlCodesAlternate(s); + } + containerrepair.updateItemName(s); + } + } else { + containerrepair.updateItemName(""); + } + } else if ("EAG|Skins-1.8".equals(c17packetcustompayload.getChannelName())) { + byte[] r = new byte[c17packetcustompayload.getBufferData().readableBytes()]; + c17packetcustompayload.getBufferData().readBytes(r); + ((EaglerMinecraftServer) serverController).getSkinService().processPacket(r, playerEntity); + } else if ("EAG|MyUpdCert-1.8".equals(c17packetcustompayload.getChannelName())) { + if (playerEntity.updateCertificate == null) { + PacketBuffer pb = c17packetcustompayload.getBufferData(); + byte[] cert = new byte[pb.readableBytes()]; + pb.readBytes(cert); + playerEntity.updateCertificate = cert; + for (EntityPlayerMP player : playerEntity.mcServer.getConfigurationManager().func_181057_v()) { + if (player != playerEntity) { + player.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("EAG|UpdateCert-1.8", + new PacketBuffer(Unpooled.buffer(cert, cert.length).writerIndex(cert.length)))); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/Packet.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/Packet.java new file mode 100644 index 0000000..4973ad0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/Packet.java @@ -0,0 +1,42 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface Packet { + /**+ + * Reads the raw packet data from the data stream. + */ + void readPacketData(PacketBuffer var1) throws IOException; + + /**+ + * Writes the raw packet data to the data stream. + */ + void writePacketData(PacketBuffer var1) throws IOException; + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + void processPacket(T var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/PacketBuffer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/PacketBuffer.java new file mode 100644 index 0000000..150731f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/PacketBuffer.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PacketBuffer extends net.minecraft.network.PacketBuffer { + + static { + __checkIntegratedContextValid("net/minecraft/network/PacketBuffer"); + } + + public PacketBuffer(ByteBuf wrapped) { + super(wrapped); + } + + public BlockPos readBlockPos_server() { + return BlockPos.fromLong(this.readLong()); + } + + public void writeBlockPos_server(BlockPos pos) { + this.writeLong(pos.toLong()); + } + + public IChatComponent readChatComponent_server() throws IOException { + return IChatComponent.Serializer.jsonToComponent(this.readStringFromBuffer(32767)); + } + + public void writeChatComponent_server(IChatComponent component) throws IOException { + this.writeString(IChatComponent.Serializer.componentToJson(component)); + } + + public void writeItemStackToBuffer_server(ItemStack stack) { + if (stack == null) { + this.writeShort(-1); + } else { + this.writeShort(Item.getIdFromItem(stack.getItem())); + this.writeByte(stack.stackSize); + this.writeShort(stack.getMetadata()); + NBTTagCompound nbttagcompound = null; + if (stack.getItem().isDamageable() || stack.getItem().getShareTag()) { + nbttagcompound = stack.getTagCompound(); + } + + this.writeNBTTagCompoundToBuffer(nbttagcompound); + } + + } + + public ItemStack readItemStackFromBuffer_server() throws IOException { + ItemStack itemstack = null; + short short1 = this.readShort(); + if (short1 >= 0) { + byte b0 = this.readByte(); + short short2 = this.readShort(); + itemstack = new ItemStack(Item.getItemById(short1), b0, short2); + itemstack.setTagCompound(this.readNBTTagCompoundFromBuffer()); + } + + return itemstack; + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/INetHandlerHandshakeServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/INetHandlerHandshakeServer.java new file mode 100644 index 0000000..4de3053 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/INetHandlerHandshakeServer.java @@ -0,0 +1,35 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake.client.C00Handshake; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INetHandlerHandshakeServer extends INetHandler { + /**+ + * There are two recognized intentions for initiating a + * handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to + * the specified intention, although a login-intention must pass + * a versioncheck or receive a disconnect otherwise + */ + void processHandshake(C00Handshake var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/client/C00Handshake.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/client/C00Handshake.java new file mode 100644 index 0000000..f40694a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/client/C00Handshake.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.EnumConnectionState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake.INetHandlerHandshakeServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C00Handshake implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/handshake/client/C00Handshake"); + } + + private int protocolVersion; + private String ip; + private int port; + private EnumConnectionState requestedState; + + public C00Handshake() { + } + + public C00Handshake(int version, String ip, int port, EnumConnectionState requestedState) { + this.protocolVersion = version; + this.ip = ip; + this.port = port; + this.requestedState = requestedState; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.protocolVersion = parPacketBuffer.readVarIntFromBuffer(); + this.ip = parPacketBuffer.readStringFromBuffer(255); + this.port = parPacketBuffer.readUnsignedShort(); + this.requestedState = EnumConnectionState.getById(parPacketBuffer.readVarIntFromBuffer()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.protocolVersion); + parPacketBuffer.writeString(this.ip); + parPacketBuffer.writeShort(this.port); + parPacketBuffer.writeVarIntToBuffer(this.requestedState.getId()); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerHandshakeServer inethandlerhandshakeserver) { + inethandlerhandshakeserver.processHandshake(this); + } + + public EnumConnectionState getRequestedState() { + return this.requestedState; + } + + public int getProtocolVersion() { + return this.protocolVersion; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginClient.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginClient.java new file mode 100644 index 0000000..d6f729f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginClient.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S00PacketDisconnect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S03PacketEnableCompression; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INetHandlerLoginClient extends INetHandler { + void handleEncryptionRequest(S01PacketEncryptionRequest var1); + + void handleLoginSuccess(S02PacketLoginSuccess var1); + + void handleDisconnect(S00PacketDisconnect var1); + + void handleEnableCompression(S03PacketEnableCompression var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginServer.java new file mode 100644 index 0000000..6007a07 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginServer.java @@ -0,0 +1,31 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client.C00PacketLoginStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client.C01PacketEncryptionResponse; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INetHandlerLoginServer extends INetHandler { + void processLoginStart(C00PacketLoginStart var1); + + void processEncryptionResponse(C01PacketEncryptionResponse var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C00PacketLoginStart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C00PacketLoginStart.java new file mode 100644 index 0000000..f6d7ffc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C00PacketLoginStart.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client; + +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C00PacketLoginStart implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/login/client/C00PacketLoginStart"); + } + + private GameProfile profile; + private byte[] skin; + + public C00PacketLoginStart() { + } + + public C00PacketLoginStart(GameProfile profileIn, byte[] skin) { + this.profile = profileIn; + this.skin = skin; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.profile = new GameProfile((EaglercraftUUID) null, parPacketBuffer.readStringFromBuffer(16)); + this.skin = parPacketBuffer.readByteArray(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.profile.getName()); + parPacketBuffer.writeByteArray(this.skin); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginServer inethandlerloginserver) { + inethandlerloginserver.processLoginStart(this); + } + + public GameProfile getProfile() { + return this.profile; + } + + public byte[] getSkin() { + return this.skin; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C01PacketEncryptionResponse.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C01PacketEncryptionResponse.java new file mode 100644 index 0000000..d95d7a4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C01PacketEncryptionResponse.java @@ -0,0 +1,61 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C01PacketEncryptionResponse implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/login/client/C01PacketEncryptionResponse"); + } + + private byte[] secretKeyEncrypted = new byte[0]; + private byte[] verifyTokenEncrypted = new byte[0]; + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.secretKeyEncrypted = parPacketBuffer.readByteArray(); + this.verifyTokenEncrypted = parPacketBuffer.readByteArray(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByteArray(this.secretKeyEncrypted); + parPacketBuffer.writeByteArray(this.verifyTokenEncrypted); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginServer inethandlerloginserver) { + inethandlerloginserver.processEncryptionResponse(this); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S00PacketDisconnect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S00PacketDisconnect.java new file mode 100644 index 0000000..e6307a5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S00PacketDisconnect.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S00PacketDisconnect implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/login/server/S00PacketDisconnect"); + } + + private IChatComponent reason; + + public S00PacketDisconnect() { + } + + public S00PacketDisconnect(IChatComponent reasonIn) { + this.reason = reasonIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.reason = parPacketBuffer.readChatComponent_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeChatComponent_server(this.reason); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient inethandlerloginclient) { + inethandlerloginclient.handleDisconnect(this); + } + + public IChatComponent func_149603_c() { + return this.reason; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S01PacketEncryptionRequest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S01PacketEncryptionRequest.java new file mode 100644 index 0000000..9906b4b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S01PacketEncryptionRequest.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S01PacketEncryptionRequest implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/login/server/S01PacketEncryptionRequest"); + } + + private String hashedServerId; + private byte[] verifyToken; + + public S01PacketEncryptionRequest() { + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.hashedServerId = parPacketBuffer.readStringFromBuffer(20); + parPacketBuffer.readByteArray(); + this.verifyToken = parPacketBuffer.readByteArray(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.hashedServerId); + parPacketBuffer.writeByteArray(new byte[0]); + parPacketBuffer.writeByteArray(this.verifyToken); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient inethandlerloginclient) { + inethandlerloginclient.handleEncryptionRequest(this); + } + + public String getServerId() { + return this.hashedServerId; + } + + public byte[] getVerifyToken() { + return this.verifyToken; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S02PacketLoginSuccess.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S02PacketLoginSuccess.java new file mode 100644 index 0000000..d7a824c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S02PacketLoginSuccess.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server; + +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S02PacketLoginSuccess implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/login/server/S02PacketLoginSuccess"); + } + + private GameProfile profile; + + public S02PacketLoginSuccess() { + } + + public S02PacketLoginSuccess(GameProfile profileIn) { + this.profile = profileIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + String s = parPacketBuffer.readStringFromBuffer(36); + String s1 = parPacketBuffer.readStringFromBuffer(16); + EaglercraftUUID uuid = EaglercraftUUID.fromString(s); + this.profile = new GameProfile(uuid, s1); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + EaglercraftUUID uuid = this.profile.getId(); + parPacketBuffer.writeString(uuid == null ? "" : uuid.toString()); + parPacketBuffer.writeString(this.profile.getName()); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient inethandlerloginclient) { + inethandlerloginclient.handleLoginSuccess(this); + } + + public GameProfile getProfile() { + return this.profile; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S03PacketEnableCompression.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S03PacketEnableCompression.java new file mode 100644 index 0000000..5cec4ac --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S03PacketEnableCompression.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S03PacketEnableCompression implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/login/server/S03PacketEnableCompression"); + } + + private int compressionTreshold; + + public S03PacketEnableCompression() { + } + + public S03PacketEnableCompression(int compressionTresholdIn) { + this.compressionTreshold = compressionTresholdIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.compressionTreshold = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.compressionTreshold); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient inethandlerloginclient) { + inethandlerloginclient.handleEnableCompression(this); + } + + public int getCompressionTreshold() { + return this.compressionTreshold; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayClient.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayClient.java new file mode 100644 index 0000000..0ef13cd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayClient.java @@ -0,0 +1,452 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S00PacketKeepAlive; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S01PacketJoinGame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S02PacketChat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S07PacketRespawn; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0APacketUseBed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0BPacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0DPacketCollectItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S14PacketEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1FPacketSetExperience; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S20PacketEntityProperties; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S21PacketChunkData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S23PacketBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S24PacketBlockAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S27PacketExplosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S28PacketEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S29PacketSoundEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2APacketParticles; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2FPacketSetSlot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S30PacketWindowItems; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S31PacketWindowProperty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S33PacketUpdateSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S34PacketMaps; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S37PacketStatistics; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3APacketTabComplete; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3EPacketTeams; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S40PacketDisconnect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S42PacketCombatEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S43PacketCamera; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S44PacketWorldBorder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S45PacketTitle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S46PacketSetCompressionLevel; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S49PacketUpdateEntityNBT; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INetHandlerPlayClient extends INetHandler { + /**+ + * Spawns an instance of the objecttype indicated by the packet + * and sets its position and momentum + */ + void handleSpawnObject(S0EPacketSpawnObject var1); + + /**+ + * Spawns an experience orb and sets its value (amount of XP) + */ + void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb var1); + + /**+ + * Handles globally visible entities. Used in vanilla for + * lightning bolts + */ + void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity var1); + + /**+ + * Spawns the mob entity at the specified location, with the + * specified rotation, momentum and type. Updates the entities + * Datawatchers with the entity metadata specified in the packet + */ + void handleSpawnMob(S0FPacketSpawnMob var1); + + /**+ + * May create a scoreboard objective, remove an objective from + * the scoreboard or update an objectives' displayname + */ + void handleScoreboardObjective(S3BPacketScoreboardObjective var1); + + /**+ + * Handles the spawning of a painting object + */ + void handleSpawnPainting(S10PacketSpawnPainting var1); + + /**+ + * Handles the creation of a nearby player entity, sets the + * position and held item + */ + void handleSpawnPlayer(S0CPacketSpawnPlayer var1); + + /**+ + * Renders a specified animation: Waking up a player, a living + * entity swinging its currently held item, being hurt or + * receiving a critical hit by normal or magical means + */ + void handleAnimation(S0BPacketAnimation var1); + + /**+ + * Updates the players statistics or achievements + */ + void handleStatistics(S37PacketStatistics var1); + + /**+ + * Updates all registered IWorldAccess instances with + * destroyBlockInWorldPartially + */ + void handleBlockBreakAnim(S25PacketBlockBreakAnim var1); + + /**+ + * Creates a sign in the specified location if it didn't exist + * and opens the GUI to edit its text + */ + void handleSignEditorOpen(S36PacketSignEditorOpen var1); + + /**+ + * Updates the NBTTagCompound metadata of instances of the + * following entitytypes: Mob spawners, command blocks, beacons, + * skulls, flowerpot + */ + void handleUpdateTileEntity(S35PacketUpdateTileEntity var1); + + /**+ + * Triggers Block.onBlockEventReceived, which is implemented in + * BlockPistonBase for extension/retraction, BlockNote for + * setting the instrument (including audiovisual feedback) and + * in BlockContainer to set the number of players accessing a + * (Ender)Chest + */ + void handleBlockAction(S24PacketBlockAction var1); + + /**+ + * Updates the block and metadata and generates a blockupdate + * (and notify the clients) + */ + void handleBlockChange(S23PacketBlockChange var1); + + /**+ + * Prints a chatmessage in the chat GUI + */ + void handleChat(S02PacketChat var1); + + /**+ + * Displays the available command-completion options the server + * knows of + */ + void handleTabComplete(S3APacketTabComplete var1); + + /**+ + * Received from the servers PlayerManager if between 1 and 64 + * blocks in a chunk are changed. If only one block requires an + * update, the server sends S23PacketBlockChange and if 64 or + * more blocks are changed, the server sends S21PacketChunkData + */ + void handleMultiBlockChange(S22PacketMultiBlockChange var1); + + /**+ + * Updates the worlds MapStorage with the specified MapData for + * the specified map-identifier and invokes a MapItemRenderer + * for it + */ + void handleMaps(S34PacketMaps var1); + + /**+ + * Verifies that the server and client are synchronized with + * respect to the inventory/container opened by the player and + * confirms if it is the case. + */ + void handleConfirmTransaction(S32PacketConfirmTransaction var1); + + /**+ + * Resets the ItemStack held in hand and closes the window that + * is opened + */ + void handleCloseWindow(S2EPacketCloseWindow var1); + + /**+ + * Handles the placement of a specified ItemStack in a specified + * container/inventory slot + */ + void handleWindowItems(S30PacketWindowItems var1); + + /**+ + * Displays a GUI by ID. In order starting from id 0: Chest, + * Workbench, Furnace, Dispenser, Enchanting table, Brewing + * stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, + * Horse + */ + void handleOpenWindow(S2DPacketOpenWindow var1); + + /**+ + * Sets the progressbar of the opened window to the specified + * value + */ + void handleWindowProperty(S31PacketWindowProperty var1); + + /**+ + * Handles pickin up an ItemStack or dropping one in your + * inventory or an open (non-creative) container + */ + void handleSetSlot(S2FPacketSetSlot var1); + + /**+ + * Handles packets that have room for a channel specification. + * Vanilla implemented channels are "MC|TrList" to acquire a + * MerchantRecipeList trades for a villager merchant, "MC|Brand" + * which sets the server brand? on the player instance and + * finally "MC|RPack" which the server uses to communicate the + * identifier of the default server resourcepack for the client + * to load. + */ + void handleCustomPayload(S3FPacketCustomPayload var1); + + /**+ + * Closes the network channel + */ + void handleDisconnect(S40PacketDisconnect var1); + + /**+ + * Retrieves the player identified by the packet, puts him to + * sleep if possible (and flags whether all players are asleep) + */ + void handleUseBed(S0APacketUseBed var1); + + /**+ + * Invokes the entities' handleUpdateHealth method which is + * implemented in LivingBase (hurt/death), MinecartMobSpawner + * (spawn delay), FireworkRocket & MinecartTNT (explosion), + * IronGolem (throwing,...), Witch (spawn particles), Zombie + * (villager transformation), Animal (breeding mode particles), + * Horse (breeding/smoke particles), Sheep (...), Tameable + * (...), Villager (particles for breeding mode, angry and + * happy), Wolf (...) + */ + void handleEntityStatus(S19PacketEntityStatus var1); + + void handleEntityAttach(S1BPacketEntityAttach var1); + + /**+ + * Initiates a new explosion (sound, particles, drop spawn) for + * the affected blocks indicated by the packet. + */ + void handleExplosion(S27PacketExplosion var1); + + void handleChangeGameState(S2BPacketChangeGameState var1); + + void handleKeepAlive(S00PacketKeepAlive var1); + + /**+ + * Updates the specified chunk with the supplied data, marks it + * for re-rendering and lighting recalculation + */ + void handleChunkData(S21PacketChunkData var1); + + void handleMapChunkBulk(S26PacketMapChunkBulk var1); + + void handleEffect(S28PacketEffect var1); + + /**+ + * Registers some server properties + * (gametype,hardcore-mode,terraintype,difficulty,player limit), + * creates a new WorldClient and sets the player initial + * dimension + */ + void handleJoinGame(S01PacketJoinGame var1); + + /**+ + * Updates the specified entity's position by the specified + * relative moment and absolute rotation. Note that subclassing + * of the packet allows for the specification of a subset of + * this data (e.g. only rel. position, abs. rotation or both). + */ + void handleEntityMovement(S14PacketEntity var1); + + /**+ + * Handles changes in player positioning and rotation such as + * when travelling to a new dimension, (re)spawning, mounting + * horses etc. Seems to immediately reply to the server with the + * clients post-processing perspective on the player positioning + */ + void handlePlayerPosLook(S08PacketPlayerPosLook var1); + + /**+ + * Spawns a specified number of particles at the specified + * location with a randomized displacement according to + * specified bounds + */ + void handleParticles(S2APacketParticles var1); + + void handlePlayerAbilities(S39PacketPlayerAbilities var1); + + void handlePlayerListItem(S38PacketPlayerListItem var1); + + /**+ + * Locally eliminates the entities. Invoked by the server when + * the items are in fact destroyed, or the player is no longer + * registered as required to monitor them. The latter happens + * when distance between the player and item increases beyond a + * certain treshold (typically the viewing distance) + */ + void handleDestroyEntities(S13PacketDestroyEntities var1); + + void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect var1); + + void handleRespawn(S07PacketRespawn var1); + + /**+ + * Updates the direction in which the specified entity is + * looking, normally this head rotation is independent of the + * rotation of the entity itself + */ + void handleEntityHeadLook(S19PacketEntityHeadLook var1); + + /**+ + * Updates which hotbar slot of the player is currently selected + */ + void handleHeldItemChange(S09PacketHeldItemChange var1); + + /**+ + * Removes or sets the ScoreObjective to be displayed at a + * particular scoreboard position (list, sidebar, below name) + */ + void handleDisplayScoreboard(S3DPacketDisplayScoreboard var1); + + /**+ + * Invoked when the server registers new proximate objects in + * your watchlist or when objects in your watchlist have changed + * -> Registers any changes locally + */ + void handleEntityMetadata(S1CPacketEntityMetadata var1); + + /**+ + * Sets the velocity of the specified entity to the specified + * value + */ + void handleEntityVelocity(S12PacketEntityVelocity var1); + + void handleEntityEquipment(S04PacketEntityEquipment var1); + + void handleSetExperience(S1FPacketSetExperience var1); + + void handleUpdateHealth(S06PacketUpdateHealth var1); + + /**+ + * Updates a team managed by the scoreboard: Create/Remove the + * team registration, Register/Remove the + * player-team-memberships, Set team displayname/prefix/suffix + * and/or whether friendly fire is enabled + */ + void handleTeams(S3EPacketTeams var1); + + /**+ + * Either updates the score with a specified value or removes + * the score for an objective + */ + void handleUpdateScore(S3CPacketUpdateScore var1); + + void handleSpawnPosition(S05PacketSpawnPosition var1); + + void handleTimeUpdate(S03PacketTimeUpdate var1); + + /**+ + * Updates a specified sign with the specified text lines + */ + void handleUpdateSign(S33PacketUpdateSign var1); + + void handleSoundEffect(S29PacketSoundEffect var1); + + void handleCollectItem(S0DPacketCollectItem var1); + + /**+ + * Updates an entity's position and rotation as specified by the + * packet + */ + void handleEntityTeleport(S18PacketEntityTeleport var1); + + /**+ + * Updates en entity's attributes and their respective + * modifiers, which are used for speed bonusses (player + * sprinting, animals fleeing, baby speed), weapon/tool + * attackDamage, hostiles followRange randomization, zombie + * maxHealth and knockback resistance as well as reinforcement + * spawning chance. + */ + void handleEntityProperties(S20PacketEntityProperties var1); + + void handleEntityEffect(S1DPacketEntityEffect var1); + + void handleCombatEvent(S42PacketCombatEvent var1); + + void handleServerDifficulty(S41PacketServerDifficulty var1); + + void handleCamera(S43PacketCamera var1); + + void handleWorldBorder(S44PacketWorldBorder var1); + + void handleTitle(S45PacketTitle var1); + + void handleSetCompressionLevel(S46PacketSetCompressionLevel var1); + + void handlePlayerListHeaderFooter(S47PacketPlayerListHeaderFooter var1); + + void handleResourcePack(S48PacketResourcePackSend var1); + + void handleEntityNBT(S49PacketUpdateEntityNBT var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayServer.java new file mode 100644 index 0000000..8150c48 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayServer.java @@ -0,0 +1,179 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C00PacketKeepAlive; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C01PacketChatMessage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C02PacketUseEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C03PacketPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0APacketAnimation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0BPacketEntityAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0CPacketInput; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0EPacketClickWindow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C11PacketEnchantItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C12PacketUpdateSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C14PacketTabComplete; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C15PacketClientSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C16PacketClientStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C17PacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C18PacketSpectate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client.C19PacketResourcePackStatus; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface INetHandlerPlayServer extends INetHandler { + void handleAnimation(C0APacketAnimation var1); + + /**+ + * Process chat messages (broadcast back to clients) and + * commands (executes) + */ + void processChatMessage(C01PacketChatMessage var1); + + /**+ + * Retrieves possible tab completions for the requested command + * string and sends them to the client + */ + void processTabComplete(C14PacketTabComplete var1); + + /**+ + * Processes the client status updates: respawn attempt from + * player, opening statistics or achievements, or acquiring + * 'open inventory' achievement + */ + void processClientStatus(C16PacketClientStatus var1); + + /**+ + * Updates serverside copy of client settings: language, render + * distance, chat visibility, chat colours, difficulty, and + * whether to show the cape + */ + void processClientSettings(C15PacketClientSettings var1); + + /**+ + * Received in response to the server requesting to confirm that + * the client-side open container matches the servers' after a + * mismatched container-slot manipulation. It will unlock the + * player's ability to manipulate the container contents + */ + void processConfirmTransaction(C0FPacketConfirmTransaction var1); + + /**+ + * Enchants the item identified by the packet given some + * convoluted conditions (matching window, which + * should/shouldn't be in use?) + */ + void processEnchantItem(C11PacketEnchantItem var1); + + /**+ + * Executes a container/inventory slot manipulation as indicated + * by the packet. Sends the serverside result if they didn't + * match the indicated result and prevents further manipulation + * by the player until he confirms that it has the same open + * container/inventory + */ + void processClickWindow(C0EPacketClickWindow var1); + + /**+ + * Processes the client closing windows (container) + */ + void processCloseWindow(C0DPacketCloseWindow var1); + + /**+ + * Synchronizes serverside and clientside book contents and + * signing + */ + void processVanilla250Packet(C17PacketCustomPayload var1); + + /**+ + * Processes interactions ((un)leashing, opening command block + * GUI) and attacks on an entity with players currently equipped + * item + */ + void processUseEntity(C02PacketUseEntity var1); + + /**+ + * Updates a players' ping statistics + */ + void processKeepAlive(C00PacketKeepAlive var1); + + /**+ + * Processes clients perspective on player positioning and/or + * orientation + */ + void processPlayer(C03PacketPlayer var1); + + /**+ + * Processes a player starting/stopping flying + */ + void processPlayerAbilities(C13PacketPlayerAbilities var1); + + /**+ + * Processes the player initiating/stopping digging on a + * particular spot, as well as a player dropping items?. (0: + * initiated, 1: reinitiated, 2? , 3-4 drop item (respectively + * without or with player control), 5: stopped; x,y,z, side + * clicked on;) + */ + void processPlayerDigging(C07PacketPlayerDigging var1); + + /**+ + * Processes a range of action-types: sneaking, sprinting, + * waking from sleep, opening the inventory or setting jump + * height of the horse the player is riding + */ + void processEntityAction(C0BPacketEntityAction var1); + + /**+ + * Processes player movement input. Includes walking, strafing, + * jumping, sneaking; excludes riding and toggling + * flying/sprinting + */ + void processInput(C0CPacketInput var1); + + /**+ + * Updates which quickbar slot is selected + */ + void processHeldItemChange(C09PacketHeldItemChange var1); + + /**+ + * Update the server with an ItemStack in a slot. + */ + void processCreativeInventoryAction(C10PacketCreativeInventoryAction var1); + + void processUpdateSign(C12PacketUpdateSign var1); + + /**+ + * Processes block placement and block activation (anvil, + * furnace, etc.) + */ + void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement var1); + + void handleSpectate(C18PacketSpectate var1); + + void handleResourcePackStatus(C19PacketResourcePackStatus var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C00PacketKeepAlive.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C00PacketKeepAlive.java new file mode 100644 index 0000000..481e15f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C00PacketKeepAlive.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C00PacketKeepAlive implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C00PacketKeepAlive"); + } + + private int key; + + public C00PacketKeepAlive() { + } + + public C00PacketKeepAlive(int key) { + this.key = key; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processKeepAlive(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.key = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.key); + } + + public int getKey() { + return this.key; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C01PacketChatMessage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C01PacketChatMessage.java new file mode 100644 index 0000000..17134ea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C01PacketChatMessage.java @@ -0,0 +1,73 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C01PacketChatMessage implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C01PacketChatMessage"); + } + + private String message; + + public C01PacketChatMessage() { + } + + public C01PacketChatMessage(String messageIn) { + if (messageIn.length() > 100) { + messageIn = messageIn.substring(0, 100); + } + + this.message = messageIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.message = parPacketBuffer.readStringFromBuffer(100); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.message); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processChatMessage(this); + } + + public String getMessage() { + return this.message; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C02PacketUseEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C02PacketUseEntity.java new file mode 100644 index 0000000..752470c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C02PacketUseEntity.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C02PacketUseEntity implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C02PacketUseEntity"); + } + + private int entityId; + private C02PacketUseEntity.Action action; + private Vec3 hitVec; + + public C02PacketUseEntity() { + } + + public C02PacketUseEntity(Entity entity, C02PacketUseEntity.Action action) { + this.entityId = entity.getEntityId(); + this.action = action; + } + + public C02PacketUseEntity(Entity entity, Vec3 hitVec) { + this(entity, C02PacketUseEntity.Action.INTERACT_AT); + this.hitVec = hitVec; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.action = (C02PacketUseEntity.Action) parPacketBuffer.readEnumValue(C02PacketUseEntity.Action.class); + if (this.action == C02PacketUseEntity.Action.INTERACT_AT) { + this.hitVec = new Vec3((double) parPacketBuffer.readFloat(), (double) parPacketBuffer.readFloat(), + (double) parPacketBuffer.readFloat()); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeEnumValue(this.action); + if (this.action == C02PacketUseEntity.Action.INTERACT_AT) { + parPacketBuffer.writeFloat((float) this.hitVec.xCoord); + parPacketBuffer.writeFloat((float) this.hitVec.yCoord); + parPacketBuffer.writeFloat((float) this.hitVec.zCoord); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processUseEntity(this); + } + + public Entity getEntityFromWorld(World worldIn) { + return worldIn.getEntityByID(this.entityId); + } + + public C02PacketUseEntity.Action getAction() { + return this.action; + } + + public Vec3 getHitVec() { + return this.hitVec; + } + + public static enum Action { + INTERACT, ATTACK, INTERACT_AT; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C03PacketPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C03PacketPlayer.java new file mode 100644 index 0000000..f681c46 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C03PacketPlayer.java @@ -0,0 +1,216 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C03PacketPlayer implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C03PacketPlayer"); + } + + protected double x; + protected double y; + protected double z; + protected float yaw; + protected float pitch; + protected boolean onGround; + protected boolean moving; + protected boolean rotating; + + public C03PacketPlayer() { + } + + public C03PacketPlayer(boolean isOnGround) { + this.onGround = isOnGround; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processPlayer(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.onGround = parPacketBuffer.readUnsignedByte() != 0; + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.onGround ? 1 : 0); + } + + public double getPositionX() { + return this.x; + } + + public double getPositionY() { + return this.y; + } + + public double getPositionZ() { + return this.z; + } + + public float getYaw() { + return this.yaw; + } + + public float getPitch() { + return this.pitch; + } + + public boolean isOnGround() { + return this.onGround; + } + + public boolean isMoving() { + return this.moving; + } + + public boolean getRotating() { + return this.rotating; + } + + public void setMoving(boolean isMoving) { + this.moving = isMoving; + } + + public static class C04PacketPlayerPosition extends C03PacketPlayer { + public C04PacketPlayerPosition() { + this.moving = true; + } + + public C04PacketPlayerPosition(double posX, double posY, double posZ, boolean isOnGround) { + this.x = posX; + this.y = posY; + this.z = posZ; + this.onGround = isOnGround; + this.moving = true; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.x = parPacketBuffer.readDouble(); + this.y = parPacketBuffer.readDouble(); + this.z = parPacketBuffer.readDouble(); + super.readPacketData(parPacketBuffer); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeDouble(this.x); + parPacketBuffer.writeDouble(this.y); + parPacketBuffer.writeDouble(this.z); + super.writePacketData(parPacketBuffer); + } + } + + public static class C05PacketPlayerLook extends C03PacketPlayer { + public C05PacketPlayerLook() { + this.rotating = true; + } + + public C05PacketPlayerLook(float playerYaw, float playerPitch, boolean isOnGround) { + this.yaw = playerYaw; + this.pitch = playerPitch; + this.onGround = isOnGround; + this.rotating = true; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.yaw = parPacketBuffer.readFloat(); + this.pitch = parPacketBuffer.readFloat(); + super.readPacketData(parPacketBuffer); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeFloat(this.yaw); + parPacketBuffer.writeFloat(this.pitch); + super.writePacketData(parPacketBuffer); + } + } + + public static class C06PacketPlayerPosLook extends C03PacketPlayer { + public C06PacketPlayerPosLook() { + this.moving = true; + this.rotating = true; + } + + public C06PacketPlayerPosLook(double playerX, double playerY, double playerZ, float playerYaw, + float playerPitch, boolean playerIsOnGround) { + this.x = playerX; + this.y = playerY; + this.z = playerZ; + this.yaw = playerYaw; + this.pitch = playerPitch; + this.onGround = playerIsOnGround; + this.rotating = true; + this.moving = true; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.x = parPacketBuffer.readDouble(); + this.y = parPacketBuffer.readDouble(); + this.z = parPacketBuffer.readDouble(); + this.yaw = parPacketBuffer.readFloat(); + this.pitch = parPacketBuffer.readFloat(); + super.readPacketData(parPacketBuffer); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeDouble(this.x); + parPacketBuffer.writeDouble(this.y); + parPacketBuffer.writeDouble(this.z); + parPacketBuffer.writeFloat(this.yaw); + parPacketBuffer.writeFloat(this.pitch); + super.writePacketData(parPacketBuffer); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C07PacketPlayerDigging.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C07PacketPlayerDigging.java new file mode 100644 index 0000000..3d5eb80 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C07PacketPlayerDigging.java @@ -0,0 +1,92 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C07PacketPlayerDigging implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C07PacketPlayerDigging"); + } + + private BlockPos position; + private EnumFacing facing; + private C07PacketPlayerDigging.Action status; + + public C07PacketPlayerDigging() { + } + + public C07PacketPlayerDigging(C07PacketPlayerDigging.Action statusIn, BlockPos posIn, EnumFacing facingIn) { + this.status = statusIn; + this.position = posIn; + this.facing = facingIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.status = (C07PacketPlayerDigging.Action) parPacketBuffer + .readEnumValue(C07PacketPlayerDigging.Action.class); + this.position = parPacketBuffer.readBlockPos_server(); + this.facing = EnumFacing.getFront(parPacketBuffer.readUnsignedByte()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeEnumValue(this.status); + parPacketBuffer.writeBlockPos_server(this.position); + parPacketBuffer.writeByte(this.facing.getIndex()); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processPlayerDigging(this); + } + + public BlockPos getPosition() { + return this.position; + } + + public EnumFacing getFacing() { + return this.facing; + } + + public C07PacketPlayerDigging.Action getStatus() { + return this.status; + } + + public static enum Action { + START_DESTROY_BLOCK, ABORT_DESTROY_BLOCK, STOP_DESTROY_BLOCK, DROP_ALL_ITEMS, DROP_ITEM, RELEASE_USE_ITEM; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java new file mode 100644 index 0000000..925cc45 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java @@ -0,0 +1,129 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C08PacketPlayerBlockPlacement implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C08PacketPlayerBlockPlacement"); + } + + private static final BlockPos field_179726_a = new BlockPos(-1, -1, -1); + private BlockPos position; + private int placedBlockDirection; + private ItemStack stack; + private float facingX; + private float facingY; + private float facingZ; + + public C08PacketPlayerBlockPlacement() { + } + + public C08PacketPlayerBlockPlacement(ItemStack stackIn) { + this(field_179726_a, 255, stackIn, 0.0F, 0.0F, 0.0F); + } + + public C08PacketPlayerBlockPlacement(BlockPos positionIn, int placedBlockDirectionIn, ItemStack stackIn, + float facingXIn, float facingYIn, float facingZIn) { + this.position = positionIn; + this.placedBlockDirection = placedBlockDirectionIn; + this.stack = stackIn != null ? stackIn.copy() : null; + this.facingX = facingXIn; + this.facingY = facingYIn; + this.facingZ = facingZIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.position = parPacketBuffer.readBlockPos_server(); + this.placedBlockDirection = parPacketBuffer.readUnsignedByte(); + this.stack = parPacketBuffer.readItemStackFromBuffer_server(); + this.facingX = (float) parPacketBuffer.readUnsignedByte() / 16.0F; + this.facingY = (float) parPacketBuffer.readUnsignedByte() / 16.0F; + this.facingZ = (float) parPacketBuffer.readUnsignedByte() / 16.0F; + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.position); + parPacketBuffer.writeByte(this.placedBlockDirection); + parPacketBuffer.writeItemStackToBuffer_server(this.stack); + parPacketBuffer.writeByte((int) (this.facingX * 16.0F)); + parPacketBuffer.writeByte((int) (this.facingY * 16.0F)); + parPacketBuffer.writeByte((int) (this.facingZ * 16.0F)); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processPlayerBlockPlacement(this); + } + + public BlockPos getPosition() { + return this.position; + } + + public int getPlacedBlockDirection() { + return this.placedBlockDirection; + } + + public ItemStack getStack() { + return this.stack; + } + + /**+ + * Returns the offset from xPosition where the actual click took + * place. + */ + public float getPlacedBlockOffsetX() { + return this.facingX; + } + + /**+ + * Returns the offset from yPosition where the actual click took + * place. + */ + public float getPlacedBlockOffsetY() { + return this.facingY; + } + + /**+ + * Returns the offset from zPosition where the actual click took + * place. + */ + public float getPlacedBlockOffsetZ() { + return this.facingZ; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C09PacketHeldItemChange.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C09PacketHeldItemChange.java new file mode 100644 index 0000000..600ff2d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C09PacketHeldItemChange.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C09PacketHeldItemChange implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C09PacketHeldItemChange"); + } + + private int slotId; + + public C09PacketHeldItemChange() { + } + + public C09PacketHeldItemChange(int slotId) { + this.slotId = slotId; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.slotId = parPacketBuffer.readShort(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeShort(this.slotId); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processHeldItemChange(this); + } + + public int getSlotId() { + return this.slotId; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0APacketAnimation.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0APacketAnimation.java new file mode 100644 index 0000000..fbd55da --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0APacketAnimation.java @@ -0,0 +1,54 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C0APacketAnimation implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C0APacketAnimation"); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.handleAnimation(this); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0BPacketEntityAction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0BPacketEntityAction.java new file mode 100644 index 0000000..f3f137f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0BPacketEntityAction.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C0BPacketEntityAction implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C0BPacketEntityAction"); + } + + private int entityID; + private C0BPacketEntityAction.Action action; + private int auxData; + + public C0BPacketEntityAction() { + } + + public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action) { + this(entity, action, 0); + } + + public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action, int auxData) { + this.entityID = entity.getEntityId(); + this.action = action; + this.auxData = auxData; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityID = parPacketBuffer.readVarIntFromBuffer(); + this.action = (C0BPacketEntityAction.Action) parPacketBuffer.readEnumValue(C0BPacketEntityAction.Action.class); + this.auxData = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityID); + parPacketBuffer.writeEnumValue(this.action); + parPacketBuffer.writeVarIntToBuffer(this.auxData); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processEntityAction(this); + } + + public C0BPacketEntityAction.Action getAction() { + return this.action; + } + + public int getAuxData() { + return this.auxData; + } + + public static enum Action { + START_SNEAKING, STOP_SNEAKING, STOP_SLEEPING, START_SPRINTING, STOP_SPRINTING, RIDING_JUMP, OPEN_INVENTORY; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0CPacketInput.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0CPacketInput.java new file mode 100644 index 0000000..c564465 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0CPacketInput.java @@ -0,0 +1,102 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C0CPacketInput implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C0CPacketInput"); + } + + private float strafeSpeed; + private float forwardSpeed; + private boolean jumping; + private boolean sneaking; + + public C0CPacketInput() { + } + + public C0CPacketInput(float strafeSpeed, float forwardSpeed, boolean jumping, boolean sneaking) { + this.strafeSpeed = strafeSpeed; + this.forwardSpeed = forwardSpeed; + this.jumping = jumping; + this.sneaking = sneaking; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.strafeSpeed = parPacketBuffer.readFloat(); + this.forwardSpeed = parPacketBuffer.readFloat(); + byte b0 = parPacketBuffer.readByte(); + this.jumping = (b0 & 1) > 0; + this.sneaking = (b0 & 2) > 0; + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeFloat(this.strafeSpeed); + parPacketBuffer.writeFloat(this.forwardSpeed); + byte b0 = 0; + if (this.jumping) { + b0 = (byte) (b0 | 1); + } + + if (this.sneaking) { + b0 = (byte) (b0 | 2); + } + + parPacketBuffer.writeByte(b0); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processInput(this); + } + + public float getStrafeSpeed() { + return this.strafeSpeed; + } + + public float getForwardSpeed() { + return this.forwardSpeed; + } + + public boolean isJumping() { + return this.jumping; + } + + public boolean isSneaking() { + return this.sneaking; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0DPacketCloseWindow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0DPacketCloseWindow.java new file mode 100644 index 0000000..79c93d3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0DPacketCloseWindow.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C0DPacketCloseWindow implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C0DPacketCloseWindow"); + } + + private int windowId; + + public C0DPacketCloseWindow() { + } + + public C0DPacketCloseWindow(int windowId) { + this.windowId = windowId; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processCloseWindow(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0EPacketClickWindow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0EPacketClickWindow.java new file mode 100644 index 0000000..0285de8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0EPacketClickWindow.java @@ -0,0 +1,111 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C0EPacketClickWindow implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C0EPacketClickWindow"); + } + + private int windowId; + private int slotId; + private int usedButton; + private short actionNumber; + private ItemStack clickedItem; + private int mode; + + public C0EPacketClickWindow() { + } + + public C0EPacketClickWindow(int windowId, int slotId, int usedButton, int mode, ItemStack clickedItem, + short actionNumber) { + this.windowId = windowId; + this.slotId = slotId; + this.usedButton = usedButton; + this.clickedItem = clickedItem != null ? clickedItem.copy() : null; + this.actionNumber = actionNumber; + this.mode = mode; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processClickWindow(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readByte(); + this.slotId = parPacketBuffer.readShort(); + this.usedButton = parPacketBuffer.readByte(); + this.actionNumber = parPacketBuffer.readShort(); + this.mode = parPacketBuffer.readByte(); + this.clickedItem = parPacketBuffer.readItemStackFromBuffer_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeShort(this.slotId); + parPacketBuffer.writeByte(this.usedButton); + parPacketBuffer.writeShort(this.actionNumber); + parPacketBuffer.writeByte(this.mode); + parPacketBuffer.writeItemStackToBuffer_server(this.clickedItem); + } + + public int getWindowId() { + return this.windowId; + } + + public int getSlotId() { + return this.slotId; + } + + public int getUsedButton() { + return this.usedButton; + } + + public short getActionNumber() { + return this.actionNumber; + } + + public ItemStack getClickedItem() { + return this.clickedItem; + } + + public int getMode() { + return this.mode; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java new file mode 100644 index 0000000..d3b0205 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C0FPacketConfirmTransaction implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C0FPacketConfirmTransaction"); + } + + private int windowId; + private short uid; + private boolean accepted; + + public C0FPacketConfirmTransaction() { + } + + public C0FPacketConfirmTransaction(int windowId, short uid, boolean accepted) { + this.windowId = windowId; + this.uid = uid; + this.accepted = accepted; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processConfirmTransaction(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readByte(); + this.uid = parPacketBuffer.readShort(); + this.accepted = parPacketBuffer.readByte() != 0; + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeShort(this.uid); + parPacketBuffer.writeByte(this.accepted ? 1 : 0); + } + + public int getWindowId() { + return this.windowId; + } + + public short getUid() { + return this.uid; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java new file mode 100644 index 0000000..ea813a9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C10PacketCreativeInventoryAction implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C10PacketCreativeInventoryAction"); + } + + private int slotId; + private ItemStack stack; + + public C10PacketCreativeInventoryAction() { + } + + public C10PacketCreativeInventoryAction(int slotIdIn, ItemStack stackIn) { + this.slotId = slotIdIn; + this.stack = stackIn != null ? stackIn.copy() : null; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processCreativeInventoryAction(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.slotId = parPacketBuffer.readShort(); + this.stack = parPacketBuffer.readItemStackFromBuffer_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeShort(this.slotId); + parPacketBuffer.writeItemStackToBuffer_server(this.stack); + } + + public int getSlotId() { + return this.slotId; + } + + public ItemStack getStack() { + return this.stack; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C11PacketEnchantItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C11PacketEnchantItem.java new file mode 100644 index 0000000..fdc0bbc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C11PacketEnchantItem.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C11PacketEnchantItem implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C11PacketEnchantItem"); + } + + private int windowId; + private int button; + + public C11PacketEnchantItem() { + } + + public C11PacketEnchantItem(int windowId, int button) { + this.windowId = windowId; + this.button = button; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processEnchantItem(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readByte(); + this.button = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeByte(this.button); + } + + public int getWindowId() { + return this.windowId; + } + + public int getButton() { + return this.button; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C12PacketUpdateSign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C12PacketUpdateSign.java new file mode 100644 index 0000000..112a9e0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C12PacketUpdateSign.java @@ -0,0 +1,92 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C12PacketUpdateSign implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C12PacketUpdateSign"); + } + + private BlockPos pos; + private IChatComponent[] lines; + + public C12PacketUpdateSign() { + } + + public C12PacketUpdateSign(BlockPos pos, IChatComponent[] lines) { + this.pos = pos; + this.lines = new IChatComponent[] { lines[0], lines[1], lines[2], lines[3] }; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.pos = parPacketBuffer.readBlockPos_server(); + this.lines = new IChatComponent[4]; + + for (int i = 0; i < 4; ++i) { + String s = parPacketBuffer.readStringFromBuffer(384); + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + this.lines[i] = ichatcomponent; + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.pos); + + for (int i = 0; i < 4; ++i) { + IChatComponent ichatcomponent = this.lines[i]; + String s = IChatComponent.Serializer.componentToJson(ichatcomponent); + parPacketBuffer.writeString(s); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processUpdateSign(this); + } + + public BlockPos getPosition() { + return this.pos; + } + + public IChatComponent[] getLines() { + return this.lines; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C13PacketPlayerAbilities.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C13PacketPlayerAbilities.java new file mode 100644 index 0000000..a74ce6f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C13PacketPlayerAbilities.java @@ -0,0 +1,141 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.PlayerCapabilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C13PacketPlayerAbilities implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C13PacketPlayerAbilities"); + } + + private boolean invulnerable; + private boolean flying; + private boolean allowFlying; + private boolean creativeMode; + private float flySpeed; + private float walkSpeed; + + public C13PacketPlayerAbilities() { + } + + public C13PacketPlayerAbilities(PlayerCapabilities capabilities) { + this.setInvulnerable(capabilities.disableDamage); + this.setFlying(capabilities.isFlying); + this.setAllowFlying(capabilities.allowFlying); + this.setCreativeMode(capabilities.isCreativeMode); + this.setFlySpeed(capabilities.getFlySpeed()); + this.setWalkSpeed(capabilities.getWalkSpeed()); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + byte b0 = parPacketBuffer.readByte(); + this.setInvulnerable((b0 & 1) > 0); + this.setFlying((b0 & 2) > 0); + this.setAllowFlying((b0 & 4) > 0); + this.setCreativeMode((b0 & 8) > 0); + this.setFlySpeed(parPacketBuffer.readFloat()); + this.setWalkSpeed(parPacketBuffer.readFloat()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + byte b0 = 0; + if (this.isInvulnerable()) { + b0 = (byte) (b0 | 1); + } + + if (this.isFlying()) { + b0 = (byte) (b0 | 2); + } + + if (this.isAllowFlying()) { + b0 = (byte) (b0 | 4); + } + + if (this.isCreativeMode()) { + b0 = (byte) (b0 | 8); + } + + parPacketBuffer.writeByte(b0); + parPacketBuffer.writeFloat(this.flySpeed); + parPacketBuffer.writeFloat(this.walkSpeed); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processPlayerAbilities(this); + } + + public boolean isInvulnerable() { + return this.invulnerable; + } + + public void setInvulnerable(boolean isInvulnerable) { + this.invulnerable = isInvulnerable; + } + + public boolean isFlying() { + return this.flying; + } + + public void setFlying(boolean isFlying) { + this.flying = isFlying; + } + + public boolean isAllowFlying() { + return this.allowFlying; + } + + public void setAllowFlying(boolean isAllowFlying) { + this.allowFlying = isAllowFlying; + } + + public boolean isCreativeMode() { + return this.creativeMode; + } + + public void setCreativeMode(boolean isCreativeMode) { + this.creativeMode = isCreativeMode; + } + + public void setFlySpeed(float flySpeedIn) { + this.flySpeed = flySpeedIn; + } + + public void setWalkSpeed(float walkSpeedIn) { + this.walkSpeed = walkSpeedIn; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C14PacketTabComplete.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C14PacketTabComplete.java new file mode 100644 index 0000000..6cf68d3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C14PacketTabComplete.java @@ -0,0 +1,92 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import org.apache.commons.lang3.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C14PacketTabComplete implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C14PacketTabComplete"); + } + + private String message; + private BlockPos targetBlock; + + public C14PacketTabComplete() { + } + + public C14PacketTabComplete(String msg) { + this(msg, (BlockPos) null); + } + + public C14PacketTabComplete(String msg, BlockPos target) { + this.message = msg; + this.targetBlock = target; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.message = parPacketBuffer.readStringFromBuffer(32767); + boolean flag = parPacketBuffer.readBoolean(); + if (flag) { + this.targetBlock = parPacketBuffer.readBlockPos_server(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(StringUtils.substring(this.message, 0, 32767)); + boolean flag = this.targetBlock != null; + parPacketBuffer.writeBoolean(flag); + if (flag) { + parPacketBuffer.writeBlockPos_server(this.targetBlock); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processTabComplete(this); + } + + public String getMessage() { + return this.message; + } + + public BlockPos getTargetBlock() { + return this.targetBlock; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C15PacketClientSettings.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C15PacketClientSettings.java new file mode 100644 index 0000000..11cf602 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C15PacketClientSettings.java @@ -0,0 +1,103 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C15PacketClientSettings implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C15PacketClientSettings"); + } + + private String lang; + private int view; + private EntityPlayer.EnumChatVisibility chatVisibility; + private boolean enableColors; + private int modelPartFlags; + + public C15PacketClientSettings() { + } + + public C15PacketClientSettings(String langIn, int viewIn, EntityPlayer.EnumChatVisibility chatVisibilityIn, + boolean enableColorsIn, int modelPartFlagsIn) { + this.lang = langIn; + this.view = viewIn; + this.chatVisibility = chatVisibilityIn; + this.enableColors = enableColorsIn; + this.modelPartFlags = modelPartFlagsIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.lang = parPacketBuffer.readStringFromBuffer(7); + this.view = parPacketBuffer.readByte(); + this.chatVisibility = EntityPlayer.EnumChatVisibility.getEnumChatVisibility(parPacketBuffer.readByte()); + this.enableColors = parPacketBuffer.readBoolean(); + this.modelPartFlags = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.lang); + parPacketBuffer.writeByte(this.view); + parPacketBuffer.writeByte(this.chatVisibility.getChatVisibility()); + parPacketBuffer.writeBoolean(this.enableColors); + parPacketBuffer.writeByte(this.modelPartFlags); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processClientSettings(this); + } + + public String getLang() { + return this.lang; + } + + public EntityPlayer.EnumChatVisibility getChatVisibility() { + return this.chatVisibility; + } + + public boolean isColorsEnabled() { + return this.enableColors; + } + + public int getModelPartFlags() { + return this.modelPartFlags; + } + + public int getViewDistance() { + return this.view; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C16PacketClientStatus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C16PacketClientStatus.java new file mode 100644 index 0000000..3d16aac --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C16PacketClientStatus.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C16PacketClientStatus implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C16PacketClientStatus"); + } + + private C16PacketClientStatus.EnumState status; + + public C16PacketClientStatus() { + } + + public C16PacketClientStatus(C16PacketClientStatus.EnumState statusIn) { + this.status = statusIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.status = (C16PacketClientStatus.EnumState) parPacketBuffer + .readEnumValue(C16PacketClientStatus.EnumState.class); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeEnumValue(this.status); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processClientStatus(this); + } + + public C16PacketClientStatus.EnumState getStatus() { + return this.status; + } + + public static enum EnumState { + PERFORM_RESPAWN, REQUEST_STATS, OPEN_INVENTORY_ACHIEVEMENT; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C17PacketCustomPayload.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C17PacketCustomPayload.java new file mode 100644 index 0000000..c341318 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C17PacketCustomPayload.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C17PacketCustomPayload implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C17PacketCustomPayload"); + } + + private String channel; + private PacketBuffer data; + + public C17PacketCustomPayload() { + } + + public C17PacketCustomPayload(String channelIn, PacketBuffer dataIn) { + this.channel = channelIn; + this.data = dataIn; + if (dataIn.writerIndex() > 32767) { + throw new IllegalArgumentException("Payload may not be larger than 32767 bytes"); + } + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.channel = parPacketBuffer.readStringFromBuffer(20); + int i = parPacketBuffer.readableBytes(); + if (i >= 0 && i <= 32767) { + this.data = new PacketBuffer(parPacketBuffer.readBytes(i)); + } else { + throw new IOException("Payload may not be larger than 32767 bytes"); + } + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.channel); + parPacketBuffer.writeBytes((ByteBuf) this.data); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.processVanilla250Packet(this); + } + + public String getChannelName() { + return this.channel; + } + + public PacketBuffer getBufferData() { + return this.data; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C18PacketSpectate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C18PacketSpectate.java new file mode 100644 index 0000000..294a69e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C18PacketSpectate.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C18PacketSpectate implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C18PacketSpectate"); + } + + private EaglercraftUUID id; + + public C18PacketSpectate() { + } + + public C18PacketSpectate(EaglercraftUUID id) { + this.id = id; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.id = parPacketBuffer.readUuid(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeUuid(this.id); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.handleSpectate(this); + } + + public Entity getEntity(WorldServer worldIn) { + return worldIn.getEntityFromUuid(this.id); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C19PacketResourcePackStatus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C19PacketResourcePackStatus.java new file mode 100644 index 0000000..fb7e358 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C19PacketResourcePackStatus.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.client; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 C19PacketResourcePackStatus implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/client/C19PacketResourcePackStatus"); + } + + private String hash; + private C19PacketResourcePackStatus.Action status; + + public C19PacketResourcePackStatus() { + } + + public C19PacketResourcePackStatus(String hashIn, C19PacketResourcePackStatus.Action statusIn) { + if (hashIn.length() > 40) { + hashIn = hashIn.substring(0, 40); + } + + this.hash = hashIn; + this.status = statusIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.hash = parPacketBuffer.readStringFromBuffer(40); + this.status = (C19PacketResourcePackStatus.Action) parPacketBuffer + .readEnumValue(C19PacketResourcePackStatus.Action.class); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.hash); + parPacketBuffer.writeEnumValue(this.status); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer inethandlerplayserver) { + inethandlerplayserver.handleResourcePackStatus(this); + } + + public static enum Action { + SUCCESSFULLY_LOADED, DECLINED, FAILED_DOWNLOAD, ACCEPTED; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S00PacketKeepAlive.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S00PacketKeepAlive.java new file mode 100644 index 0000000..8dd5164 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S00PacketKeepAlive.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S00PacketKeepAlive implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S00PacketKeepAlive"); + } + + private int id; + + public S00PacketKeepAlive() { + } + + public S00PacketKeepAlive(int idIn) { + this.id = idIn; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleKeepAlive(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.id = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.id); + } + + public int func_149134_c() { + return this.id; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S01PacketJoinGame.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S01PacketJoinGame.java new file mode 100644 index 0000000..2ca6cae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S01PacketJoinGame.java @@ -0,0 +1,139 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S01PacketJoinGame implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S01PacketJoinGame"); + } + + private int entityId; + private boolean hardcoreMode; + private WorldSettings.GameType gameType; + private int dimension; + private EnumDifficulty difficulty; + private int maxPlayers; + private WorldType worldType; + private boolean reducedDebugInfo; + + public S01PacketJoinGame() { + } + + public S01PacketJoinGame(int entityIdIn, WorldSettings.GameType gameTypeIn, boolean hardcoreModeIn, int dimensionIn, + EnumDifficulty difficultyIn, int maxPlayersIn, WorldType worldTypeIn, boolean reducedDebugInfoIn) { + this.entityId = entityIdIn; + this.dimension = dimensionIn; + this.difficulty = difficultyIn; + this.gameType = gameTypeIn; + this.maxPlayers = maxPlayersIn; + this.hardcoreMode = hardcoreModeIn; + this.worldType = worldTypeIn; + this.reducedDebugInfo = reducedDebugInfoIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readInt(); + int i = parPacketBuffer.readUnsignedByte(); + this.hardcoreMode = (i & 8) == 8; + i = i & -9; + this.gameType = WorldSettings.GameType.getByID(i); + this.dimension = parPacketBuffer.readByte(); + this.difficulty = EnumDifficulty.getDifficultyEnum(parPacketBuffer.readUnsignedByte()); + this.maxPlayers = parPacketBuffer.readUnsignedByte(); + this.worldType = WorldType.parseWorldType(parPacketBuffer.readStringFromBuffer(16)); + if (this.worldType == null) { + this.worldType = WorldType.DEFAULT; + } + + this.reducedDebugInfo = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.entityId); + int i = this.gameType.getID(); + if (this.hardcoreMode) { + i |= 8; + } + + parPacketBuffer.writeByte(i); + parPacketBuffer.writeByte(this.dimension); + parPacketBuffer.writeByte(this.difficulty.getDifficultyId()); + parPacketBuffer.writeByte(this.maxPlayers); + parPacketBuffer.writeString(this.worldType.getWorldTypeName()); + parPacketBuffer.writeBoolean(this.reducedDebugInfo); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleJoinGame(this); + } + + public int getEntityId() { + return this.entityId; + } + + public boolean isHardcoreMode() { + return this.hardcoreMode; + } + + public WorldSettings.GameType getGameType() { + return this.gameType; + } + + public int getDimension() { + return this.dimension; + } + + public EnumDifficulty getDifficulty() { + return this.difficulty; + } + + public int getMaxPlayers() { + return this.maxPlayers; + } + + public WorldType getWorldType() { + return this.worldType; + } + + public boolean isReducedDebugInfo() { + return this.reducedDebugInfo; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S02PacketChat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S02PacketChat.java new file mode 100644 index 0000000..3fadfe3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S02PacketChat.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S02PacketChat implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S02PacketChat"); + } + + private IChatComponent chatComponent; + private byte type; + + public S02PacketChat() { + } + + public S02PacketChat(IChatComponent component) { + this(component, (byte) 1); + } + + public S02PacketChat(IChatComponent message, byte typeIn) { + this.chatComponent = message; + this.type = typeIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.chatComponent = parPacketBuffer.readChatComponent_server(); + this.type = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeChatComponent_server(this.chatComponent); + parPacketBuffer.writeByte(this.type); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleChat(this); + } + + public IChatComponent getChatComponent() { + return this.chatComponent; + } + + public boolean isChat() { + return this.type == 1 || this.type == 2; + } + + /**+ + * Returns the id of the area to display the text, 2 for above + * the action bar, anything else currently for the chat window + */ + public byte getType() { + return this.type; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S03PacketTimeUpdate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S03PacketTimeUpdate.java new file mode 100644 index 0000000..6671c21 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S03PacketTimeUpdate.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S03PacketTimeUpdate implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S03PacketTimeUpdate"); + } + + private long totalWorldTime; + private long worldTime; + + public S03PacketTimeUpdate() { + } + + public S03PacketTimeUpdate(long totalWorldTimeIn, long totalTimeIn, boolean doDayLightCycle) { + this.totalWorldTime = totalWorldTimeIn; + this.worldTime = totalTimeIn; + if (!doDayLightCycle) { + this.worldTime = -this.worldTime; + if (this.worldTime == 0L) { + this.worldTime = -1L; + } + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.totalWorldTime = parPacketBuffer.readLong(); + this.worldTime = parPacketBuffer.readLong(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeLong(this.totalWorldTime); + parPacketBuffer.writeLong(this.worldTime); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleTimeUpdate(this); + } + + public long getTotalWorldTime() { + return this.totalWorldTime; + } + + public long getWorldTime() { + return this.worldTime; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S04PacketEntityEquipment.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S04PacketEntityEquipment.java new file mode 100644 index 0000000..6f6f8b6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S04PacketEntityEquipment.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S04PacketEntityEquipment implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S04PacketEntityEquipment"); + } + + private int entityID; + private int equipmentSlot; + private ItemStack itemStack; + + public S04PacketEntityEquipment() { + } + + public S04PacketEntityEquipment(int entityIDIn, int parInt1, ItemStack itemStackIn) { + this.entityID = entityIDIn; + this.equipmentSlot = parInt1; + this.itemStack = itemStackIn == null ? null : itemStackIn.copy(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityID = parPacketBuffer.readVarIntFromBuffer(); + this.equipmentSlot = parPacketBuffer.readShort(); + this.itemStack = parPacketBuffer.readItemStackFromBuffer_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityID); + parPacketBuffer.writeShort(this.equipmentSlot); + parPacketBuffer.writeItemStackToBuffer_server(this.itemStack); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityEquipment(this); + } + + public ItemStack getItemStack() { + return this.itemStack; + } + + public int getEntityID() { + return this.entityID; + } + + public int getEquipmentSlot() { + return this.equipmentSlot; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S05PacketSpawnPosition.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S05PacketSpawnPosition.java new file mode 100644 index 0000000..d9e7d40 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S05PacketSpawnPosition.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S05PacketSpawnPosition implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S05PacketSpawnPosition"); + } + + private BlockPos spawnBlockPos; + + public S05PacketSpawnPosition() { + } + + public S05PacketSpawnPosition(BlockPos spawnBlockPosIn) { + this.spawnBlockPos = spawnBlockPosIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.spawnBlockPos = parPacketBuffer.readBlockPos_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.spawnBlockPos); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnPosition(this); + } + + public BlockPos getSpawnPos() { + return this.spawnBlockPos; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S06PacketUpdateHealth.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S06PacketUpdateHealth.java new file mode 100644 index 0000000..d607f10 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S06PacketUpdateHealth.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S06PacketUpdateHealth implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S06PacketUpdateHealth"); + } + + private float health; + private int foodLevel; + private float saturationLevel; + + public S06PacketUpdateHealth() { + } + + public S06PacketUpdateHealth(float healthIn, int foodLevelIn, float saturationIn) { + this.health = healthIn; + this.foodLevel = foodLevelIn; + this.saturationLevel = saturationIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.health = parPacketBuffer.readFloat(); + this.foodLevel = parPacketBuffer.readVarIntFromBuffer(); + this.saturationLevel = parPacketBuffer.readFloat(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeFloat(this.health); + parPacketBuffer.writeVarIntToBuffer(this.foodLevel); + parPacketBuffer.writeFloat(this.saturationLevel); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleUpdateHealth(this); + } + + public float getHealth() { + return this.health; + } + + public int getFoodLevel() { + return this.foodLevel; + } + + public float getSaturationLevel() { + return this.saturationLevel; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S07PacketRespawn.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S07PacketRespawn.java new file mode 100644 index 0000000..4fa522e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S07PacketRespawn.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S07PacketRespawn implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S07PacketRespawn"); + } + + private int dimensionID; + private EnumDifficulty difficulty; + private WorldSettings.GameType gameType; + private WorldType worldType; + + public S07PacketRespawn() { + } + + public S07PacketRespawn(int dimensionIDIn, EnumDifficulty difficultyIn, WorldType worldTypeIn, + WorldSettings.GameType gameTypeIn) { + this.dimensionID = dimensionIDIn; + this.difficulty = difficultyIn; + this.gameType = gameTypeIn; + this.worldType = worldTypeIn; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleRespawn(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.dimensionID = parPacketBuffer.readInt(); + this.difficulty = EnumDifficulty.getDifficultyEnum(parPacketBuffer.readUnsignedByte()); + this.gameType = WorldSettings.GameType.getByID(parPacketBuffer.readUnsignedByte()); + this.worldType = WorldType.parseWorldType(parPacketBuffer.readStringFromBuffer(16)); + if (this.worldType == null) { + this.worldType = WorldType.DEFAULT; + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.dimensionID); + parPacketBuffer.writeByte(this.difficulty.getDifficultyId()); + parPacketBuffer.writeByte(this.gameType.getID()); + parPacketBuffer.writeString(this.worldType.getWorldTypeName()); + } + + public int getDimensionID() { + return this.dimensionID; + } + + public EnumDifficulty getDifficulty() { + return this.difficulty; + } + + public WorldSettings.GameType getGameType() { + return this.gameType; + } + + public WorldType getWorldType() { + return this.worldType; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S08PacketPlayerPosLook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S08PacketPlayerPosLook.java new file mode 100644 index 0000000..65feffd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S08PacketPlayerPosLook.java @@ -0,0 +1,152 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.EnumSet; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S08PacketPlayerPosLook implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S08PacketPlayerPosLook"); + } + + private double x; + private double y; + private double z; + private float yaw; + private float pitch; + private Set field_179835_f; + + public S08PacketPlayerPosLook() { + } + + public S08PacketPlayerPosLook(double xIn, double yIn, double zIn, float yawIn, float pitchIn, + Set parSet) { + this.x = xIn; + this.y = yIn; + this.z = zIn; + this.yaw = yawIn; + this.pitch = pitchIn; + this.field_179835_f = parSet; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.x = parPacketBuffer.readDouble(); + this.y = parPacketBuffer.readDouble(); + this.z = parPacketBuffer.readDouble(); + this.yaw = parPacketBuffer.readFloat(); + this.pitch = parPacketBuffer.readFloat(); + this.field_179835_f = S08PacketPlayerPosLook.EnumFlags.func_180053_a(parPacketBuffer.readUnsignedByte()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeDouble(this.x); + parPacketBuffer.writeDouble(this.y); + parPacketBuffer.writeDouble(this.z); + parPacketBuffer.writeFloat(this.yaw); + parPacketBuffer.writeFloat(this.pitch); + parPacketBuffer.writeByte(S08PacketPlayerPosLook.EnumFlags.func_180056_a(this.field_179835_f)); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handlePlayerPosLook(this); + } + + public double getX() { + return this.x; + } + + public double getY() { + return this.y; + } + + public double getZ() { + return this.z; + } + + public float getYaw() { + return this.yaw; + } + + public float getPitch() { + return this.pitch; + } + + public Set func_179834_f() { + return this.field_179835_f; + } + + public static enum EnumFlags { + X(0), Y(1), Z(2), Y_ROT(3), X_ROT(4); + + private int field_180058_f; + + private EnumFlags(int parInt2) { + this.field_180058_f = parInt2; + } + + private int func_180055_a() { + return 1 << this.field_180058_f; + } + + private boolean func_180054_b(int parInt1) { + return (parInt1 & this.func_180055_a()) == this.func_180055_a(); + } + + public static Set func_180053_a(int parInt1) { + EnumSet enumset = EnumSet.noneOf(S08PacketPlayerPosLook.EnumFlags.class); + + for (S08PacketPlayerPosLook.EnumFlags s08packetplayerposlook$enumflags : values()) { + if (s08packetplayerposlook$enumflags.func_180054_b(parInt1)) { + enumset.add(s08packetplayerposlook$enumflags); + } + } + + return enumset; + } + + public static int func_180056_a(Set parSet) { + int i = 0; + + for (S08PacketPlayerPosLook.EnumFlags s08packetplayerposlook$enumflags : parSet) { + i |= s08packetplayerposlook$enumflags.func_180055_a(); + } + + return i; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S09PacketHeldItemChange.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S09PacketHeldItemChange.java new file mode 100644 index 0000000..1d68337 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S09PacketHeldItemChange.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S09PacketHeldItemChange implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S09PacketHeldItemChange"); + } + + private int heldItemHotbarIndex; + + public S09PacketHeldItemChange() { + } + + public S09PacketHeldItemChange(int hotbarIndexIn) { + this.heldItemHotbarIndex = hotbarIndexIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.heldItemHotbarIndex = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.heldItemHotbarIndex); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleHeldItemChange(this); + } + + public int getHeldItemHotbarIndex() { + return this.heldItemHotbarIndex; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0APacketUseBed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0APacketUseBed.java new file mode 100644 index 0000000..30fc489 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0APacketUseBed.java @@ -0,0 +1,80 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S0APacketUseBed implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S0APacketUseBed"); + } + + private int playerID; + private BlockPos bedPos; + + public S0APacketUseBed() { + } + + public S0APacketUseBed(EntityPlayer player, BlockPos bedPosIn) { + this.playerID = player.getEntityId(); + this.bedPos = bedPosIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.playerID = parPacketBuffer.readVarIntFromBuffer(); + this.bedPos = parPacketBuffer.readBlockPos_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.playerID); + parPacketBuffer.writeBlockPos_server(this.bedPos); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleUseBed(this); + } + + public EntityPlayer getPlayer(World worldIn) { + return (EntityPlayer) worldIn.getEntityByID(this.playerID); + } + + public BlockPos getBedPosition() { + return this.bedPos; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0BPacketAnimation.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0BPacketAnimation.java new file mode 100644 index 0000000..dd612e0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0BPacketAnimation.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S0BPacketAnimation implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S0BPacketAnimation"); + } + + private int entityId; + private int type; + + public S0BPacketAnimation() { + } + + public S0BPacketAnimation(Entity ent, int animationType) { + this.entityId = ent.getEntityId(); + this.type = animationType; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.type = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.type); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleAnimation(this); + } + + public int getEntityID() { + return this.entityId; + } + + public int getAnimationType() { + return this.type; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java new file mode 100644 index 0000000..4cd7b9e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java @@ -0,0 +1,146 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.DataWatcher; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S0CPacketSpawnPlayer implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S0CPacketSpawnPlayer"); + } + + private int entityId; + private EaglercraftUUID playerId; + private int x; + private int y; + private int z; + private byte yaw; + private byte pitch; + private int currentItem; + private DataWatcher watcher; + private List field_148958_j; + + public S0CPacketSpawnPlayer() { + } + + public S0CPacketSpawnPlayer(EntityPlayer player) { + this.entityId = player.getEntityId(); + this.playerId = player.getGameProfile().getId(); + this.x = MathHelper.floor_double(player.posX * 32.0D); + this.y = MathHelper.floor_double(player.posY * 32.0D); + this.z = MathHelper.floor_double(player.posZ * 32.0D); + this.yaw = (byte) ((int) (player.rotationYaw * 256.0F / 360.0F)); + this.pitch = (byte) ((int) (player.rotationPitch * 256.0F / 360.0F)); + ItemStack itemstack = player.inventory.getCurrentItem(); + this.currentItem = itemstack == null ? 0 : Item.getIdFromItem(itemstack.getItem()); + this.watcher = player.getDataWatcher(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.playerId = parPacketBuffer.readUuid(); + this.x = parPacketBuffer.readInt(); + this.y = parPacketBuffer.readInt(); + this.z = parPacketBuffer.readInt(); + this.yaw = parPacketBuffer.readByte(); + this.pitch = parPacketBuffer.readByte(); + this.currentItem = parPacketBuffer.readShort(); + this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(parPacketBuffer); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeUuid(this.playerId); + parPacketBuffer.writeInt(this.x); + parPacketBuffer.writeInt(this.y); + parPacketBuffer.writeInt(this.z); + parPacketBuffer.writeByte(this.yaw); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeShort(this.currentItem); + this.watcher.writeTo(parPacketBuffer); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnPlayer(this); + } + + public List func_148944_c() { + if (this.field_148958_j == null) { + this.field_148958_j = this.watcher.getAllWatched(); + } + + return this.field_148958_j; + } + + public int getEntityID() { + return this.entityId; + } + + public EaglercraftUUID getPlayer() { + return this.playerId; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getZ() { + return this.z; + } + + public byte getYaw() { + return this.yaw; + } + + public byte getPitch() { + return this.pitch; + } + + public int getCurrentItemID() { + return this.currentItem; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0DPacketCollectItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0DPacketCollectItem.java new file mode 100644 index 0000000..f93386c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0DPacketCollectItem.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S0DPacketCollectItem implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S0DPacketCollectItem"); + } + + private int collectedItemEntityId; + private int entityId; + + public S0DPacketCollectItem() { + } + + public S0DPacketCollectItem(int collectedItemEntityIdIn, int entityIdIn) { + this.collectedItemEntityId = collectedItemEntityIdIn; + this.entityId = entityIdIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.collectedItemEntityId = parPacketBuffer.readVarIntFromBuffer(); + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.collectedItemEntityId); + parPacketBuffer.writeVarIntToBuffer(this.entityId); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleCollectItem(this); + } + + public int getCollectedItemEntityID() { + return this.collectedItemEntityId; + } + + public int getEntityID() { + return this.entityId; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0EPacketSpawnObject.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0EPacketSpawnObject.java new file mode 100644 index 0000000..0188f6d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0EPacketSpawnObject.java @@ -0,0 +1,220 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S0EPacketSpawnObject implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S0EPacketSpawnObject"); + } + + private int entityId; + private int x; + private int y; + private int z; + private int speedX; + private int speedY; + private int speedZ; + private int pitch; + private int yaw; + private int type; + private int field_149020_k; + + public S0EPacketSpawnObject() { + } + + public S0EPacketSpawnObject(Entity entityIn, int typeIn) { + this(entityIn, typeIn, 0); + } + + public S0EPacketSpawnObject(Entity entityIn, int typeIn, int parInt1) { + this.entityId = entityIn.getEntityId(); + this.x = MathHelper.floor_double(entityIn.posX * 32.0D); + this.y = MathHelper.floor_double(entityIn.posY * 32.0D); + this.z = MathHelper.floor_double(entityIn.posZ * 32.0D); + this.pitch = MathHelper.floor_float(entityIn.rotationPitch * 256.0F / 360.0F); + this.yaw = MathHelper.floor_float(entityIn.rotationYaw * 256.0F / 360.0F); + this.type = typeIn; + this.field_149020_k = parInt1; + if (parInt1 > 0) { + double d0 = entityIn.motionX; + double d1 = entityIn.motionY; + double d2 = entityIn.motionZ; + double d3 = 3.9D; + if (d0 < -d3) { + d0 = -d3; + } + + if (d1 < -d3) { + d1 = -d3; + } + + if (d2 < -d3) { + d2 = -d3; + } + + if (d0 > d3) { + d0 = d3; + } + + if (d1 > d3) { + d1 = d3; + } + + if (d2 > d3) { + d2 = d3; + } + + this.speedX = (int) (d0 * 8000.0D); + this.speedY = (int) (d1 * 8000.0D); + this.speedZ = (int) (d2 * 8000.0D); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.type = parPacketBuffer.readByte(); + this.x = parPacketBuffer.readInt(); + this.y = parPacketBuffer.readInt(); + this.z = parPacketBuffer.readInt(); + this.pitch = parPacketBuffer.readByte(); + this.yaw = parPacketBuffer.readByte(); + this.field_149020_k = parPacketBuffer.readInt(); + if (this.field_149020_k > 0) { + this.speedX = parPacketBuffer.readShort(); + this.speedY = parPacketBuffer.readShort(); + this.speedZ = parPacketBuffer.readShort(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.type); + parPacketBuffer.writeInt(this.x); + parPacketBuffer.writeInt(this.y); + parPacketBuffer.writeInt(this.z); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeByte(this.yaw); + parPacketBuffer.writeInt(this.field_149020_k); + if (this.field_149020_k > 0) { + parPacketBuffer.writeShort(this.speedX); + parPacketBuffer.writeShort(this.speedY); + parPacketBuffer.writeShort(this.speedZ); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnObject(this); + } + + public int getEntityID() { + return this.entityId; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getZ() { + return this.z; + } + + public int getSpeedX() { + return this.speedX; + } + + public int getSpeedY() { + return this.speedY; + } + + public int getSpeedZ() { + return this.speedZ; + } + + public int getPitch() { + return this.pitch; + } + + public int getYaw() { + return this.yaw; + } + + public int getType() { + return this.type; + } + + public int func_149009_m() { + return this.field_149020_k; + } + + public void setX(int newX) { + this.x = newX; + } + + public void setY(int newY) { + this.y = newY; + } + + public void setZ(int newZ) { + this.z = newZ; + } + + public void setSpeedX(int newSpeedX) { + this.speedX = newSpeedX; + } + + public void setSpeedY(int newSpeedY) { + this.speedY = newSpeedY; + } + + public void setSpeedZ(int newSpeedZ) { + this.speedZ = newSpeedZ; + } + + public void func_149002_g(int parInt1) { + this.field_149020_k = parInt1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0FPacketSpawnMob.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0FPacketSpawnMob.java new file mode 100644 index 0000000..a1fc476 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0FPacketSpawnMob.java @@ -0,0 +1,195 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.DataWatcher; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S0FPacketSpawnMob implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S0FPacketSpawnMob"); + } + + private int entityId; + private int type; + private int x; + private int y; + private int z; + private int velocityX; + private int velocityY; + private int velocityZ; + private byte yaw; + private byte pitch; + private byte headPitch; + private DataWatcher field_149043_l; + private List watcher; + + public S0FPacketSpawnMob() { + } + + public S0FPacketSpawnMob(EntityLivingBase entityIn) { + this.entityId = entityIn.getEntityId(); + this.type = (byte) EntityList.getEntityID(entityIn); + this.x = MathHelper.floor_double(entityIn.posX * 32.0D); + this.y = MathHelper.floor_double(entityIn.posY * 32.0D); + this.z = MathHelper.floor_double(entityIn.posZ * 32.0D); + this.yaw = (byte) ((int) (entityIn.rotationYaw * 256.0F / 360.0F)); + this.pitch = (byte) ((int) (entityIn.rotationPitch * 256.0F / 360.0F)); + this.headPitch = (byte) ((int) (entityIn.rotationYawHead * 256.0F / 360.0F)); + double d0 = 3.9D; + double d1 = entityIn.motionX; + double d2 = entityIn.motionY; + double d3 = entityIn.motionZ; + if (d1 < -d0) { + d1 = -d0; + } + + if (d2 < -d0) { + d2 = -d0; + } + + if (d3 < -d0) { + d3 = -d0; + } + + if (d1 > d0) { + d1 = d0; + } + + if (d2 > d0) { + d2 = d0; + } + + if (d3 > d0) { + d3 = d0; + } + + this.velocityX = (int) (d1 * 8000.0D); + this.velocityY = (int) (d2 * 8000.0D); + this.velocityZ = (int) (d3 * 8000.0D); + this.field_149043_l = entityIn.getDataWatcher(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.type = parPacketBuffer.readByte() & 255; + this.x = parPacketBuffer.readInt(); + this.y = parPacketBuffer.readInt(); + this.z = parPacketBuffer.readInt(); + this.yaw = parPacketBuffer.readByte(); + this.pitch = parPacketBuffer.readByte(); + this.headPitch = parPacketBuffer.readByte(); + this.velocityX = parPacketBuffer.readShort(); + this.velocityY = parPacketBuffer.readShort(); + this.velocityZ = parPacketBuffer.readShort(); + this.watcher = DataWatcher.readWatchedListFromPacketBuffer(parPacketBuffer); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.type & 255); + parPacketBuffer.writeInt(this.x); + parPacketBuffer.writeInt(this.y); + parPacketBuffer.writeInt(this.z); + parPacketBuffer.writeByte(this.yaw); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeByte(this.headPitch); + parPacketBuffer.writeShort(this.velocityX); + parPacketBuffer.writeShort(this.velocityY); + parPacketBuffer.writeShort(this.velocityZ); + this.field_149043_l.writeTo(parPacketBuffer); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnMob(this); + } + + public List func_149027_c() { + if (this.watcher == null) { + this.watcher = this.field_149043_l.getAllWatched(); + } + + return this.watcher; + } + + public int getEntityID() { + return this.entityId; + } + + public int getEntityType() { + return this.type; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getZ() { + return this.z; + } + + public int getVelocityX() { + return this.velocityX; + } + + public int getVelocityY() { + return this.velocityY; + } + + public int getVelocityZ() { + return this.velocityZ; + } + + public byte getYaw() { + return this.yaw; + } + + public byte getPitch() { + return this.pitch; + } + + public byte getHeadPitch() { + return this.headPitch; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S10PacketSpawnPainting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S10PacketSpawnPainting.java new file mode 100644 index 0000000..5100521 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S10PacketSpawnPainting.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityPainting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S10PacketSpawnPainting implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S10PacketSpawnPainting"); + } + + private int entityID; + private BlockPos position; + private EnumFacing facing; + private String title; + + public S10PacketSpawnPainting() { + } + + public S10PacketSpawnPainting(EntityPainting painting) { + this.entityID = painting.getEntityId(); + this.position = painting.getHangingPosition(); + this.facing = painting.facingDirection; + this.title = painting.art.title; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityID = parPacketBuffer.readVarIntFromBuffer(); + this.title = parPacketBuffer.readStringFromBuffer(EntityPainting.EnumArt.field_180001_A); + this.position = parPacketBuffer.readBlockPos_server(); + this.facing = EnumFacing.getHorizontal(parPacketBuffer.readUnsignedByte()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityID); + parPacketBuffer.writeString(this.title); + parPacketBuffer.writeBlockPos_server(this.position); + parPacketBuffer.writeByte(this.facing.getHorizontalIndex()); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnPainting(this); + } + + public int getEntityID() { + return this.entityID; + } + + public BlockPos getPosition() { + return this.position; + } + + public EnumFacing getFacing() { + return this.facing; + } + + public String getTitle() { + return this.title; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java new file mode 100644 index 0000000..e4db0c1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java @@ -0,0 +1,103 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityXPOrb; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S11PacketSpawnExperienceOrb implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S11PacketSpawnExperienceOrb"); + } + + private int entityID; + private int posX; + private int posY; + private int posZ; + private int xpValue; + + public S11PacketSpawnExperienceOrb() { + } + + public S11PacketSpawnExperienceOrb(EntityXPOrb xpOrb) { + this.entityID = xpOrb.getEntityId(); + this.posX = MathHelper.floor_double(xpOrb.posX * 32.0D); + this.posY = MathHelper.floor_double(xpOrb.posY * 32.0D); + this.posZ = MathHelper.floor_double(xpOrb.posZ * 32.0D); + this.xpValue = xpOrb.getXpValue(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityID = parPacketBuffer.readVarIntFromBuffer(); + this.posX = parPacketBuffer.readInt(); + this.posY = parPacketBuffer.readInt(); + this.posZ = parPacketBuffer.readInt(); + this.xpValue = parPacketBuffer.readShort(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityID); + parPacketBuffer.writeInt(this.posX); + parPacketBuffer.writeInt(this.posY); + parPacketBuffer.writeInt(this.posZ); + parPacketBuffer.writeShort(this.xpValue); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnExperienceOrb(this); + } + + public int getEntityID() { + return this.entityID; + } + + public int getX() { + return this.posX; + } + + public int getY() { + return this.posY; + } + + public int getZ() { + return this.posZ; + } + + public int getXPValue() { + return this.xpValue; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S12PacketEntityVelocity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S12PacketEntityVelocity.java new file mode 100644 index 0000000..5efdfd9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S12PacketEntityVelocity.java @@ -0,0 +1,123 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S12PacketEntityVelocity implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S12PacketEntityVelocity"); + } + + private int entityID; + private int motionX; + private int motionY; + private int motionZ; + + public S12PacketEntityVelocity() { + } + + public S12PacketEntityVelocity(Entity entityIn) { + this(entityIn.getEntityId(), entityIn.motionX, entityIn.motionY, entityIn.motionZ); + } + + public S12PacketEntityVelocity(int entityIDIn, double motionXIn, double motionYIn, double motionZIn) { + this.entityID = entityIDIn; + double d0 = 3.9D; + if (motionXIn < -d0) { + motionXIn = -d0; + } + + if (motionYIn < -d0) { + motionYIn = -d0; + } + + if (motionZIn < -d0) { + motionZIn = -d0; + } + + if (motionXIn > d0) { + motionXIn = d0; + } + + if (motionYIn > d0) { + motionYIn = d0; + } + + if (motionZIn > d0) { + motionZIn = d0; + } + + this.motionX = (int) (motionXIn * 8000.0D); + this.motionY = (int) (motionYIn * 8000.0D); + this.motionZ = (int) (motionZIn * 8000.0D); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityID = parPacketBuffer.readVarIntFromBuffer(); + this.motionX = parPacketBuffer.readShort(); + this.motionY = parPacketBuffer.readShort(); + this.motionZ = parPacketBuffer.readShort(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityID); + parPacketBuffer.writeShort(this.motionX); + parPacketBuffer.writeShort(this.motionY); + parPacketBuffer.writeShort(this.motionZ); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityVelocity(this); + } + + public int getEntityID() { + return this.entityID; + } + + public int getMotionX() { + return this.motionX; + } + + public int getMotionY() { + return this.motionY; + } + + public int getMotionZ() { + return this.motionZ; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S13PacketDestroyEntities.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S13PacketDestroyEntities.java new file mode 100644 index 0000000..49037b5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S13PacketDestroyEntities.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S13PacketDestroyEntities implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S13PacketDestroyEntities"); + } + + private int[] entityIDs; + + public S13PacketDestroyEntities() { + } + + public S13PacketDestroyEntities(int... entityIDsIn) { + this.entityIDs = entityIDsIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityIDs = new int[parPacketBuffer.readVarIntFromBuffer()]; + + for (int i = 0; i < this.entityIDs.length; ++i) { + this.entityIDs[i] = parPacketBuffer.readVarIntFromBuffer(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityIDs.length); + + for (int i = 0; i < this.entityIDs.length; ++i) { + parPacketBuffer.writeVarIntToBuffer(this.entityIDs[i]); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleDestroyEntities(this); + } + + public int[] getEntityIDs() { + return this.entityIDs; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S14PacketEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S14PacketEntity.java new file mode 100644 index 0000000..d72075c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S14PacketEntity.java @@ -0,0 +1,223 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S14PacketEntity implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S14PacketEntity"); + } + + protected int entityId; + protected byte posX; + protected byte posY; + protected byte posZ; + protected byte yaw; + protected byte pitch; + protected boolean onGround; + protected boolean field_149069_g; + + public S14PacketEntity() { + } + + public S14PacketEntity(int entityIdIn) { + this.entityId = entityIdIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityMovement(this); + } + + public String toString() { + return "Entity_" + super.toString(); + } + + public Entity getEntity(World worldIn) { + return worldIn.getEntityByID(this.entityId); + } + + public byte func_149062_c() { + return this.posX; + } + + public byte func_149061_d() { + return this.posY; + } + + public byte func_149064_e() { + return this.posZ; + } + + public byte func_149066_f() { + return this.yaw; + } + + public byte func_149063_g() { + return this.pitch; + } + + public boolean func_149060_h() { + return this.field_149069_g; + } + + public boolean getOnGround() { + return this.onGround; + } + + public static class S15PacketEntityRelMove extends S14PacketEntity { + public S15PacketEntityRelMove() { + } + + public S15PacketEntityRelMove(int entityIdIn, byte x, byte y, byte z, boolean onGroundIn) { + super(entityIdIn); + this.posX = x; + this.posY = y; + this.posZ = z; + this.onGround = onGroundIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + super.readPacketData(parPacketBuffer); + this.posX = parPacketBuffer.readByte(); + this.posY = parPacketBuffer.readByte(); + this.posZ = parPacketBuffer.readByte(); + this.onGround = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + super.writePacketData(parPacketBuffer); + parPacketBuffer.writeByte(this.posX); + parPacketBuffer.writeByte(this.posY); + parPacketBuffer.writeByte(this.posZ); + parPacketBuffer.writeBoolean(this.onGround); + } + } + + public static class S16PacketEntityLook extends S14PacketEntity { + public S16PacketEntityLook() { + this.field_149069_g = true; + } + + public S16PacketEntityLook(int entityIdIn, byte yawIn, byte pitchIn, boolean onGroundIn) { + super(entityIdIn); + this.yaw = yawIn; + this.pitch = pitchIn; + this.field_149069_g = true; + this.onGround = onGroundIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + super.readPacketData(parPacketBuffer); + this.yaw = parPacketBuffer.readByte(); + this.pitch = parPacketBuffer.readByte(); + this.onGround = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + super.writePacketData(parPacketBuffer); + parPacketBuffer.writeByte(this.yaw); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeBoolean(this.onGround); + } + } + + public static class S17PacketEntityLookMove extends S14PacketEntity { + public S17PacketEntityLookMove() { + this.field_149069_g = true; + } + + public S17PacketEntityLookMove(int parInt1, byte parByte1, byte parByte2, byte parByte3, byte parByte4, + byte parByte5, boolean parFlag) { + super(parInt1); + this.posX = parByte1; + this.posY = parByte2; + this.posZ = parByte3; + this.yaw = parByte4; + this.pitch = parByte5; + this.onGround = parFlag; + this.field_149069_g = true; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + super.readPacketData(parPacketBuffer); + this.posX = parPacketBuffer.readByte(); + this.posY = parPacketBuffer.readByte(); + this.posZ = parPacketBuffer.readByte(); + this.yaw = parPacketBuffer.readByte(); + this.pitch = parPacketBuffer.readByte(); + this.onGround = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + super.writePacketData(parPacketBuffer); + parPacketBuffer.writeByte(this.posX); + parPacketBuffer.writeByte(this.posY); + parPacketBuffer.writeByte(this.posZ); + parPacketBuffer.writeByte(this.yaw); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeBoolean(this.onGround); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S18PacketEntityTeleport.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S18PacketEntityTeleport.java new file mode 100644 index 0000000..fec9219 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S18PacketEntityTeleport.java @@ -0,0 +1,130 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S18PacketEntityTeleport implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S18PacketEntityTeleport"); + } + + private int entityId; + private int posX; + private int posY; + private int posZ; + private byte yaw; + private byte pitch; + private boolean onGround; + + public S18PacketEntityTeleport() { + } + + public S18PacketEntityTeleport(Entity entityIn) { + this.entityId = entityIn.getEntityId(); + this.posX = MathHelper.floor_double(entityIn.posX * 32.0D); + this.posY = MathHelper.floor_double(entityIn.posY * 32.0D); + this.posZ = MathHelper.floor_double(entityIn.posZ * 32.0D); + this.yaw = (byte) ((int) (entityIn.rotationYaw * 256.0F / 360.0F)); + this.pitch = (byte) ((int) (entityIn.rotationPitch * 256.0F / 360.0F)); + this.onGround = entityIn.onGround; + } + + public S18PacketEntityTeleport(int entityIdIn, int posXIn, int posYIn, int posZIn, byte yawIn, byte pitchIn, + boolean onGroundIn) { + this.entityId = entityIdIn; + this.posX = posXIn; + this.posY = posYIn; + this.posZ = posZIn; + this.yaw = yawIn; + this.pitch = pitchIn; + this.onGround = onGroundIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.posX = parPacketBuffer.readInt(); + this.posY = parPacketBuffer.readInt(); + this.posZ = parPacketBuffer.readInt(); + this.yaw = parPacketBuffer.readByte(); + this.pitch = parPacketBuffer.readByte(); + this.onGround = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeInt(this.posX); + parPacketBuffer.writeInt(this.posY); + parPacketBuffer.writeInt(this.posZ); + parPacketBuffer.writeByte(this.yaw); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeBoolean(this.onGround); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityTeleport(this); + } + + public int getEntityId() { + return this.entityId; + } + + public int getX() { + return this.posX; + } + + public int getY() { + return this.posY; + } + + public int getZ() { + return this.posZ; + } + + public byte getYaw() { + return this.yaw; + } + + public byte getPitch() { + return this.pitch; + } + + public boolean getOnGround() { + return this.onGround; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityHeadLook.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityHeadLook.java new file mode 100644 index 0000000..6f7ac89 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityHeadLook.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S19PacketEntityHeadLook implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S19PacketEntityHeadLook"); + } + + private int entityId; + private byte yaw; + + public S19PacketEntityHeadLook() { + } + + public S19PacketEntityHeadLook(Entity entityIn, byte parByte1) { + this.entityId = entityIn.getEntityId(); + this.yaw = parByte1; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.yaw = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.yaw); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityHeadLook(this); + } + + public Entity getEntity(World worldIn) { + return worldIn.getEntityByID(this.entityId); + } + + public byte getYaw() { + return this.yaw; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityStatus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityStatus.java new file mode 100644 index 0000000..bba6108 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityStatus.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S19PacketEntityStatus implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S19PacketEntityStatus"); + } + + private int entityId; + private byte logicOpcode; + + public S19PacketEntityStatus() { + } + + public S19PacketEntityStatus(Entity entityIn, byte opCodeIn) { + this.entityId = entityIn.getEntityId(); + this.logicOpcode = opCodeIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readInt(); + this.logicOpcode = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.entityId); + parPacketBuffer.writeByte(this.logicOpcode); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityStatus(this); + } + + public Entity getEntity(World worldIn) { + return worldIn.getEntityByID(this.entityId); + } + + public byte getOpCode() { + return this.logicOpcode; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1BPacketEntityAttach.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1BPacketEntityAttach.java new file mode 100644 index 0000000..f8de06d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1BPacketEntityAttach.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S1BPacketEntityAttach implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S1BPacketEntityAttach"); + } + + private int leash; + private int entityId; + private int vehicleEntityId; + + public S1BPacketEntityAttach() { + } + + public S1BPacketEntityAttach(int leashIn, Entity entityIn, Entity vehicle) { + this.leash = leashIn; + this.entityId = entityIn.getEntityId(); + this.vehicleEntityId = vehicle != null ? vehicle.getEntityId() : -1; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readInt(); + this.vehicleEntityId = parPacketBuffer.readInt(); + this.leash = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.entityId); + parPacketBuffer.writeInt(this.vehicleEntityId); + parPacketBuffer.writeByte(this.leash); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityAttach(this); + } + + public int getLeash() { + return this.leash; + } + + public int getEntityId() { + return this.entityId; + } + + public int getVehicleEntityId() { + return this.vehicleEntityId; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1CPacketEntityMetadata.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1CPacketEntityMetadata.java new file mode 100644 index 0000000..58cdcc3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1CPacketEntityMetadata.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.DataWatcher; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S1CPacketEntityMetadata implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S1CPacketEntityMetadata"); + } + + private int entityId; + private List field_149378_b; + + public S1CPacketEntityMetadata() { + } + + public S1CPacketEntityMetadata(int entityIdIn, DataWatcher parDataWatcher, boolean parFlag) { + this.entityId = entityIdIn; + if (parFlag) { + this.field_149378_b = parDataWatcher.getAllWatched(); + } else { + this.field_149378_b = parDataWatcher.getChanged(); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.field_149378_b = DataWatcher.readWatchedListFromPacketBuffer(parPacketBuffer); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + DataWatcher.writeWatchedListToPacketBuffer(this.field_149378_b, parPacketBuffer); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityMetadata(this); + } + + public List func_149376_c() { + return this.field_149378_b; + } + + public int getEntityId() { + return this.entityId; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1DPacketEntityEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1DPacketEntityEffect.java new file mode 100644 index 0000000..9268030 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1DPacketEntityEffect.java @@ -0,0 +1,111 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S1DPacketEntityEffect implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S1DPacketEntityEffect"); + } + + private int entityId; + private byte effectId; + private byte amplifier; + private int duration; + private byte hideParticles; + + public S1DPacketEntityEffect() { + } + + public S1DPacketEntityEffect(int entityIdIn, PotionEffect effect) { + this.entityId = entityIdIn; + this.effectId = (byte) (effect.getPotionID() & 255); + this.amplifier = (byte) (effect.getAmplifier() & 255); + if (effect.getDuration() > 32767) { + this.duration = 32767; + } else { + this.duration = effect.getDuration(); + } + + this.hideParticles = (byte) (effect.getIsShowParticles() ? 1 : 0); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.effectId = parPacketBuffer.readByte(); + this.amplifier = parPacketBuffer.readByte(); + this.duration = parPacketBuffer.readVarIntFromBuffer(); + this.hideParticles = parPacketBuffer.readByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.effectId); + parPacketBuffer.writeByte(this.amplifier); + parPacketBuffer.writeVarIntToBuffer(this.duration); + parPacketBuffer.writeByte(this.hideParticles); + } + + public boolean func_149429_c() { + return this.duration == 32767; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityEffect(this); + } + + public int getEntityId() { + return this.entityId; + } + + public byte getEffectId() { + return this.effectId; + } + + public byte getAmplifier() { + return this.amplifier; + } + + public int getDuration() { + return this.duration; + } + + public boolean func_179707_f() { + return this.hideParticles != 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java new file mode 100644 index 0000000..f0cae78 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S1EPacketRemoveEntityEffect implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S1EPacketRemoveEntityEffect"); + } + + private int entityId; + private int effectId; + + public S1EPacketRemoveEntityEffect() { + } + + public S1EPacketRemoveEntityEffect(int entityIdIn, PotionEffect effect) { + this.entityId = entityIdIn; + this.effectId = effect.getPotionID(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.effectId = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.effectId); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleRemoveEntityEffect(this); + } + + public int getEntityId() { + return this.entityId; + } + + public int getEffectId() { + return this.effectId; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1FPacketSetExperience.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1FPacketSetExperience.java new file mode 100644 index 0000000..342337a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1FPacketSetExperience.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S1FPacketSetExperience implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S1FPacketSetExperience"); + } + + private float field_149401_a; + private int totalExperience; + private int level; + + public S1FPacketSetExperience() { + } + + public S1FPacketSetExperience(float parFloat1, int totalExperienceIn, int levelIn) { + this.field_149401_a = parFloat1; + this.totalExperience = totalExperienceIn; + this.level = levelIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.field_149401_a = parPacketBuffer.readFloat(); + this.level = parPacketBuffer.readVarIntFromBuffer(); + this.totalExperience = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeFloat(this.field_149401_a); + parPacketBuffer.writeVarIntToBuffer(this.level); + parPacketBuffer.writeVarIntToBuffer(this.totalExperience); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSetExperience(this); + } + + public float func_149397_c() { + return this.field_149401_a; + } + + public int getTotalExperience() { + return this.totalExperience; + } + + public int getLevel() { + return this.level; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S20PacketEntityProperties.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S20PacketEntityProperties.java new file mode 100644 index 0000000..794ade4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S20PacketEntityProperties.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S20PacketEntityProperties implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S20PacketEntityProperties"); + } + + private int entityId; + private final List field_149444_b = Lists.newArrayList(); + + public S20PacketEntityProperties() { + } + + public S20PacketEntityProperties(int entityIdIn, Collection parCollection) { + this.entityId = entityIdIn; + + for (IAttributeInstance iattributeinstance : parCollection) { + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot( + iattributeinstance.getAttribute().getAttributeUnlocalizedName(), iattributeinstance.getBaseValue(), + iattributeinstance.func_111122_c())); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + int i = parPacketBuffer.readInt(); + + for (int j = 0; j < i; ++j) { + String s = parPacketBuffer.readStringFromBuffer(64); + double d0 = parPacketBuffer.readDouble(); + ArrayList arraylist = Lists.newArrayList(); + int k = parPacketBuffer.readVarIntFromBuffer(); + + for (int l = 0; l < k; ++l) { + EaglercraftUUID uuid = parPacketBuffer.readUuid(); + arraylist.add(new AttributeModifier(uuid, "Unknown synced attribute modifier", + parPacketBuffer.readDouble(), parPacketBuffer.readByte())); + } + + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(s, d0, arraylist)); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeInt(this.field_149444_b.size()); + + for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : this.field_149444_b) { + parPacketBuffer.writeString(s20packetentityproperties$snapshot.func_151409_a()); + parPacketBuffer.writeDouble(s20packetentityproperties$snapshot.func_151410_b()); + parPacketBuffer.writeVarIntToBuffer(s20packetentityproperties$snapshot.func_151408_c().size()); + + for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c()) { + parPacketBuffer.writeUuid(attributemodifier.getID()); + parPacketBuffer.writeDouble(attributemodifier.getAmount()); + parPacketBuffer.writeByte(attributemodifier.getOperation()); + } + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityProperties(this); + } + + public int getEntityId() { + return this.entityId; + } + + public List func_149441_d() { + return this.field_149444_b; + } + + public class Snapshot { + private final String field_151412_b; + private final double field_151413_c; + private final Collection field_151411_d; + + public Snapshot(String parString1, double parDouble1, Collection parCollection) { + this.field_151412_b = parString1; + this.field_151413_c = parDouble1; + this.field_151411_d = parCollection; + } + + public String func_151409_a() { + return this.field_151412_b; + } + + public double func_151410_b() { + return this.field_151413_c; + } + + public Collection func_151408_c() { + return this.field_151411_d; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S21PacketChunkData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S21PacketChunkData.java new file mode 100644 index 0000000..eded2ae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S21PacketChunkData.java @@ -0,0 +1,169 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S21PacketChunkData implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S21PacketChunkData"); + } + + private int chunkX; + private int chunkZ; + private S21PacketChunkData.Extracted extractedData; + private boolean field_149279_g; + + public S21PacketChunkData() { + } + + public S21PacketChunkData(Chunk chunkIn, boolean parFlag, int parInt1) { + this.chunkX = chunkIn.xPosition; + this.chunkZ = chunkIn.zPosition; + this.field_149279_g = parFlag; + this.extractedData = func_179756_a(chunkIn, parFlag, !chunkIn.getWorld().provider.getHasNoSky(), parInt1); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.chunkX = parPacketBuffer.readInt(); + this.chunkZ = parPacketBuffer.readInt(); + this.field_149279_g = parPacketBuffer.readBoolean(); + this.extractedData = new S21PacketChunkData.Extracted(); + this.extractedData.dataSize = parPacketBuffer.readShort(); + this.extractedData.data = parPacketBuffer.readByteArray(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.chunkX); + parPacketBuffer.writeInt(this.chunkZ); + parPacketBuffer.writeBoolean(this.field_149279_g); + parPacketBuffer.writeShort((short) (this.extractedData.dataSize & '\uffff')); + parPacketBuffer.writeByteArray(this.extractedData.data); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleChunkData(this); + } + + public byte[] func_149272_d() { + return this.extractedData.data; + } + + protected static int func_180737_a(int parInt1, boolean parFlag, boolean parFlag2) { + int i = parInt1 * 2 * 16 * 16 * 16; + int j = parInt1 * 16 * 16 * 16 / 2; + int k = parFlag ? parInt1 * 16 * 16 * 16 / 2 : 0; + int l = parFlag2 ? 256 : 0; + return i + j + k + l; + } + + public static S21PacketChunkData.Extracted func_179756_a(Chunk parChunk, boolean parFlag, boolean parFlag2, + int parInt1) { + ExtendedBlockStorage[] aextendedblockstorage = parChunk.getBlockStorageArray(); + S21PacketChunkData.Extracted s21packetchunkdata$extracted = new S21PacketChunkData.Extracted(); + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < aextendedblockstorage.length; ++i) { + ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[i]; + if (extendedblockstorage != null && (!parFlag || !extendedblockstorage.isEmpty()) + && (parInt1 & 1 << i) != 0) { + s21packetchunkdata$extracted.dataSize |= 1 << i; + arraylist.add(extendedblockstorage); + } + } + + s21packetchunkdata$extracted.data = new byte[func_180737_a( + Integer.bitCount(s21packetchunkdata$extracted.dataSize), parFlag2, parFlag)]; + int j = 0; + + for (ExtendedBlockStorage extendedblockstorage1 : (ArrayList) arraylist) { + char[] achar = extendedblockstorage1.getData(); + + for (char c0 : achar) { + s21packetchunkdata$extracted.data[j++] = (byte) (c0 & 255); + s21packetchunkdata$extracted.data[j++] = (byte) (c0 >> 8 & 255); + } + } + + for (ExtendedBlockStorage extendedblockstorage2 : (ArrayList) arraylist) { + j = func_179757_a(extendedblockstorage2.getBlocklightArray().getData(), s21packetchunkdata$extracted.data, + j); + } + + if (parFlag2) { + for (ExtendedBlockStorage extendedblockstorage3 : (ArrayList) arraylist) { + j = func_179757_a(extendedblockstorage3.getSkylightArray().getData(), s21packetchunkdata$extracted.data, + j); + } + } + + if (parFlag) { + func_179757_a(parChunk.getBiomeArray(), s21packetchunkdata$extracted.data, j); + } + + return s21packetchunkdata$extracted; + } + + private static int func_179757_a(byte[] parArrayOfByte, byte[] parArrayOfByte2, int parInt1) { + System.arraycopy(parArrayOfByte, 0, parArrayOfByte2, parInt1, parArrayOfByte.length); + return parInt1 + parArrayOfByte.length; + } + + public int getChunkX() { + return this.chunkX; + } + + public int getChunkZ() { + return this.chunkZ; + } + + public int getExtractedSize() { + return this.extractedData.dataSize; + } + + public boolean func_149274_i() { + return this.field_149279_g; + } + + public static class Extracted { + public byte[] data; + public int dataSize; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S22PacketMultiBlockChange.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S22PacketMultiBlockChange.java new file mode 100644 index 0000000..5537d6b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S22PacketMultiBlockChange.java @@ -0,0 +1,125 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S22PacketMultiBlockChange implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S22PacketMultiBlockChange"); + } + + private ChunkCoordIntPair chunkPosCoord; + private S22PacketMultiBlockChange.BlockUpdateData[] changedBlocks; + + public S22PacketMultiBlockChange() { + } + + public S22PacketMultiBlockChange(int parInt1, short[] crammedPositionsIn, Chunk chunkIn) { + this.chunkPosCoord = new ChunkCoordIntPair(chunkIn.xPosition, chunkIn.zPosition); + this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[parInt1]; + + for (int i = 0; i < this.changedBlocks.length; ++i) { + this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(crammedPositionsIn[i], chunkIn); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.chunkPosCoord = new ChunkCoordIntPair(parPacketBuffer.readInt(), parPacketBuffer.readInt()); + this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[parPacketBuffer.readVarIntFromBuffer()]; + + for (int i = 0; i < this.changedBlocks.length; ++i) { + this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(parPacketBuffer.readShort(), + (IBlockState) Block.BLOCK_STATE_IDS.getByValue(parPacketBuffer.readVarIntFromBuffer())); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.chunkPosCoord.chunkXPos); + parPacketBuffer.writeInt(this.chunkPosCoord.chunkZPos); + parPacketBuffer.writeVarIntToBuffer(this.changedBlocks.length); + + for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : this.changedBlocks) { + parPacketBuffer.writeShort(s22packetmultiblockchange$blockupdatedata.func_180089_b()); + parPacketBuffer.writeVarIntToBuffer( + Block.BLOCK_STATE_IDS.get(s22packetmultiblockchange$blockupdatedata.getBlockState())); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleMultiBlockChange(this); + } + + public S22PacketMultiBlockChange.BlockUpdateData[] getChangedBlocks() { + return this.changedBlocks; + } + + public class BlockUpdateData { + private final short chunkPosCrammed; + private final IBlockState blockState; + + public BlockUpdateData(short parShort1, IBlockState state) { + this.chunkPosCrammed = parShort1; + this.blockState = state; + } + + public BlockUpdateData(short parShort1, Chunk chunkIn) { + this.chunkPosCrammed = parShort1; + this.blockState = chunkIn.getBlockState(this.getPos()); + } + + public BlockPos getPos() { + return new BlockPos(S22PacketMultiBlockChange.this.chunkPosCoord.getBlock(this.chunkPosCrammed >> 12 & 15, + this.chunkPosCrammed & 255, this.chunkPosCrammed >> 8 & 15)); + } + + public short func_180089_b() { + return this.chunkPosCrammed; + } + + public IBlockState getBlockState() { + return this.blockState; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S23PacketBlockChange.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S23PacketBlockChange.java new file mode 100644 index 0000000..6e0c60c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S23PacketBlockChange.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S23PacketBlockChange implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S23PacketBlockChange"); + } + + private BlockPos blockPosition; + private IBlockState blockState; + + public S23PacketBlockChange() { + } + + public S23PacketBlockChange(World worldIn, BlockPos blockPositionIn) { + this.blockPosition = blockPositionIn; + this.blockState = worldIn.getBlockState(blockPositionIn); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.blockPosition = parPacketBuffer.readBlockPos_server(); + this.blockState = (IBlockState) Block.BLOCK_STATE_IDS.getByValue(parPacketBuffer.readVarIntFromBuffer()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.blockPosition); + parPacketBuffer.writeVarIntToBuffer(Block.BLOCK_STATE_IDS.get(this.blockState)); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleBlockChange(this); + } + + public IBlockState getBlockState() { + return this.blockState; + } + + public BlockPos getBlockPosition() { + return this.blockPosition; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S24PacketBlockAction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S24PacketBlockAction.java new file mode 100644 index 0000000..563b162 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S24PacketBlockAction.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S24PacketBlockAction implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S24PacketBlockAction"); + } + + private BlockPos blockPosition; + private int instrument; + private int pitch; + private Block block; + + public S24PacketBlockAction() { + } + + public S24PacketBlockAction(BlockPos blockPositionIn, Block blockIn, int instrumentIn, int pitchIn) { + this.blockPosition = blockPositionIn; + this.instrument = instrumentIn; + this.pitch = pitchIn; + this.block = blockIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.blockPosition = parPacketBuffer.readBlockPos_server(); + this.instrument = parPacketBuffer.readUnsignedByte(); + this.pitch = parPacketBuffer.readUnsignedByte(); + this.block = Block.getBlockById(parPacketBuffer.readVarIntFromBuffer() & 4095); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.blockPosition); + parPacketBuffer.writeByte(this.instrument); + parPacketBuffer.writeByte(this.pitch); + parPacketBuffer.writeVarIntToBuffer(Block.getIdFromBlock(this.block) & 4095); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleBlockAction(this); + } + + public BlockPos getBlockPosition() { + return this.blockPosition; + } + + /**+ + * instrument data for noteblocks + */ + public int getData1() { + return this.instrument; + } + + /**+ + * pitch data for noteblocks + */ + public int getData2() { + return this.pitch; + } + + public Block getBlockType() { + return this.block; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java new file mode 100644 index 0000000..22540fc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S25PacketBlockBreakAnim implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S25PacketBlockBreakAnim"); + } + + private int breakerId; + private BlockPos position; + private int progress; + + public S25PacketBlockBreakAnim() { + } + + public S25PacketBlockBreakAnim(int breakerId, BlockPos pos, int progress) { + this.breakerId = breakerId; + this.position = pos; + this.progress = progress; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.breakerId = parPacketBuffer.readVarIntFromBuffer(); + this.position = parPacketBuffer.readBlockPos_server(); + this.progress = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.breakerId); + parPacketBuffer.writeBlockPos_server(this.position); + parPacketBuffer.writeByte(this.progress); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleBlockBreakAnim(this); + } + + public int getBreakerId() { + return this.breakerId; + } + + public BlockPos getPosition() { + return this.position; + } + + public int getProgress() { + return this.progress; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S26PacketMapChunkBulk.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S26PacketMapChunkBulk.java new file mode 100644 index 0000000..1926855 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S26PacketMapChunkBulk.java @@ -0,0 +1,135 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S21PacketChunkData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S26PacketMapChunkBulk implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S26PacketMapChunkBulk"); + } + + private int[] xPositions; + private int[] zPositions; + private S21PacketChunkData.Extracted[] chunksData; + private boolean isOverworld; + + public S26PacketMapChunkBulk() { + } + + public S26PacketMapChunkBulk(List chunks) { + int i = chunks.size(); + this.xPositions = new int[i]; + this.zPositions = new int[i]; + this.chunksData = new S21PacketChunkData.Extracted[i]; + this.isOverworld = !((Chunk) chunks.get(0)).getWorld().provider.getHasNoSky(); + + for (int j = 0; j < i; ++j) { + Chunk chunk = (Chunk) chunks.get(j); + S21PacketChunkData.Extracted s21packetchunkdata$extracted = S21PacketChunkData.func_179756_a(chunk, true, + this.isOverworld, '\uffff'); + this.xPositions[j] = chunk.xPosition; + this.zPositions[j] = chunk.zPosition; + this.chunksData[j] = s21packetchunkdata$extracted; + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.isOverworld = parPacketBuffer.readBoolean(); + int i = parPacketBuffer.readVarIntFromBuffer(); + this.xPositions = new int[i]; + this.zPositions = new int[i]; + this.chunksData = new S21PacketChunkData.Extracted[i]; + + for (int j = 0; j < i; ++j) { + this.xPositions[j] = parPacketBuffer.readInt(); + this.zPositions[j] = parPacketBuffer.readInt(); + this.chunksData[j] = new S21PacketChunkData.Extracted(); + this.chunksData[j].dataSize = parPacketBuffer.readShort() & '\uffff'; + this.chunksData[j].data = new byte[S21PacketChunkData + .func_180737_a(Integer.bitCount(this.chunksData[j].dataSize), this.isOverworld, true)]; + } + + for (int k = 0; k < i; ++k) { + parPacketBuffer.readBytes(this.chunksData[k].data); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBoolean(this.isOverworld); + parPacketBuffer.writeVarIntToBuffer(this.chunksData.length); + + for (int i = 0; i < this.xPositions.length; ++i) { + parPacketBuffer.writeInt(this.xPositions[i]); + parPacketBuffer.writeInt(this.zPositions[i]); + parPacketBuffer.writeShort((short) (this.chunksData[i].dataSize & '\uffff')); + } + + for (int j = 0; j < this.xPositions.length; ++j) { + parPacketBuffer.writeBytes(this.chunksData[j].data); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleMapChunkBulk(this); + } + + public int getChunkX(int parInt1) { + return this.xPositions[parInt1]; + } + + public int getChunkZ(int parInt1) { + return this.zPositions[parInt1]; + } + + public int getChunkCount() { + return this.xPositions.length; + } + + public byte[] getChunkBytes(int parInt1) { + return this.chunksData[parInt1].data; + } + + public int getChunkSize(int parInt1) { + return this.chunksData[parInt1].dataSize; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S27PacketExplosion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S27PacketExplosion.java new file mode 100644 index 0000000..e15e3e4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S27PacketExplosion.java @@ -0,0 +1,158 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S27PacketExplosion implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S27PacketExplosion"); + } + + private double posX; + private double posY; + private double posZ; + private float strength; + private List affectedBlockPositions; + private float field_149152_f; + private float field_149153_g; + private float field_149159_h; + + public S27PacketExplosion() { + } + + public S27PacketExplosion(double parDouble1, double y, double z, float strengthIn, List affectedBlocksIn, + Vec3 parVec3_1) { + this.posX = parDouble1; + this.posY = y; + this.posZ = z; + this.strength = strengthIn; + this.affectedBlockPositions = Lists.newArrayList(affectedBlocksIn); + if (parVec3_1 != null) { + this.field_149152_f = (float) parVec3_1.xCoord; + this.field_149153_g = (float) parVec3_1.yCoord; + this.field_149159_h = (float) parVec3_1.zCoord; + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.posX = (double) parPacketBuffer.readFloat(); + this.posY = (double) parPacketBuffer.readFloat(); + this.posZ = (double) parPacketBuffer.readFloat(); + this.strength = parPacketBuffer.readFloat(); + int i = parPacketBuffer.readInt(); + this.affectedBlockPositions = Lists.newArrayListWithCapacity(i); + int j = (int) this.posX; + int k = (int) this.posY; + int l = (int) this.posZ; + + for (int i1 = 0; i1 < i; ++i1) { + int j1 = parPacketBuffer.readByte() + j; + int k1 = parPacketBuffer.readByte() + k; + int l1 = parPacketBuffer.readByte() + l; + this.affectedBlockPositions.add(new BlockPos(j1, k1, l1)); + } + + this.field_149152_f = parPacketBuffer.readFloat(); + this.field_149153_g = parPacketBuffer.readFloat(); + this.field_149159_h = parPacketBuffer.readFloat(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeFloat((float) this.posX); + parPacketBuffer.writeFloat((float) this.posY); + parPacketBuffer.writeFloat((float) this.posZ); + parPacketBuffer.writeFloat(this.strength); + parPacketBuffer.writeInt(this.affectedBlockPositions.size()); + int i = (int) this.posX; + int j = (int) this.posY; + int k = (int) this.posZ; + + for (BlockPos blockpos : this.affectedBlockPositions) { + int l = blockpos.getX() - i; + int i1 = blockpos.getY() - j; + int j1 = blockpos.getZ() - k; + parPacketBuffer.writeByte(l); + parPacketBuffer.writeByte(i1); + parPacketBuffer.writeByte(j1); + } + + parPacketBuffer.writeFloat(this.field_149152_f); + parPacketBuffer.writeFloat(this.field_149153_g); + parPacketBuffer.writeFloat(this.field_149159_h); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleExplosion(this); + } + + public float func_149149_c() { + return this.field_149152_f; + } + + public float func_149144_d() { + return this.field_149153_g; + } + + public float func_149147_e() { + return this.field_149159_h; + } + + public double getX() { + return this.posX; + } + + public double getY() { + return this.posY; + } + + public double getZ() { + return this.posZ; + } + + public float getStrength() { + return this.strength; + } + + public List getAffectedBlockPositions() { + return this.affectedBlockPositions; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S28PacketEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S28PacketEffect.java new file mode 100644 index 0000000..af5eb38 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S28PacketEffect.java @@ -0,0 +1,94 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S28PacketEffect implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S28PacketEffect"); + } + + private int soundType; + private BlockPos soundPos; + private int soundData; + private boolean serverWide; + + public S28PacketEffect() { + } + + public S28PacketEffect(int soundTypeIn, BlockPos soundPosIn, int soundDataIn, boolean serverWideIn) { + this.soundType = soundTypeIn; + this.soundPos = soundPosIn; + this.soundData = soundDataIn; + this.serverWide = serverWideIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.soundType = parPacketBuffer.readInt(); + this.soundPos = parPacketBuffer.readBlockPos_server(); + this.soundData = parPacketBuffer.readInt(); + this.serverWide = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.soundType); + parPacketBuffer.writeBlockPos_server(this.soundPos); + parPacketBuffer.writeInt(this.soundData); + parPacketBuffer.writeBoolean(this.serverWide); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEffect(this); + } + + public boolean isSoundServerwide() { + return this.serverWide; + } + + public int getSoundType() { + return this.soundType; + } + + public int getSoundData() { + return this.soundData; + } + + public BlockPos getSoundPos() { + return this.soundPos; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S29PacketSoundEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S29PacketSoundEffect.java new file mode 100644 index 0000000..14a5852 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S29PacketSoundEffect.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import org.apache.commons.lang3.Validate; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S29PacketSoundEffect implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S29PacketSoundEffect"); + } + + private String soundName; + private int posX; + private int posY = Integer.MAX_VALUE; + private int posZ; + private float soundVolume; + private int soundPitch; + + public S29PacketSoundEffect() { + } + + public S29PacketSoundEffect(String soundNameIn, double soundX, double soundY, double soundZ, float volume, + float pitch) { + Validate.notNull(soundNameIn, "name", new Object[0]); + this.soundName = soundNameIn; + this.posX = (int) (soundX * 8.0D); + this.posY = (int) (soundY * 8.0D); + this.posZ = (int) (soundZ * 8.0D); + this.soundVolume = volume; + this.soundPitch = (int) (pitch * 63.0F); + pitch = MathHelper.clamp_float(pitch, 0.0F, 255.0F); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.soundName = parPacketBuffer.readStringFromBuffer(256); + this.posX = parPacketBuffer.readInt(); + this.posY = parPacketBuffer.readInt(); + this.posZ = parPacketBuffer.readInt(); + this.soundVolume = parPacketBuffer.readFloat(); + this.soundPitch = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.soundName); + parPacketBuffer.writeInt(this.posX); + parPacketBuffer.writeInt(this.posY); + parPacketBuffer.writeInt(this.posZ); + parPacketBuffer.writeFloat(this.soundVolume); + parPacketBuffer.writeByte(this.soundPitch); + } + + public String getSoundName() { + return this.soundName; + } + + public double getX() { + return (double) ((float) this.posX / 8.0F); + } + + public double getY() { + return (double) ((float) this.posY / 8.0F); + } + + public double getZ() { + return (double) ((float) this.posZ / 8.0F); + } + + public float getVolume() { + return this.soundVolume; + } + + public float getPitch() { + return (float) this.soundPitch / 63.0F; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSoundEffect(this); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2APacketParticles.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2APacketParticles.java new file mode 100644 index 0000000..7a218a4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2APacketParticles.java @@ -0,0 +1,200 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S2APacketParticles implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S2APacketParticles"); + } + + private EnumParticleTypes particleType; + private float xCoord; + private float yCoord; + private float zCoord; + private float xOffset; + private float yOffset; + private float zOffset; + private float particleSpeed; + private int particleCount; + private boolean longDistance; + private int[] particleArguments; + + public S2APacketParticles() { + } + + public S2APacketParticles(EnumParticleTypes particleTypeIn, boolean longDistanceIn, float x, float y, float z, + float xOffsetIn, float yOffset, float zOffset, float particleSpeedIn, int particleCountIn, + int... particleArgumentsIn) { + this.particleType = particleTypeIn; + this.longDistance = longDistanceIn; + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.xOffset = xOffsetIn; + this.yOffset = yOffset; + this.zOffset = zOffset; + this.particleSpeed = particleSpeedIn; + this.particleCount = particleCountIn; + this.particleArguments = particleArgumentsIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.particleType = EnumParticleTypes.getParticleFromId(parPacketBuffer.readInt()); + if (this.particleType == null) { + this.particleType = EnumParticleTypes.BARRIER; + } + + this.longDistance = parPacketBuffer.readBoolean(); + this.xCoord = parPacketBuffer.readFloat(); + this.yCoord = parPacketBuffer.readFloat(); + this.zCoord = parPacketBuffer.readFloat(); + this.xOffset = parPacketBuffer.readFloat(); + this.yOffset = parPacketBuffer.readFloat(); + this.zOffset = parPacketBuffer.readFloat(); + this.particleSpeed = parPacketBuffer.readFloat(); + this.particleCount = parPacketBuffer.readInt(); + int i = this.particleType.getArgumentCount(); + this.particleArguments = new int[i]; + + for (int j = 0; j < i; ++j) { + this.particleArguments[j] = parPacketBuffer.readVarIntFromBuffer(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeInt(this.particleType.getParticleID()); + parPacketBuffer.writeBoolean(this.longDistance); + parPacketBuffer.writeFloat(this.xCoord); + parPacketBuffer.writeFloat(this.yCoord); + parPacketBuffer.writeFloat(this.zCoord); + parPacketBuffer.writeFloat(this.xOffset); + parPacketBuffer.writeFloat(this.yOffset); + parPacketBuffer.writeFloat(this.zOffset); + parPacketBuffer.writeFloat(this.particleSpeed); + parPacketBuffer.writeInt(this.particleCount); + int i = this.particleType.getArgumentCount(); + + for (int j = 0; j < i; ++j) { + parPacketBuffer.writeVarIntToBuffer(this.particleArguments[j]); + } + + } + + public EnumParticleTypes getParticleType() { + return this.particleType; + } + + public boolean isLongDistance() { + return this.longDistance; + } + + /**+ + * Gets the x coordinate to spawn the particle. + */ + public double getXCoordinate() { + return (double) this.xCoord; + } + + /**+ + * Gets the y coordinate to spawn the particle. + */ + public double getYCoordinate() { + return (double) this.yCoord; + } + + /**+ + * Gets the z coordinate to spawn the particle. + */ + public double getZCoordinate() { + return (double) this.zCoord; + } + + /**+ + * Gets the x coordinate offset for the particle. The particle + * may use the offset for particle spread. + */ + public float getXOffset() { + return this.xOffset; + } + + /**+ + * Gets the y coordinate offset for the particle. The particle + * may use the offset for particle spread. + */ + public float getYOffset() { + return this.yOffset; + } + + /**+ + * Gets the z coordinate offset for the particle. The particle + * may use the offset for particle spread. + */ + public float getZOffset() { + return this.zOffset; + } + + /**+ + * Gets the speed of the particle animation (used in client side + * rendering). + */ + public float getParticleSpeed() { + return this.particleSpeed; + } + + /**+ + * Gets the amount of particles to spawn + */ + public int getParticleCount() { + return this.particleCount; + } + + /**+ + * Gets the particle arguments. Some particles rely on block + * and/or item ids and sometimes metadata ids to color or + * texture the particle. + */ + public int[] getParticleArgs() { + return this.particleArguments; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleParticles(this); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2BPacketChangeGameState.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2BPacketChangeGameState.java new file mode 100644 index 0000000..a294550 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2BPacketChangeGameState.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S2BPacketChangeGameState implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S2BPacketChangeGameState"); + } + + public static final String[] MESSAGE_NAMES = new String[] { "tile.bed.notValid" }; + private int state; + private float field_149141_c; + + public S2BPacketChangeGameState() { + } + + public S2BPacketChangeGameState(int stateIn, float parFloat1) { + this.state = stateIn; + this.field_149141_c = parFloat1; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.state = parPacketBuffer.readUnsignedByte(); + this.field_149141_c = parPacketBuffer.readFloat(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.state); + parPacketBuffer.writeFloat(this.field_149141_c); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleChangeGameState(this); + } + + public int getGameState() { + return this.state; + } + + public float func_149137_d() { + return this.field_149141_c; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java new file mode 100644 index 0000000..14a0328 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java @@ -0,0 +1,107 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S2CPacketSpawnGlobalEntity implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity"); + } + + private int entityId; + private int x; + private int y; + private int z; + private int type; + + public S2CPacketSpawnGlobalEntity() { + } + + public S2CPacketSpawnGlobalEntity(Entity entityIn) { + this.entityId = entityIn.getEntityId(); + this.x = MathHelper.floor_double(entityIn.posX * 32.0D); + this.y = MathHelper.floor_double(entityIn.posY * 32.0D); + this.z = MathHelper.floor_double(entityIn.posZ * 32.0D); + if (entityIn instanceof EntityLightningBolt) { + this.type = 1; + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.type = parPacketBuffer.readByte(); + this.x = parPacketBuffer.readInt(); + this.y = parPacketBuffer.readInt(); + this.z = parPacketBuffer.readInt(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeByte(this.type); + parPacketBuffer.writeInt(this.x); + parPacketBuffer.writeInt(this.y); + parPacketBuffer.writeInt(this.z); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSpawnGlobalEntity(this); + } + + public int func_149052_c() { + return this.entityId; + } + + public int func_149051_d() { + return this.x; + } + + public int func_149050_e() { + return this.y; + } + + public int func_149049_f() { + return this.z; + } + + public int func_149053_g() { + return this.type; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2DPacketOpenWindow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2DPacketOpenWindow.java new file mode 100644 index 0000000..74e8849 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2DPacketOpenWindow.java @@ -0,0 +1,121 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S2DPacketOpenWindow implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S2DPacketOpenWindow"); + } + + private int windowId; + private String inventoryType; + private IChatComponent windowTitle; + private int slotCount; + private int entityId; + + public S2DPacketOpenWindow() { + } + + public S2DPacketOpenWindow(int incomingWindowId, String incomingWindowTitle, IChatComponent windowTitleIn) { + this(incomingWindowId, incomingWindowTitle, windowTitleIn, 0); + } + + public S2DPacketOpenWindow(int windowIdIn, String guiId, IChatComponent windowTitleIn, int slotCountIn) { + this.windowId = windowIdIn; + this.inventoryType = guiId; + this.windowTitle = windowTitleIn; + this.slotCount = slotCountIn; + } + + public S2DPacketOpenWindow(int windowIdIn, String guiId, IChatComponent windowTitleIn, int slotCountIn, + int incomingEntityId) { + this(windowIdIn, guiId, windowTitleIn, slotCountIn); + this.entityId = incomingEntityId; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleOpenWindow(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readUnsignedByte(); + this.inventoryType = parPacketBuffer.readStringFromBuffer(32); + this.windowTitle = parPacketBuffer.readChatComponent_server(); + this.slotCount = parPacketBuffer.readUnsignedByte(); + if (this.inventoryType.equals("EntityHorse")) { + this.entityId = parPacketBuffer.readInt(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeString(this.inventoryType); + parPacketBuffer.writeChatComponent_server(this.windowTitle); + parPacketBuffer.writeByte(this.slotCount); + if (this.inventoryType.equals("EntityHorse")) { + parPacketBuffer.writeInt(this.entityId); + } + + } + + public int getWindowId() { + return this.windowId; + } + + public String getGuiId() { + return this.inventoryType; + } + + public IChatComponent getWindowTitle() { + return this.windowTitle; + } + + public int getSlotCount() { + return this.slotCount; + } + + public int getEntityId() { + return this.entityId; + } + + public boolean hasSlots() { + return this.slotCount > 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2EPacketCloseWindow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2EPacketCloseWindow.java new file mode 100644 index 0000000..75607bf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2EPacketCloseWindow.java @@ -0,0 +1,65 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S2EPacketCloseWindow implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S2EPacketCloseWindow"); + } + + private int windowId; + + public S2EPacketCloseWindow() { + } + + public S2EPacketCloseWindow(int windowIdIn) { + this.windowId = windowIdIn; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleCloseWindow(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readUnsignedByte(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2FPacketSetSlot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2FPacketSetSlot.java new file mode 100644 index 0000000..988f0bb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2FPacketSetSlot.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S2FPacketSetSlot implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S2FPacketSetSlot"); + } + + private int windowId; + private int slot; + private ItemStack item; + + public S2FPacketSetSlot() { + } + + public S2FPacketSetSlot(int windowIdIn, int slotIn, ItemStack itemIn) { + this.windowId = windowIdIn; + this.slot = slotIn; + this.item = itemIn == null ? null : itemIn.copy(); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSetSlot(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readByte(); + this.slot = parPacketBuffer.readShort(); + this.item = parPacketBuffer.readItemStackFromBuffer_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeShort(this.slot); + parPacketBuffer.writeItemStackToBuffer_server(this.item); + } + + public int func_149175_c() { + return this.windowId; + } + + public int func_149173_d() { + return this.slot; + } + + public ItemStack func_149174_e() { + return this.item; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S30PacketWindowItems.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S30PacketWindowItems.java new file mode 100644 index 0000000..51ebd34 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S30PacketWindowItems.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S30PacketWindowItems implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S30PacketWindowItems"); + } + + private int windowId; + private ItemStack[] itemStacks; + + public S30PacketWindowItems() { + } + + public S30PacketWindowItems(int windowIdIn, List parList) { + this.windowId = windowIdIn; + this.itemStacks = new ItemStack[parList.size()]; + + for (int i = 0; i < this.itemStacks.length; ++i) { + ItemStack itemstack = (ItemStack) parList.get(i); + this.itemStacks[i] = itemstack == null ? null : itemstack.copy(); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readUnsignedByte(); + short short1 = parPacketBuffer.readShort(); + this.itemStacks = new ItemStack[short1]; + + for (int i = 0; i < short1; ++i) { + this.itemStacks[i] = parPacketBuffer.readItemStackFromBuffer_server(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeShort(this.itemStacks.length); + + for (ItemStack itemstack : this.itemStacks) { + parPacketBuffer.writeItemStackToBuffer_server(itemstack); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleWindowItems(this); + } + + public int func_148911_c() { + return this.windowId; + } + + public ItemStack[] getItemStacks() { + return this.itemStacks; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S31PacketWindowProperty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S31PacketWindowProperty.java new file mode 100644 index 0000000..3c29f3d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S31PacketWindowProperty.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S31PacketWindowProperty implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S31PacketWindowProperty"); + } + + private int windowId; + private int varIndex; + private int varValue; + + public S31PacketWindowProperty() { + } + + public S31PacketWindowProperty(int windowIdIn, int varIndexIn, int varValueIn) { + this.windowId = windowIdIn; + this.varIndex = varIndexIn; + this.varValue = varValueIn; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleWindowProperty(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readUnsignedByte(); + this.varIndex = parPacketBuffer.readShort(); + this.varValue = parPacketBuffer.readShort(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeShort(this.varIndex); + parPacketBuffer.writeShort(this.varValue); + } + + public int getWindowId() { + return this.windowId; + } + + public int getVarIndex() { + return this.varIndex; + } + + public int getVarValue() { + return this.varValue; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S32PacketConfirmTransaction.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S32PacketConfirmTransaction.java new file mode 100644 index 0000000..acd005a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S32PacketConfirmTransaction.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S32PacketConfirmTransaction implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S32PacketConfirmTransaction"); + } + + private int windowId; + private short actionNumber; + private boolean field_148893_c; + + public S32PacketConfirmTransaction() { + } + + public S32PacketConfirmTransaction(int windowIdIn, short actionNumberIn, boolean parFlag) { + this.windowId = windowIdIn; + this.actionNumber = actionNumberIn; + this.field_148893_c = parFlag; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleConfirmTransaction(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.windowId = parPacketBuffer.readUnsignedByte(); + this.actionNumber = parPacketBuffer.readShort(); + this.field_148893_c = parPacketBuffer.readBoolean(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.windowId); + parPacketBuffer.writeShort(this.actionNumber); + parPacketBuffer.writeBoolean(this.field_148893_c); + } + + public int getWindowId() { + return this.windowId; + } + + public short getActionNumber() { + return this.actionNumber; + } + + public boolean func_148888_e() { + return this.field_148893_c; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S33PacketUpdateSign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S33PacketUpdateSign.java new file mode 100644 index 0000000..9b6c0f4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S33PacketUpdateSign.java @@ -0,0 +1,91 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S33PacketUpdateSign implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S33PacketUpdateSign"); + } + + private World world; + private BlockPos blockPos; + private IChatComponent[] lines; + + public S33PacketUpdateSign() { + } + + public S33PacketUpdateSign(World worldIn, BlockPos blockPosIn, IChatComponent[] linesIn) { + this.world = worldIn; + this.blockPos = blockPosIn; + this.lines = new IChatComponent[] { linesIn[0], linesIn[1], linesIn[2], linesIn[3] }; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.blockPos = parPacketBuffer.readBlockPos_server(); + this.lines = new IChatComponent[4]; + + for (int i = 0; i < 4; ++i) { + this.lines[i] = parPacketBuffer.readChatComponent_server(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.blockPos); + + for (int i = 0; i < 4; ++i) { + parPacketBuffer.writeChatComponent_server(this.lines[i]); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleUpdateSign(this); + } + + public BlockPos getPos() { + return this.blockPos; + } + + public IChatComponent[] getLines() { + return this.lines; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S34PacketMaps.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S34PacketMaps.java new file mode 100644 index 0000000..6a90293 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S34PacketMaps.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec4b; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.MapData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S34PacketMaps implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S34PacketMaps"); + } + + private int mapId; + private byte mapScale; + private Vec4b[] mapVisiblePlayersVec4b; + private int mapMinX; + private int mapMinY; + private int mapMaxX; + private int mapMaxY; + private byte[] mapDataBytes; + + public S34PacketMaps() { + } + + public S34PacketMaps(int mapIdIn, byte scale, Collection visiblePlayers, byte[] colors, int minX, int minY, + int maxX, int maxY) { + this.mapId = mapIdIn; + this.mapScale = scale; + this.mapVisiblePlayersVec4b = (Vec4b[]) visiblePlayers.toArray(new Vec4b[visiblePlayers.size()]); + this.mapMinX = minX; + this.mapMinY = minY; + this.mapMaxX = maxX; + this.mapMaxY = maxY; + this.mapDataBytes = new byte[maxX * maxY]; + + for (int i = 0; i < maxX; ++i) { + for (int j = 0; j < maxY; ++j) { + this.mapDataBytes[i + j * maxX] = colors[minX + i + (minY + j) * 128]; + } + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.mapId = parPacketBuffer.readVarIntFromBuffer(); + this.mapScale = parPacketBuffer.readByte(); + this.mapVisiblePlayersVec4b = new Vec4b[parPacketBuffer.readVarIntFromBuffer()]; + + for (int i = 0; i < this.mapVisiblePlayersVec4b.length; ++i) { + short short1 = (short) parPacketBuffer.readByte(); + this.mapVisiblePlayersVec4b[i] = new Vec4b((byte) (short1 >> 4 & 15), parPacketBuffer.readByte(), + parPacketBuffer.readByte(), (byte) (short1 & 15)); + } + + this.mapMaxX = parPacketBuffer.readUnsignedByte(); + if (this.mapMaxX > 0) { + this.mapMaxY = parPacketBuffer.readUnsignedByte(); + this.mapMinX = parPacketBuffer.readUnsignedByte(); + this.mapMinY = parPacketBuffer.readUnsignedByte(); + this.mapDataBytes = parPacketBuffer.readByteArray(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.mapId); + parPacketBuffer.writeByte(this.mapScale); + parPacketBuffer.writeVarIntToBuffer(this.mapVisiblePlayersVec4b.length); + + for (Vec4b vec4b : this.mapVisiblePlayersVec4b) { + parPacketBuffer.writeByte((vec4b.func_176110_a() & 15) << 4 | vec4b.func_176111_d() & 15); + parPacketBuffer.writeByte(vec4b.func_176112_b()); + parPacketBuffer.writeByte(vec4b.func_176113_c()); + } + + parPacketBuffer.writeByte(this.mapMaxX); + if (this.mapMaxX > 0) { + parPacketBuffer.writeByte(this.mapMaxY); + parPacketBuffer.writeByte(this.mapMinX); + parPacketBuffer.writeByte(this.mapMinY); + parPacketBuffer.writeByteArray(this.mapDataBytes); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleMaps(this); + } + + public int getMapId() { + return this.mapId; + } + + /**+ + * Sets new MapData from the packet to given MapData param + */ + public void setMapdataTo(MapData mapdataIn) { + mapdataIn.scale = this.mapScale; + mapdataIn.mapDecorations.clear(); + + for (int i = 0; i < this.mapVisiblePlayersVec4b.length; ++i) { + Vec4b vec4b = this.mapVisiblePlayersVec4b[i]; + mapdataIn.mapDecorations.put("icon-" + i, vec4b); + } + + for (int j = 0; j < this.mapMaxX; ++j) { + for (int k = 0; k < this.mapMaxY; ++k) { + mapdataIn.colors[this.mapMinX + j + (this.mapMinY + k) * 128] = this.mapDataBytes[j + k * this.mapMaxX]; + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java new file mode 100644 index 0000000..25cc7f9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S35PacketUpdateTileEntity implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S35PacketUpdateTileEntity"); + } + + private BlockPos blockPos; + private int metadata; + private NBTTagCompound nbt; + + public S35PacketUpdateTileEntity() { + } + + public S35PacketUpdateTileEntity(BlockPos blockPosIn, int metadataIn, NBTTagCompound nbtIn) { + this.blockPos = blockPosIn; + this.metadata = metadataIn; + this.nbt = nbtIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.blockPos = parPacketBuffer.readBlockPos_server(); + this.metadata = parPacketBuffer.readUnsignedByte(); + this.nbt = parPacketBuffer.readNBTTagCompoundFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.blockPos); + parPacketBuffer.writeByte((byte) this.metadata); + parPacketBuffer.writeNBTTagCompoundToBuffer(this.nbt); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleUpdateTileEntity(this); + } + + public BlockPos getPos() { + return this.blockPos; + } + + public int getTileEntityType() { + return this.metadata; + } + + public NBTTagCompound getNbtCompound() { + return this.nbt; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S36PacketSignEditorOpen.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S36PacketSignEditorOpen.java new file mode 100644 index 0000000..35277c9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S36PacketSignEditorOpen.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S36PacketSignEditorOpen implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S36PacketSignEditorOpen"); + } + + private BlockPos signPosition; + + public S36PacketSignEditorOpen() { + } + + public S36PacketSignEditorOpen(BlockPos signPositionIn) { + this.signPosition = signPositionIn; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSignEditorOpen(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.signPosition = parPacketBuffer.readBlockPos_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeBlockPos_server(this.signPosition); + } + + public BlockPos getSignPosition() { + return this.signPosition; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S37PacketStatistics.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S37PacketStatistics.java new file mode 100644 index 0000000..cb6f8e7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S37PacketStatistics.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S37PacketStatistics implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S37PacketStatistics"); + } + + private Map field_148976_a; + + public S37PacketStatistics() { + } + + public S37PacketStatistics(Map parMap) { + this.field_148976_a = parMap; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleStatistics(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + int i = parPacketBuffer.readVarIntFromBuffer(); + this.field_148976_a = Maps.newHashMap(); + + for (int j = 0; j < i; ++j) { + StatBase statbase = StatList.getOneShotStat(parPacketBuffer.readStringFromBuffer(32767)); + int k = parPacketBuffer.readVarIntFromBuffer(); + if (statbase != null) { + this.field_148976_a.put(statbase, Integer.valueOf(k)); + } + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.field_148976_a.size()); + + for (Entry entry : this.field_148976_a.entrySet()) { + parPacketBuffer.writeString(((StatBase) entry.getKey()).statId); + parPacketBuffer.writeVarIntToBuffer(((Integer) entry.getValue()).intValue()); + } + + } + + public Map func_148974_c() { + return this.field_148976_a; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S38PacketPlayerListItem.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S38PacketPlayerListItem.java new file mode 100644 index 0000000..82748bb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S38PacketPlayerListItem.java @@ -0,0 +1,251 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.Property; +import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S38PacketPlayerListItem implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S38PacketPlayerListItem"); + } + + private S38PacketPlayerListItem.Action action; + private final List players = Lists.newArrayList(); + + public S38PacketPlayerListItem() { + } + + public S38PacketPlayerListItem(S38PacketPlayerListItem.Action actionIn, EntityPlayerMP... players) { + this.action = actionIn; + + for (EntityPlayerMP entityplayermp : players) { + this.players.add(new S38PacketPlayerListItem.AddPlayerData(entityplayermp.getGameProfile(), + entityplayermp.ping, entityplayermp.theItemInWorldManager.getGameType(), + entityplayermp.getTabListDisplayName())); + } + + } + + public S38PacketPlayerListItem(S38PacketPlayerListItem.Action actionIn, Iterable players) { + this.action = actionIn; + + for (EntityPlayerMP entityplayermp : players) { + this.players.add(new S38PacketPlayerListItem.AddPlayerData(entityplayermp.getGameProfile(), + entityplayermp.ping, entityplayermp.theItemInWorldManager.getGameType(), + entityplayermp.getTabListDisplayName())); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.action = (S38PacketPlayerListItem.Action) parPacketBuffer + .readEnumValue(S38PacketPlayerListItem.Action.class); + int i = parPacketBuffer.readVarIntFromBuffer(); + + for (int j = 0; j < i; ++j) { + GameProfile gameprofile = null; + int k = 0; + WorldSettings.GameType worldsettings$gametype = null; + IChatComponent ichatcomponent = null; + switch (this.action) { + case ADD_PLAYER: + gameprofile = new GameProfile(parPacketBuffer.readUuid(), parPacketBuffer.readStringFromBuffer(16)); + int l = parPacketBuffer.readVarIntFromBuffer(); + int i1 = 0; + + for (; i1 < l; ++i1) { + String s = parPacketBuffer.readStringFromBuffer(32767); + String s1 = parPacketBuffer.readStringFromBuffer(32767); + if (parPacketBuffer.readBoolean()) { + gameprofile.getProperties().put(s, + new Property(s, s1, parPacketBuffer.readStringFromBuffer(32767))); + } else { + gameprofile.getProperties().put(s, new Property(s, s1)); + } + } + + worldsettings$gametype = WorldSettings.GameType.getByID(parPacketBuffer.readVarIntFromBuffer()); + k = parPacketBuffer.readVarIntFromBuffer(); + if (parPacketBuffer.readBoolean()) { + ichatcomponent = parPacketBuffer.readChatComponent_server(); + } + break; + case UPDATE_GAME_MODE: + gameprofile = new GameProfile(parPacketBuffer.readUuid(), (String) null); + worldsettings$gametype = WorldSettings.GameType.getByID(parPacketBuffer.readVarIntFromBuffer()); + break; + case UPDATE_LATENCY: + gameprofile = new GameProfile(parPacketBuffer.readUuid(), (String) null); + k = parPacketBuffer.readVarIntFromBuffer(); + break; + case UPDATE_DISPLAY_NAME: + gameprofile = new GameProfile(parPacketBuffer.readUuid(), (String) null); + if (parPacketBuffer.readBoolean()) { + ichatcomponent = parPacketBuffer.readChatComponent_server(); + } + break; + case REMOVE_PLAYER: + gameprofile = new GameProfile(parPacketBuffer.readUuid(), (String) null); + } + + this.players.add( + new S38PacketPlayerListItem.AddPlayerData(gameprofile, k, worldsettings$gametype, ichatcomponent)); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeEnumValue(this.action); + parPacketBuffer.writeVarIntToBuffer(this.players.size()); + + for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : this.players) { + switch (this.action) { + case ADD_PLAYER: + parPacketBuffer.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + parPacketBuffer.writeString(s38packetplayerlistitem$addplayerdata.getProfile().getName()); + parPacketBuffer + .writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getProfile().getProperties().size()); + + for (Property property : s38packetplayerlistitem$addplayerdata.getProfile().getProperties().values()) { + parPacketBuffer.writeString(property.getName()); + parPacketBuffer.writeString(property.getValue()); + if (property.hasSignature()) { + parPacketBuffer.writeBoolean(true); + parPacketBuffer.writeString(property.getSignature()); + } else { + parPacketBuffer.writeBoolean(false); + } + } + + parPacketBuffer.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID()); + parPacketBuffer.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing()); + if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null) { + parPacketBuffer.writeBoolean(false); + } else { + parPacketBuffer.writeBoolean(true); + parPacketBuffer.writeChatComponent_server(s38packetplayerlistitem$addplayerdata.getDisplayName()); + } + break; + case UPDATE_GAME_MODE: + parPacketBuffer.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + parPacketBuffer.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID()); + break; + case UPDATE_LATENCY: + parPacketBuffer.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + parPacketBuffer.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing()); + break; + case UPDATE_DISPLAY_NAME: + parPacketBuffer.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null) { + parPacketBuffer.writeBoolean(false); + } else { + parPacketBuffer.writeBoolean(true); + parPacketBuffer.writeChatComponent_server(s38packetplayerlistitem$addplayerdata.getDisplayName()); + } + break; + case REMOVE_PLAYER: + parPacketBuffer.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + } + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handlePlayerListItem(this); + } + + public List func_179767_a() { + return this.players; + } + + public S38PacketPlayerListItem.Action func_179768_b() { + return this.action; + } + + public String toString() { + return Objects.toStringHelper(this).add("action", this.action).add("entries", this.players).toString(); + } + + public static enum Action { + ADD_PLAYER, UPDATE_GAME_MODE, UPDATE_LATENCY, UPDATE_DISPLAY_NAME, REMOVE_PLAYER; + } + + public class AddPlayerData { + private final int ping; + private final WorldSettings.GameType gamemode; + private final GameProfile profile; + private final IChatComponent displayName; + + public AddPlayerData(GameProfile profile, int pingIn, WorldSettings.GameType gamemodeIn, + IChatComponent displayNameIn) { + this.profile = profile; + this.ping = pingIn; + this.gamemode = gamemodeIn; + this.displayName = displayNameIn; + } + + public GameProfile getProfile() { + return this.profile; + } + + public int getPing() { + return this.ping; + } + + public WorldSettings.GameType getGameMode() { + return this.gamemode; + } + + public IChatComponent getDisplayName() { + return this.displayName; + } + + public String toString() { + return Objects.toStringHelper(this).add("latency", this.ping).add("gameMode", this.gamemode) + .add("profile", this.profile).add("displayName", this.displayName == null ? null + : IChatComponent.Serializer.componentToJson(this.displayName)) + .toString(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S39PacketPlayerAbilities.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S39PacketPlayerAbilities.java new file mode 100644 index 0000000..a5e626a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S39PacketPlayerAbilities.java @@ -0,0 +1,149 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.PlayerCapabilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S39PacketPlayerAbilities implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S39PacketPlayerAbilities"); + } + + private boolean invulnerable; + private boolean flying; + private boolean allowFlying; + private boolean creativeMode; + private float flySpeed; + private float walkSpeed; + + public S39PacketPlayerAbilities() { + } + + public S39PacketPlayerAbilities(PlayerCapabilities capabilities) { + this.setInvulnerable(capabilities.disableDamage); + this.setFlying(capabilities.isFlying); + this.setAllowFlying(capabilities.allowFlying); + this.setCreativeMode(capabilities.isCreativeMode); + this.setFlySpeed(capabilities.getFlySpeed()); + this.setWalkSpeed(capabilities.getWalkSpeed()); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + byte b0 = parPacketBuffer.readByte(); + this.setInvulnerable((b0 & 1) > 0); + this.setFlying((b0 & 2) > 0); + this.setAllowFlying((b0 & 4) > 0); + this.setCreativeMode((b0 & 8) > 0); + this.setFlySpeed(parPacketBuffer.readFloat()); + this.setWalkSpeed(parPacketBuffer.readFloat()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + byte b0 = 0; + if (this.isInvulnerable()) { + b0 = (byte) (b0 | 1); + } + + if (this.isFlying()) { + b0 = (byte) (b0 | 2); + } + + if (this.isAllowFlying()) { + b0 = (byte) (b0 | 4); + } + + if (this.isCreativeMode()) { + b0 = (byte) (b0 | 8); + } + + parPacketBuffer.writeByte(b0); + parPacketBuffer.writeFloat(this.flySpeed); + parPacketBuffer.writeFloat(this.walkSpeed); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handlePlayerAbilities(this); + } + + public boolean isInvulnerable() { + return this.invulnerable; + } + + public void setInvulnerable(boolean isInvulnerable) { + this.invulnerable = isInvulnerable; + } + + public boolean isFlying() { + return this.flying; + } + + public void setFlying(boolean isFlying) { + this.flying = isFlying; + } + + public boolean isAllowFlying() { + return this.allowFlying; + } + + public void setAllowFlying(boolean isAllowFlying) { + this.allowFlying = isAllowFlying; + } + + public boolean isCreativeMode() { + return this.creativeMode; + } + + public void setCreativeMode(boolean isCreativeMode) { + this.creativeMode = isCreativeMode; + } + + public float getFlySpeed() { + return this.flySpeed; + } + + public void setFlySpeed(float flySpeedIn) { + this.flySpeed = flySpeedIn; + } + + public float getWalkSpeed() { + return this.walkSpeed; + } + + public void setWalkSpeed(float walkSpeedIn) { + this.walkSpeed = walkSpeedIn; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3APacketTabComplete.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3APacketTabComplete.java new file mode 100644 index 0000000..2b211e7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3APacketTabComplete.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S3APacketTabComplete implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S3APacketTabComplete"); + } + + private String[] matches; + + public S3APacketTabComplete() { + } + + public S3APacketTabComplete(String[] matchesIn) { + this.matches = matchesIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.matches = new String[parPacketBuffer.readVarIntFromBuffer()]; + + for (int i = 0; i < this.matches.length; ++i) { + this.matches[i] = parPacketBuffer.readStringFromBuffer(32767); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.matches.length); + + for (String s : this.matches) { + parPacketBuffer.writeString(s); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleTabComplete(this); + } + + public String[] func_149630_c() { + return this.matches; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java new file mode 100644 index 0000000..42b24ae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S3BPacketScoreboardObjective implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S3BPacketScoreboardObjective"); + } + + private String objectiveName; + private String objectiveValue; + private IScoreObjectiveCriteria.EnumRenderType type; + private int field_149342_c; + + public S3BPacketScoreboardObjective() { + } + + public S3BPacketScoreboardObjective(ScoreObjective parScoreObjective, int parInt1) { + this.objectiveName = parScoreObjective.getName(); + this.objectiveValue = parScoreObjective.getDisplayName(); + this.type = parScoreObjective.getCriteria().getRenderType(); + this.field_149342_c = parInt1; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.objectiveName = parPacketBuffer.readStringFromBuffer(16); + this.field_149342_c = parPacketBuffer.readByte(); + if (this.field_149342_c == 0 || this.field_149342_c == 2) { + this.objectiveValue = parPacketBuffer.readStringFromBuffer(32); + this.type = IScoreObjectiveCriteria.EnumRenderType.func_178795_a(parPacketBuffer.readStringFromBuffer(16)); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.objectiveName); + parPacketBuffer.writeByte(this.field_149342_c); + if (this.field_149342_c == 0 || this.field_149342_c == 2) { + parPacketBuffer.writeString(this.objectiveValue); + parPacketBuffer.writeString(this.type.func_178796_a()); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleScoreboardObjective(this); + } + + public String func_149339_c() { + return this.objectiveName; + } + + public String func_149337_d() { + return this.objectiveValue; + } + + public int func_149338_e() { + return this.field_149342_c; + } + + public IScoreObjectiveCriteria.EnumRenderType func_179817_d() { + return this.type; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3CPacketUpdateScore.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3CPacketUpdateScore.java new file mode 100644 index 0000000..c93e29a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3CPacketUpdateScore.java @@ -0,0 +1,119 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S3CPacketUpdateScore implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S3CPacketUpdateScore"); + } + + private String name = ""; + private String objective = ""; + private int value; + private S3CPacketUpdateScore.Action action; + + public S3CPacketUpdateScore() { + } + + public S3CPacketUpdateScore(Score scoreIn) { + this.name = scoreIn.getPlayerName(); + this.objective = scoreIn.getObjective().getName(); + this.value = scoreIn.getScorePoints(); + this.action = S3CPacketUpdateScore.Action.CHANGE; + } + + public S3CPacketUpdateScore(String nameIn) { + this.name = nameIn; + this.objective = ""; + this.value = 0; + this.action = S3CPacketUpdateScore.Action.REMOVE; + } + + public S3CPacketUpdateScore(String nameIn, ScoreObjective objectiveIn) { + this.name = nameIn; + this.objective = objectiveIn.getName(); + this.value = 0; + this.action = S3CPacketUpdateScore.Action.REMOVE; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.name = parPacketBuffer.readStringFromBuffer(40); + this.action = (S3CPacketUpdateScore.Action) parPacketBuffer.readEnumValue(S3CPacketUpdateScore.Action.class); + this.objective = parPacketBuffer.readStringFromBuffer(16); + if (this.action != S3CPacketUpdateScore.Action.REMOVE) { + this.value = parPacketBuffer.readVarIntFromBuffer(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.name); + parPacketBuffer.writeEnumValue(this.action); + parPacketBuffer.writeString(this.objective); + if (this.action != S3CPacketUpdateScore.Action.REMOVE) { + parPacketBuffer.writeVarIntToBuffer(this.value); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleUpdateScore(this); + } + + public String getPlayerName() { + return this.name; + } + + public String getObjectiveName() { + return this.objective; + } + + public int getScoreValue() { + return this.value; + } + + public S3CPacketUpdateScore.Action getScoreAction() { + return this.action; + } + + public static enum Action { + CHANGE, REMOVE; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java new file mode 100644 index 0000000..1a77a76 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S3DPacketDisplayScoreboard implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S3DPacketDisplayScoreboard"); + } + + private int position; + private String scoreName; + + public S3DPacketDisplayScoreboard() { + } + + public S3DPacketDisplayScoreboard(int positionIn, ScoreObjective scoreIn) { + this.position = positionIn; + if (scoreIn == null) { + this.scoreName = ""; + } else { + this.scoreName = scoreIn.getName(); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.position = parPacketBuffer.readByte(); + this.scoreName = parPacketBuffer.readStringFromBuffer(16); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.position); + parPacketBuffer.writeString(this.scoreName); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleDisplayScoreboard(this); + } + + public int func_149371_c() { + return this.position; + } + + public String func_149370_d() { + return this.scoreName; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3EPacketTeams.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3EPacketTeams.java new file mode 100644 index 0000000..35e1efd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3EPacketTeams.java @@ -0,0 +1,184 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S3EPacketTeams implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S3EPacketTeams"); + } + + private String field_149320_a = ""; + private String field_149318_b = ""; + private String field_149319_c = ""; + private String field_149316_d = ""; + private String field_179816_e; + private int field_179815_f; + private Collection field_149317_e; + private int field_149314_f; + private int field_149315_g; + + public S3EPacketTeams() { + this.field_179816_e = Team.EnumVisible.ALWAYS.field_178830_e; + this.field_179815_f = -1; + this.field_149317_e = Lists.newArrayList(); + } + + public S3EPacketTeams(ScorePlayerTeam parScorePlayerTeam, int parInt1) { + this.field_179816_e = Team.EnumVisible.ALWAYS.field_178830_e; + this.field_179815_f = -1; + this.field_149317_e = Lists.newArrayList(); + this.field_149320_a = parScorePlayerTeam.getRegisteredName(); + this.field_149314_f = parInt1; + if (parInt1 == 0 || parInt1 == 2) { + this.field_149318_b = parScorePlayerTeam.getTeamName(); + this.field_149319_c = parScorePlayerTeam.getColorPrefix(); + this.field_149316_d = parScorePlayerTeam.getColorSuffix(); + this.field_149315_g = parScorePlayerTeam.func_98299_i(); + this.field_179816_e = parScorePlayerTeam.getNameTagVisibility().field_178830_e; + this.field_179815_f = parScorePlayerTeam.getChatFormat().getColorIndex(); + } + + if (parInt1 == 0) { + this.field_149317_e.addAll(parScorePlayerTeam.getMembershipCollection()); + } + + } + + public S3EPacketTeams(ScorePlayerTeam parScorePlayerTeam, Collection parCollection, int parInt1) { + this.field_179816_e = Team.EnumVisible.ALWAYS.field_178830_e; + this.field_179815_f = -1; + this.field_149317_e = Lists.newArrayList(); + if (parInt1 != 3 && parInt1 != 4) { + throw new IllegalArgumentException("Method must be join or leave for player constructor"); + } else if (parCollection != null && !parCollection.isEmpty()) { + this.field_149314_f = parInt1; + this.field_149320_a = parScorePlayerTeam.getRegisteredName(); + this.field_149317_e.addAll(parCollection); + } else { + throw new IllegalArgumentException("Players cannot be null/empty"); + } + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.field_149320_a = parPacketBuffer.readStringFromBuffer(16); + this.field_149314_f = parPacketBuffer.readByte(); + if (this.field_149314_f == 0 || this.field_149314_f == 2) { + this.field_149318_b = parPacketBuffer.readStringFromBuffer(32); + this.field_149319_c = parPacketBuffer.readStringFromBuffer(16); + this.field_149316_d = parPacketBuffer.readStringFromBuffer(16); + this.field_149315_g = parPacketBuffer.readByte(); + this.field_179816_e = parPacketBuffer.readStringFromBuffer(32); + this.field_179815_f = parPacketBuffer.readByte(); + } + + if (this.field_149314_f == 0 || this.field_149314_f == 3 || this.field_149314_f == 4) { + int i = parPacketBuffer.readVarIntFromBuffer(); + + for (int j = 0; j < i; ++j) { + this.field_149317_e.add(parPacketBuffer.readStringFromBuffer(40)); + } + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.field_149320_a); + parPacketBuffer.writeByte(this.field_149314_f); + if (this.field_149314_f == 0 || this.field_149314_f == 2) { + parPacketBuffer.writeString(this.field_149318_b); + parPacketBuffer.writeString(this.field_149319_c); + parPacketBuffer.writeString(this.field_149316_d); + parPacketBuffer.writeByte(this.field_149315_g); + parPacketBuffer.writeString(this.field_179816_e); + parPacketBuffer.writeByte(this.field_179815_f); + } + + if (this.field_149314_f == 0 || this.field_149314_f == 3 || this.field_149314_f == 4) { + parPacketBuffer.writeVarIntToBuffer(this.field_149317_e.size()); + + for (String s : this.field_149317_e) { + parPacketBuffer.writeString(s); + } + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleTeams(this); + } + + public String func_149312_c() { + return this.field_149320_a; + } + + public String func_149306_d() { + return this.field_149318_b; + } + + public String func_149311_e() { + return this.field_149319_c; + } + + public String func_149309_f() { + return this.field_149316_d; + } + + public Collection func_149310_g() { + return this.field_149317_e; + } + + public int func_149307_h() { + return this.field_149314_f; + } + + public int func_149308_i() { + return this.field_149315_g; + } + + public int func_179813_h() { + return this.field_179815_f; + } + + public String func_179814_i() { + return this.field_179816_e; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3FPacketCustomPayload.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3FPacketCustomPayload.java new file mode 100644 index 0000000..6fda19e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3FPacketCustomPayload.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S3FPacketCustomPayload implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S3FPacketCustomPayload"); + } + + private String channel; + private PacketBuffer data; + + public S3FPacketCustomPayload() { + } + + public S3FPacketCustomPayload(String channelName, PacketBuffer dataIn) { + this.channel = channelName; + this.data = dataIn; + if (dataIn.writerIndex() > 1048576) { + throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); + } + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.channel = parPacketBuffer.readStringFromBuffer(20); + int i = parPacketBuffer.readableBytes(); + if (i >= 0 && i <= 1048576) { + this.data = new PacketBuffer(parPacketBuffer.readBytes(i)); + } else { + throw new IOException("Payload may not be larger than 1048576 bytes"); + } + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.channel); + parPacketBuffer.writeBytes((ByteBuf) this.data); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleCustomPayload(this); + } + + public String getChannelName() { + return this.channel; + } + + public PacketBuffer getBufferData() { + return this.data; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S40PacketDisconnect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S40PacketDisconnect.java new file mode 100644 index 0000000..2d02d79 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S40PacketDisconnect.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S40PacketDisconnect implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S40PacketDisconnect"); + } + + private IChatComponent reason; + + public S40PacketDisconnect() { + } + + public S40PacketDisconnect(IChatComponent reasonIn) { + this.reason = reasonIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.reason = parPacketBuffer.readChatComponent_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeChatComponent_server(this.reason); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleDisconnect(this); + } + + public IChatComponent getReason() { + return this.reason; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S41PacketServerDifficulty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S41PacketServerDifficulty.java new file mode 100644 index 0000000..ace207c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S41PacketServerDifficulty.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S41PacketServerDifficulty implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S41PacketServerDifficulty"); + } + + private EnumDifficulty difficulty; + private boolean difficultyLocked; + + public S41PacketServerDifficulty() { + } + + public S41PacketServerDifficulty(EnumDifficulty difficultyIn, boolean lockedIn) { + this.difficulty = difficultyIn; + this.difficultyLocked = lockedIn; + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleServerDifficulty(this); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.difficulty = EnumDifficulty.getDifficultyEnum(parPacketBuffer.readUnsignedByte()); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeByte(this.difficulty.getDifficultyId()); + } + + public boolean isDifficultyLocked() { + return this.difficultyLocked; + } + + public EnumDifficulty getDifficulty() { + return this.difficulty; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S42PacketCombatEvent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S42PacketCombatEvent.java new file mode 100644 index 0000000..941d990 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S42PacketCombatEvent.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.CombatTracker; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S42PacketCombatEvent implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S42PacketCombatEvent"); + } + + public S42PacketCombatEvent.Event eventType; + public int field_179774_b; + public int field_179775_c; + public int field_179772_d; + public String deathMessage; + + public S42PacketCombatEvent() { + } + + public S42PacketCombatEvent(CombatTracker combatTrackerIn, S42PacketCombatEvent.Event combatEventType) { + this.eventType = combatEventType; + EntityLivingBase entitylivingbase = combatTrackerIn.func_94550_c(); + switch (combatEventType) { + case END_COMBAT: + this.field_179772_d = combatTrackerIn.func_180134_f(); + this.field_179775_c = entitylivingbase == null ? -1 : entitylivingbase.getEntityId(); + break; + case ENTITY_DIED: + this.field_179774_b = combatTrackerIn.getFighter().getEntityId(); + this.field_179775_c = entitylivingbase == null ? -1 : entitylivingbase.getEntityId(); + this.deathMessage = combatTrackerIn.getDeathMessage().getUnformattedText(); + } + + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.eventType = (S42PacketCombatEvent.Event) parPacketBuffer.readEnumValue(S42PacketCombatEvent.Event.class); + if (this.eventType == S42PacketCombatEvent.Event.END_COMBAT) { + this.field_179772_d = parPacketBuffer.readVarIntFromBuffer(); + this.field_179775_c = parPacketBuffer.readInt(); + } else if (this.eventType == S42PacketCombatEvent.Event.ENTITY_DIED) { + this.field_179774_b = parPacketBuffer.readVarIntFromBuffer(); + this.field_179775_c = parPacketBuffer.readInt(); + this.deathMessage = parPacketBuffer.readStringFromBuffer(32767); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeEnumValue(this.eventType); + if (this.eventType == S42PacketCombatEvent.Event.END_COMBAT) { + parPacketBuffer.writeVarIntToBuffer(this.field_179772_d); + parPacketBuffer.writeInt(this.field_179775_c); + } else if (this.eventType == S42PacketCombatEvent.Event.ENTITY_DIED) { + parPacketBuffer.writeVarIntToBuffer(this.field_179774_b); + parPacketBuffer.writeInt(this.field_179775_c); + parPacketBuffer.writeString(this.deathMessage); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleCombatEvent(this); + } + + public static enum Event { + ENTER_COMBAT, END_COMBAT, ENTITY_DIED; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S43PacketCamera.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S43PacketCamera.java new file mode 100644 index 0000000..b719077 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S43PacketCamera.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S43PacketCamera implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S43PacketCamera"); + } + + public int entityId; + + public S43PacketCamera() { + } + + public S43PacketCamera(Entity entityIn) { + this.entityId = entityIn.getEntityId(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleCamera(this); + } + + public Entity getEntity(World worldIn) { + return worldIn.getEntityByID(this.entityId); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S44PacketWorldBorder.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S44PacketWorldBorder.java new file mode 100644 index 0000000..f17902b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S44PacketWorldBorder.java @@ -0,0 +1,178 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S44PacketWorldBorder implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S44PacketWorldBorder"); + } + + private S44PacketWorldBorder.Action action; + private int size; + private double centerX; + private double centerZ; + private double targetSize; + private double diameter; + private long timeUntilTarget; + private int warningTime; + private int warningDistance; + + public S44PacketWorldBorder() { + } + + public S44PacketWorldBorder(WorldBorder border, S44PacketWorldBorder.Action actionIn) { + this.action = actionIn; + this.centerX = border.getCenterX(); + this.centerZ = border.getCenterZ(); + this.diameter = border.getDiameter(); + this.targetSize = border.getTargetSize(); + this.timeUntilTarget = border.getTimeUntilTarget(); + this.size = border.getSize(); + this.warningDistance = border.getWarningDistance(); + this.warningTime = border.getWarningTime(); + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.action = (S44PacketWorldBorder.Action) parPacketBuffer.readEnumValue(S44PacketWorldBorder.Action.class); + switch (this.action) { + case SET_SIZE: + this.targetSize = parPacketBuffer.readDouble(); + break; + case LERP_SIZE: + this.diameter = parPacketBuffer.readDouble(); + this.targetSize = parPacketBuffer.readDouble(); + this.timeUntilTarget = parPacketBuffer.readVarLong(); + break; + case SET_CENTER: + this.centerX = parPacketBuffer.readDouble(); + this.centerZ = parPacketBuffer.readDouble(); + break; + case SET_WARNING_BLOCKS: + this.warningDistance = parPacketBuffer.readVarIntFromBuffer(); + break; + case SET_WARNING_TIME: + this.warningTime = parPacketBuffer.readVarIntFromBuffer(); + break; + case INITIALIZE: + this.centerX = parPacketBuffer.readDouble(); + this.centerZ = parPacketBuffer.readDouble(); + this.diameter = parPacketBuffer.readDouble(); + this.targetSize = parPacketBuffer.readDouble(); + this.timeUntilTarget = parPacketBuffer.readVarLong(); + this.size = parPacketBuffer.readVarIntFromBuffer(); + this.warningDistance = parPacketBuffer.readVarIntFromBuffer(); + this.warningTime = parPacketBuffer.readVarIntFromBuffer(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeEnumValue(this.action); + switch (this.action) { + case SET_SIZE: + parPacketBuffer.writeDouble(this.targetSize); + break; + case LERP_SIZE: + parPacketBuffer.writeDouble(this.diameter); + parPacketBuffer.writeDouble(this.targetSize); + parPacketBuffer.writeVarLong(this.timeUntilTarget); + break; + case SET_CENTER: + parPacketBuffer.writeDouble(this.centerX); + parPacketBuffer.writeDouble(this.centerZ); + break; + case SET_WARNING_BLOCKS: + parPacketBuffer.writeVarIntToBuffer(this.warningDistance); + break; + case SET_WARNING_TIME: + parPacketBuffer.writeVarIntToBuffer(this.warningTime); + break; + case INITIALIZE: + parPacketBuffer.writeDouble(this.centerX); + parPacketBuffer.writeDouble(this.centerZ); + parPacketBuffer.writeDouble(this.diameter); + parPacketBuffer.writeDouble(this.targetSize); + parPacketBuffer.writeVarLong(this.timeUntilTarget); + parPacketBuffer.writeVarIntToBuffer(this.size); + parPacketBuffer.writeVarIntToBuffer(this.warningDistance); + parPacketBuffer.writeVarIntToBuffer(this.warningTime); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleWorldBorder(this); + } + + public void func_179788_a(WorldBorder border) { + switch (this.action) { + case SET_SIZE: + border.setTransition(this.targetSize); + break; + case LERP_SIZE: + border.setTransition(this.diameter, this.targetSize, this.timeUntilTarget); + break; + case SET_CENTER: + border.setCenter(this.centerX, this.centerZ); + break; + case SET_WARNING_BLOCKS: + border.setWarningDistance(this.warningDistance); + break; + case SET_WARNING_TIME: + border.setWarningTime(this.warningTime); + break; + case INITIALIZE: + border.setCenter(this.centerX, this.centerZ); + if (this.timeUntilTarget > 0L) { + border.setTransition(this.diameter, this.targetSize, this.timeUntilTarget); + } else { + border.setTransition(this.targetSize); + } + + border.setSize(this.size); + border.setWarningDistance(this.warningDistance); + border.setWarningTime(this.warningTime); + } + + } + + public static enum Action { + SET_SIZE, LERP_SIZE, SET_CENTER, INITIALIZE, SET_WARNING_TIME, SET_WARNING_BLOCKS; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S45PacketTitle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S45PacketTitle.java new file mode 100644 index 0000000..9071f47 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S45PacketTitle.java @@ -0,0 +1,148 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S45PacketTitle implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S45PacketTitle"); + } + + private S45PacketTitle.Type type; + private IChatComponent message; + private int fadeInTime; + private int displayTime; + private int fadeOutTime; + + public S45PacketTitle() { + } + + public S45PacketTitle(S45PacketTitle.Type type, IChatComponent message) { + this(type, message, -1, -1, -1); + } + + public S45PacketTitle(int fadeInTime, int displayTime, int fadeOutTime) { + this(S45PacketTitle.Type.TIMES, (IChatComponent) null, fadeInTime, displayTime, fadeOutTime); + } + + public S45PacketTitle(S45PacketTitle.Type type, IChatComponent message, int fadeInTime, int displayTime, + int fadeOutTime) { + this.type = type; + this.message = message; + this.fadeInTime = fadeInTime; + this.displayTime = displayTime; + this.fadeOutTime = fadeOutTime; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.type = (S45PacketTitle.Type) parPacketBuffer.readEnumValue(S45PacketTitle.Type.class); + if (this.type == S45PacketTitle.Type.TITLE || this.type == S45PacketTitle.Type.SUBTITLE) { + this.message = parPacketBuffer.readChatComponent_server(); + } + + if (this.type == S45PacketTitle.Type.TIMES) { + this.fadeInTime = parPacketBuffer.readInt(); + this.displayTime = parPacketBuffer.readInt(); + this.fadeOutTime = parPacketBuffer.readInt(); + } + + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeEnumValue(this.type); + if (this.type == S45PacketTitle.Type.TITLE || this.type == S45PacketTitle.Type.SUBTITLE) { + parPacketBuffer.writeChatComponent_server(this.message); + } + + if (this.type == S45PacketTitle.Type.TIMES) { + parPacketBuffer.writeInt(this.fadeInTime); + parPacketBuffer.writeInt(this.displayTime); + parPacketBuffer.writeInt(this.fadeOutTime); + } + + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleTitle(this); + } + + public S45PacketTitle.Type getType() { + return this.type; + } + + public IChatComponent getMessage() { + return this.message; + } + + public int getFadeInTime() { + return this.fadeInTime; + } + + public int getDisplayTime() { + return this.displayTime; + } + + public int getFadeOutTime() { + return this.fadeOutTime; + } + + public static enum Type { + TITLE, SUBTITLE, TIMES, CLEAR, RESET; + + public static S45PacketTitle.Type byName(String name) { + for (S45PacketTitle.Type s45packettitle$type : values()) { + if (s45packettitle$type.name().equalsIgnoreCase(name)) { + return s45packettitle$type; + } + } + + return TITLE; + } + + public static String[] getNames() { + String[] astring = new String[values().length]; + int i = 0; + + for (S45PacketTitle.Type s45packettitle$type : values()) { + astring[i++] = s45packettitle$type.name().toLowerCase(); + } + + return astring; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java new file mode 100644 index 0000000..8c7d69c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S46PacketSetCompressionLevel implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S46PacketSetCompressionLevel"); + } + + private int field_179761_a; + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.field_179761_a = parPacketBuffer.readVarIntFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.field_179761_a); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleSetCompressionLevel(this); + } + + public int func_179760_a() { + return this.field_179761_a; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java new file mode 100644 index 0000000..f082e4d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S47PacketPlayerListHeaderFooter implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter"); + } + + private IChatComponent header; + private IChatComponent footer; + + public S47PacketPlayerListHeaderFooter() { + } + + public S47PacketPlayerListHeaderFooter(IChatComponent headerIn) { + this.header = headerIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.header = parPacketBuffer.readChatComponent_server(); + this.footer = parPacketBuffer.readChatComponent_server(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeChatComponent_server(this.header); + parPacketBuffer.writeChatComponent_server(this.footer); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handlePlayerListHeaderFooter(this); + } + + public IChatComponent getHeader() { + return this.header; + } + + public IChatComponent getFooter() { + return this.footer; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S48PacketResourcePackSend.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S48PacketResourcePackSend.java new file mode 100644 index 0000000..a097160 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S48PacketResourcePackSend.java @@ -0,0 +1,80 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S48PacketResourcePackSend implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S48PacketResourcePackSend"); + } + + private String url; + private String hash; + + public S48PacketResourcePackSend() { + } + + public S48PacketResourcePackSend(String url, String hash) { + this.url = url; + this.hash = hash; + if (hash.length() > 40) { + throw new IllegalArgumentException("Hash is too long (max 40, was " + hash.length() + ")"); + } + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.url = parPacketBuffer.readStringFromBuffer(32767); + this.hash = parPacketBuffer.readStringFromBuffer(40); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeString(this.url); + parPacketBuffer.writeString(this.hash); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleResourcePack(this); + } + + public String getURL() { + return this.url; + } + + public String getHash() { + return this.hash; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java new file mode 100644 index 0000000..3eb320d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java @@ -0,0 +1,80 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.INetHandlerPlayClient; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 S49PacketUpdateEntityNBT implements Packet { + + static { + __checkIntegratedContextValid("net/minecraft/network/play/server/S49PacketUpdateEntityNBT"); + } + + private int entityId; + private NBTTagCompound tagCompound; + + public S49PacketUpdateEntityNBT() { + } + + public S49PacketUpdateEntityNBT(int entityIdIn, NBTTagCompound tagCompoundIn) { + this.entityId = entityIdIn; + this.tagCompound = tagCompoundIn; + } + + /**+ + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { + this.entityId = parPacketBuffer.readVarIntFromBuffer(); + this.tagCompound = parPacketBuffer.readNBTTagCompoundFromBuffer(); + } + + /**+ + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { + parPacketBuffer.writeVarIntToBuffer(this.entityId); + parPacketBuffer.writeNBTTagCompoundToBuffer(this.tagCompound); + } + + /**+ + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient inethandlerplayclient) { + inethandlerplayclient.handleEntityNBT(this); + } + + public NBTTagCompound getTagCompound() { + return this.tagCompound; + } + + public Entity getEntity(World worldIn) { + return worldIn.getEntityByID(this.entityId); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/Path.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/Path.java new file mode 100644 index 0000000..e7c15a7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/Path.java @@ -0,0 +1,172 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Path { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/Path"); + } + + /**+ + * Contains the points in this path + */ + private PathPoint[] pathPoints = new PathPoint[1024]; + private int count; + + /**+ + * Adds a point to the path + */ + public PathPoint addPoint(PathPoint point) { + if (point.index >= 0) { + throw new IllegalStateException("OW KNOWS!"); + } else { + if (this.count == this.pathPoints.length) { + PathPoint[] apathpoint = new PathPoint[this.count << 1]; + System.arraycopy(this.pathPoints, 0, apathpoint, 0, this.count); + this.pathPoints = apathpoint; + } + + this.pathPoints[this.count] = point; + point.index = this.count; + this.sortBack(this.count++); + return point; + } + } + + /**+ + * Clears the path + */ + public void clearPath() { + this.count = 0; + } + + /**+ + * Returns and removes the first point in the path + */ + public PathPoint dequeue() { + PathPoint pathpoint = this.pathPoints[0]; + this.pathPoints[0] = this.pathPoints[--this.count]; + this.pathPoints[this.count] = null; + if (this.count > 0) { + this.sortForward(0); + } + + pathpoint.index = -1; + return pathpoint; + } + + /**+ + * Changes the provided point's distance to target + */ + public void changeDistance(PathPoint parPathPoint, float parFloat1) { + float f = parPathPoint.distanceToTarget; + parPathPoint.distanceToTarget = parFloat1; + if (parFloat1 < f) { + this.sortBack(parPathPoint.index); + } else { + this.sortForward(parPathPoint.index); + } + + } + + /**+ + * Sorts a point to the left + */ + private void sortBack(int parInt1) { + PathPoint pathpoint = this.pathPoints[parInt1]; + + int i; + for (float f = pathpoint.distanceToTarget; parInt1 > 0; parInt1 = i) { + i = parInt1 - 1 >> 1; + PathPoint pathpoint1 = this.pathPoints[i]; + if (f >= pathpoint1.distanceToTarget) { + break; + } + + this.pathPoints[parInt1] = pathpoint1; + pathpoint1.index = parInt1; + } + + this.pathPoints[parInt1] = pathpoint; + pathpoint.index = parInt1; + } + + /**+ + * Sorts a point to the right + */ + private void sortForward(int parInt1) { + PathPoint pathpoint = this.pathPoints[parInt1]; + float f = pathpoint.distanceToTarget; + + while (true) { + int i = 1 + (parInt1 << 1); + int j = i + 1; + if (i >= this.count) { + break; + } + + PathPoint pathpoint1 = this.pathPoints[i]; + float f1 = pathpoint1.distanceToTarget; + PathPoint pathpoint2; + float f2; + if (j >= this.count) { + pathpoint2 = null; + f2 = Float.POSITIVE_INFINITY; + } else { + pathpoint2 = this.pathPoints[j]; + f2 = pathpoint2.distanceToTarget; + } + + if (f1 < f2) { + if (f1 >= f) { + break; + } + + this.pathPoints[parInt1] = pathpoint1; + pathpoint1.index = parInt1; + parInt1 = i; + } else { + if (f2 >= f) { + break; + } + + this.pathPoints[parInt1] = pathpoint2; + pathpoint2.index = parInt1; + parInt1 = j; + } + } + + this.pathPoints[parInt1] = pathpoint; + pathpoint.index = parInt1; + } + + /**+ + * Returns true if this path contains no points + */ + public boolean isPathEmpty() { + return this.count == 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathEntity.java new file mode 100644 index 0000000..9bcc71c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathEntity.java @@ -0,0 +1,137 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PathEntity { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathEntity"); + } + + private final PathPoint[] points; + private int currentPathIndex; + private int pathLength; + + public PathEntity(PathPoint[] pathpoints) { + this.points = pathpoints; + this.pathLength = pathpoints.length; + } + + /**+ + * Directs this path to the next point in its array + */ + public void incrementPathIndex() { + ++this.currentPathIndex; + } + + /**+ + * Returns true if this path has reached the end + */ + public boolean isFinished() { + return this.currentPathIndex >= this.pathLength; + } + + /**+ + * returns the last PathPoint of the Array + */ + public PathPoint getFinalPathPoint() { + return this.pathLength > 0 ? this.points[this.pathLength - 1] : null; + } + + /**+ + * return the PathPoint located at the specified PathIndex, + * usually the current one + */ + public PathPoint getPathPointFromIndex(int index) { + return this.points[index]; + } + + public int getCurrentPathLength() { + return this.pathLength; + } + + public void setCurrentPathLength(int length) { + this.pathLength = length; + } + + public int getCurrentPathIndex() { + return this.currentPathIndex; + } + + public void setCurrentPathIndex(int currentPathIndexIn) { + this.currentPathIndex = currentPathIndexIn; + } + + /**+ + * Gets the vector of the PathPoint associated with the given + * index. + */ + public Vec3 getVectorFromIndex(Entity entityIn, int index) { + double d0 = (double) this.points[index].xCoord + (double) ((int) (entityIn.width + 1.0F)) * 0.5D; + double d1 = (double) this.points[index].yCoord; + double d2 = (double) this.points[index].zCoord + (double) ((int) (entityIn.width + 1.0F)) * 0.5D; + return new Vec3(d0, d1, d2); + } + + /**+ + * returns the current PathEntity target node as Vec3D + */ + public Vec3 getPosition(Entity entityIn) { + return this.getVectorFromIndex(entityIn, this.currentPathIndex); + } + + /**+ + * Returns true if the EntityPath are the same. Non instance + * related equals. + */ + public boolean isSamePath(PathEntity pathentityIn) { + if (pathentityIn == null) { + return false; + } else if (pathentityIn.points.length != this.points.length) { + return false; + } else { + for (int i = 0; i < this.points.length; ++i) { + if (this.points[i].xCoord != pathentityIn.points[i].xCoord + || this.points[i].yCoord != pathentityIn.points[i].yCoord + || this.points[i].zCoord != pathentityIn.points[i].zCoord) { + return false; + } + } + + return true; + } + } + + /**+ + * Returns true if the final PathPoint in the PathEntity is + * equal to Vec3D coords. + */ + public boolean isDestinationSame(Vec3 vec) { + PathPoint pathpoint = this.getFinalPathPoint(); + return pathpoint == null ? false : pathpoint.xCoord == (int) vec.xCoord && pathpoint.zCoord == (int) vec.zCoord; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathFinder.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathFinder.java new file mode 100644 index 0000000..39f8194 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathFinder.java @@ -0,0 +1,156 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.Path; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder.NodeProcessor; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PathFinder { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathFinder"); + } + + /**+ + * The path being generated + */ + private Path path = new Path(); + /**+ + * Selection of path points to add to the path + */ + private PathPoint[] pathOptions = new PathPoint[32]; + private NodeProcessor nodeProcessor; + + public PathFinder(NodeProcessor nodeProcessorIn) { + this.nodeProcessor = nodeProcessorIn; + } + + /**+ + * Internal implementation of creating a path from an entity to + * a point + */ + public PathEntity createEntityPathTo(IBlockAccess blockaccess, Entity entityFrom, Entity entityTo, float dist) { + return this.createEntityPathTo(blockaccess, entityFrom, entityTo.posX, entityTo.getEntityBoundingBox().minY, + entityTo.posZ, dist); + } + + /**+ + * Internal implementation of creating a path from an entity to + * a point + */ + public PathEntity createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, BlockPos targetPos, float dist) { + return this.createEntityPathTo(blockaccess, entityIn, (double) ((float) targetPos.getX() + 0.5F), + (double) ((float) targetPos.getY() + 0.5F), (double) ((float) targetPos.getZ() + 0.5F), dist); + } + + /**+ + * Internal implementation of creating a path from an entity to + * a point + */ + private PathEntity createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, double x, double y, double z, + float distance) { + this.path.clearPath(); + this.nodeProcessor.initProcessor(blockaccess, entityIn); + PathPoint pathpoint = this.nodeProcessor.getPathPointTo(entityIn); + PathPoint pathpoint1 = this.nodeProcessor.getPathPointToCoords(entityIn, x, y, z); + PathEntity pathentity = this.addToPath(entityIn, pathpoint, pathpoint1, distance); + this.nodeProcessor.postProcess(); + return pathentity; + } + + /**+ + * Adds a path from start to end and returns the whole path + */ + private PathEntity addToPath(Entity entityIn, PathPoint pathpointStart, PathPoint pathpointEnd, float maxDistance) { + pathpointStart.totalPathDistance = 0.0F; + pathpointStart.distanceToNext = pathpointStart.distanceToSquared(pathpointEnd); + pathpointStart.distanceToTarget = pathpointStart.distanceToNext; + this.path.clearPath(); + this.path.addPoint(pathpointStart); + PathPoint pathpoint = pathpointStart; + + while (!this.path.isPathEmpty()) { + PathPoint pathpoint1 = this.path.dequeue(); + if (pathpoint1.equals(pathpointEnd)) { + return this.createEntityPath(pathpointStart, pathpointEnd); + } + + if (pathpoint1.distanceToSquared(pathpointEnd) < pathpoint.distanceToSquared(pathpointEnd)) { + pathpoint = pathpoint1; + } + + pathpoint1.visited = true; + int i = this.nodeProcessor.findPathOptions(this.pathOptions, entityIn, pathpoint1, pathpointEnd, + maxDistance); + + for (int j = 0; j < i; ++j) { + PathPoint pathpoint2 = this.pathOptions[j]; + float f = pathpoint1.totalPathDistance + pathpoint1.distanceToSquared(pathpoint2); + if (f < maxDistance * 2.0F && (!pathpoint2.isAssigned() || f < pathpoint2.totalPathDistance)) { + pathpoint2.previous = pathpoint1; + pathpoint2.totalPathDistance = f; + pathpoint2.distanceToNext = pathpoint2.distanceToSquared(pathpointEnd); + if (pathpoint2.isAssigned()) { + this.path.changeDistance(pathpoint2, pathpoint2.totalPathDistance + pathpoint2.distanceToNext); + } else { + pathpoint2.distanceToTarget = pathpoint2.totalPathDistance + pathpoint2.distanceToNext; + this.path.addPoint(pathpoint2); + } + } + } + } + + if (pathpoint == pathpointStart) { + return null; + } else { + return this.createEntityPath(pathpointStart, pathpoint); + } + } + + /**+ + * Returns a new PathEntity for a given start and end point + */ + private PathEntity createEntityPath(PathPoint start, PathPoint end) { + int i = 1; + + for (PathPoint pathpoint = end; pathpoint.previous != null; pathpoint = pathpoint.previous) { + ++i; + } + + PathPoint[] apathpoint = new PathPoint[i]; + PathPoint pathpoint1 = end; + --i; + + for (apathpoint[i] = end; pathpoint1.previous != null; apathpoint[i] = pathpoint1) { + pathpoint1 = pathpoint1.previous; + --i; + } + + return new PathEntity(apathpoint); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigate.java new file mode 100644 index 0000000..cb4e6c4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigate.java @@ -0,0 +1,310 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathFinder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCache; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class PathNavigate { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigate"); + } + + protected EntityLiving theEntity; + protected World worldObj; + protected PathEntity currentPath; + protected double speed; + private final IAttributeInstance pathSearchRange; + private int totalTicks; + private int ticksAtLastPos; + /**+ + * Coordinates of the entity's position last time a check was + * done (part of monitoring getting 'stuck') + */ + private Vec3 lastPosCheck = new Vec3(0.0D, 0.0D, 0.0D); + private float heightRequirement = 1.0F; + private final PathFinder pathFinder; + + public PathNavigate(EntityLiving entitylivingIn, World worldIn) { + this.theEntity = entitylivingIn; + this.worldObj = worldIn; + this.pathSearchRange = entitylivingIn.getEntityAttribute(SharedMonsterAttributes.followRange); + this.pathFinder = this.getPathFinder(); + } + + protected abstract PathFinder getPathFinder(); + + /**+ + * Sets the speed + */ + public void setSpeed(double speedIn) { + this.speed = speedIn; + } + + /**+ + * Gets the maximum distance that the path finding will search + * in. + */ + public float getPathSearchRange() { + return (float) this.pathSearchRange.getAttributeValue(); + } + + /**+ + * Returns the path to the given coordinates. Args : x, y, z + */ + public final PathEntity getPathToXYZ(double x, double y, double z) { + return this.getPathToPos(new BlockPos(MathHelper.floor_double(x), (int) y, MathHelper.floor_double(z))); + } + + /**+ + * Returns path to given BlockPos + */ + public PathEntity getPathToPos(BlockPos pos) { + if (!this.canNavigate()) { + return null; + } else { + float f = this.getPathSearchRange(); + this.worldObj.theProfiler.startSection("pathfind"); + BlockPos blockpos = new BlockPos(this.theEntity); + int i = (int) (f + 8.0F); + ChunkCache chunkcache = new ChunkCache(this.worldObj, blockpos.add(-i, -i, -i), blockpos.add(i, i, i), 0); + PathEntity pathentity = this.pathFinder.createEntityPathTo(chunkcache, this.theEntity, (BlockPos) pos, f); + this.worldObj.theProfiler.endSection(); + return pathentity; + } + } + + /**+ + * Try to find and set a path to XYZ. Returns true if + * successful. Args : x, y, z, speed + */ + public boolean tryMoveToXYZ(double x, double y, double z, double speedIn) { + PathEntity pathentity = this.getPathToXYZ((double) MathHelper.floor_double(x), (double) ((int) y), + (double) MathHelper.floor_double(z)); + return this.setPath(pathentity, speedIn); + } + + /**+ + * Sets vertical space requirement for path + */ + public void setHeightRequirement(float jumpHeight) { + this.heightRequirement = jumpHeight; + } + + /**+ + * Returns the path to the given EntityLiving. Args : entity + */ + public PathEntity getPathToEntityLiving(Entity entityIn) { + if (!this.canNavigate()) { + return null; + } else { + float f = this.getPathSearchRange(); + this.worldObj.theProfiler.startSection("pathfind"); + BlockPos blockpos = (new BlockPos(this.theEntity)).up(); + int i = (int) (f + 16.0F); + ChunkCache chunkcache = new ChunkCache(this.worldObj, blockpos.add(-i, -i, -i), blockpos.add(i, i, i), 0); + PathEntity pathentity = this.pathFinder.createEntityPathTo(chunkcache, this.theEntity, (Entity) entityIn, + f); + this.worldObj.theProfiler.endSection(); + return pathentity; + } + } + + /**+ + * Try to find and set a path to EntityLiving. Returns true if + * successful. Args : entity, speed + */ + public boolean tryMoveToEntityLiving(Entity entityIn, double speedIn) { + PathEntity pathentity = this.getPathToEntityLiving(entityIn); + return pathentity != null ? this.setPath(pathentity, speedIn) : false; + } + + /**+ + * Sets a new path. If it's diferent from the old path. Checks + * to adjust path for sun avoiding, and stores start coords. + * Args : path, speed + */ + public boolean setPath(PathEntity pathentityIn, double speedIn) { + if (pathentityIn == null) { + this.currentPath = null; + return false; + } else { + if (!pathentityIn.isSamePath(this.currentPath)) { + this.currentPath = pathentityIn; + } + + this.removeSunnyPath(); + if (this.currentPath.getCurrentPathLength() == 0) { + return false; + } else { + this.speed = speedIn; + Vec3 vec3 = this.getEntityPosition(); + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck = vec3; + return true; + } + } + } + + /**+ + * gets the actively used PathEntity + */ + public PathEntity getPath() { + return this.currentPath; + } + + public void onUpdateNavigation() { + ++this.totalTicks; + if (!this.noPath()) { + if (this.canNavigate()) { + this.pathFollow(); + } else if (this.currentPath != null + && this.currentPath.getCurrentPathIndex() < this.currentPath.getCurrentPathLength()) { + Vec3 vec3 = this.getEntityPosition(); + Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, + this.currentPath.getCurrentPathIndex()); + if (vec3.yCoord > vec31.yCoord && !this.theEntity.onGround + && MathHelper.floor_double(vec3.xCoord) == MathHelper.floor_double(vec31.xCoord) + && MathHelper.floor_double(vec3.zCoord) == MathHelper.floor_double(vec31.zCoord)) { + this.currentPath.setCurrentPathIndex(this.currentPath.getCurrentPathIndex() + 1); + } + } + + if (!this.noPath()) { + Vec3 vec32 = this.currentPath.getPosition(this.theEntity); + if (vec32 != null) { + AxisAlignedBB axisalignedbb1 = (new AxisAlignedBB(vec32.xCoord, vec32.yCoord, vec32.zCoord, + vec32.xCoord, vec32.yCoord, vec32.zCoord)).expand(0.5D, 0.5D, 0.5D); + List list = this.worldObj.getCollidingBoundingBoxes(this.theEntity, + axisalignedbb1.addCoord(0.0D, -1.0D, 0.0D)); + double d0 = -1.0D; + axisalignedbb1 = axisalignedbb1.offset(0.0D, 1.0D, 0.0D); + + for (AxisAlignedBB axisalignedbb : (List) list) { + d0 = axisalignedbb.calculateYOffset(axisalignedbb1, d0); + } + + this.theEntity.getMoveHelper().setMoveTo(vec32.xCoord, vec32.yCoord + d0, vec32.zCoord, this.speed); + } + } + } + } + + protected void pathFollow() { + Vec3 vec3 = this.getEntityPosition(); + int i = this.currentPath.getCurrentPathLength(); + + for (int j = this.currentPath.getCurrentPathIndex(); j < this.currentPath.getCurrentPathLength(); ++j) { + if (this.currentPath.getPathPointFromIndex(j).yCoord != (int) vec3.yCoord) { + i = j; + break; + } + } + + float f = this.theEntity.width * this.theEntity.width * this.heightRequirement; + + for (int k = this.currentPath.getCurrentPathIndex(); k < i; ++k) { + Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, k); + if (vec3.squareDistanceTo(vec31) < (double) f) { + this.currentPath.setCurrentPathIndex(k + 1); + } + } + + int j1 = MathHelper.ceiling_float_int(this.theEntity.width); + int k1 = (int) this.theEntity.height + 1; + int l = j1; + + for (int i1 = i - 1; i1 >= this.currentPath.getCurrentPathIndex(); --i1) { + if (this.isDirectPathBetweenPoints(vec3, this.currentPath.getVectorFromIndex(this.theEntity, i1), j1, k1, + l)) { + this.currentPath.setCurrentPathIndex(i1); + break; + } + } + + this.checkForStuck(vec3); + } + + /**+ + * Checks if entity haven't been moved when last checked and if + * so, clears current {@link + * net.minecraft.pathfinding.PathEntity} + */ + protected void checkForStuck(Vec3 positionVec3) { + if (this.totalTicks - this.ticksAtLastPos > 100) { + if (positionVec3.squareDistanceTo(this.lastPosCheck) < 2.25D) { + this.clearPathEntity(); + } + + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck = positionVec3; + } + + } + + /**+ + * If null path or reached the end + */ + public boolean noPath() { + return this.currentPath == null || this.currentPath.isFinished(); + } + + /**+ + * sets active PathEntity to null + */ + public void clearPathEntity() { + this.currentPath = null; + } + + protected abstract Vec3 getEntityPosition(); + + protected abstract boolean canNavigate(); + + /**+ + * Returns true if the entity is in water or lava, false + * otherwise + */ + protected boolean isInLiquid() { + return this.theEntity.isInWater() || this.theEntity.isInLava(); + } + + /**+ + * Trims path data from the end to the first sun covered block + */ + protected void removeSunnyPath() { + } + + protected abstract boolean isDirectPathBetweenPoints(Vec3 var1, Vec3 var2, int var3, int var4, int var5); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateClimber.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateClimber.java new file mode 100644 index 0000000..a1292ce --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateClimber.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigateGround; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PathNavigateClimber extends PathNavigateGround { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigateClimber"); + } + + private BlockPos targetPosition; + + public PathNavigateClimber(EntityLiving entityLivingIn, World worldIn) { + super(entityLivingIn, worldIn); + } + + /**+ + * Returns path to given BlockPos + */ + public PathEntity getPathToPos(BlockPos blockpos) { + this.targetPosition = blockpos; + return super.getPathToPos(blockpos); + } + + /**+ + * Returns the path to the given EntityLiving. Args : entity + */ + public PathEntity getPathToEntityLiving(Entity entity) { + this.targetPosition = new BlockPos(entity); + return super.getPathToEntityLiving(entity); + } + + /**+ + * Try to find and set a path to EntityLiving. Returns true if + * successful. Args : entity, speed + */ + public boolean tryMoveToEntityLiving(Entity entity, double d0) { + PathEntity pathentity = this.getPathToEntityLiving(entity); + if (pathentity != null) { + return this.setPath(pathentity, d0); + } else { + this.targetPosition = new BlockPos(entity); + this.speed = d0; + return true; + } + } + + public void onUpdateNavigation() { + if (!this.noPath()) { + super.onUpdateNavigation(); + } else { + if (this.targetPosition != null) { + double d0 = (double) (this.theEntity.width * this.theEntity.width); + if (this.theEntity.getDistanceSqToCenter(this.targetPosition) >= d0 + && (this.theEntity.posY <= (double) this.targetPosition.getY() + || this.theEntity.getDistanceSqToCenter(new BlockPos(this.targetPosition.getX(), + MathHelper.floor_double(this.theEntity.posY), + this.targetPosition.getZ())) >= d0)) { + this.theEntity.getMoveHelper().setMoveTo((double) this.targetPosition.getX(), + (double) this.targetPosition.getY(), (double) this.targetPosition.getZ(), this.speed); + } else { + this.targetPosition = null; + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateGround.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateGround.java new file mode 100644 index 0000000..56fb1d3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateGround.java @@ -0,0 +1,276 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathFinder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder.WalkNodeProcessor; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PathNavigateGround extends PathNavigate { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigateGround"); + } + + protected WalkNodeProcessor nodeProcessor; + private boolean shouldAvoidSun; + + public PathNavigateGround(EntityLiving entitylivingIn, World worldIn) { + super(entitylivingIn, worldIn); + } + + protected PathFinder getPathFinder() { + this.nodeProcessor = new WalkNodeProcessor(); + this.nodeProcessor.setEnterDoors(true); + return new PathFinder(this.nodeProcessor); + } + + /**+ + * If on ground or swimming and can swim + */ + protected boolean canNavigate() { + return this.theEntity.onGround || this.getCanSwim() && this.isInLiquid() || this.theEntity.isRiding() + && this.theEntity instanceof EntityZombie && this.theEntity.ridingEntity instanceof EntityChicken; + } + + protected Vec3 getEntityPosition() { + return new Vec3(this.theEntity.posX, (double) this.getPathablePosY(), this.theEntity.posZ); + } + + /**+ + * Gets the safe pathing Y position for the entity depending on + * if it can path swim or not + */ + private int getPathablePosY() { + if (this.theEntity.isInWater() && this.getCanSwim()) { + int i = (int) this.theEntity.getEntityBoundingBox().minY; + Block block = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.theEntity.posX), i, + MathHelper.floor_double(this.theEntity.posZ))).getBlock(); + int j = 0; + + while (block == Blocks.flowing_water || block == Blocks.water) { + ++i; + block = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.theEntity.posX), i, + MathHelper.floor_double(this.theEntity.posZ))).getBlock(); + ++j; + if (j > 16) { + return (int) this.theEntity.getEntityBoundingBox().minY; + } + } + + return i; + } else { + return (int) (this.theEntity.getEntityBoundingBox().minY + 0.5D); + } + } + + /**+ + * Trims path data from the end to the first sun covered block + */ + protected void removeSunnyPath() { + super.removeSunnyPath(); + if (this.shouldAvoidSun) { + if (this.worldObj.canSeeSky(new BlockPos(MathHelper.floor_double(this.theEntity.posX), + (int) (this.theEntity.getEntityBoundingBox().minY + 0.5D), + MathHelper.floor_double(this.theEntity.posZ)))) { + return; + } + + for (int i = 0; i < this.currentPath.getCurrentPathLength(); ++i) { + PathPoint pathpoint = this.currentPath.getPathPointFromIndex(i); + if (this.worldObj.canSeeSky(new BlockPos(pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord))) { + this.currentPath.setCurrentPathLength(i - 1); + return; + } + } + } + + } + + /**+ + * Returns true when an entity of specified size could safely + * walk in a straight line between the two points. Args: pos1, + * pos2, entityXSize, entityYSize, entityZSize + */ + protected boolean isDirectPathBetweenPoints(Vec3 posVec31, Vec3 posVec32, int sizeX, int sizeY, int sizeZ) { + int i = MathHelper.floor_double(posVec31.xCoord); + int j = MathHelper.floor_double(posVec31.zCoord); + double d0 = posVec32.xCoord - posVec31.xCoord; + double d1 = posVec32.zCoord - posVec31.zCoord; + double d2 = d0 * d0 + d1 * d1; + if (d2 < 1.0E-8D) { + return false; + } else { + double d3 = 1.0D / Math.sqrt(d2); + d0 = d0 * d3; + d1 = d1 * d3; + sizeX = sizeX + 2; + sizeZ = sizeZ + 2; + if (!this.isSafeToStandAt(i, (int) posVec31.yCoord, j, sizeX, sizeY, sizeZ, posVec31, d0, d1)) { + return false; + } else { + sizeX = sizeX - 2; + sizeZ = sizeZ - 2; + double d4 = 1.0D / Math.abs(d0); + double d5 = 1.0D / Math.abs(d1); + double d6 = (double) (i * 1) - posVec31.xCoord; + double d7 = (double) (j * 1) - posVec31.zCoord; + if (d0 >= 0.0D) { + ++d6; + } + + if (d1 >= 0.0D) { + ++d7; + } + + d6 = d6 / d0; + d7 = d7 / d1; + int k = d0 < 0.0D ? -1 : 1; + int l = d1 < 0.0D ? -1 : 1; + int i1 = MathHelper.floor_double(posVec32.xCoord); + int j1 = MathHelper.floor_double(posVec32.zCoord); + int k1 = i1 - i; + int l1 = j1 - j; + + while (k1 * k > 0 || l1 * l > 0) { + if (d6 < d7) { + d6 += d4; + i += k; + k1 = i1 - i; + } else { + d7 += d5; + j += l; + l1 = j1 - j; + } + + if (!this.isSafeToStandAt(i, (int) posVec31.yCoord, j, sizeX, sizeY, sizeZ, posVec31, d0, d1)) { + return false; + } + } + + return true; + } + } + } + + /**+ + * Returns true when an entity could stand at a position, + * including solid blocks under the entire entity. + */ + private boolean isSafeToStandAt(int x, int y, int z, int sizeX, int sizeY, int sizeZ, Vec3 vec31, double parDouble1, + double parDouble2) { + int i = x - sizeX / 2; + int j = z - sizeZ / 2; + if (!this.isPositionClear(i, y, j, sizeX, sizeY, sizeZ, vec31, parDouble1, parDouble2)) { + return false; + } else { + for (int k = i; k < i + sizeX; ++k) { + for (int l = j; l < j + sizeZ; ++l) { + double d0 = (double) k + 0.5D - vec31.xCoord; + double d1 = (double) l + 0.5D - vec31.zCoord; + if (d0 * parDouble1 + d1 * parDouble2 >= 0.0D) { + Block block = this.worldObj.getBlockState(new BlockPos(k, y - 1, l)).getBlock(); + Material material = block.getMaterial(); + if (material == Material.air) { + return false; + } + + if (material == Material.water && !this.theEntity.isInWater()) { + return false; + } + + if (material == Material.lava) { + return false; + } + } + } + } + + return true; + } + } + + /**+ + * Returns true if an entity does not collide with any solid + * blocks at the position. + */ + private boolean isPositionClear(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, + Vec3 parVec3_1, double parDouble1, double parDouble2) { + for (BlockPos blockpos : BlockPos.getAllInBox(new BlockPos(parInt1, parInt2, parInt3), + new BlockPos(parInt1 + parInt4 - 1, parInt2 + parInt5 - 1, parInt3 + parInt6 - 1))) { + double d0 = (double) blockpos.getX() + 0.5D - parVec3_1.xCoord; + double d1 = (double) blockpos.getZ() + 0.5D - parVec3_1.zCoord; + if (d0 * parDouble1 + d1 * parDouble2 >= 0.0D) { + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + if (!block.isPassable(this.worldObj, blockpos)) { + return false; + } + } + } + + return true; + } + + public void setAvoidsWater(boolean avoidsWater) { + this.nodeProcessor.setAvoidsWater(avoidsWater); + } + + public boolean getAvoidsWater() { + return this.nodeProcessor.getAvoidsWater(); + } + + public void setBreakDoors(boolean canBreakDoors) { + this.nodeProcessor.setBreakDoors(canBreakDoors); + } + + public void setEnterDoors(boolean par1) { + this.nodeProcessor.setEnterDoors(par1); + } + + public boolean getEnterDoors() { + return this.nodeProcessor.getEnterDoors(); + } + + public void setCanSwim(boolean canSwim) { + this.nodeProcessor.setCanSwim(canSwim); + } + + public boolean getCanSwim() { + return this.nodeProcessor.getCanSwim(); + } + + public void setAvoidSun(boolean par1) { + this.shouldAvoidSun = par1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateSwimmer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateSwimmer.java new file mode 100644 index 0000000..05cc160 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateSwimmer.java @@ -0,0 +1,99 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathFinder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathNavigate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder.SwimNodeProcessor; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PathNavigateSwimmer extends PathNavigate { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigateSwimmer"); + } + + public PathNavigateSwimmer(EntityLiving entitylivingIn, World worldIn) { + super(entitylivingIn, worldIn); + } + + protected PathFinder getPathFinder() { + return new PathFinder(new SwimNodeProcessor()); + } + + /**+ + * If on ground or swimming and can swim + */ + protected boolean canNavigate() { + return this.isInLiquid(); + } + + protected Vec3 getEntityPosition() { + return new Vec3(this.theEntity.posX, this.theEntity.posY + (double) this.theEntity.height * 0.5D, + this.theEntity.posZ); + } + + protected void pathFollow() { + Vec3 vec3 = this.getEntityPosition(); + float f = this.theEntity.width * this.theEntity.width; + byte b0 = 6; + if (vec3.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, + this.currentPath.getCurrentPathIndex())) < (double) f) { + this.currentPath.incrementPathIndex(); + } + + for (int i = Math.min(this.currentPath.getCurrentPathIndex() + b0, + this.currentPath.getCurrentPathLength() - 1); i > this.currentPath.getCurrentPathIndex(); --i) { + Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, i); + if (vec31.squareDistanceTo(vec3) <= 36.0D && this.isDirectPathBetweenPoints(vec3, vec31, 0, 0, 0)) { + this.currentPath.setCurrentPathIndex(i); + break; + } + } + + this.checkForStuck(vec3); + } + + /**+ + * Trims path data from the end to the first sun covered block + */ + protected void removeSunnyPath() { + super.removeSunnyPath(); + } + + /**+ + * Returns true when an entity of specified size could safely + * walk in a straight line between the two points. Args: pos1, + * pos2, entityXSize, entityYSize, entityZSize + */ + protected boolean isDirectPathBetweenPoints(Vec3 vec3, Vec3 vec31, int var3, int var4, int var5) { + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, + new Vec3(vec31.xCoord, vec31.yCoord + (double) this.theEntity.height * 0.5D, vec31.zCoord), false, true, + false); + return movingobjectposition == null + || movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathPoint.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathPoint.java new file mode 100644 index 0000000..9958b43 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathPoint.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PathPoint { + + static { + __checkIntegratedContextValid("net/minecraft/pathfinding/PathPoint"); + } + + public final int xCoord; + public final int yCoord; + public final int zCoord; + private final int hash; + int index = -1; + float totalPathDistance; + float distanceToNext; + float distanceToTarget; + PathPoint previous; + public boolean visited; + + public PathPoint(int x, int y, int z) { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.hash = makeHash(x, y, z); + } + + public static int makeHash(int x, int y, int z) { + return y & 255 | (x & 32767) << 8 | (z & 32767) << 24 | (x < 0 ? Integer.MIN_VALUE : 0) + | (z < 0 ? '\u8000' : 0); + } + + /**+ + * Returns the linear distance to another path point + */ + public float distanceTo(PathPoint pathpointIn) { + float f = (float) (pathpointIn.xCoord - this.xCoord); + float f1 = (float) (pathpointIn.yCoord - this.yCoord); + float f2 = (float) (pathpointIn.zCoord - this.zCoord); + return MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2); + } + + /**+ + * Returns the squared distance to another path point + */ + public float distanceToSquared(PathPoint pathpointIn) { + float f = (float) (pathpointIn.xCoord - this.xCoord); + float f1 = (float) (pathpointIn.yCoord - this.yCoord); + float f2 = (float) (pathpointIn.zCoord - this.zCoord); + return f * f + f1 * f1 + f2 * f2; + } + + public boolean equals(Object object) { + if (!(object instanceof PathPoint)) { + return false; + } else { + PathPoint pathpoint = (PathPoint) object; + return this.hash == pathpoint.hash && this.xCoord == pathpoint.xCoord && this.yCoord == pathpoint.yCoord + && this.zCoord == pathpoint.zCoord; + } + } + + public int hashCode() { + return this.hash; + } + + /**+ + * Returns true if this point has already been assigned to a + * path + */ + public boolean isAssigned() { + return this.index >= 0; + } + + public String toString() { + return this.xCoord + ", " + this.yCoord + ", " + this.zCoord; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/Potion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/Potion.java new file mode 100644 index 0000000..2d4199b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/Potion.java @@ -0,0 +1,398 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.SharedMonsterAttributes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttribute; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionAbsorption; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionAttackDamage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHealth; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHealthBoost; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Potion { + + static { + __checkIntegratedContextValid("net/minecraft/potion/Potion"); + } + + /**+ + * The array of potion types. + */ + public static final Potion[] potionTypes = new Potion[32]; + private static final Map field_180150_I = Maps.newHashMap(); + public static final Potion field_180151_b = null; + public static final Potion moveSpeed = (new Potion(1, new ResourceLocation("speed"), false, 8171462)) + .setPotionName("potion.moveSpeed").setIconIndex(0, 0) + .registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, + "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); + public static final Potion moveSlowdown = (new Potion(2, new ResourceLocation("slowness"), true, 5926017)) + .setPotionName("potion.moveSlowdown").setIconIndex(1, 0) + .registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, + "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); + public static final Potion digSpeed = (new Potion(3, new ResourceLocation("haste"), false, 14270531)) + .setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); + public static final Potion digSlowdown = (new Potion(4, new ResourceLocation("mining_fatigue"), true, 4866583)) + .setPotionName("potion.digSlowDown").setIconIndex(3, 0); + public static final Potion damageBoost = (new PotionAttackDamage(5, new ResourceLocation("strength"), false, + 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).registerPotionAttributeModifier( + SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 2.5D, 2); + public static final Potion heal = (new PotionHealth(6, new ResourceLocation("instant_health"), false, 16262179)) + .setPotionName("potion.heal"); + public static final Potion harm = (new PotionHealth(7, new ResourceLocation("instant_damage"), true, 4393481)) + .setPotionName("potion.harm"); + public static final Potion jump = (new Potion(8, new ResourceLocation("jump_boost"), false, 2293580)) + .setPotionName("potion.jump").setIconIndex(2, 1); + public static final Potion confusion = (new Potion(9, new ResourceLocation("nausea"), true, 5578058)) + .setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); + /**+ + * The regeneration Potion object. + */ + public static final Potion regeneration = (new Potion(10, new ResourceLocation("regeneration"), false, 13458603)) + .setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); + public static final Potion resistance = (new Potion(11, new ResourceLocation("resistance"), false, 10044730)) + .setPotionName("potion.resistance").setIconIndex(6, 1); + /**+ + * The fire resistance Potion object. + */ + public static final Potion fireResistance = (new Potion(12, new ResourceLocation("fire_resistance"), false, + 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); + /**+ + * The water breathing Potion object. + */ + public static final Potion waterBreathing = (new Potion(13, new ResourceLocation("water_breathing"), false, + 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); + /**+ + * The invisibility Potion object. + */ + public static final Potion invisibility = (new Potion(14, new ResourceLocation("invisibility"), false, 8356754)) + .setPotionName("potion.invisibility").setIconIndex(0, 1); + /**+ + * The blindness Potion object. + */ + public static final Potion blindness = (new Potion(15, new ResourceLocation("blindness"), true, 2039587)) + .setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); + /**+ + * The night vision Potion object. + */ + public static final Potion nightVision = (new Potion(16, new ResourceLocation("night_vision"), false, 2039713)) + .setPotionName("potion.nightVision").setIconIndex(4, 1); + /**+ + * The hunger Potion object. + */ + public static final Potion hunger = (new Potion(17, new ResourceLocation("hunger"), true, 5797459)) + .setPotionName("potion.hunger").setIconIndex(1, 1); + /**+ + * The weakness Potion object. + */ + public static final Potion weakness = (new PotionAttackDamage(18, new ResourceLocation("weakness"), true, 4738376)) + .setPotionName("potion.weakness").setIconIndex(5, 0).registerPotionAttributeModifier( + SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); + /**+ + * The poison Potion object. + */ + public static final Potion poison = (new Potion(19, new ResourceLocation("poison"), true, 5149489)) + .setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); + /**+ + * The wither Potion object. + */ + public static final Potion wither = (new Potion(20, new ResourceLocation("wither"), true, 3484199)) + .setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); + /**+ + * The health boost Potion object. + */ + public static final Potion healthBoost = (new PotionHealthBoost(21, new ResourceLocation("health_boost"), false, + 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).registerPotionAttributeModifier( + SharedMonsterAttributes.maxHealth, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); + /**+ + * The absorption Potion object. + */ + public static final Potion absorption = (new PotionAbsorption(22, new ResourceLocation("absorption"), false, + 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); + /**+ + * The saturation Potion object. + */ + public static final Potion saturation = (new PotionHealth(23, new ResourceLocation("saturation"), false, 16262179)) + .setPotionName("potion.saturation"); + public static final Potion field_180153_z = null; + public static final Potion field_180147_A = null; + public static final Potion field_180148_B = null; + public static final Potion field_180149_C = null; + public static final Potion field_180143_D = null; + public static final Potion field_180144_E = null; + public static final Potion field_180145_F = null; + public static final Potion field_180146_G = null; + public final int id; + private final Map attributeModifierMap = Maps.newHashMap(); + private final boolean isBadEffect; + private final int liquidColor; + /**+ + * The name of the Potion. + */ + private String name = ""; + /**+ + * The index for the icon displayed when the potion effect is + * active. + */ + private int statusIconIndex = -1; + private double effectiveness; + private boolean usable; + + protected Potion(int potionID, ResourceLocation location, boolean badEffect, int potionColor) { + this.id = potionID; + potionTypes[potionID] = this; + field_180150_I.put(location, this); + this.isBadEffect = badEffect; + if (badEffect) { + this.effectiveness = 0.5D; + } else { + this.effectiveness = 1.0D; + } + + this.liquidColor = potionColor; + } + + public static Potion getPotionFromResourceLocation(String location) { + return (Potion) field_180150_I.get(new ResourceLocation(location)); + } + + public static Set func_181168_c() { + return field_180150_I.keySet(); + } + + /**+ + * Sets the index for the icon displayed in the player's + * inventory when the status is active. + */ + protected Potion setIconIndex(int parInt1, int parInt2) { + this.statusIconIndex = parInt1 + parInt2 * 8; + return this; + } + + /**+ + * returns the ID of the potion + */ + public int getId() { + return this.id; + } + + public void performEffect(EntityLivingBase entityLivingBaseIn, int parInt1) { + if (this.id == regeneration.id) { + if (entityLivingBaseIn.getHealth() < entityLivingBaseIn.getMaxHealth()) { + entityLivingBaseIn.heal(1.0F); + } + } else if (this.id == poison.id) { + if (entityLivingBaseIn.getHealth() > 1.0F) { + entityLivingBaseIn.attackEntityFrom(DamageSource.magic, 1.0F); + } + } else if (this.id == wither.id) { + entityLivingBaseIn.attackEntityFrom(DamageSource.wither, 1.0F); + } else if (this.id == hunger.id && entityLivingBaseIn instanceof EntityPlayer) { + ((EntityPlayer) entityLivingBaseIn).addExhaustion(0.025F * (float) (parInt1 + 1)); + } else if (this.id == saturation.id && entityLivingBaseIn instanceof EntityPlayer) { + ((EntityPlayer) entityLivingBaseIn).getFoodStats().addStats(parInt1 + 1, 1.0F); + } else if ((this.id != heal.id || entityLivingBaseIn.isEntityUndead()) + && (this.id != harm.id || !entityLivingBaseIn.isEntityUndead())) { + if (this.id == harm.id && !entityLivingBaseIn.isEntityUndead() + || this.id == heal.id && entityLivingBaseIn.isEntityUndead()) { + entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float) (6 << parInt1)); + } + } else { + entityLivingBaseIn.heal((float) Math.max(4 << parInt1, 0)); + } + + } + + public void affectEntity(Entity entityLivingBaseIn, Entity parEntity2, EntityLivingBase parEntityLivingBase, + int parInt1, double parDouble1) { + if ((this.id != heal.id || parEntityLivingBase.isEntityUndead()) + && (this.id != harm.id || !parEntityLivingBase.isEntityUndead())) { + if (this.id == harm.id && !parEntityLivingBase.isEntityUndead() + || this.id == heal.id && parEntityLivingBase.isEntityUndead()) { + int j = (int) (parDouble1 * (double) (6 << parInt1) + 0.5D); + if (entityLivingBaseIn == null) { + parEntityLivingBase.attackEntityFrom(DamageSource.magic, (float) j); + } else { + parEntityLivingBase.attackEntityFrom( + DamageSource.causeIndirectMagicDamage(entityLivingBaseIn, parEntity2), (float) j); + } + } + } else { + int i = (int) (parDouble1 * (double) (4 << parInt1) + 0.5D); + parEntityLivingBase.heal((float) i); + } + + } + + /**+ + * Returns true if the potion has an instant effect instead of a + * continuous one (eg Harming) + */ + public boolean isInstant() { + return false; + } + + /**+ + * checks if Potion effect is ready to be applied this tick. + */ + public boolean isReady(int i, int j) { + if (this.id == regeneration.id) { + int i1 = 50 >> j; + return i1 > 0 ? i % i1 == 0 : true; + } else if (this.id == poison.id) { + int l = 25 >> j; + return l > 0 ? i % l == 0 : true; + } else if (this.id == wither.id) { + int k = 40 >> j; + return k > 0 ? i % k == 0 : true; + } else { + return this.id == hunger.id; + } + } + + /**+ + * Set the potion name. + */ + public Potion setPotionName(String nameIn) { + this.name = nameIn; + return this; + } + + /**+ + * returns the name of the potion + */ + public String getName() { + return this.name; + } + + /**+ + * Returns true if the potion has a associated status icon to + * display in then inventory when active. + */ + public boolean hasStatusIcon() { + return this.statusIconIndex >= 0; + } + + /**+ + * Returns the index for the icon to display when the potion is + * active. + */ + public int getStatusIconIndex() { + return this.statusIconIndex; + } + + /**+ + * This method returns true if the potion effect is bad - + * negative - for the entity. + */ + public boolean isBadEffect() { + return this.isBadEffect; + } + + public static String getDurationString(PotionEffect effect) { + if (effect.getIsPotionDurationMax()) { + return "**:**"; + } else { + int i = effect.getDuration(); + return StringUtils.ticksToElapsedTime(i); + } + } + + protected Potion setEffectiveness(double effectivenessIn) { + this.effectiveness = effectivenessIn; + return this; + } + + public double getEffectiveness() { + return this.effectiveness; + } + + public boolean isUsable() { + return this.usable; + } + + /**+ + * Returns the color of the potion liquid. + */ + public int getLiquidColor() { + return this.liquidColor; + } + + /**+ + * Used by potions to register the attribute they modify. + */ + public Potion registerPotionAttributeModifier(IAttribute parIAttribute, String parString1, double parDouble1, + int parInt1) { + AttributeModifier attributemodifier = new AttributeModifier(EaglercraftUUID.fromString(parString1), + this.getName(), parDouble1, parInt1); + this.attributeModifierMap.put(parIAttribute, attributemodifier); + return this; + } + + public Map getAttributeModifierMap() { + return this.attributeModifierMap; + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap baseattributemap, + int var3) { + for (Entry entry : this.attributeModifierMap.entrySet()) { + IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstance((IAttribute) entry.getKey()); + if (iattributeinstance != null) { + iattributeinstance.removeModifier((AttributeModifier) entry.getValue()); + } + } + + } + + public void applyAttributesModifiersToEntity(EntityLivingBase var1, BaseAttributeMap baseattributemap, int i) { + for (Entry entry : this.attributeModifierMap.entrySet()) { + IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstance((IAttribute) entry.getKey()); + if (iattributeinstance != null) { + AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); + iattributeinstance.removeModifier(attributemodifier); + iattributeinstance.applyModifier(new AttributeModifier(attributemodifier.getID(), + this.getName() + " " + i, this.getAttributeModifierAmount(i, attributemodifier), + attributemodifier.getOperation())); + } + } + + } + + public double getAttributeModifierAmount(int i, AttributeModifier attributemodifier) { + return attributemodifier.getAmount() * (double) (i + 1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAbsorption.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAbsorption.java new file mode 100644 index 0000000..5bb644f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAbsorption.java @@ -0,0 +1,51 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PotionAbsorption extends Potion { + + static { + __checkIntegratedContextValid("net/minecraft/potion/PotionAbsorption"); + } + + protected PotionAbsorption(int potionID, ResourceLocation location, boolean badEffect, int potionColor) { + super(potionID, location, badEffect, potionColor); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap amplifier, + int parInt1) { + entityLivingBaseIn.setAbsorptionAmount(entityLivingBaseIn.getAbsorptionAmount() - (float) (4 * (parInt1 + 1))); + super.removeAttributesModifiersFromEntity(entityLivingBaseIn, amplifier, parInt1); + } + + public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap amplifier, + int parInt1) { + entityLivingBaseIn.setAbsorptionAmount(entityLivingBaseIn.getAbsorptionAmount() + (float) (4 * (parInt1 + 1))); + super.applyAttributesModifiersToEntity(entityLivingBaseIn, amplifier, parInt1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAttackDamage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAttackDamage.java new file mode 100644 index 0000000..c01111d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAttackDamage.java @@ -0,0 +1,43 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.AttributeModifier; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PotionAttackDamage extends Potion { + + static { + __checkIntegratedContextValid("net/minecraft/potion/PotionAttackDamage"); + } + + protected PotionAttackDamage(int potionID, ResourceLocation location, boolean badEffect, int potionColor) { + super(potionID, location, badEffect, potionColor); + } + + public double getAttributeModifierAmount(int modifier, AttributeModifier parAttributeModifier) { + return this.id == Potion.weakness.id ? (double) (-0.5F * (float) (modifier + 1)) + : 1.3D * (double) (modifier + 1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionEffect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionEffect.java new file mode 100644 index 0000000..5a557d4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionEffect.java @@ -0,0 +1,228 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PotionEffect { + + static { + __checkIntegratedContextValid("net/minecraft/potion/PotionEffect"); + } + + private static final Logger LOGGER = LogManager.getLogger(); + private int potionID; + private int duration; + private int amplifier; + private boolean isSplashPotion; + private boolean isAmbient; + private boolean isPotionDurationMax; + private boolean showParticles; + + public PotionEffect(int id, int effectDuration) { + this(id, effectDuration, 0); + } + + public PotionEffect(int id, int effectDuration, int effectAmplifier) { + this(id, effectDuration, effectAmplifier, false, true); + } + + public PotionEffect(int id, int effectDuration, int effectAmplifier, boolean ambient, boolean showParticles) { + this.potionID = id; + this.duration = effectDuration; + this.amplifier = effectAmplifier; + this.isAmbient = ambient; + this.showParticles = showParticles; + } + + public PotionEffect(PotionEffect other) { + this.potionID = other.potionID; + this.duration = other.duration; + this.amplifier = other.amplifier; + this.isAmbient = other.isAmbient; + this.showParticles = other.showParticles; + } + + /**+ + * merges the input PotionEffect into this one if this.amplifier + * <= tomerge.amplifier. The duration in the supplied potion + * effect is assumed to be greater. + */ + public void combine(PotionEffect other) { + if (this.potionID != other.potionID) { + LOGGER.warn("This method should only be called for matching effects!"); + } + + if (other.amplifier > this.amplifier) { + this.amplifier = other.amplifier; + this.duration = other.duration; + } else if (other.amplifier == this.amplifier && this.duration < other.duration) { + this.duration = other.duration; + } else if (!other.isAmbient && this.isAmbient) { + this.isAmbient = other.isAmbient; + } + + this.showParticles = other.showParticles; + } + + /**+ + * Retrieve the ID of the potion this effect matches. + */ + public int getPotionID() { + return this.potionID; + } + + public int getDuration() { + return this.duration; + } + + public int getAmplifier() { + return this.amplifier; + } + + /**+ + * Set whether this potion is a splash potion. + */ + public void setSplashPotion(boolean splashPotion) { + this.isSplashPotion = splashPotion; + } + + /**+ + * Gets whether this potion effect originated from a beacon + */ + public boolean getIsAmbient() { + return this.isAmbient; + } + + public boolean getIsShowParticles() { + return this.showParticles; + } + + public boolean onUpdate(EntityLivingBase entityIn) { + if (this.duration > 0) { + if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) { + this.performEffect(entityIn); + } + + this.deincrementDuration(); + } + + return this.duration > 0; + } + + private int deincrementDuration() { + return --this.duration; + } + + public void performEffect(EntityLivingBase entityIn) { + if (this.duration > 0) { + Potion.potionTypes[this.potionID].performEffect(entityIn, this.amplifier); + } + + } + + public String getEffectName() { + return Potion.potionTypes[this.potionID].getName(); + } + + public int hashCode() { + return this.potionID; + } + + public String toString() { + String s = ""; + if (this.getAmplifier() > 0) { + s = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration(); + } else { + s = this.getEffectName() + ", Duration: " + this.getDuration(); + } + + if (this.isSplashPotion) { + s = s + ", Splash: true"; + } + + if (!this.showParticles) { + s = s + ", Particles: false"; + } + + return Potion.potionTypes[this.potionID].isUsable() ? "(" + s + ")" : s; + } + + public boolean equals(Object object) { + if (!(object instanceof PotionEffect)) { + return false; + } else { + PotionEffect potioneffect = (PotionEffect) object; + return this.potionID == potioneffect.potionID && this.amplifier == potioneffect.amplifier + && this.duration == potioneffect.duration && this.isSplashPotion == potioneffect.isSplashPotion + && this.isAmbient == potioneffect.isAmbient; + } + } + + /**+ + * Write a custom potion effect to a potion item's NBT data. + */ + public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound nbt) { + nbt.setByte("Id", (byte) this.getPotionID()); + nbt.setByte("Amplifier", (byte) this.getAmplifier()); + nbt.setInteger("Duration", this.getDuration()); + nbt.setBoolean("Ambient", this.getIsAmbient()); + nbt.setBoolean("ShowParticles", this.getIsShowParticles()); + return nbt; + } + + /**+ + * Read a custom potion effect from a potion item's NBT data. + */ + public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) { + byte b0 = nbt.getByte("Id"); + if (b0 >= 0 && b0 < Potion.potionTypes.length && Potion.potionTypes[b0] != null) { + byte b1 = nbt.getByte("Amplifier"); + int i = nbt.getInteger("Duration"); + boolean flag = nbt.getBoolean("Ambient"); + boolean flag1 = true; + if (nbt.hasKey("ShowParticles", 1)) { + flag1 = nbt.getBoolean("ShowParticles"); + } + + return new PotionEffect(b0, i, b1, flag, flag1); + } else { + return null; + } + } + + /**+ + * Toggle the isPotionDurationMax field. + */ + public void setPotionDurationMax(boolean maxDuration) { + this.isPotionDurationMax = maxDuration; + } + + public boolean getIsPotionDurationMax() { + return this.isPotionDurationMax; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealth.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealth.java new file mode 100644 index 0000000..a5a1825 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealth.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PotionHealth extends Potion { + + static { + __checkIntegratedContextValid("net/minecraft/potion/PotionHealth"); + } + + public PotionHealth(int potionID, ResourceLocation location, boolean badEffect, int potionColor) { + super(potionID, location, badEffect, potionColor); + } + + /**+ + * Returns true if the potion has an instant effect instead of a + * continuous one (eg Harming) + */ + public boolean isInstant() { + return true; + } + + /**+ + * checks if Potion effect is ready to be applied this tick. + */ + public boolean isReady(int parInt1, int parInt2) { + return parInt1 >= 1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealthBoost.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealthBoost.java new file mode 100644 index 0000000..e58a3c6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealthBoost.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PotionHealthBoost extends Potion { + + static { + __checkIntegratedContextValid("net/minecraft/potion/PotionHealthBoost"); + } + + public PotionHealthBoost(int potionID, ResourceLocation location, boolean badEffect, int potionColor) { + super(potionID, location, badEffect, potionColor); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase entitylivingbase, + BaseAttributeMap baseattributemap, int i) { + super.removeAttributesModifiersFromEntity(entitylivingbase, baseattributemap, i); + if (entitylivingbase.getHealth() > entitylivingbase.getMaxHealth()) { + entitylivingbase.setHealth(entitylivingbase.getMaxHealth()); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHelper.java new file mode 100644 index 0000000..3426572 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHelper.java @@ -0,0 +1,541 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import net.PeytonPlayz585.shadow.Config; +import net.PeytonPlayz585.shadow.CustomColors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IntegerCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PotionHelper { + + static { + __checkIntegratedContextValid("net/minecraft/potion/PotionHelper"); + } + + public static final String field_77924_a = null; + public static final String sugarEffect = "-0+1-2-3&4-4+13"; + public static final String ghastTearEffect = "+0-1-2-3&4-4+13"; + public static final String spiderEyeEffect = "-0-1+2-3&4-4+13"; + public static final String fermentedSpiderEyeEffect = "-0+3-4+13"; + public static final String speckledMelonEffect = "+0-1+2-3&4-4+13"; + public static final String blazePowderEffect = "+0-1-2+3&4-4+13"; + public static final String magmaCreamEffect = "+0+1-2-3&4-4+13"; + public static final String redstoneEffect = "-5+6-7"; + public static final String glowstoneEffect = "+5-6-7"; + public static final String gunpowderEffect = "+14&13-13"; + public static final String goldenCarrotEffect = "-0+1+2-3+13&4-4"; + public static final String pufferfishEffect = "+0-1+2+3+13&4-4"; + public static final String rabbitFootEffect = "+0+1-2+3&4-4+13"; + private static final Map potionRequirements = Maps.newHashMap(); + private static final Map potionAmplifiers = Maps.newHashMap(); + private static final Map DATAVALUE_COLORS = Maps.newHashMap(); + /**+ + * An array of possible potion prefix names, as translation IDs. + */ + private static final String[] potionPrefixes = new String[] { "potion.prefix.mundane", + "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", + "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", + "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", + "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", + "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", + "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", + "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", + "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky" }; + + /**+ + * Checks if the bit at 1 << j is on in i. + */ + public static boolean checkFlag(int parInt1, int parInt2) { + return (parInt1 & 1 << parInt2) != 0; + } + + /**+ + * Returns 1 if the flag is set, 0 if it is not set. + */ + private static int isFlagSet(int parInt1, int parInt2) { + /**+ + * Checks if the bit at 1 << j is on in i. + */ + return checkFlag(parInt1, parInt2) ? 1 : 0; + } + + /**+ + * Returns 0 if the flag is set, 1 if it is not set. + */ + private static int isFlagUnset(int parInt1, int parInt2) { + /**+ + * Checks if the bit at 1 << j is on in i. + */ + return checkFlag(parInt1, parInt2) ? 0 : 1; + } + + /**+ + * Given a potion data value, get its prefix index number. + */ + public static int getPotionPrefixIndex(int dataValue) { + return func_77908_a(dataValue, 5, 4, 3, 2, 1); + } + + /**+ + * Given a {@link Collection}<{@link PotionEffect}> will return + * an Integer color. + */ + public static int calcPotionLiquidColor(Collection parCollection) { + int i = 3694022; + if (parCollection != null && !parCollection.isEmpty()) { + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + float f3 = 0.0F; + + for (PotionEffect potioneffect : parCollection) { + if (potioneffect.getIsShowParticles()) { + int j = Potion.potionTypes[potioneffect.getPotionID()].getLiquidColor(); + + if (Config.isCustomColors()) { + j = CustomColors.getPotionColor(potioneffect.getPotionID(), j); + } + + for (int k = 0; k <= potioneffect.getAmplifier(); ++k) { + f += (float) (j >> 16 & 255) / 255.0F; + f1 += (float) (j >> 8 & 255) / 255.0F; + f2 += (float) (j >> 0 & 255) / 255.0F; + ++f3; + } + } + } + + if (f3 == 0.0F) { + return 0; + } else { + f = f / f3 * 255.0F; + f1 = f1 / f3 * 255.0F; + f2 = f2 / f3 * 255.0F; + return (int) f << 16 | (int) f1 << 8 | (int) f2; + } + } else { + if (Config.isCustomColors()) { + i = CustomColors.getPotionColor(0, i); + } + + return i; + } + } + + /**+ + * Check whether a {@link Collection}<{@link PotionEffect}> are + * all ambient. + */ + public static boolean getAreAmbient(Collection potionEffects) { + for (PotionEffect potioneffect : potionEffects) { + if (!potioneffect.getIsAmbient()) { + return false; + } + } + + return true; + } + + /**+ + * Given a potion data value, get the associated liquid color + * (optionally bypassing the cache) + */ + public static int getLiquidColor(int dataValue, boolean bypassCache) { + Integer integer = IntegerCache.func_181756_a(dataValue); + if (!bypassCache) { + if (DATAVALUE_COLORS.containsKey(integer)) { + return ((Integer) DATAVALUE_COLORS.get(integer)).intValue(); + } else { + int i = calcPotionLiquidColor(getPotionEffects(integer.intValue(), false)); + DATAVALUE_COLORS.put(integer, Integer.valueOf(i)); + return i; + } + } else { + /**+ + * Given a {@link Collection}<{@link PotionEffect}> will return + * an Integer color. + */ + return calcPotionLiquidColor(getPotionEffects(integer.intValue(), true)); + } + } + + /**+ + * Given a potion data value, get its prefix as a translation + * ID. + */ + public static String getPotionPrefix(int dataValue) { + int i = getPotionPrefixIndex(dataValue); + return potionPrefixes[i]; + } + + private static int func_77904_a(boolean parFlag, boolean parFlag2, boolean parFlag3, int parInt1, int parInt2, + int parInt3, int parInt4) { + int i = 0; + if (parFlag) { + i = isFlagUnset(parInt4, parInt2); + } else if (parInt1 != -1) { + if (parInt1 == 0 && countSetFlags(parInt4) == parInt2) { + i = 1; + } else if (parInt1 == 1 && countSetFlags(parInt4) > parInt2) { + i = 1; + } else if (parInt1 == 2 && countSetFlags(parInt4) < parInt2) { + i = 1; + } + } else { + i = isFlagSet(parInt4, parInt2); + } + + if (parFlag2) { + i *= parInt3; + } + + if (parFlag3) { + i *= -1; + } + + return i; + } + + /**+ + * Returns the number of 1 bits in the given integer. + */ + private static int countSetFlags(int parInt1) { + int i; + for (i = 0; parInt1 > 0; ++i) { + parInt1 &= parInt1 - 1; + } + + return i; + } + + private static int parsePotionEffects(String parString1, int parInt1, int parInt2, int parInt3) { + if (parInt1 < parString1.length() && parInt2 >= 0 && parInt1 < parInt2) { + int i = parString1.indexOf(124, parInt1); + if (i >= 0 && i < parInt2) { + int k1 = parsePotionEffects(parString1, parInt1, i - 1, parInt3); + if (k1 > 0) { + return k1; + } else { + int i2 = parsePotionEffects(parString1, i + 1, parInt2, parInt3); + return i2 > 0 ? i2 : 0; + } + } else { + int j = parString1.indexOf(38, parInt1); + if (j >= 0 && j < parInt2) { + int l1 = parsePotionEffects(parString1, parInt1, j - 1, parInt3); + if (l1 <= 0) { + return 0; + } else { + int j2 = parsePotionEffects(parString1, j + 1, parInt2, parInt3); + return j2 <= 0 ? 0 : (l1 > j2 ? l1 : j2); + } + } else { + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + boolean flag4 = false; + byte b0 = -1; + int k = 0; + int l = 0; + int i1 = 0; + + for (int j1 = parInt1; j1 < parInt2; ++j1) { + char c0 = parString1.charAt(j1); + if (c0 >= 48 && c0 <= 57) { + if (flag) { + l = c0 - 48; + flag1 = true; + } else { + k = k * 10; + k = k + (c0 - 48); + flag2 = true; + } + } else if (c0 == 42) { + flag = true; + } else if (c0 == 33) { + if (flag2) { + i1 += func_77904_a(flag3, flag1, flag4, b0, k, l, parInt3); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + l = 0; + k = 0; + b0 = -1; + } + + flag3 = true; + } else if (c0 == 45) { + if (flag2) { + i1 += func_77904_a(flag3, flag1, flag4, b0, k, l, parInt3); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + l = 0; + k = 0; + b0 = -1; + } + + flag4 = true; + } else if (c0 != 61 && c0 != 60 && c0 != 62) { + if (c0 == 43 && flag2) { + i1 += func_77904_a(flag3, flag1, flag4, b0, k, l, parInt3); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + l = 0; + k = 0; + b0 = -1; + } + } else { + if (flag2) { + i1 += func_77904_a(flag3, flag1, flag4, b0, k, l, parInt3); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + l = 0; + k = 0; + b0 = -1; + } + + if (c0 == 61) { + b0 = 0; + } else if (c0 == 60) { + b0 = 2; + } else if (c0 == 62) { + b0 = 1; + } + } + } + + if (flag2) { + i1 += func_77904_a(flag3, flag1, flag4, b0, k, l, parInt3); + } + + return i1; + } + } + } else { + return 0; + } + } + + /**+ + * Returns a list of effects for the specified potion damage + * value. + */ + public static List getPotionEffects(int parInt1, boolean parFlag) { + ArrayList arraylist = null; + + for (Potion potion : Potion.potionTypes) { + if (potion != null && (!potion.isUsable() || parFlag)) { + String s = (String) potionRequirements.get(Integer.valueOf(potion.getId())); + if (s != null) { + int i = parsePotionEffects(s, 0, s.length(), parInt1); + if (i > 0) { + int j = 0; + String s1 = (String) potionAmplifiers.get(Integer.valueOf(potion.getId())); + if (s1 != null) { + j = parsePotionEffects(s1, 0, s1.length(), parInt1); + if (j < 0) { + j = 0; + } + } + + if (potion.isInstant()) { + i = 1; + } else { + i = 1200 * (i * 3 + (i - 1) * 2); + i = i >> j; + i = (int) Math.round((double) i * potion.getEffectiveness()); + if ((parInt1 & 16384) != 0) { + i = (int) Math.round((double) i * 0.75D + 0.5D); + } + } + + if (arraylist == null) { + arraylist = Lists.newArrayList(); + } + + PotionEffect potioneffect = new PotionEffect(potion.getId(), i, j); + if ((parInt1 & 16384) != 0) { + potioneffect.setSplashPotion(true); + } + + arraylist.add(potioneffect); + } + } + } + } + + return arraylist; + } + + /**+ + * Manipulates the specified bit of the potion damage value + * according to the rules passed from applyIngredient. + */ + private static int brewBitOperations(int parInt1, int parInt2, boolean parFlag, boolean parFlag2, + boolean parFlag3) { + if (parFlag3) { + if (!checkFlag(parInt1, parInt2)) { + return 0; + } + } else if (parFlag) { + parInt1 &= ~(1 << parInt2); + } else if (parFlag2) { + if ((parInt1 & 1 << parInt2) == 0) { + parInt1 |= 1 << parInt2; + } else { + parInt1 &= ~(1 << parInt2); + } + } else { + parInt1 |= 1 << parInt2; + } + + return parInt1; + } + + /**+ + * Returns the new potion damage value after the specified + * ingredient info is applied to the specified potion. + */ + public static int applyIngredient(int parInt1, String parString1) { + byte b0 = 0; + int i = parString1.length(); + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + int j = 0; + + for (int k = b0; k < i; ++k) { + char c0 = parString1.charAt(k); + if (c0 >= 48 && c0 <= 57) { + j = j * 10; + j = j + (c0 - 48); + flag = true; + } else if (c0 == 33) { + if (flag) { + parInt1 = brewBitOperations(parInt1, j, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + j = 0; + } + + flag1 = true; + } else if (c0 == 45) { + if (flag) { + parInt1 = brewBitOperations(parInt1, j, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + j = 0; + } + + flag2 = true; + } else if (c0 == 43) { + if (flag) { + parInt1 = brewBitOperations(parInt1, j, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + j = 0; + } + } else if (c0 == 38) { + if (flag) { + parInt1 = brewBitOperations(parInt1, j, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + j = 0; + } + + flag3 = true; + } + } + + if (flag) { + parInt1 = brewBitOperations(parInt1, j, flag2, flag1, flag3); + } + + return parInt1 & 32767; + } + + public static int func_77908_a(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6) { + return (checkFlag(parInt1, parInt2) ? 16 : 0) | (checkFlag(parInt1, parInt3) ? 8 : 0) + | (checkFlag(parInt1, parInt4) ? 4 : 0) | (checkFlag(parInt1, parInt5) ? 2 : 0) + | (checkFlag(parInt1, parInt6) ? 1 : 0); + } + + public static void clearPotionColorCache() { + DATAVALUE_COLORS.clear(); + } + + static { + potionRequirements.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); + potionRequirements.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); + potionRequirements.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); + potionRequirements.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); + potionRequirements.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); + potionRequirements.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.waterBreathing.getId()), "0 & !1 & 2 & 3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.jump.getId()), "0 & 1 & !2 & 3 & 3+6"); + potionAmplifiers.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.regeneration.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.harm.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.heal.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.resistance.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.poison.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.jump.getId()), "5"); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/profiler/Profiler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/profiler/Profiler.java new file mode 100644 index 0000000..cd8d36b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/profiler/Profiler.java @@ -0,0 +1,219 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.profiler; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import net.PeytonPlayz585.shadow.Lagometer; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Profiler { + + static { + __checkIntegratedContextValid("net/minecraft/profiler/Profiler"); + } + + private static final Logger logger = LogManager.getLogger(); + /**+ + * List of parent sections + */ + private final List sectionList = Lists.newArrayList(); + /**+ + * List of timestamps (System.nanoTime) + */ + private final List timestampList = Lists.newArrayList(); + public boolean profilingEnabled; + /**+ + * Current profiling section + */ + private String profilingSection = ""; + private final Map profilingMap = Maps.newHashMap(); + + private static final int HASH_SCHEDULED_EXECUTABLES = "scheduledExecutables".hashCode(); + private static final int HASH_TICK = "tick".hashCode(); + private static final int HASH_PRE_RENDER_ERRORS = "preRenderErrors".hashCode(); + + /**+ + * Clear profiling. + */ + public void clearProfiling() { + this.profilingMap.clear(); + this.profilingSection = ""; + this.sectionList.clear(); + } + + /**+ + * Start section + */ + public void startSection(String name) { + + if (Lagometer.isActive()) { + int i = name.hashCode(); + + if (i == HASH_SCHEDULED_EXECUTABLES && name.equals("scheduledExecutables")) { + Lagometer.timerScheduledExecutables.start(); + } else if (i == HASH_TICK && name.equals("tick")) { + Lagometer.timerScheduledExecutables.end(); + Lagometer.timerTick.start(); + } else if (i == HASH_PRE_RENDER_ERRORS && name.equals("preRenderErrors")) { + Lagometer.timerTick.end(); + } + } + + if (this.profilingEnabled) { + if (this.profilingSection.length() > 0) { + this.profilingSection = this.profilingSection + "."; + } + + this.profilingSection = this.profilingSection + name; + this.sectionList.add(this.profilingSection); + this.timestampList.add(Long.valueOf(System.nanoTime())); + } + } + + /**+ + * End section + */ + public void endSection() { + if (this.profilingEnabled) { + long i = System.nanoTime(); + long j = ((Long) this.timestampList.remove(this.timestampList.size() - 1)).longValue(); + this.sectionList.remove(this.sectionList.size() - 1); + long k = i - j; + if (this.profilingMap.containsKey(this.profilingSection)) { + this.profilingMap.put(this.profilingSection, + Long.valueOf(((Long) this.profilingMap.get(this.profilingSection)).longValue() + k)); + } else { + this.profilingMap.put(this.profilingSection, Long.valueOf(k)); + } + + if (k > 100000000L) { + logger.warn("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + + (double) k / 1000000.0D + " ms"); + } + + this.profilingSection = !this.sectionList.isEmpty() + ? (String) this.sectionList.get(this.sectionList.size() - 1) + : ""; + } + } + + /**+ + * Get profiling data + */ + public List getProfilingData(String parString1) { + if (!this.profilingEnabled) { + return null; + } else { + long i = this.profilingMap.containsKey("root") ? ((Long) this.profilingMap.get("root")).longValue() : 0L; + long j = this.profilingMap.containsKey(parString1) ? ((Long) this.profilingMap.get(parString1)).longValue() + : -1L; + ArrayList arraylist = Lists.newArrayList(); + if (parString1.length() > 0) { + parString1 = parString1 + "."; + } + + long k = 0L; + + for (String s : this.profilingMap.keySet()) { + if (s.length() > parString1.length() && s.startsWith(parString1) + && s.indexOf(".", parString1.length() + 1) < 0) { + k += ((Long) this.profilingMap.get(s)).longValue(); + } + } + + float f = (float) k; + if (k < j) { + k = j; + } + + if (i < k) { + i = k; + } + + for (String s1 : this.profilingMap.keySet()) { + if (s1.length() > parString1.length() && s1.startsWith(parString1) + && s1.indexOf(".", parString1.length() + 1) < 0) { + long l = ((Long) this.profilingMap.get(s1)).longValue(); + double d0 = (double) l * 100.0D / (double) k; + double d1 = (double) l * 100.0D / (double) i; + String s2 = s1.substring(parString1.length()); + arraylist.add(new Profiler.Result(s2, d0, d1)); + } + } + + for (String s3 : this.profilingMap.keySet()) { + this.profilingMap.put(s3, Long.valueOf(((Long) this.profilingMap.get(s3)).longValue() * 999L / 1000L)); + } + + if ((float) k > f) { + arraylist.add(new Profiler.Result("unspecified", (double) ((float) k - f) * 100.0D / (double) k, + (double) ((float) k - f) * 100.0D / (double) i)); + } + + Collections.sort(arraylist); + arraylist.add(0, new Profiler.Result(parString1, 100.0D, (double) k * 100.0D / (double) i)); + return arraylist; + } + } + + /**+ + * End current section and start a new section + */ + public void endStartSection(String name) { + this.endSection(); + this.startSection(name); + } + + public String getNameOfLastSection() { + return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String) this.sectionList.get(this.sectionList.size() - 1); + } + + public static final class Result implements Comparable { + public double field_76332_a; + public double field_76330_b; + public String field_76331_c; + + public Result(String parString1, double parDouble1, double parDouble2) { + this.field_76331_c = parString1; + this.field_76332_a = parDouble1; + this.field_76330_b = parDouble2; + } + + public int compareTo(Profiler.Result profiler$result) { + return profiler$result.field_76332_a < this.field_76332_a ? -1 + : (profiler$result.field_76332_a > this.field_76332_a ? 1 + : profiler$result.field_76331_c.compareTo(this.field_76331_c)); + } + + public int func_76329_a() { + return (this.field_76331_c.hashCode() & 11184810) + 4473924; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/GoalColor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/GoalColor.java new file mode 100644 index 0000000..24cc432 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/GoalColor.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GoalColor implements IScoreObjectiveCriteria { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/GoalColor"); + } + + private final String goalName; + + public GoalColor(String parString1, EnumChatFormatting parEnumChatFormatting) { + this.goalName = parString1 + parEnumChatFormatting.getFriendlyName(); + IScoreObjectiveCriteria.INSTANCES.put(this.goalName, this); + } + + public String getName() { + return this.goalName; + } + + public int func_96635_a(List parList) { + return 0; + } + + public boolean isReadOnly() { + return false; + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() { + return IScoreObjectiveCriteria.EnumRenderType.INTEGER; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/IScoreObjectiveCriteria.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/IScoreObjectiveCriteria.java new file mode 100644 index 0000000..324d15d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/IScoreObjectiveCriteria.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.GoalColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreDummyCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreHealthCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IScoreObjectiveCriteria { + Map INSTANCES = Maps.newHashMap(); + IScoreObjectiveCriteria DUMMY = new ScoreDummyCriteria("dummy"); + IScoreObjectiveCriteria TRIGGER = new ScoreDummyCriteria("trigger"); + IScoreObjectiveCriteria deathCount = new ScoreDummyCriteria("deathCount"); + IScoreObjectiveCriteria playerKillCount = new ScoreDummyCriteria("playerKillCount"); + IScoreObjectiveCriteria totalKillCount = new ScoreDummyCriteria("totalKillCount"); + IScoreObjectiveCriteria health = new ScoreHealthCriteria("health"); + IScoreObjectiveCriteria[] field_178792_h = new IScoreObjectiveCriteria[] { + new GoalColor("teamkill.", EnumChatFormatting.BLACK), + new GoalColor("teamkill.", EnumChatFormatting.DARK_BLUE), + new GoalColor("teamkill.", EnumChatFormatting.DARK_GREEN), + new GoalColor("teamkill.", EnumChatFormatting.DARK_AQUA), + new GoalColor("teamkill.", EnumChatFormatting.DARK_RED), + new GoalColor("teamkill.", EnumChatFormatting.DARK_PURPLE), + new GoalColor("teamkill.", EnumChatFormatting.GOLD), new GoalColor("teamkill.", EnumChatFormatting.GRAY), + new GoalColor("teamkill.", EnumChatFormatting.DARK_GRAY), + new GoalColor("teamkill.", EnumChatFormatting.BLUE), new GoalColor("teamkill.", EnumChatFormatting.GREEN), + new GoalColor("teamkill.", EnumChatFormatting.AQUA), new GoalColor("teamkill.", EnumChatFormatting.RED), + new GoalColor("teamkill.", EnumChatFormatting.LIGHT_PURPLE), + new GoalColor("teamkill.", EnumChatFormatting.YELLOW), + new GoalColor("teamkill.", EnumChatFormatting.WHITE) }; + IScoreObjectiveCriteria[] field_178793_i = new IScoreObjectiveCriteria[] { + new GoalColor("killedByTeam.", EnumChatFormatting.BLACK), + new GoalColor("killedByTeam.", EnumChatFormatting.DARK_BLUE), + new GoalColor("killedByTeam.", EnumChatFormatting.DARK_GREEN), + new GoalColor("killedByTeam.", EnumChatFormatting.DARK_AQUA), + new GoalColor("killedByTeam.", EnumChatFormatting.DARK_RED), + new GoalColor("killedByTeam.", EnumChatFormatting.DARK_PURPLE), + new GoalColor("killedByTeam.", EnumChatFormatting.GOLD), + new GoalColor("killedByTeam.", EnumChatFormatting.GRAY), + new GoalColor("killedByTeam.", EnumChatFormatting.DARK_GRAY), + new GoalColor("killedByTeam.", EnumChatFormatting.BLUE), + new GoalColor("killedByTeam.", EnumChatFormatting.GREEN), + new GoalColor("killedByTeam.", EnumChatFormatting.AQUA), + new GoalColor("killedByTeam.", EnumChatFormatting.RED), + new GoalColor("killedByTeam.", EnumChatFormatting.LIGHT_PURPLE), + new GoalColor("killedByTeam.", EnumChatFormatting.YELLOW), + new GoalColor("killedByTeam.", EnumChatFormatting.WHITE) }; + + String getName(); + + int func_96635_a(List var1); + + boolean isReadOnly(); + + IScoreObjectiveCriteria.EnumRenderType getRenderType(); + + public static enum EnumRenderType { + INTEGER("integer"), HEARTS("hearts"); + + private static final Map field_178801_c = Maps.newHashMap(); + private final String field_178798_d; + + private EnumRenderType(String parString2) { + this.field_178798_d = parString2; + } + + public String func_178796_a() { + return this.field_178798_d; + } + + public static IScoreObjectiveCriteria.EnumRenderType func_178795_a(String parString1) { + IScoreObjectiveCriteria.EnumRenderType iscoreobjectivecriteria$enumrendertype = (IScoreObjectiveCriteria.EnumRenderType) field_178801_c + .get(parString1); + return iscoreobjectivecriteria$enumrendertype == null ? INTEGER : iscoreobjectivecriteria$enumrendertype; + } + + static { + for (IScoreObjectiveCriteria.EnumRenderType iscoreobjectivecriteria$enumrendertype : values()) { + field_178801_c.put(iscoreobjectivecriteria$enumrendertype.func_178796_a(), + iscoreobjectivecriteria$enumrendertype); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Score.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Score.java new file mode 100644 index 0000000..ae26d3a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Score.java @@ -0,0 +1,125 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import java.util.Comparator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Score { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/Score"); + } + + /**+ + * Used for sorting score by points + */ + public static final Comparator scoreComparator = new Comparator() { + public int compare(Score score, Score score1) { + return score.getScorePoints() > score1.getScorePoints() ? 1 + : (score.getScorePoints() < score1.getScorePoints() ? -1 + : score1.getPlayerName().compareToIgnoreCase(score.getPlayerName())); + } + }; + private final Scoreboard theScoreboard; + private final ScoreObjective theScoreObjective; + private final String scorePlayerName; + private int scorePoints; + private boolean locked; + private boolean field_178818_g; + + public Score(Scoreboard theScoreboardIn, ScoreObjective theScoreObjectiveIn, String scorePlayerNameIn) { + this.theScoreboard = theScoreboardIn; + this.theScoreObjective = theScoreObjectiveIn; + this.scorePlayerName = scorePlayerNameIn; + this.field_178818_g = true; + } + + public void increseScore(int amount) { + if (this.theScoreObjective.getCriteria().isReadOnly()) { + throw new IllegalStateException("Cannot modify read-only score"); + } else { + this.setScorePoints(this.getScorePoints() + amount); + } + } + + public void decreaseScore(int amount) { + if (this.theScoreObjective.getCriteria().isReadOnly()) { + throw new IllegalStateException("Cannot modify read-only score"); + } else { + this.setScorePoints(this.getScorePoints() - amount); + } + } + + public void func_96648_a() { + if (this.theScoreObjective.getCriteria().isReadOnly()) { + throw new IllegalStateException("Cannot modify read-only score"); + } else { + this.increseScore(1); + } + } + + public int getScorePoints() { + return this.scorePoints; + } + + public void setScorePoints(int points) { + int i = this.scorePoints; + this.scorePoints = points; + if (i != points || this.field_178818_g) { + this.field_178818_g = false; + this.getScoreScoreboard().func_96536_a(this); + } + + } + + public ScoreObjective getObjective() { + return this.theScoreObjective; + } + + /**+ + * Returns the name of the player this score belongs to + */ + public String getPlayerName() { + return this.scorePlayerName; + } + + public Scoreboard getScoreScoreboard() { + return this.theScoreboard; + } + + public boolean isLocked() { + return this.locked; + } + + public void setLocked(boolean locked) { + this.locked = locked; + } + + public void func_96651_a(List parList) { + this.setScorePoints(this.theScoreObjective.getCriteria().func_96635_a(parList)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreDummyCriteria.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreDummyCriteria.java new file mode 100644 index 0000000..e5a7bee --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreDummyCriteria.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ScoreDummyCriteria implements IScoreObjectiveCriteria { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/ScoreDummyCriteria"); + } + + private final String dummyName; + + public ScoreDummyCriteria(String name) { + this.dummyName = name; + IScoreObjectiveCriteria.INSTANCES.put(name, this); + } + + public String getName() { + return this.dummyName; + } + + public int func_96635_a(List var1) { + return 0; + } + + public boolean isReadOnly() { + return false; + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() { + return IScoreObjectiveCriteria.EnumRenderType.INTEGER; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreHealthCriteria.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreHealthCriteria.java new file mode 100644 index 0000000..1cfb39e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreHealthCriteria.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreDummyCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ScoreHealthCriteria extends ScoreDummyCriteria { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/ScoreHealthCriteria"); + } + + public ScoreHealthCriteria(String name) { + super(name); + } + + public int func_96635_a(List list) { + float f = 0.0F; + + for (EntityPlayer entityplayer : list) { + f += entityplayer.getHealth() + entityplayer.getAbsorptionAmount(); + } + + if (list.size() > 0) { + f /= (float) list.size(); + } + + return MathHelper.ceiling_float_int(f); + } + + public boolean isReadOnly() { + return true; + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() { + return IScoreObjectiveCriteria.EnumRenderType.HEARTS; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreObjective.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreObjective.java new file mode 100644 index 0000000..55605a8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreObjective.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ScoreObjective { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/ScoreObjective"); + } + + private final Scoreboard theScoreboard; + private final String name; + private final IScoreObjectiveCriteria objectiveCriteria; + private IScoreObjectiveCriteria.EnumRenderType renderType; + private String displayName; + + public ScoreObjective(Scoreboard theScoreboardIn, String nameIn, IScoreObjectiveCriteria objectiveCriteriaIn) { + this.theScoreboard = theScoreboardIn; + this.name = nameIn; + this.objectiveCriteria = objectiveCriteriaIn; + this.displayName = nameIn; + this.renderType = objectiveCriteriaIn.getRenderType(); + } + + public Scoreboard getScoreboard() { + return this.theScoreboard; + } + + public String getName() { + return this.name; + } + + public IScoreObjectiveCriteria getCriteria() { + return this.objectiveCriteria; + } + + public String getDisplayName() { + return this.displayName; + } + + public void setDisplayName(String nameIn) { + this.displayName = nameIn; + this.theScoreboard.func_96532_b(this); + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() { + return this.renderType; + } + + public void setRenderType(IScoreObjectiveCriteria.EnumRenderType type) { + this.renderType = type; + this.theScoreboard.func_96532_b(this); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScorePlayerTeam.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScorePlayerTeam.java new file mode 100644 index 0000000..75c4993 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScorePlayerTeam.java @@ -0,0 +1,185 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ScorePlayerTeam extends Team { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/ScorePlayerTeam"); + } + + private final Scoreboard theScoreboard; + private final String registeredName; + /**+ + * A set of all team member usernames. + */ + private final Set membershipSet = Sets.newHashSet(); + private String teamNameSPT; + private String namePrefixSPT = ""; + private String colorSuffix = ""; + private boolean allowFriendlyFire = true; + private boolean canSeeFriendlyInvisibles = true; + private Team.EnumVisible nameTagVisibility = Team.EnumVisible.ALWAYS; + private Team.EnumVisible deathMessageVisibility = Team.EnumVisible.ALWAYS; + private EnumChatFormatting chatFormat = EnumChatFormatting.RESET; + + public ScorePlayerTeam(Scoreboard theScoreboardIn, String name) { + this.theScoreboard = theScoreboardIn; + this.registeredName = name; + this.teamNameSPT = name; + } + + /**+ + * Retrieve the name by which this team is registered in the + * scoreboard + */ + public String getRegisteredName() { + return this.registeredName; + } + + public String getTeamName() { + return this.teamNameSPT; + } + + public void setTeamName(String name) { + if (name == null) { + throw new IllegalArgumentException("Name cannot be null"); + } else { + this.teamNameSPT = name; + this.theScoreboard.sendTeamUpdate(this); + } + } + + public Collection getMembershipCollection() { + return this.membershipSet; + } + + /**+ + * Returns the color prefix for the player's team name + */ + public String getColorPrefix() { + return this.namePrefixSPT; + } + + public void setNamePrefix(String prefix) { + if (prefix == null) { + throw new IllegalArgumentException("Prefix cannot be null"); + } else { + this.namePrefixSPT = prefix; + this.theScoreboard.sendTeamUpdate(this); + } + } + + /**+ + * Returns the color suffix for the player's team name + */ + public String getColorSuffix() { + return this.colorSuffix; + } + + public void setNameSuffix(String suffix) { + this.colorSuffix = suffix; + this.theScoreboard.sendTeamUpdate(this); + } + + public String formatString(String input) { + return this.getColorPrefix() + input + this.getColorSuffix(); + } + + /**+ + * Returns the player name including the color prefixes and + * suffixes + */ + public static String formatPlayerName(Team parTeam, String parString1) { + return parTeam == null ? parString1 : parTeam.formatString(parString1); + } + + public boolean getAllowFriendlyFire() { + return this.allowFriendlyFire; + } + + public void setAllowFriendlyFire(boolean friendlyFire) { + this.allowFriendlyFire = friendlyFire; + this.theScoreboard.sendTeamUpdate(this); + } + + public boolean getSeeFriendlyInvisiblesEnabled() { + return this.canSeeFriendlyInvisibles; + } + + public void setSeeFriendlyInvisiblesEnabled(boolean friendlyInvisibles) { + this.canSeeFriendlyInvisibles = friendlyInvisibles; + this.theScoreboard.sendTeamUpdate(this); + } + + public Team.EnumVisible getNameTagVisibility() { + return this.nameTagVisibility; + } + + public Team.EnumVisible getDeathMessageVisibility() { + return this.deathMessageVisibility; + } + + public void setNameTagVisibility(Team.EnumVisible parEnumVisible) { + this.nameTagVisibility = parEnumVisible; + this.theScoreboard.sendTeamUpdate(this); + } + + public void setDeathMessageVisibility(Team.EnumVisible parEnumVisible) { + this.deathMessageVisibility = parEnumVisible; + this.theScoreboard.sendTeamUpdate(this); + } + + public int func_98299_i() { + int i = 0; + if (this.getAllowFriendlyFire()) { + i |= 1; + } + + if (this.getSeeFriendlyInvisiblesEnabled()) { + i |= 2; + } + + return i; + } + + public void func_98298_a(int parInt1) { + this.setAllowFriendlyFire((parInt1 & 1) > 0); + this.setSeeFriendlyInvisiblesEnabled((parInt1 & 2) > 0); + } + + public void setChatFormat(EnumChatFormatting parEnumChatFormatting) { + this.chatFormat = parEnumChatFormatting; + } + + public EnumChatFormatting getChatFormat() { + return this.chatFormat; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Scoreboard.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Scoreboard.java new file mode 100644 index 0000000..86ed437 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Scoreboard.java @@ -0,0 +1,452 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Scoreboard { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/Scoreboard"); + } + + private final Map scoreObjectives = Maps.newHashMap(); + private final Map> scoreObjectiveCriterias = Maps.newHashMap(); + private final Map> entitiesScoreObjectives = Maps.newHashMap(); + /**+ + * Index 0 is tab menu, 1 is sidebar, and 2 is below name + */ + private final ScoreObjective[] objectiveDisplaySlots = new ScoreObjective[19]; + private final Map teams = Maps.newHashMap(); + private final Map teamMemberships = Maps.newHashMap(); + private static String[] field_178823_g = null; + + /**+ + * Returns a ScoreObjective for the objective name + */ + public ScoreObjective getObjective(String name) { + return (ScoreObjective) this.scoreObjectives.get(name); + } + + /**+ + * Create and returns the score objective for the given name and + * ScoreCriteria + */ + public ScoreObjective addScoreObjective(String name, IScoreObjectiveCriteria criteria) { + if (name.length() > 16) { + throw new IllegalArgumentException("The objective name \'" + name + "\' is too long!"); + } else { + ScoreObjective scoreobjective = this.getObjective(name); + if (scoreobjective != null) { + throw new IllegalArgumentException("An objective with the name \'" + name + "\' already exists!"); + } else { + scoreobjective = new ScoreObjective(this, name, criteria); + Object object = (List) this.scoreObjectiveCriterias.get(criteria); + if (object == null) { + object = Lists.newArrayList(); + this.scoreObjectiveCriterias.put(criteria, (List) object); + } + + ((List) object).add(scoreobjective); + this.scoreObjectives.put(name, scoreobjective); + this.onScoreObjectiveAdded(scoreobjective); + return scoreobjective; + } + } + } + + /**+ + * Returns all the objectives for the given criteria + */ + public Collection getObjectivesFromCriteria(IScoreObjectiveCriteria criteria) { + Collection collection = (Collection) this.scoreObjectiveCriterias.get(criteria); + return collection == null ? Lists.newArrayList() : Lists.newArrayList(collection); + } + + /**+ + * Returns if the entity has the given ScoreObjective + */ + public boolean entityHasObjective(String name, ScoreObjective parScoreObjective) { + Map map = (Map) this.entitiesScoreObjectives.get(name); + if (map == null) { + return false; + } else { + Score score = (Score) map.get(parScoreObjective); + return score != null; + } + } + + /**+ + * Returns the value of the given objective for the given entity + * name + */ + public Score getValueFromObjective(String name, ScoreObjective objective) { + if (name.length() > 40) { + throw new IllegalArgumentException("The player name \'" + name + "\' is too long!"); + } else { + Object object = (Map) this.entitiesScoreObjectives.get(name); + if (object == null) { + object = Maps.newHashMap(); + this.entitiesScoreObjectives.put(name, (Map) object); + } + + Score score = (Score) ((Map) object).get(objective); + if (score == null) { + score = new Score(this, objective, name); + ((Map) object).put(objective, score); + } + + return score; + } + } + + /**+ + * Returns an array of Score objects, sorting by + * Score.getScorePoints() + */ + public Collection getSortedScores(ScoreObjective objective) { + ArrayList arraylist = Lists.newArrayList(); + + for (Map map : this.entitiesScoreObjectives.values()) { + Score score = (Score) map.get(objective); + if (score != null) { + arraylist.add(score); + } + } + + Collections.sort(arraylist, Score.scoreComparator); + return arraylist; + } + + public Collection getScoreObjectives() { + return this.scoreObjectives.values(); + } + + public Collection getObjectiveNames() { + return this.entitiesScoreObjectives.keySet(); + } + + /**+ + * Remove the given ScoreObjective for the given Entity name. + */ + public void removeObjectiveFromEntity(String name, ScoreObjective objective) { + if (objective == null) { + Map map = (Map) this.entitiesScoreObjectives.remove(name); + if (map != null) { + this.func_96516_a(name); + } + } else { + Map map2 = (Map) this.entitiesScoreObjectives.get(name); + if (map2 != null) { + Score score = (Score) map2.remove(objective); + if (map2.size() < 1) { + Map map1 = (Map) this.entitiesScoreObjectives.remove(name); + if (map1 != null) { + this.func_96516_a(name); + } + } else if (score != null) { + this.func_178820_a(name, objective); + } + } + } + + } + + public Collection getScores() { + Collection collection = this.entitiesScoreObjectives.values(); + ArrayList arraylist = Lists.newArrayList(); + + for (Map map : (Collection) collection) { + arraylist.addAll(map.values()); + } + + return arraylist; + } + + public Map getObjectivesForEntity(String name) { + Object object = (Map) this.entitiesScoreObjectives.get(name); + if (object == null) { + object = Maps.newHashMap(); + } + + return (Map) object; + } + + public void removeObjective(ScoreObjective parScoreObjective) { + this.scoreObjectives.remove(parScoreObjective.getName()); + + for (int i = 0; i < 19; ++i) { + if (this.getObjectiveInDisplaySlot(i) == parScoreObjective) { + this.setObjectiveInDisplaySlot(i, (ScoreObjective) null); + } + } + + List list = (List) this.scoreObjectiveCriterias.get(parScoreObjective.getCriteria()); + if (list != null) { + list.remove(parScoreObjective); + } + + for (Map map : this.entitiesScoreObjectives.values()) { + map.remove(parScoreObjective); + } + + this.func_96533_c(parScoreObjective); + } + + /**+ + * 0 is tab menu, 1 is sidebar, 2 is below name + */ + public void setObjectiveInDisplaySlot(int parInt1, ScoreObjective parScoreObjective) { + this.objectiveDisplaySlots[parInt1] = parScoreObjective; + } + + /**+ + * 0 is tab menu, 1 is sidebar, 2 is below name + */ + public ScoreObjective getObjectiveInDisplaySlot(int parInt1) { + return this.objectiveDisplaySlots[parInt1]; + } + + /**+ + * Retrieve the ScorePlayerTeam instance identified by the + * passed team name + */ + public ScorePlayerTeam getTeam(String parString1) { + return (ScorePlayerTeam) this.teams.get(parString1); + } + + public ScorePlayerTeam createTeam(String parString1) { + if (parString1.length() > 16) { + throw new IllegalArgumentException("The team name \'" + parString1 + "\' is too long!"); + } else { + ScorePlayerTeam scoreplayerteam = this.getTeam(parString1); + if (scoreplayerteam != null) { + throw new IllegalArgumentException("A team with the name \'" + parString1 + "\' already exists!"); + } else { + scoreplayerteam = new ScorePlayerTeam(this, parString1); + this.teams.put(parString1, scoreplayerteam); + this.broadcastTeamCreated(scoreplayerteam); + return scoreplayerteam; + } + } + } + + /**+ + * Removes the team from the scoreboard, updates all player + * memberships and broadcasts the deletion to all players + */ + public void removeTeam(ScorePlayerTeam parScorePlayerTeam) { + this.teams.remove(parScorePlayerTeam.getRegisteredName()); + + for (String s : parScorePlayerTeam.getMembershipCollection()) { + this.teamMemberships.remove(s); + } + + this.func_96513_c(parScorePlayerTeam); + } + + /**+ + * Adds a player to the given team + */ + public boolean addPlayerToTeam(String player, String newTeam) { + if (player.length() > 40) { + throw new IllegalArgumentException("The player name \'" + player + "\' is too long!"); + } else if (!this.teams.containsKey(newTeam)) { + return false; + } else { + ScorePlayerTeam scoreplayerteam = this.getTeam(newTeam); + if (this.getPlayersTeam(player) != null) { + this.removePlayerFromTeams(player); + } + + this.teamMemberships.put(player, scoreplayerteam); + scoreplayerteam.getMembershipCollection().add(player); + return true; + } + } + + public boolean removePlayerFromTeams(String parString1) { + ScorePlayerTeam scoreplayerteam = this.getPlayersTeam(parString1); + if (scoreplayerteam != null) { + this.removePlayerFromTeam(parString1, scoreplayerteam); + return true; + } else { + return false; + } + } + + /**+ + * Removes the given username from the given ScorePlayerTeam. If + * the player is not on the team then an IllegalStateException + * is thrown. + */ + public void removePlayerFromTeam(String parString1, ScorePlayerTeam parScorePlayerTeam) { + if (this.getPlayersTeam(parString1) != parScorePlayerTeam) { + throw new IllegalStateException( + "Player is either on another team or not on any team. Cannot remove from team \'" + + parScorePlayerTeam.getRegisteredName() + "\'."); + } else { + this.teamMemberships.remove(parString1); + parScorePlayerTeam.getMembershipCollection().remove(parString1); + } + } + + /**+ + * Retrieve all registered ScorePlayerTeam names + */ + public Collection getTeamNames() { + return this.teams.keySet(); + } + + /**+ + * Retrieve all registered ScorePlayerTeam instances + */ + public Collection getTeams() { + return this.teams.values(); + } + + /**+ + * Gets the ScorePlayerTeam object for the given username. + */ + public ScorePlayerTeam getPlayersTeam(String parString1) { + return (ScorePlayerTeam) this.teamMemberships.get(parString1); + } + + /**+ + * Called when a score objective is added + */ + public void onScoreObjectiveAdded(ScoreObjective scoreObjectiveIn) { + } + + public void func_96532_b(ScoreObjective parScoreObjective) { + } + + public void func_96533_c(ScoreObjective parScoreObjective) { + } + + public void func_96536_a(Score parScore) { + } + + public void func_96516_a(String parString1) { + } + + public void func_178820_a(String parString1, ScoreObjective parScoreObjective) { + } + + /**+ + * This packet will notify the players that this team is + * created, and that will register it on the client + */ + public void broadcastTeamCreated(ScorePlayerTeam playerTeam) { + } + + /**+ + * This packet will notify the players that this team is updated + */ + public void sendTeamUpdate(ScorePlayerTeam playerTeam) { + } + + public void func_96513_c(ScorePlayerTeam playerTeam) { + } + + /**+ + * Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, + * otherwise null. + */ + public static String getObjectiveDisplaySlot(int parInt1) { + switch (parInt1) { + case 0: + return "list"; + case 1: + return "sidebar"; + case 2: + return "belowName"; + default: + if (parInt1 >= 3 && parInt1 <= 18) { + EnumChatFormatting enumchatformatting = EnumChatFormatting.func_175744_a(parInt1 - 3); + if (enumchatformatting != null && enumchatformatting != EnumChatFormatting.RESET) { + return "sidebar.team." + enumchatformatting.getFriendlyName(); + } + } + + return null; + } + } + + /**+ + * Returns 0 for (case-insensitive) 'list', 1 for 'sidebar', 2 + * for 'belowName', otherwise -1. + */ + public static int getObjectiveDisplaySlotNumber(String parString1) { + if (parString1.equalsIgnoreCase("list")) { + return 0; + } else if (parString1.equalsIgnoreCase("sidebar")) { + return 1; + } else if (parString1.equalsIgnoreCase("belowName")) { + return 2; + } else { + if (parString1.startsWith("sidebar.team.")) { + String s = parString1.substring("sidebar.team.".length()); + EnumChatFormatting enumchatformatting = EnumChatFormatting.getValueByName(s); + if (enumchatformatting != null && enumchatformatting.getColorIndex() >= 0) { + return enumchatformatting.getColorIndex() + 3; + } + } + + return -1; + } + } + + public static String[] getDisplaySlotStrings() { + if (field_178823_g == null) { + field_178823_g = new String[19]; + + for (int i = 0; i < 19; ++i) { + field_178823_g[i] = getObjectiveDisplaySlot(i); + } + } + + return field_178823_g; + } + + public void func_181140_a(Entity parEntity) { + if (parEntity != null && !(parEntity instanceof EntityPlayer) && !parEntity.isEntityAlive()) { + String s = parEntity.getUniqueID().toString(); + this.removeObjectiveFromEntity(s, (ScoreObjective) null); + this.removePlayerFromTeams(s); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreboardSaveData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreboardSaveData.java new file mode 100644 index 0000000..35e1c78 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreboardSaveData.java @@ -0,0 +1,288 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ScoreboardSaveData extends WorldSavedData { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/ScoreboardSaveData"); + } + + private static final Logger logger = LogManager.getLogger(); + private Scoreboard theScoreboard; + private NBTTagCompound delayedInitNbt; + + public ScoreboardSaveData() { + this("scoreboard"); + } + + public ScoreboardSaveData(String name) { + super(name); + } + + public void setScoreboard(Scoreboard scoreboardIn) { + this.theScoreboard = scoreboardIn; + if (this.delayedInitNbt != null) { + this.readFromNBT(this.delayedInitNbt); + } + + } + + /**+ + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbttagcompound) { + if (this.theScoreboard == null) { + this.delayedInitNbt = nbttagcompound; + } else { + this.readObjectives(nbttagcompound.getTagList("Objectives", 10)); + this.readScores(nbttagcompound.getTagList("PlayerScores", 10)); + if (nbttagcompound.hasKey("DisplaySlots", 10)) { + this.readDisplayConfig(nbttagcompound.getCompoundTag("DisplaySlots")); + } + + if (nbttagcompound.hasKey("Teams", 9)) { + this.readTeams(nbttagcompound.getTagList("Teams", 10)); + } + + } + } + + protected void readTeams(NBTTagList parNBTTagList) { + for (int i = 0; i < parNBTTagList.tagCount(); ++i) { + NBTTagCompound nbttagcompound = parNBTTagList.getCompoundTagAt(i); + String s = nbttagcompound.getString("Name"); + if (s.length() > 16) { + s = s.substring(0, 16); + } + + ScorePlayerTeam scoreplayerteam = this.theScoreboard.createTeam(s); + String s1 = nbttagcompound.getString("DisplayName"); + if (s1.length() > 32) { + s1 = s1.substring(0, 32); + } + + scoreplayerteam.setTeamName(s1); + if (nbttagcompound.hasKey("TeamColor", 8)) { + scoreplayerteam.setChatFormat(EnumChatFormatting.getValueByName(nbttagcompound.getString("TeamColor"))); + } + + scoreplayerteam.setNamePrefix(nbttagcompound.getString("Prefix")); + scoreplayerteam.setNameSuffix(nbttagcompound.getString("Suffix")); + if (nbttagcompound.hasKey("AllowFriendlyFire", 99)) { + scoreplayerteam.setAllowFriendlyFire(nbttagcompound.getBoolean("AllowFriendlyFire")); + } + + if (nbttagcompound.hasKey("SeeFriendlyInvisibles", 99)) { + scoreplayerteam.setSeeFriendlyInvisiblesEnabled(nbttagcompound.getBoolean("SeeFriendlyInvisibles")); + } + + if (nbttagcompound.hasKey("NameTagVisibility", 8)) { + Team.EnumVisible team$enumvisible = Team.EnumVisible + .func_178824_a(nbttagcompound.getString("NameTagVisibility")); + if (team$enumvisible != null) { + scoreplayerteam.setNameTagVisibility(team$enumvisible); + } + } + + if (nbttagcompound.hasKey("DeathMessageVisibility", 8)) { + Team.EnumVisible team$enumvisible1 = Team.EnumVisible + .func_178824_a(nbttagcompound.getString("DeathMessageVisibility")); + if (team$enumvisible1 != null) { + scoreplayerteam.setDeathMessageVisibility(team$enumvisible1); + } + } + + this.func_96502_a(scoreplayerteam, nbttagcompound.getTagList("Players", 8)); + } + + } + + protected void func_96502_a(ScorePlayerTeam parScorePlayerTeam, NBTTagList parNBTTagList) { + for (int i = 0; i < parNBTTagList.tagCount(); ++i) { + this.theScoreboard.addPlayerToTeam(parNBTTagList.getStringTagAt(i), parScorePlayerTeam.getRegisteredName()); + } + + } + + protected void readDisplayConfig(NBTTagCompound parNBTTagCompound) { + for (int i = 0; i < 19; ++i) { + if (parNBTTagCompound.hasKey("slot_" + i, 8)) { + String s = parNBTTagCompound.getString("slot_" + i); + ScoreObjective scoreobjective = this.theScoreboard.getObjective(s); + this.theScoreboard.setObjectiveInDisplaySlot(i, scoreobjective); + } + } + + } + + protected void readObjectives(NBTTagList nbt) { + for (int i = 0; i < nbt.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbt.getCompoundTagAt(i); + IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria) IScoreObjectiveCriteria.INSTANCES + .get(nbttagcompound.getString("CriteriaName")); + if (iscoreobjectivecriteria != null) { + String s = nbttagcompound.getString("Name"); + if (s.length() > 16) { + s = s.substring(0, 16); + } + + ScoreObjective scoreobjective = this.theScoreboard.addScoreObjective(s, iscoreobjectivecriteria); + scoreobjective.setDisplayName(nbttagcompound.getString("DisplayName")); + scoreobjective.setRenderType( + IScoreObjectiveCriteria.EnumRenderType.func_178795_a(nbttagcompound.getString("RenderType"))); + } + } + + } + + protected void readScores(NBTTagList nbt) { + for (int i = 0; i < nbt.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbt.getCompoundTagAt(i); + ScoreObjective scoreobjective = this.theScoreboard.getObjective(nbttagcompound.getString("Objective")); + String s = nbttagcompound.getString("Name"); + if (s.length() > 40) { + s = s.substring(0, 40); + } + + Score score = this.theScoreboard.getValueFromObjective(s, scoreobjective); + score.setScorePoints(nbttagcompound.getInteger("Score")); + if (nbttagcompound.hasKey("Locked")) { + score.setLocked(nbttagcompound.getBoolean("Locked")); + } + } + + } + + /**+ + * write data to NBTTagCompound from this MapDataBase, similar + * to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbttagcompound) { + if (this.theScoreboard == null) { + logger.warn("Tried to save scoreboard without having a scoreboard..."); + } else { + nbttagcompound.setTag("Objectives", this.objectivesToNbt()); + nbttagcompound.setTag("PlayerScores", this.scoresToNbt()); + nbttagcompound.setTag("Teams", this.func_96496_a()); + this.func_96497_d(nbttagcompound); + } + } + + protected NBTTagList func_96496_a() { + NBTTagList nbttaglist = new NBTTagList(); + + for (ScorePlayerTeam scoreplayerteam : this.theScoreboard.getTeams()) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", scoreplayerteam.getRegisteredName()); + nbttagcompound.setString("DisplayName", scoreplayerteam.getTeamName()); + if (scoreplayerteam.getChatFormat().getColorIndex() >= 0) { + nbttagcompound.setString("TeamColor", scoreplayerteam.getChatFormat().getFriendlyName()); + } + + nbttagcompound.setString("Prefix", scoreplayerteam.getColorPrefix()); + nbttagcompound.setString("Suffix", scoreplayerteam.getColorSuffix()); + nbttagcompound.setBoolean("AllowFriendlyFire", scoreplayerteam.getAllowFriendlyFire()); + nbttagcompound.setBoolean("SeeFriendlyInvisibles", scoreplayerteam.getSeeFriendlyInvisiblesEnabled()); + nbttagcompound.setString("NameTagVisibility", scoreplayerteam.getNameTagVisibility().field_178830_e); + nbttagcompound.setString("DeathMessageVisibility", + scoreplayerteam.getDeathMessageVisibility().field_178830_e); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (String s : scoreplayerteam.getMembershipCollection()) { + nbttaglist1.appendTag(new NBTTagString(s)); + } + + nbttagcompound.setTag("Players", nbttaglist1); + nbttaglist.appendTag(nbttagcompound); + } + + return nbttaglist; + } + + protected void func_96497_d(NBTTagCompound parNBTTagCompound) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + for (int i = 0; i < 19; ++i) { + ScoreObjective scoreobjective = this.theScoreboard.getObjectiveInDisplaySlot(i); + if (scoreobjective != null) { + nbttagcompound.setString("slot_" + i, scoreobjective.getName()); + flag = true; + } + } + + if (flag) { + parNBTTagCompound.setTag("DisplaySlots", nbttagcompound); + } + + } + + protected NBTTagList objectivesToNbt() { + NBTTagList nbttaglist = new NBTTagList(); + + for (ScoreObjective scoreobjective : this.theScoreboard.getScoreObjectives()) { + if (scoreobjective.getCriteria() != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", scoreobjective.getName()); + nbttagcompound.setString("CriteriaName", scoreobjective.getCriteria().getName()); + nbttagcompound.setString("DisplayName", scoreobjective.getDisplayName()); + nbttagcompound.setString("RenderType", scoreobjective.getRenderType().func_178796_a()); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } + + protected NBTTagList scoresToNbt() { + NBTTagList nbttaglist = new NBTTagList(); + + for (Score score : this.theScoreboard.getScores()) { + if (score.getObjective() != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", score.getPlayerName()); + nbttagcompound.setString("Objective", score.getObjective().getName()); + nbttagcompound.setInteger("Score", score.getScorePoints()); + nbttagcompound.setBoolean("Locked", score.isLocked()); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ServerScoreboard.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ServerScoreboard.java new file mode 100644 index 0000000..4aeae7d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ServerScoreboard.java @@ -0,0 +1,265 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3EPacketTeams; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreboardSaveData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ServerScoreboard extends Scoreboard { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/ServerScoreboard"); + } + + private final MinecraftServer scoreboardMCServer; + private final Set field_96553_b = Sets.newHashSet(); + private ScoreboardSaveData scoreboardSaveData; + + public ServerScoreboard(MinecraftServer mcServer) { + this.scoreboardMCServer = mcServer; + } + + public void func_96536_a(Score score) { + super.func_96536_a(score); + if (this.field_96553_b.contains(score.getObjective())) { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(score)); + } + + this.func_96551_b(); + } + + public void func_96516_a(String s) { + super.func_96516_a(s); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(s)); + this.func_96551_b(); + } + + public void func_178820_a(String s, ScoreObjective scoreobjective) { + super.func_178820_a(s, scoreobjective); + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3CPacketUpdateScore(s, scoreobjective)); + this.func_96551_b(); + } + + /**+ + * 0 is tab menu, 1 is sidebar, 2 is below name + */ + public void setObjectiveInDisplaySlot(int i, ScoreObjective scoreobjective) { + ScoreObjective scoreobjective1 = this.getObjectiveInDisplaySlot(i); + super.setObjectiveInDisplaySlot(i, scoreobjective); + if (scoreobjective1 != scoreobjective && scoreobjective1 != null) { + if (this.func_96552_h(scoreobjective1) > 0) { + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3DPacketDisplayScoreboard(i, scoreobjective)); + } else { + this.getPlayerIterator(scoreobjective1); + } + } + + if (scoreobjective != null) { + if (this.field_96553_b.contains(scoreobjective)) { + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3DPacketDisplayScoreboard(i, scoreobjective)); + } else { + this.func_96549_e(scoreobjective); + } + } + + this.func_96551_b(); + } + + /**+ + * Adds a player to the given team + */ + public boolean addPlayerToTeam(String s, String s1) { + if (super.addPlayerToTeam(s, s1)) { + ScorePlayerTeam scoreplayerteam = this.getTeam(s1); + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] { s }), 3)); + this.func_96551_b(); + return true; + } else { + return false; + } + } + + /**+ + * Removes the given username from the given ScorePlayerTeam. If + * the player is not on the team then an IllegalStateException + * is thrown. + */ + public void removePlayerFromTeam(String s, ScorePlayerTeam scoreplayerteam) { + super.removePlayerFromTeam(s, scoreplayerteam); + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] { s }), 4)); + this.func_96551_b(); + } + + /**+ + * Called when a score objective is added + */ + public void onScoreObjectiveAdded(ScoreObjective scoreobjective) { + super.onScoreObjectiveAdded(scoreobjective); + this.func_96551_b(); + } + + public void func_96532_b(ScoreObjective scoreobjective) { + super.func_96532_b(scoreobjective); + if (this.field_96553_b.contains(scoreobjective)) { + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3BPacketScoreboardObjective(scoreobjective, 2)); + } + + this.func_96551_b(); + } + + public void func_96533_c(ScoreObjective scoreobjective) { + super.func_96533_c(scoreobjective); + if (this.field_96553_b.contains(scoreobjective)) { + this.getPlayerIterator(scoreobjective); + } + + this.func_96551_b(); + } + + /**+ + * This packet will notify the players that this team is + * created, and that will register it on the client + */ + public void broadcastTeamCreated(ScorePlayerTeam scoreplayerteam) { + super.broadcastTeamCreated(scoreplayerteam); + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, 0)); + this.func_96551_b(); + } + + /**+ + * This packet will notify the players that this team is updated + */ + public void sendTeamUpdate(ScorePlayerTeam scoreplayerteam) { + super.sendTeamUpdate(scoreplayerteam); + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, 2)); + this.func_96551_b(); + } + + public void func_96513_c(ScorePlayerTeam scoreplayerteam) { + super.func_96513_c(scoreplayerteam); + this.scoreboardMCServer.getConfigurationManager() + .sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, 1)); + this.func_96551_b(); + } + + public void func_96547_a(ScoreboardSaveData parScoreboardSaveData) { + this.scoreboardSaveData = parScoreboardSaveData; + } + + protected void func_96551_b() { + if (this.scoreboardSaveData != null) { + this.scoreboardSaveData.markDirty(); + } + + } + + public List func_96550_d(ScoreObjective parScoreObjective) { + ArrayList arraylist = Lists.newArrayList(); + arraylist.add(new S3BPacketScoreboardObjective(parScoreObjective, 0)); + + for (int i = 0; i < 19; ++i) { + if (this.getObjectiveInDisplaySlot(i) == parScoreObjective) { + arraylist.add(new S3DPacketDisplayScoreboard(i, parScoreObjective)); + } + } + + for (Score score : this.getSortedScores(parScoreObjective)) { + arraylist.add(new S3CPacketUpdateScore(score)); + } + + return arraylist; + } + + public void func_96549_e(ScoreObjective parScoreObjective) { + List list = this.func_96550_d(parScoreObjective); + + for (EntityPlayerMP entityplayermp : this.scoreboardMCServer.getConfigurationManager().func_181057_v()) { + for (Packet packet : (List) list) { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + + this.field_96553_b.add(parScoreObjective); + } + + public List func_96548_f(ScoreObjective parScoreObjective) { + ArrayList arraylist = Lists.newArrayList(); + arraylist.add(new S3BPacketScoreboardObjective(parScoreObjective, 1)); + + for (int i = 0; i < 19; ++i) { + if (this.getObjectiveInDisplaySlot(i) == parScoreObjective) { + arraylist.add(new S3DPacketDisplayScoreboard(i, parScoreObjective)); + } + } + + return arraylist; + } + + public void getPlayerIterator(ScoreObjective parScoreObjective) { + List list = this.func_96548_f(parScoreObjective); + + for (EntityPlayerMP entityplayermp : this.scoreboardMCServer.getConfigurationManager().func_181057_v()) { + for (Packet packet : (List) list) { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + + this.field_96553_b.remove(parScoreObjective); + } + + public int func_96552_h(ScoreObjective parScoreObjective) { + int i = 0; + + for (int j = 0; j < 19; ++j) { + if (this.getObjectiveInDisplaySlot(j) == parScoreObjective) { + ++i; + } + } + + return i; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Team.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Team.java new file mode 100644 index 0000000..3787e06 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Team.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; + +import com.google.common.collect.Maps; + +import java.util.Collection; +import java.util.Map; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Team { + + static { + __checkIntegratedContextValid("net/minecraft/scoreboard/Team"); + } + + /**+ + * Same as == + */ + public boolean isSameTeam(Team other) { + return other == null ? false : this == other; + } + + public abstract String getRegisteredName(); + + public abstract String formatString(String var1); + + public abstract boolean getSeeFriendlyInvisiblesEnabled(); + + public abstract boolean getAllowFriendlyFire(); + + public abstract Team.EnumVisible getNameTagVisibility(); + + public abstract Collection getMembershipCollection(); + + public abstract Team.EnumVisible getDeathMessageVisibility(); + + public static enum EnumVisible { + ALWAYS("always", 0), NEVER("never", 1), HIDE_FOR_OTHER_TEAMS("hideForOtherTeams", 2), + HIDE_FOR_OWN_TEAM("hideForOwnTeam", 3); + + private static Map field_178828_g = Maps.newHashMap(); + public final String field_178830_e; + public final int field_178827_f; + + public static String[] func_178825_a() { + return (String[]) field_178828_g.keySet().toArray(new String[field_178828_g.size()]); + } + + public static Team.EnumVisible func_178824_a(String parString1) { + return (Team.EnumVisible) field_178828_g.get(parString1); + } + + private EnumVisible(String parString2, int parInt2) { + this.field_178830_e = parString2; + this.field_178827_f = parInt2; + } + + static { + for (Team.EnumVisible team$enumvisible : values()) { + field_178828_g.put(team$enumvisible.field_178830_e, team$enumvisible); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/MinecraftServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/MinecraftServer.java new file mode 100644 index 0000000..baa1237 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/MinecraftServer.java @@ -0,0 +1,1048 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server; + +import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.Callable; + +import net.PeytonPlayz585.shadow.WorldServerOF; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.futures.FutureTask; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ServerCommandManager; +import net.minecraft.crash.CrashReport; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S03PacketTimeUpdate; +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.management.ServerConfigurationManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IThreadListener; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Util; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldManager; +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.WorldServerMulti; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.demo.DemoWorldServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.ISaveFormat; +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 org.apache.commons.lang3.Validate; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class MinecraftServer implements Runnable, ICommandSender, IThreadListener { + + static { + __checkIntegratedContextValid("net/minecraft/server/MinecraftServer"); + } + + private static final Logger logger = LogManager.getLogger(); + private static MinecraftServer mcServer; + /**+ + * List of names of players who are online. + */ + protected final List playersOnline = Lists.newArrayList(); + protected final ICommandManager commandManager; + public final Profiler theProfiler = new Profiler(); + private final EaglercraftRandom random = new EaglercraftRandom(); + /**+ + * The server's port. + */ + private int serverPort = -1; + public WorldServer[] worldServers; + private ServerConfigurationManager serverConfigManager; + /**+ + * Indicates whether the server is running or not. Set to false + * to initiate a shutdown. + */ + protected boolean serverRunning = false; + private boolean serverStopped; + private int tickCounter; + public String currentTask; + public int percentDone; + private boolean onlineMode; + private boolean canSpawnAnimals; + private boolean canSpawnNPCs; + private boolean pvpEnabled; + private boolean allowFlight; + private String motd; + private int buildLimit; + private int maxPlayerIdleMinutes = 0; + public final long[] tickTimeArray = new long[100]; + public long[][] timeOfLastDimensionTick; + private String serverOwner; + private String worldName; + private boolean isDemo; + private boolean enableBonusChest; + private boolean worldIsBeingDeleted; + /**+ + * The texture pack for the server + */ + private String resourcePackUrl = ""; + private String resourcePackHash = ""; + private boolean serverIsRunning; + protected long timeOfLastWarning; + private String userMessage; + private boolean startProfiling; + private boolean isGamemodeForced; + private long nanoTimeSinceStatusRefresh = 0L; + protected final Queue> futureTaskQueue = new LinkedList(); + private Thread serverThread; + protected long currentTime = getCurrentTimeMillis(); + private boolean paused = false; + private boolean isSpawnChunksLoaded = false; + + public MinecraftServer(String worldName) { + mcServer = this; + this.worldName = worldName; + this.commandManager = new ServerCommandManager(); + } + + protected ServerCommandManager createNewCommandManager() { + return new ServerCommandManager(); + } + + protected abstract boolean startServer() throws IOException; + + protected void convertMapIfNeeded(String worldNameIn) { + + } + + /**+ + * Typically "menu.convertingLevel", "menu.loadingLevel" or + * others. + */ + protected synchronized void setUserMessage(String message) { + this.userMessage = message; + } + + public synchronized String getUserMessage() { + return this.userMessage; + } + + protected void loadAllWorlds(ISaveHandler isavehandler, String s1, WorldSettings worldsettings) { + this.setUserMessage("menu.loadingLevel"); + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + if (worldinfo == null) { + if (this.isDemo() || worldsettings == null) { + worldsettings = DemoWorldServer.demoWorldSettings; + } + worldinfo = new WorldInfo(worldsettings, s1); + } else { + worldinfo.setWorldName(s1); + worldsettings = new WorldSettings(worldinfo); + } + + for (int j = 0; j < this.worldServers.length; ++j) { + byte b0 = 0; + if (j == 1) { + b0 = -1; + } + + if (j == 2) { + b0 = 1; + } + + if (j == 0) { + if (this.isDemo()) { + this.worldServers[j] = (WorldServer) (new DemoWorldServer(this, isavehandler, worldinfo, b0, + this.theProfiler)).init(); + } else { + this.worldServers[j] = (WorldServer) (new WorldServerOF(this, isavehandler, worldinfo, b0, + this.theProfiler)).init(); + } + + this.worldServers[j].initialize(worldsettings); + } else { + this.worldServers[j] = (WorldServer) (new WorldServerMulti(this, isavehandler, b0, this.worldServers[0], + this.theProfiler)).init(); + } + + this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j])); + if (!this.isSinglePlayer()) { + this.worldServers[j].getWorldInfo().setGameType(this.getGameType()); + } + } + + this.serverConfigManager.setPlayerManager(this.worldServers); + this.setDifficultyForAllWorlds(this.getDifficulty()); + this.isSpawnChunksLoaded = this.worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("loadSpawnChunks"); + if (this.isSpawnChunksLoaded) { + this.initialWorldChunkLoad(); + } + } + + protected void initialWorldChunkLoad() { + boolean flag = true; + boolean flag1 = true; + boolean flag2 = true; + boolean flag3 = true; + int i = 0; + this.setUserMessage("menu.generatingTerrain"); + byte b0 = 0; + logger.info("Preparing start region for level " + b0); + WorldServer worldserver = this.worldServers[b0]; + BlockPos blockpos = worldserver.getSpawnPoint(); + long j = getCurrentTimeMillis(); + + for (int k = -192; k <= 192; k += 16) { + for (int l = -192; l <= 192; l += 16) { + long i1 = getCurrentTimeMillis(); + if (i1 - j > 1000L) { + this.outputPercentRemaining("Preparing spawn area", i * 100 / 625); + j = i1; + } + + ++i; + worldserver.theChunkProviderServer.loadChunk(blockpos.getX() + k >> 4, blockpos.getZ() + l >> 4); + } + } + + this.clearCurrentTask(); + } + + protected void unloadSpawnChunks() { + WorldServer worldserver = this.worldServers[0]; + BlockPos blockpos = worldserver.getSpawnPoint(); + int cnt = 0; + + for (int k = -192; k <= 192 && this.isServerRunning(); k += 16) { + for (int l = -192; l <= 192 && this.isServerRunning(); l += 16) { + Chunk chunk = worldserver.theChunkProviderServer.loadChunk(blockpos.getX() + k >> 4, + blockpos.getZ() + l >> 4); + if (chunk != null + && !worldserver.getPlayerManager().hasPlayerInstance(chunk.xPosition, chunk.zPosition)) { + worldserver.theChunkProviderServer.dropChunk(chunk.xPosition, chunk.zPosition); + ++cnt; + } + } + } + + logger.info("Dropped {} spawn chunks with no players in them", cnt); + } + + public abstract boolean canStructuresSpawn(); + + public abstract WorldSettings.GameType getGameType(); + + public abstract EnumDifficulty getDifficulty(); + + public abstract boolean isHardcore(); + + public abstract int getOpPermissionLevel(); + + public abstract boolean func_181034_q(); + + public abstract boolean func_183002_r(); + + /**+ + * Used to display a percent remaining given text and the + * percentage. + */ + protected void outputPercentRemaining(String parString1, int parInt1) { + this.currentTask = parString1; + this.percentDone = parInt1; + logger.info(parString1 + ": " + parInt1 + "%"); + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.startingIntegratedServer", parInt1 * 0.01f); + } + + /**+ + * Set current task to null and set its percentage to 0. + */ + protected void clearCurrentTask() { + this.currentTask = null; + this.percentDone = 0; + } + + /**+ + * par1 indicates if a log message should be output. + */ + public void saveAllWorlds(boolean dontLog) { + if (!this.worldIsBeingDeleted) { + for (WorldServer worldserver : this.worldServers) { + if (worldserver != null) { + if (!dontLog) { + logger.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + + worldserver.provider.getDimensionName()); + } + + try { + worldserver.saveAllChunks(true, (IProgressUpdate) null); + } catch (MinecraftException minecraftexception) { + logger.warn(minecraftexception.getMessage()); + } + } + } + + } + } + + /**+ + * Saves all necessary data as preparation for stopping the + * server. + */ + public void stopServer() { + if (!this.worldIsBeingDeleted) { + logger.info("Stopping server"); + + if (this.serverConfigManager != null) { + logger.info("Saving players"); + this.serverConfigManager.saveAllPlayerData(); + this.serverConfigManager.removeAllPlayers(); + } + + if (this.worldServers != null) { + logger.info("Saving worlds"); + this.saveAllWorlds(false); + + for (int i = 0; i < this.worldServers.length; ++i) { + WorldServer worldserver = this.worldServers[i]; + worldserver.flush(); + } + } + } else { + logger.info("Stopping server without saving"); + String str = getFolderName(); + logger.info("Deleting world \"{}\"...", str); + EaglerIntegratedServerWorker.saveFormat.deleteWorldDirectory(str); + logger.info("Deletion successful!"); + } + } + + /**+ + * WARNING : directly calls + * getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName()); + */ + public void deleteWorldAndStopServer() { + this.worldIsBeingDeleted = true; + this.initiateShutdown(); + } + + public boolean isServerRunning() { + return this.serverRunning; + } + + /**+ + * Sets the serverRunning variable to false, in order to get the + * server to shut down. + */ + public void initiateShutdown() { + this.serverRunning = false; + } + + protected void setInstance() { + mcServer = this; + } + + public void run() { + try { + if (this.startServer()) { + this.currentTime = getCurrentTimeMillis(); + long i = 0L; + + while (this.serverRunning) { + long k = getCurrentTimeMillis(); + long j = k - this.currentTime; + if (j > 2000L && this.currentTime - this.timeOfLastWarning >= 15000L) { + logger.warn( + "Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", + new Object[] { Long.valueOf(j), Long.valueOf(j / 50L) }); + j = 2000L; + this.timeOfLastWarning = this.currentTime; + } + + if (j < 0L) { + logger.warn("Time ran backwards! Did the system time change?"); + j = 0L; + } + + i += j; + this.currentTime = k; + if (this.worldServers[0].areAllPlayersAsleep()) { + this.tick(); + i = 0L; + } else { + while (i > 50L) { + i -= 50L; + this.tick(); + } + } + + Thread.sleep(Math.max(1L, 50L - i)); + this.serverIsRunning = true; + } + } else { + this.finalTick((CrashReport) null); + } + } catch (Throwable throwable1) { + logger.error("Encountered an unexpected exception", throwable1); + CrashReport crashreport = null; + if (throwable1 instanceof ReportedException) { + crashreport = this.addServerInfoToCrashReport(((ReportedException) throwable1).getCrashReport()); + } else { + crashreport = this + .addServerInfoToCrashReport(new CrashReport("Exception in server tick loop", throwable1)); + } + + this.finalTick(crashreport); + } finally { + try { + this.serverStopped = true; + this.stopServer(); + } catch (Throwable throwable) { + logger.error("Exception stopping the server", throwable); + } finally { + this.systemExitNow(); + } + + } + + } + + /**+ + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport var1) { + } + + /**+ + * Directly calls System.exit(0), instantly killing the program. + */ + protected void systemExitNow() { + } + + /**+ + * Main function called by run() every loop. + */ + public void tick() { + long i = System.nanoTime(); + ++this.tickCounter; + if (this.startProfiling) { + this.startProfiling = false; + this.theProfiler.profilingEnabled = true; + this.theProfiler.clearProfiling(); + } + + this.theProfiler.startSection("root"); + this.updateTimeLightAndEntities(); + + boolean loadSpawnChunks = this.worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("loadSpawnChunks"); + if (this.isSpawnChunksLoaded != loadSpawnChunks) { + if (loadSpawnChunks) { + this.initialWorldChunkLoad(); + } else { + this.unloadSpawnChunks(); + } + this.isSpawnChunksLoaded = loadSpawnChunks; + } + + if (this.tickCounter % 900 == 0) { + this.theProfiler.startSection("save"); + this.serverConfigManager.saveAllPlayerData(); + this.saveAllWorlds(true); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tallying"); + this.tickTimeArray[this.tickCounter % 100] = System.nanoTime() - i; + this.theProfiler.endSection(); + this.theProfiler.startSection("snooper"); + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public void updateTimeLightAndEntities() { + this.theProfiler.startSection("jobs"); + synchronized (this.futureTaskQueue) { + while (!this.futureTaskQueue.isEmpty()) { + Util.func_181617_a((FutureTask) this.futureTaskQueue.poll(), logger); + } + } + + this.theProfiler.endStartSection("levels"); + + for (int j = 0; j < this.worldServers.length; ++j) { + long i = System.nanoTime(); + if (j == 0 || this.getAllowNether()) { + WorldServer worldserver = this.worldServers[j]; + this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); + if (this.tickCounter % 20 == 0) { + this.theProfiler.startSection("timeSync"); + this.serverConfigManager.sendPacketToAllPlayersInDimension( + new S03PacketTimeUpdate(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), + worldserver.getGameRules().getBoolean("doDaylightCycle")), + worldserver.provider.getDimensionId()); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tick"); + + try { + worldserver.tick(); + } catch (Throwable throwable1) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception ticking world"); + worldserver.addWorldInfoToCrashReport(crashreport); + throw new ReportedException(crashreport); + } + + try { + worldserver.updateEntities(); + } catch (Throwable throwable) { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, + "Exception ticking world entities"); + worldserver.addWorldInfoToCrashReport(crashreport1); + throw new ReportedException(crashreport1); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("tracker"); + worldserver.getEntityTracker().updateTrackedEntities(); + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + this.timeOfLastDimensionTick[j][this.tickCounter % 100] = System.nanoTime() - i; + } + + this.theProfiler.endStartSection("connection"); + EaglerIntegratedServerWorker.tick(); + this.theProfiler.endStartSection("players"); + this.serverConfigManager.onTick(); + this.theProfiler.endStartSection("tickables"); + + for (int k = 0; k < this.playersOnline.size(); ++k) { + ((ITickable) this.playersOnline.get(k)).update(); + } + + this.theProfiler.endSection(); + } + + public boolean getAllowNether() { + return true; + } + + public void startServerThread() { + this.serverThread = new Thread(this, "Server thread"); + this.serverThread.start(); + } + + /**+ + * Logs the message with a level of WARN. + */ + public void logWarning(String s) { + logger.warn(s); + } + + /**+ + * Gets the worldServer by the given dimension. + */ + public WorldServer worldServerForDimension(int dimension) { + return dimension == -1 ? this.worldServers[1] : (dimension == 1 ? this.worldServers[2] : this.worldServers[0]); + } + + /**+ + * Returns the server's Minecraft version as string. + */ + public String getMinecraftVersion() { + return "1.8.8"; + } + + /**+ + * Returns the number of players currently on the server. + */ + public int getCurrentPlayerCount() { + return this.serverConfigManager.getCurrentPlayerCount(); + } + + /**+ + * Returns the maximum number of players allowed on the server. + */ + public int getMaxPlayers() { + return this.serverConfigManager.getMaxPlayers(); + } + + /**+ + * Returns an array of the usernames of all the connected + * players. + */ + public String[] getAllUsernames() { + return this.serverConfigManager.getAllUsernames(); + } + + /**+ + * Returns an array of the GameProfiles of all the connected + * players + */ + public GameProfile[] getGameProfiles() { + return this.serverConfigManager.getAllProfiles(); + } + + public String getServerModName() { + return "eagler"; + } + + /**+ + * Adds the server info, including from theWorldServer, to the + * crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport crashreport) { + crashreport.getCategory().addCrashSectionCallable("Profiler Position", new Callable() { + public String call() throws Exception { + return MinecraftServer.this.theProfiler.profilingEnabled + ? MinecraftServer.this.theProfiler.getNameOfLastSection() + : "N/A (disabled)"; + } + }); + if (this.serverConfigManager != null) { + crashreport.getCategory().addCrashSectionCallable("Player Count", new Callable() { + public String call() { + return MinecraftServer.this.serverConfigManager.getCurrentPlayerCount() + " / " + + MinecraftServer.this.serverConfigManager.getMaxPlayers() + "; " + + MinecraftServer.this.serverConfigManager.func_181057_v(); + } + }); + } + + return crashreport; + } + + public List getTabCompletions(ICommandSender sender, String input, BlockPos pos) { + ArrayList arraylist = Lists.newArrayList(); + if (input.startsWith("/")) { + input = input.substring(1); + boolean flag = !input.contains(" "); + List list = this.commandManager.getTabCompletionOptions(sender, input, pos); + if (list != null) { + for (String s2 : (List) list) { + if (flag) { + arraylist.add("/" + s2); + } else { + arraylist.add(s2); + } + } + } + + return arraylist; + } else { + String[] astring = input.split(" ", -1); + String s = astring[astring.length - 1]; + + for (String s1 : this.serverConfigManager.getAllUsernames()) { + if (CommandBase.doesStringStartWith(s, s1)) { + arraylist.add(s1); + } + } + + return arraylist; + } + } + + /**+ + * Gets mcServer. + */ + public static MinecraftServer getServer() { + return mcServer; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return "Server"; + } + + /**+ + * Send a chat message to the CommandSender + */ + public void addChatMessage(IChatComponent ichatcomponent) { + logger.info(ichatcomponent.getUnformattedText()); + } + + /**+ + * Returns {@code true} if the CommandSender is allowed to + * execute the command, {@code false} if not + */ + public boolean canCommandSenderUseCommand(int var1, String var2) { + return true; + } + + public ICommandManager getCommandManager() { + return this.commandManager; + } + + /**+ + * Returns the username of the server owner (for integrated + * servers) + */ + public String getServerOwner() { + return this.serverOwner; + } + + /**+ + * Sets the username of the owner of this server (in the case of + * an integrated server) + */ + public void setServerOwner(String owner) { + this.serverOwner = owner; + } + + public boolean isSinglePlayer() { + return this.serverOwner != null; + } + + public String getFolderName() { + return this.worldName; + } + + public String getWorldName() { + return this.worldName; + } + + public void setDifficultyForAllWorlds(EnumDifficulty enumdifficulty) { + for (int i = 0; i < this.worldServers.length; ++i) { + WorldServer worldserver = this.worldServers[i]; + if (worldserver != null) { + if (worldserver.getWorldInfo().isHardcoreModeEnabled()) { + worldserver.getWorldInfo().setDifficulty(EnumDifficulty.HARD); + worldserver.setAllowedSpawnTypes(true, true); + } else if (this.isSinglePlayer()) { + worldserver.getWorldInfo().setDifficulty(enumdifficulty); + worldserver.setAllowedSpawnTypes(worldserver.getDifficulty() != EnumDifficulty.PEACEFUL, true); + } else { + worldserver.getWorldInfo().setDifficulty(enumdifficulty); + worldserver.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals); + } + } + } + + } + + protected boolean allowSpawnMonsters() { + return true; + } + + /**+ + * Gets whether this is a demo or not. + */ + public boolean isDemo() { + return this.isDemo; + } + + /**+ + * Sets whether this is a demo or not. + */ + public void setDemo(boolean demo) { + this.isDemo = demo; + } + + public void canCreateBonusChest(boolean enable) { + this.enableBonusChest = enable; + } + + public String getResourcePackUrl() { + return this.resourcePackUrl; + } + + public String getResourcePackHash() { + return this.resourcePackHash; + } + + public void setResourcePack(String parString1, String parString2) { + this.resourcePackUrl = parString1; + this.resourcePackHash = parString2; + } + + /**+ + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() { + return true; + } + + public abstract boolean isDedicatedServer(); + + public boolean isServerInOnlineMode() { + return this.onlineMode; + } + + public void setOnlineMode(boolean online) { + this.onlineMode = online; + } + + public boolean getCanSpawnAnimals() { + return this.canSpawnAnimals; + } + + public void setCanSpawnAnimals(boolean spawnAnimals) { + this.canSpawnAnimals = spawnAnimals; + } + + public boolean getCanSpawnNPCs() { + return this.canSpawnNPCs; + } + + public abstract boolean func_181035_ah(); + + public void setCanSpawnNPCs(boolean spawnNpcs) { + this.canSpawnNPCs = spawnNpcs; + } + + public boolean isPVPEnabled() { + return this.pvpEnabled; + } + + public void setAllowPvp(boolean allowPvp) { + this.pvpEnabled = allowPvp; + } + + public boolean isFlightAllowed() { + return this.allowFlight; + } + + public void setAllowFlight(boolean allow) { + this.allowFlight = allow; + } + + public abstract boolean isCommandBlockEnabled(); + + public String getMOTD() { + return this.motd; + } + + public void setMOTD(String motdIn) { + this.motd = motdIn; + } + + public int getBuildLimit() { + return this.buildLimit; + } + + public void setBuildLimit(int maxBuildHeight) { + this.buildLimit = maxBuildHeight; + } + + public boolean isServerStopped() { + return this.serverStopped; + } + + public ServerConfigurationManager getConfigurationManager() { + return this.serverConfigManager; + } + + public void setConfigManager(ServerConfigurationManager configManager) { + this.serverConfigManager = configManager; + } + + /**+ + * Sets the game type for all worlds. + */ + public void setGameType(WorldSettings.GameType worldsettings$gametype) { + for (int i = 0; i < this.worldServers.length; ++i) { + getServer().worldServers[i].getWorldInfo().setGameType(worldsettings$gametype); + } + + } + + public boolean serverIsInRunLoop() { + return this.serverIsRunning; + } + + public boolean getGuiEnabled() { + return false; + } + + public abstract String shareToLAN(WorldSettings.GameType var1, boolean var2); + + public int getTickCounter() { + return this.tickCounter; + } + + public void enableProfiling() { + this.startProfiling = true; + } + + /**+ + * Get the position in the world. {@code null} is not + * allowed! If you are not an entity in the world, return + * the coordinates 0, 0, 0 + */ + public BlockPos getPosition() { + return BlockPos.ORIGIN; + } + + /**+ + * Get the position vector. {@code null} is not allowed! + * If you are not an entity in the world, return 0.0D, 0.0D, + * 0.0D + */ + public Vec3 getPositionVector() { + return new Vec3(0.0D, 0.0D, 0.0D); + } + + /**+ + * Get the world, if available. {@code null} is not + * allowed! If you are not an entity in the world, return + * the overworld + */ + public World getEntityWorld() { + return this.worldServers[0]; + } + + /**+ + * Returns the entity associated with the command sender. MAY BE + * NULL! + */ + public Entity getCommandSenderEntity() { + return null; + } + + /**+ + * Return the spawn protection area's size. + */ + public int getSpawnProtectionSize() { + return 16; + } + + public boolean isBlockProtected(World var1, BlockPos var2, EntityPlayer var3) { + return false; + } + + public boolean getForceGamemode() { + return this.isGamemodeForced; + } + + public static long getCurrentTimeMillis() { + return System.currentTimeMillis(); + } + + public int getMaxPlayerIdleMinutes() { + return this.maxPlayerIdleMinutes; + } + + public void setPlayerIdleTimeout(int i) { + this.maxPlayerIdleMinutes = i; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return new ChatComponentText(this.getName()); + } + + public boolean isAnnouncingPlayerAchievements() { + return true; + } + + public void refreshStatusNextTick() { + this.nanoTimeSinceStatusRefresh = 0L; + } + + public Entity getEntityFromUuid(EaglercraftUUID uuid) { + for (WorldServer worldserver : this.worldServers) { + if (worldserver != null) { + Entity entity = worldserver.getEntityFromUuid(uuid); + if (entity != null) { + return entity; + } + } + } + + return null; + } + + /**+ + * Returns true if the command sender should be sent feedback + * about executed commands + */ + public boolean sendCommandFeedback() { + /**+ + * Gets mcServer. + */ + return getServer().worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); + } + + public void setCommandStat(CommandResultStats.Type var1, int var2) { + } + + public int getMaxWorldSize() { + return 29999984; + } + + public boolean isCallingFromMinecraftThread() { + return true; + } + + /**+ + * The compression treshold. If the packet is larger than the + * specified amount of bytes, it will be compressed + */ + public int getNetworkCompressionTreshold() { + return 256; + } + + public void setPaused(boolean pause) { + this.paused = pause; + } + + public boolean getPaused() { + return paused; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ItemInWorldManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ItemInWorldManager.java new file mode 100644 index 0000000..659ef70 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ItemInWorldManager.java @@ -0,0 +1,378 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSword; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S23PacketBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ILockableContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +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.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ItemInWorldManager { + + static { + __checkIntegratedContextValid("net/minecraft/server/management/ItemInWorldManager"); + } + + public World theWorld; + public EntityPlayerMP thisPlayerMP; + private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; + private boolean isDestroyingBlock; + private int initialDamage; + private BlockPos field_180240_f = BlockPos.ORIGIN; + private int curblockDamage; + private boolean receivedFinishDiggingPacket; + private BlockPos field_180241_i = BlockPos.ORIGIN; + private int initialBlockDamage; + private int durabilityRemainingOnBlock = -1; + + public ItemInWorldManager(World worldIn) { + this.theWorld = worldIn; + } + + public void setGameType(WorldSettings.GameType type) { + this.gameType = type; + type.configurePlayerCapabilities(this.thisPlayerMP.capabilities); + this.thisPlayerMP.sendPlayerAbilities(); + this.thisPlayerMP.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S38PacketPlayerListItem( + S38PacketPlayerListItem.Action.UPDATE_GAME_MODE, new EntityPlayerMP[] { this.thisPlayerMP })); + } + + public WorldSettings.GameType getGameType() { + return this.gameType; + } + + public boolean survivalOrAdventure() { + return this.gameType.isSurvivalOrAdventure(); + } + + /**+ + * Get if we are in creative game mode. + */ + public boolean isCreative() { + return this.gameType.isCreative(); + } + + /**+ + * if the gameType is currently NOT_SET then change it to par1 + */ + public void initializeGameType(WorldSettings.GameType type) { + if (this.gameType == WorldSettings.GameType.NOT_SET) { + this.gameType = type; + } + + this.setGameType(this.gameType); + } + + public void updateBlockRemoving() { + ++this.curblockDamage; + if (this.receivedFinishDiggingPacket) { + int i = this.curblockDamage - this.initialBlockDamage; + Block block = this.theWorld.getBlockState(this.field_180241_i).getBlock(); + if (block.getMaterial() == Material.air) { + this.receivedFinishDiggingPacket = false; + } else { + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, + this.field_180241_i) * (float) (i + 1); + int j = (int) (f * 10.0F); + if (j != this.durabilityRemainingOnBlock) { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180241_i, j); + this.durabilityRemainingOnBlock = j; + } + + if (f >= 1.0F) { + this.receivedFinishDiggingPacket = false; + this.tryHarvestBlock(this.field_180241_i); + } + } + } else if (this.isDestroyingBlock) { + Block block1 = this.theWorld.getBlockState(this.field_180240_f).getBlock(); + if (block1.getMaterial() == Material.air) { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } else { + int k = this.curblockDamage - this.initialDamage; + float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, + this.field_180241_i) * (float) (k + 1); + int l = (int) (f1 * 10.0F); + if (l != this.durabilityRemainingOnBlock) { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, l); + this.durabilityRemainingOnBlock = l; + } + } + } + + } + + /**+ + * If not creative, it calls sendBlockBreakProgress until the + * block is broken first. tryHarvestBlock can also be the result + * of this call. + */ + public void onBlockClicked(BlockPos blockpos, EnumFacing enumfacing) { + if (this.isCreative()) { + if (!this.theWorld.extinguishFire((EntityPlayer) null, blockpos, enumfacing)) { + this.tryHarvestBlock(blockpos); + } + + } else { + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + if (this.gameType.isAdventure()) { + if (this.gameType == WorldSettings.GameType.SPECTATOR) { + return; + } + + if (!this.thisPlayerMP.isAllowEdit()) { + ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); + if (itemstack == null) { + return; + } + + if (!itemstack.canDestroy(block)) { + return; + } + } + } + + this.theWorld.extinguishFire((EntityPlayer) null, blockpos, enumfacing); + this.initialDamage = this.curblockDamage; + float f = 1.0F; + if (block.getMaterial() != Material.air) { + block.onBlockClicked(this.theWorld, blockpos, this.thisPlayerMP); + f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, blockpos); + } + + if (block.getMaterial() != Material.air && f >= 1.0F) { + this.tryHarvestBlock(blockpos); + } else { + this.isDestroyingBlock = true; + this.field_180240_f = blockpos; + int i = (int) (f * 10.0F); + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), blockpos, i); + this.durabilityRemainingOnBlock = i; + } + + } + } + + public void blockRemoving(BlockPos blockpos) { + if (blockpos.equals(this.field_180240_f)) { + int i = this.curblockDamage - this.initialDamage; + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + if (block.getMaterial() != Material.air) { + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, blockpos) + * (float) (i + 1); + if (f >= 0.7F) { + this.isDestroyingBlock = false; + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), blockpos, -1); + this.tryHarvestBlock(blockpos); + } else if (!this.receivedFinishDiggingPacket) { + this.isDestroyingBlock = false; + this.receivedFinishDiggingPacket = true; + this.field_180241_i = blockpos; + this.initialBlockDamage = this.initialDamage; + } + } + } + + } + + /**+ + * Stops the block breaking process + */ + public void cancelDestroyingBlock() { + this.isDestroyingBlock = false; + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, -1); + } + + /**+ + * Removes a block and triggers the appropriate events + */ + private boolean removeBlock(BlockPos pos) { + IBlockState iblockstate = this.theWorld.getBlockState(pos); + iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); + boolean flag = this.theWorld.setBlockToAir(pos); + if (flag) { + iblockstate.getBlock().onBlockDestroyedByPlayer(this.theWorld, pos, iblockstate); + } + + return flag; + } + + /**+ + * Attempts to harvest a block + */ + public boolean tryHarvestBlock(BlockPos blockpos) { + if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null + && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) { + return false; + } else { + IBlockState iblockstate = this.theWorld.getBlockState(blockpos); + TileEntity tileentity = this.theWorld.getTileEntity(blockpos); + if (this.gameType.isAdventure()) { + if (this.gameType == WorldSettings.GameType.SPECTATOR) { + return false; + } + + if (!this.thisPlayerMP.isAllowEdit()) { + ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); + if (itemstack == null) { + return false; + } + + if (!itemstack.canDestroy(iblockstate.getBlock())) { + return false; + } + } + } + + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, blockpos, Block.getStateId(iblockstate)); + boolean flag1 = this.removeBlock(blockpos); + if (this.isCreative()) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(this.theWorld, blockpos)); + } else { + ItemStack itemstack1 = this.thisPlayerMP.getCurrentEquippedItem(); + boolean flag = this.thisPlayerMP.canHarvestBlock(iblockstate.getBlock()); + if (itemstack1 != null) { + itemstack1.onBlockDestroyed(this.theWorld, iblockstate.getBlock(), blockpos, this.thisPlayerMP); + if (itemstack1.stackSize == 0) { + this.thisPlayerMP.destroyCurrentEquippedItem(); + } + } + + if (flag1 && flag) { + iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, blockpos, iblockstate, + tileentity); + } + } + + return flag1; + } + } + + /**+ + * Attempts to right-click use an item by the given EntityPlayer + * in the given World + */ + public boolean tryUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack) { + if (this.gameType == WorldSettings.GameType.SPECTATOR) { + return false; + } else { + int i = itemstack.stackSize; + int j = itemstack.getMetadata(); + ItemStack itemstack1 = itemstack.useItemRightClick(world, entityplayer); + if (itemstack1 != itemstack || itemstack1 != null && (itemstack1.stackSize != i + || itemstack1.getMaxItemUseDuration() > 0 || itemstack1.getMetadata() != j)) { + entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = itemstack1; + if (this.isCreative()) { + itemstack1.stackSize = i; + if (itemstack1.isItemStackDamageable()) { + itemstack1.setItemDamage(j); + } + } + + if (itemstack1.stackSize == 0) { + entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null; + } + + if (!entityplayer.isUsingItem()) { + ((EntityPlayerMP) entityplayer).sendContainerToPlayer(entityplayer.inventoryContainer); + } + + return true; + } else { + return false; + } + } + } + + /**+ + * Activate the clicked on block, otherwise use the held item. + */ + public boolean activateBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, + BlockPos blockpos, EnumFacing enumfacing, float f, float f1, float f2) { + if (this.gameType == WorldSettings.GameType.SPECTATOR) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof ILockableContainer) { + Block block = world.getBlockState(blockpos).getBlock(); + ILockableContainer ilockablecontainer = (ILockableContainer) tileentity; + if (ilockablecontainer instanceof TileEntityChest && block instanceof BlockChest) { + ilockablecontainer = ((BlockChest) block).getLockableContainer(world, blockpos); + } + + if (ilockablecontainer != null) { + entityplayer.displayGUIChest(ilockablecontainer); + return true; + } + } else if (tileentity instanceof IInventory) { + entityplayer.displayGUIChest((IInventory) tileentity); + return true; + } + + return false; + } else { + if (!entityplayer.isSneaking() || entityplayer.getHeldItem() == null) { + IBlockState iblockstate = world.getBlockState(blockpos); + if (iblockstate.getBlock().onBlockActivated(world, blockpos, iblockstate, entityplayer, enumfacing, f, + f1, f2)) { + return true; + } + } + + if (itemstack == null) { + return false; + } else if (this.isCreative()) { + int j = itemstack.getMetadata(); + int i = itemstack.stackSize; + boolean flag = itemstack.onItemUse(entityplayer, world, blockpos, enumfacing, f, f1, f2); + itemstack.setItemDamage(j); + itemstack.stackSize = i; + return flag; + } else { + return itemstack.onItemUse(entityplayer, world, blockpos, enumfacing, f, f1, f2); + } + } + } + + /**+ + * Sets the world instance. + */ + public void setWorld(WorldServer serverWorld) { + this.theWorld = serverWorld; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/LowerStringMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/LowerStringMap.java new file mode 100644 index 0000000..b331ca3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/LowerStringMap.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; + +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 LowerStringMap implements Map { + + static { + __checkIntegratedContextValid("net/minecraft/server/management/LowerStringMap"); + } + + private final Map internalMap = Maps.newLinkedHashMap(); + + public int size() { + return this.internalMap.size(); + } + + public boolean isEmpty() { + return this.internalMap.isEmpty(); + } + + public boolean containsKey(Object parObject) { + return this.internalMap.containsKey(parObject.toString().toLowerCase()); + } + + public boolean containsValue(Object parObject) { + return this.internalMap.containsKey(parObject); + } + + public V get(Object parObject) { + return (V) this.internalMap.get(parObject.toString().toLowerCase()); + } + + public V put(String parString1, V parObject) { + return (V) this.internalMap.put(parString1.toLowerCase(), parObject); + } + + public V remove(Object object) { + return (V) this.internalMap.remove(object.toString().toLowerCase()); + } + + public void putAll(Map parMap) { + for (Entry entry : parMap.entrySet()) { + this.put((String) entry.getKey(), (V) entry.getValue()); + } + + } + + public void clear() { + this.internalMap.clear(); + } + + public Set keySet() { + return this.internalMap.keySet(); + } + + public Collection values() { + return this.internalMap.values(); + } + + public Set> entrySet() { + return this.internalMap.entrySet(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/PlayerManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/PlayerManager.java new file mode 100644 index 0000000..5161505 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/PlayerManager.java @@ -0,0 +1,503 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S21PacketChunkData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S23PacketBlockChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.LongHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +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.Chunk; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 PlayerManager { + + static { + __checkIntegratedContextValid("net/minecraft/server/management/PlayerManager"); + } + + private static final Logger pmLogger = LogManager.getLogger(); + private final WorldServer theWorldServer; + /**+ + * players in the current instance + */ + private final List players = Lists.newArrayList(); + /**+ + * the hash of all playerInstances created + */ + private final LongHashMap playerInstances = new LongHashMap(); + /**+ + * the playerInstances(chunks) that need to be updated + */ + private final List playerInstancesToUpdate = Lists.newArrayList(); + /**+ + * This field is using when chunk should be processed (every + * 8000 ticks) + */ + private final List playerInstanceList = Lists.newArrayList(); + private int playerViewRadius; + private long previousTotalWorldTime; + /**+ + * x, z direction vectors: east, south, west, north + */ + private final int[][] xzDirectionsConst = new int[][] { { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, -1 } }; + + public PlayerManager(WorldServer serverWorld) { + this.theWorldServer = serverWorld; + this.setPlayerViewRadius(serverWorld.getMinecraftServer().getConfigurationManager().getViewDistance()); + } + + /**+ + * Returns the WorldServer associated with this PlayerManager + */ + public WorldServer getWorldServer() { + return this.theWorldServer; + } + + /**+ + * updates all the player instances that need to be updated + */ + public void updatePlayerInstances() { + long i = this.theWorldServer.getTotalWorldTime(); + if (i - this.previousTotalWorldTime > 8000L) { + this.previousTotalWorldTime = i; + + for (int j = 0; j < this.playerInstanceList.size(); ++j) { + PlayerManager.PlayerInstance playermanager$playerinstance = (PlayerManager.PlayerInstance) this.playerInstanceList + .get(j); + playermanager$playerinstance.onUpdate(); + playermanager$playerinstance.processChunk(); + } + } else { + for (int k = 0; k < this.playerInstancesToUpdate.size(); ++k) { + PlayerManager.PlayerInstance playermanager$playerinstance1 = (PlayerManager.PlayerInstance) this.playerInstancesToUpdate + .get(k); + playermanager$playerinstance1.onUpdate(); + } + } + + this.playerInstancesToUpdate.clear(); + if (this.players.isEmpty()) { + WorldProvider worldprovider = this.theWorldServer.provider; + if (!worldprovider.canRespawnHere()) { + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } + + } + + public boolean hasPlayerInstance(int chunkX, int chunkZ) { + long i = (long) chunkX + 2147483647L | (long) chunkZ + 2147483647L << 32; + return this.playerInstances.getValueByKey(i) != null; + } + + /**+ + * passi n the chunk x and y and a flag as to whether or not the + * instance should be made if it doesnt exist + */ + private PlayerManager.PlayerInstance getPlayerInstance(int chunkX, int chunkZ, boolean createIfAbsent) { + long i = (long) chunkX + 2147483647L | (long) chunkZ + 2147483647L << 32; + PlayerManager.PlayerInstance playermanager$playerinstance = (PlayerManager.PlayerInstance) this.playerInstances + .getValueByKey(i); + if (playermanager$playerinstance == null && createIfAbsent) { + playermanager$playerinstance = new PlayerManager.PlayerInstance(chunkX, chunkZ); + this.playerInstances.add(i, playermanager$playerinstance); + this.playerInstanceList.add(playermanager$playerinstance); + } + + return playermanager$playerinstance; + } + + public void markBlockForUpdate(BlockPos pos) { + int i = pos.getX() >> 4; + int j = pos.getZ() >> 4; + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(i, j, false); + if (playermanager$playerinstance != null) { + playermanager$playerinstance.flagChunkForUpdate(pos.getX() & 15, pos.getY(), pos.getZ() & 15); + } + + } + + /**+ + * Adds an EntityPlayerMP to the PlayerManager and to all player + * instances within player visibility + */ + public void addPlayer(EntityPlayerMP player) { + int i = (int) player.posX >> 4; + int j = (int) player.posZ >> 4; + player.managedPosX = player.posX; + player.managedPosZ = player.posZ; + + for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) { + this.getPlayerInstance(k, l, true).addPlayer(player); + } + } + + this.players.add(player); + this.filterChunkLoadQueue(player); + } + + /**+ + * Removes all chunks from the given player's chunk load queue + * that are not in viewing range of the player. + */ + public void filterChunkLoadQueue(EntityPlayerMP player) { + ArrayList arraylist = Lists.newArrayList(player.loadedChunks); + int i = 0; + int j = this.playerViewRadius; + int k = (int) player.posX >> 4; + int l = (int) player.posZ >> 4; + int i1 = 0; + int j1 = 0; + ChunkCoordIntPair chunkcoordintpair = this.getPlayerInstance(k, l, true).chunkCoords; + player.loadedChunks.clear(); + if (arraylist.contains(chunkcoordintpair)) { + player.loadedChunks.add(chunkcoordintpair); + } + + for (int k1 = 1; k1 <= j * 2; ++k1) { + for (int l1 = 0; l1 < 2; ++l1) { + int[] aint = this.xzDirectionsConst[i++ % 4]; + + for (int i2 = 0; i2 < k1; ++i2) { + i1 += aint[0]; + j1 += aint[1]; + chunkcoordintpair = this.getPlayerInstance(k + i1, l + j1, true).chunkCoords; + if (arraylist.contains(chunkcoordintpair)) { + player.loadedChunks.add(chunkcoordintpair); + } + } + } + } + + i = i % 4; + + for (int j2 = 0; j2 < j * 2; ++j2) { + i1 += this.xzDirectionsConst[i][0]; + j1 += this.xzDirectionsConst[i][1]; + chunkcoordintpair = this.getPlayerInstance(k + i1, l + j1, true).chunkCoords; + if (arraylist.contains(chunkcoordintpair)) { + player.loadedChunks.add(chunkcoordintpair); + } + } + + } + + /**+ + * Removes an EntityPlayerMP from the PlayerManager. + */ + public void removePlayer(EntityPlayerMP player) { + int i = (int) player.managedPosX >> 4; + int j = (int) player.managedPosZ >> 4; + + for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(k, l, false); + if (playermanager$playerinstance != null) { + playermanager$playerinstance.removePlayer(player); + } + } + } + + this.players.remove(player); + } + + /**+ + * Determine if two rectangles centered at the given points + * overlap for the provided radius. Arguments: x1, z1, x2, z2, + * radius. + */ + private boolean overlaps(int x1, int z1, int x2, int z2, int radius) { + int i = x1 - x2; + int j = z1 - z2; + return i >= -radius && i <= radius ? j >= -radius && j <= radius : false; + } + + /**+ + * update chunks around a player being moved by server logic + * (e.g. cart, boat) + */ + public void updateMountedMovingPlayer(EntityPlayerMP player) { + int i = (int) player.posX >> 4; + int j = (int) player.posZ >> 4; + double d0 = player.managedPosX - player.posX; + double d1 = player.managedPosZ - player.posZ; + double d2 = d0 * d0 + d1 * d1; + if (d2 >= 64.0D) { + int k = (int) player.managedPosX >> 4; + int l = (int) player.managedPosZ >> 4; + int i1 = this.playerViewRadius; + int j1 = i - k; + int k1 = j - l; + if (j1 != 0 || k1 != 0) { + for (int l1 = i - i1; l1 <= i + i1; ++l1) { + for (int i2 = j - i1; i2 <= j + i1; ++i2) { + if (!this.overlaps(l1, i2, k, l, i1)) { + this.getPlayerInstance(l1, i2, true).addPlayer(player); + } + + if (!this.overlaps(l1 - j1, i2 - k1, i, j, i1)) { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(l1 - j1, + i2 - k1, false); + if (playermanager$playerinstance != null) { + playermanager$playerinstance.removePlayer(player); + } + } + } + } + + this.filterChunkLoadQueue(player); + player.managedPosX = player.posX; + player.managedPosZ = player.posZ; + } + } + } + + public boolean isPlayerWatchingChunk(EntityPlayerMP player, int chunkX, int chunkZ) { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(chunkX, chunkZ, false); + return playermanager$playerinstance != null + && playermanager$playerinstance.playersWatchingChunk.contains(player) + && !player.loadedChunks.contains(playermanager$playerinstance.chunkCoords); + } + + public void setPlayerViewRadius(int radius) { + radius = MathHelper.clamp_int(radius, 3, 32); + if (radius != this.playerViewRadius) { + int i = radius - this.playerViewRadius; + + for (EntityPlayerMP entityplayermp : Lists.newArrayList(this.players)) { + int j = (int) entityplayermp.posX >> 4; + int k = (int) entityplayermp.posZ >> 4; + if (i > 0) { + for (int j1 = j - radius; j1 <= j + radius; ++j1) { + for (int k1 = k - radius; k1 <= k + radius; ++k1) { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(j1, k1, + true); + if (!playermanager$playerinstance.playersWatchingChunk.contains(entityplayermp)) { + playermanager$playerinstance.addPlayer(entityplayermp); + } + } + } + } else { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) { + for (int i1 = k - this.playerViewRadius; i1 <= k + this.playerViewRadius; ++i1) { + if (!this.overlaps(l, i1, j, k, radius)) { + this.getPlayerInstance(l, i1, true).removePlayer(entityplayermp); + } + } + } + } + } + + this.playerViewRadius = radius; + } + } + + /**+ + * Get the furthest viewable block given player's view distance + */ + public static int getFurthestViewableBlock(int distance) { + return distance * 16 - 16; + } + + class PlayerInstance { + private final List playersWatchingChunk = Lists.newArrayList(); + private final ChunkCoordIntPair chunkCoords; + private short[] locationOfBlockChange = new short[64]; + private int numBlocksToUpdate; + private int flagsYAreasToUpdate; + private long previousWorldTime; + + public PlayerInstance(int chunkX, int chunkZ) { + this.chunkCoords = new ChunkCoordIntPair(chunkX, chunkZ); + PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(chunkX, chunkZ); + } + + /**+ + * Adds an EntityPlayerMP to the PlayerManager and to all player + * instances within player visibility + */ + public void addPlayer(EntityPlayerMP player) { + if (this.playersWatchingChunk.contains(player)) { + PlayerManager.pmLogger.debug("Failed to add player. {} already is in chunk {}, {}", + new Object[] { player, Integer.valueOf(this.chunkCoords.chunkXPos), + Integer.valueOf(this.chunkCoords.chunkZPos) }); + } else { + if (this.playersWatchingChunk.isEmpty()) { + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + this.playersWatchingChunk.add(player); + player.loadedChunks.add(this.chunkCoords); + } + } + + /**+ + * Removes an EntityPlayerMP from the PlayerManager. + */ + public void removePlayer(EntityPlayerMP player) { + if (this.playersWatchingChunk.contains(player)) { + Chunk chunk = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, + this.chunkCoords.chunkZPos); + if (chunk.isPopulated()) { + player.playerNetServerHandler.sendPacket(new S21PacketChunkData(chunk, true, 0)); + } + + this.playersWatchingChunk.remove(player); + player.loadedChunks.remove(this.chunkCoords); + if (this.playersWatchingChunk.isEmpty()) { + long i = (long) this.chunkCoords.chunkXPos + 2147483647L + | (long) this.chunkCoords.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(chunk); + PlayerManager.this.playerInstances.remove(i); + PlayerManager.this.playerInstanceList.remove(this); + if (this.numBlocksToUpdate > 0) { + PlayerManager.this.playerInstancesToUpdate.remove(this); + } + + PlayerManager.this.getWorldServer().theChunkProviderServer.dropChunk(this.chunkCoords.chunkXPos, + this.chunkCoords.chunkZPos); + } + + } + } + + public void processChunk() { + this.increaseInhabitedTime(PlayerManager.this.theWorldServer + .getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos)); + } + + private void increaseInhabitedTime(Chunk theChunk) { + theChunk.setInhabitedTime(theChunk.getInhabitedTime() + + PlayerManager.this.theWorldServer.getTotalWorldTime() - this.previousWorldTime); + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + public void flagChunkForUpdate(int x, int y, int z) { + if (this.numBlocksToUpdate == 0) { + PlayerManager.this.playerInstancesToUpdate.add(this); + } + + this.flagsYAreasToUpdate |= 1 << (y >> 4); + if (this.numBlocksToUpdate < 64) { + short short1 = (short) (x << 12 | z << 8 | y); + + for (int i = 0; i < this.numBlocksToUpdate; ++i) { + if (this.locationOfBlockChange[i] == short1) { + return; + } + } + + this.locationOfBlockChange[this.numBlocksToUpdate++] = short1; + } + + } + + public void sendToAllPlayersWatchingChunk(Packet thePacket) { + for (int i = 0; i < this.playersWatchingChunk.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playersWatchingChunk.get(i); + if (!entityplayermp.loadedChunks.contains(this.chunkCoords)) { + entityplayermp.playerNetServerHandler.sendPacket(thePacket); + } + } + + } + + public void onUpdate() { + if (this.numBlocksToUpdate != 0) { + if (this.numBlocksToUpdate == 1) { + int i = (this.locationOfBlockChange[0] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; + int j = this.locationOfBlockChange[0] & 255; + int k = (this.locationOfBlockChange[0] >> 8 & 15) + this.chunkCoords.chunkZPos * 16; + BlockPos blockpos = new BlockPos(i, j, k); + this.sendToAllPlayersWatchingChunk( + new S23PacketBlockChange(PlayerManager.this.theWorldServer, blockpos)); + if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity()) { + this.sendTileToAllPlayersWatchingChunk( + PlayerManager.this.theWorldServer.getTileEntity(blockpos)); + } + } else if (this.numBlocksToUpdate == 64) { + int i1 = this.chunkCoords.chunkXPos * 16; + int k1 = this.chunkCoords.chunkZPos * 16; + this.sendToAllPlayersWatchingChunk( + new S21PacketChunkData( + PlayerManager.this.theWorldServer.getChunkFromChunkCoords( + this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos), + false, this.flagsYAreasToUpdate)); + + for (int i2 = 0; i2 < 16; ++i2) { + if ((this.flagsYAreasToUpdate & 1 << i2) != 0) { + int k2 = i2 << 4; + List list = PlayerManager.this.theWorldServer.getTileEntitiesIn(i1, k2, k1, i1 + 16, + k2 + 16, k1 + 16); + + for (int l = 0; l < list.size(); ++l) { + this.sendTileToAllPlayersWatchingChunk((TileEntity) list.get(l)); + } + } + } + } else { + this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numBlocksToUpdate, + this.locationOfBlockChange, PlayerManager.this.theWorldServer + .getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos))); + + for (int j1 = 0; j1 < this.numBlocksToUpdate; ++j1) { + int l1 = (this.locationOfBlockChange[j1] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; + int j2 = this.locationOfBlockChange[j1] & 255; + int l2 = (this.locationOfBlockChange[j1] >> 8 & 15) + this.chunkCoords.chunkZPos * 16; + BlockPos blockpos1 = new BlockPos(l1, j2, l2); + if (PlayerManager.this.theWorldServer.getBlockState(blockpos1).getBlock().hasTileEntity()) { + this.sendTileToAllPlayersWatchingChunk( + PlayerManager.this.theWorldServer.getTileEntity(blockpos1)); + } + } + } + + this.numBlocksToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + + private void sendTileToAllPlayersWatchingChunk(TileEntity theTileEntity) { + if (theTileEntity != null) { + Packet packet = theTileEntity.getDescriptionPacket(); + if (packet != null) { + this.sendToAllPlayersWatchingChunk(packet); + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ServerConfigurationManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ServerConfigurationManager.java new file mode 100644 index 0000000..14e7814 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ServerConfigurationManager.java @@ -0,0 +1,925 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.NetHandlerPlayServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S01PacketJoinGame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S02PacketChat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S07PacketRespawn; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S1FPacketSetExperience; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3EPacketTeams; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S44PacketWorldBorder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScorePlayerTeam; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ServerScoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Team; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.ItemInWorldManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.PlayerManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatisticsFile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +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.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.IBorderListener; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.demo.DemoWorldManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.IPlayerFileData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; +import net.lax1dude.eaglercraft.v1_8.sp.server.socket.IntegratedServerPlayerNetworkManager; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class ServerConfigurationManager { + + static { + __checkIntegratedContextValid("net/minecraft/server/management/ServerConfigurationManager"); + } + + private static final Logger logger = LogManager.getLogger(); + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); + private final MinecraftServer mcServer; + /**+ + * A list of player entities that exist on this server. + */ + private final List playerEntityList = Lists.newArrayList(); + private final Map uuidToPlayerMap = Maps.newHashMap(); + private final Map playerStatFiles; + private IPlayerFileData playerNBTManagerObj; + private boolean whiteListEnforced; + protected int maxPlayers; + protected int viewDistance; + private WorldSettings.GameType gameType; + private boolean commandsAllowedForAll; + private int playerPingIndex; + + private WorldSettings.GameType lanGamemode = WorldSettings.GameType.SURVIVAL; + private boolean lanCheats = false; + + public ServerConfigurationManager(MinecraftServer server) { + this.playerStatFiles = Maps.newHashMap(); + this.mcServer = server; + this.maxPlayers = 8; + } + + public void initializeConnectionToPlayer(IntegratedServerPlayerNetworkManager netManager, EntityPlayerMP playerIn) { + GameProfile gameprofile1 = playerIn.getGameProfile(); + NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(playerIn); + playerIn.setWorld(this.mcServer.worldServerForDimension(playerIn.dimension)); + playerIn.theItemInWorldManager.setWorld((WorldServer) playerIn.worldObj); + String s1 = "channel:" + netManager.playerChannel; + + logger.info(playerIn.getName() + "[" + s1 + "] logged in with entity id " + playerIn.getEntityId() + " at (" + + playerIn.posX + ", " + playerIn.posY + ", " + playerIn.posZ + ")"); + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + WorldInfo worldinfo = worldserver.getWorldInfo(); + BlockPos blockpos = worldserver.getSpawnPoint(); + this.setPlayerGameTypeBasedOnOther(playerIn, (EntityPlayerMP) null, worldserver); + NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.mcServer, netManager, playerIn); + nethandlerplayserver.sendPacket(new S01PacketJoinGame(playerIn.getEntityId(), + playerIn.theItemInWorldManager.getGameType(), worldinfo.isHardcoreModeEnabled(), + worldserver.provider.getDimensionId(), worldserver.getDifficulty(), this.getMaxPlayers(), + worldinfo.getTerrainType(), worldserver.getGameRules().getBoolean("reducedDebugInfo"))); + nethandlerplayserver + .sendPacket(new S3FPacketCustomPayload("MC|Brand", (PacketBuffer) (new PacketBuffer(Unpooled.buffer())) + .writeString(this.getServerInstance().getServerModName()))); + nethandlerplayserver + .sendPacket(new S41PacketServerDifficulty(worldinfo.getDifficulty(), worldinfo.isDifficultyLocked())); + nethandlerplayserver.sendPacket(new S05PacketSpawnPosition(blockpos)); + nethandlerplayserver.sendPacket(new S39PacketPlayerAbilities(playerIn.capabilities)); + nethandlerplayserver.sendPacket(new S09PacketHeldItemChange(playerIn.inventory.currentItem)); + playerIn.getStatFile().func_150877_d(); + playerIn.getStatFile().sendAchievements(playerIn); + this.sendScoreboard((ServerScoreboard) worldserver.getScoreboard(), playerIn); + this.mcServer.refreshStatusNextTick(); + ChatComponentTranslation chatcomponenttranslation; + chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined", + new Object[] { playerIn.getDisplayName() }); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.sendChatMsg(chatcomponenttranslation); + if (playerIn.canCommandSenderUseCommand(2, "give")) { + ChatComponentText shaderF4Msg = new ChatComponentText("[EaglercraftX] "); + shaderF4Msg.getChatStyle().setColor(EnumChatFormatting.GOLD); + ChatComponentTranslation shaderF4Msg2 = new ChatComponentTranslation("command.skull.tip"); + shaderF4Msg2.getChatStyle().setColor(EnumChatFormatting.AQUA); + shaderF4Msg.appendSibling(shaderF4Msg2); + playerIn.addChatMessage(shaderF4Msg); + } + this.playerLoggedIn(playerIn); + nethandlerplayserver.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, + playerIn.rotationPitch); + this.updateTimeAndWeatherForPlayer(playerIn, worldserver); + if (this.mcServer.getResourcePackUrl().length() > 0) { + playerIn.loadResourcePack(this.mcServer.getResourcePackUrl(), this.mcServer.getResourcePackHash()); + } + + for (PotionEffect potioneffect : playerIn.getActivePotionEffects()) { + nethandlerplayserver.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); + } + + playerIn.addSelfToInternalCraftingInventory(); + if (nbttagcompound != null && nbttagcompound.hasKey("Riding", 10)) { + Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver); + if (entity != null) { + entity.forceSpawn = true; + worldserver.spawnEntityInWorld(entity); + playerIn.mountEntity(entity); + entity.forceSpawn = false; + } + } + + if (EagRuntime.getConfiguration().allowUpdateSvc()) { + for (EntityPlayerMP playerItr : playerEntityList) { + if (playerItr != playerIn && playerItr.updateCertificate != null) { + nethandlerplayserver + .sendPacket(new S3FPacketCustomPayload("EAG|UpdateCert-1.8", + new PacketBuffer(Unpooled + .buffer(playerItr.updateCertificate, playerItr.updateCertificate.length) + .writerIndex(playerItr.updateCertificate.length)))); + } + } + } + } + + protected void sendScoreboard(ServerScoreboard scoreboardIn, EntityPlayerMP playerIn) { + HashSet hashset = Sets.newHashSet(); + + for (ScorePlayerTeam scoreplayerteam : scoreboardIn.getTeams()) { + playerIn.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0)); + } + + for (int i = 0; i < 19; ++i) { + ScoreObjective scoreobjective = scoreboardIn.getObjectiveInDisplaySlot(i); + if (scoreobjective != null && !hashset.contains(scoreobjective)) { + for (Packet packet : scoreboardIn.func_96550_d(scoreobjective)) { + playerIn.playerNetServerHandler.sendPacket(packet); + } + + hashset.add(scoreobjective); + } + } + + } + + /**+ + * Sets the NBT manager to the one for the WorldServer given. + */ + public void setPlayerManager(WorldServer[] worldServers) { + this.playerNBTManagerObj = worldServers[0].getSaveHandler().getPlayerNBTManager(); + worldServers[0].getWorldBorder().addListener(new IBorderListener() { + public void onSizeChanged(WorldBorder worldborder, double var2) { + ServerConfigurationManager.this.sendPacketToAllPlayers( + new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.SET_SIZE)); + } + + public void onTransitionStarted(WorldBorder worldborder, double var2, double var4, long var6) { + ServerConfigurationManager.this.sendPacketToAllPlayers( + new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.LERP_SIZE)); + } + + public void onCenterChanged(WorldBorder worldborder, double var2, double var4) { + ServerConfigurationManager.this.sendPacketToAllPlayers( + new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.SET_CENTER)); + } + + public void onWarningTimeChanged(WorldBorder worldborder, int var2) { + ServerConfigurationManager.this.sendPacketToAllPlayers( + new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.SET_WARNING_TIME)); + } + + public void onWarningDistanceChanged(WorldBorder worldborder, int var2) { + ServerConfigurationManager.this.sendPacketToAllPlayers( + new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.SET_WARNING_BLOCKS)); + } + + public void onDamageAmountChanged(WorldBorder var1, double var2) { + } + + public void onDamageBufferChanged(WorldBorder var1, double var2) { + } + }); + } + + public void preparePlayer(EntityPlayerMP playerIn, WorldServer worldIn) { + WorldServer worldserver = playerIn.getServerForPlayer(); + if (worldIn != null) { + worldIn.getPlayerManager().removePlayer(playerIn); + } + + worldserver.getPlayerManager().addPlayer(playerIn); + worldserver.theChunkProviderServer.loadChunk((int) playerIn.posX >> 4, (int) playerIn.posZ >> 4); + } + + public int getEntityViewDistance() { + return PlayerManager.getFurthestViewableBlock(this.getViewDistance()); + } + + /**+ + * called during player login. reads the player information from + * disk. + */ + public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP playerIn) { + NBTTagCompound nbttagcompound = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); + NBTTagCompound nbttagcompound1; + if (playerIn.getName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) { + playerIn.readFromNBT(nbttagcompound); + nbttagcompound1 = nbttagcompound; + logger.debug("loading single player"); + } else { + nbttagcompound1 = this.playerNBTManagerObj.readPlayerData(playerIn); + } + + return nbttagcompound1; + } + + /**+ + * also stores the NBTTags if this is an intergratedPlayerList + */ + protected void writePlayerData(EntityPlayerMP entityplayermp) { + this.playerNBTManagerObj.writePlayerData(entityplayermp); + StatisticsFile statisticsfile = (StatisticsFile) this.playerStatFiles.get(entityplayermp.getName()); + if (statisticsfile != null) { + statisticsfile.saveStatFile(); + } + + } + + /**+ + * Called when a player successfully logs in. Reads player data + * from disk and inserts the player into the world. + */ + public void playerLoggedIn(EntityPlayerMP playerIn) { + this.playerEntityList.add(playerIn); + this.uuidToPlayerMap.put(playerIn.getUniqueID(), playerIn); + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, + new EntityPlayerMP[] { playerIn })); + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + worldserver.spawnEntityInWorld(playerIn); + this.preparePlayer(playerIn, (WorldServer) null); + + for (int i = 0; i < this.playerEntityList.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntityList.get(i); + playerIn.playerNetServerHandler.sendPacket(new S38PacketPlayerListItem( + S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] { entityplayermp })); + } + + } + + /**+ + * using player's dimension, update their movement when in a + * vehicle (e.g. cart, boat) + */ + public void serverUpdateMountedMovingPlayer(EntityPlayerMP playerIn) { + playerIn.getServerForPlayer().getPlayerManager().updateMountedMovingPlayer(playerIn); + } + + /**+ + * Called when a player disconnects from the game. Writes player + * data to disk and removes them from the world. + */ + public void playerLoggedOut(EntityPlayerMP playerIn) { + playerIn.triggerAchievement(StatList.leaveGameStat); + this.writePlayerData(playerIn); + WorldServer worldserver = playerIn.getServerForPlayer(); + if (playerIn.ridingEntity != null) { + worldserver.removePlayerEntityDangerously(playerIn.ridingEntity); + logger.debug("removing player mount"); + } + + worldserver.removeEntity(playerIn); + worldserver.getPlayerManager().removePlayer(playerIn); + this.playerEntityList.remove(playerIn); + EaglercraftUUID uuid = playerIn.getUniqueID(); + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.uuidToPlayerMap.get(uuid); + if (entityplayermp == playerIn) { + this.uuidToPlayerMap.remove(uuid); + this.playerStatFiles.remove(entityplayermp.getName()); + } + + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, + new EntityPlayerMP[] { playerIn })); + } + + /**+ + * checks ban-lists, then white-lists, then space for the + * server. Returns null on success, or an error message + */ + public String allowUserToConnect(GameProfile gameprofile) { + return this.playerEntityList.size() >= this.maxPlayers && !this.func_183023_f(gameprofile) + ? "The server is full!" + : (doesPlayerAlreadyExist(gameprofile) + ? "\"" + gameprofile.getName() + "\" is already playing on this world!" + : null); + } + + private boolean doesPlayerAlreadyExist(GameProfile gameprofile) { + for (EntityPlayerMP player : this.playerEntityList) { + if (player.getName().equalsIgnoreCase(gameprofile.getName()) + || player.getUniqueID().equals(gameprofile.getId())) { + return true; + } + } + return false; + } + + /**+ + * also checks for multiple logins across servers + */ + public EntityPlayerMP createPlayerForUser(GameProfile profile) { + EaglercraftUUID uuid = EntityPlayer.getUUID(profile); + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < this.playerEntityList.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntityList.get(i); + if (entityplayermp.getUniqueID().equals(uuid) + || entityplayermp.getName().equalsIgnoreCase(profile.getName())) { + arraylist.add(entityplayermp); + } + } + + EntityPlayerMP entityplayermp2 = (EntityPlayerMP) this.uuidToPlayerMap.get(profile.getId()); + if (entityplayermp2 != null && !arraylist.contains(entityplayermp2)) { + arraylist.add(entityplayermp2); + } + + for (EntityPlayerMP entityplayermp1 : (ArrayList) arraylist) { + entityplayermp1.playerNetServerHandler.kickPlayerFromServer("You logged in from another location"); + } + + Object object; + if (this.mcServer.isDemo()) { + object = new DemoWorldManager(this.mcServer.worldServerForDimension(0)); + } else { + object = new ItemInWorldManager(this.mcServer.worldServerForDimension(0)); + } + + return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), profile, + (ItemInWorldManager) object); + } + + /**+ + * Called on respawn + */ + public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP playerIn, int dimension, boolean conqueredEnd) { + playerIn.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(playerIn); + playerIn.getServerForPlayer().getEntityTracker().untrackEntity(playerIn); + playerIn.getServerForPlayer().getPlayerManager().removePlayer(playerIn); + this.playerEntityList.remove(playerIn); + this.mcServer.worldServerForDimension(playerIn.dimension).removePlayerEntityDangerously(playerIn); + BlockPos blockpos = playerIn.getBedLocation(); + boolean flag = playerIn.isSpawnForced(); + playerIn.dimension = dimension; + Object object; + if (this.mcServer.isDemo()) { + object = new DemoWorldManager(this.mcServer.worldServerForDimension(playerIn.dimension)); + } else { + object = new ItemInWorldManager(this.mcServer.worldServerForDimension(playerIn.dimension)); + } + + EntityPlayerMP entityplayermp = new EntityPlayerMP(this.mcServer, + this.mcServer.worldServerForDimension(playerIn.dimension), playerIn.getGameProfile(), + (ItemInWorldManager) object); + entityplayermp.playerNetServerHandler = playerIn.playerNetServerHandler; + entityplayermp.clonePlayer(playerIn, conqueredEnd); + entityplayermp.setEntityId(playerIn.getEntityId()); + entityplayermp.func_174817_o(playerIn); + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + this.setPlayerGameTypeBasedOnOther(entityplayermp, playerIn, worldserver); + if (blockpos != null) { + BlockPos blockpos1 = EntityPlayer + .getBedSpawnLocation(this.mcServer.worldServerForDimension(playerIn.dimension), blockpos, flag); + if (blockpos1 != null) { + entityplayermp.setLocationAndAngles((double) ((float) blockpos1.getX() + 0.5F), + (double) ((float) blockpos1.getY() + 0.1F), (double) ((float) blockpos1.getZ() + 0.5F), 0.0F, + 0.0F); + entityplayermp.setSpawnPoint(blockpos, flag); + } else { + entityplayermp.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(0, 0.0F)); + } + } + + worldserver.theChunkProviderServer.loadChunk((int) entityplayermp.posX >> 4, (int) entityplayermp.posZ >> 4); + + while (!worldserver.getCollidingBoundingBoxes(entityplayermp, entityplayermp.getEntityBoundingBox()).isEmpty() + && entityplayermp.posY < 256.0D) { + entityplayermp.setPosition(entityplayermp.posX, entityplayermp.posY + 1.0D, entityplayermp.posZ); + } + + entityplayermp.playerNetServerHandler.sendPacket(new S07PacketRespawn(entityplayermp.dimension, + entityplayermp.worldObj.getDifficulty(), entityplayermp.worldObj.getWorldInfo().getTerrainType(), + entityplayermp.theItemInWorldManager.getGameType())); + BlockPos blockpos2 = worldserver.getSpawnPoint(); + entityplayermp.playerNetServerHandler.setPlayerLocation(entityplayermp.posX, entityplayermp.posY, + entityplayermp.posZ, entityplayermp.rotationYaw, entityplayermp.rotationPitch); + entityplayermp.playerNetServerHandler.sendPacket(new S05PacketSpawnPosition(blockpos2)); + entityplayermp.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(entityplayermp.experience, + entityplayermp.experienceTotal, entityplayermp.experienceLevel)); + this.updateTimeAndWeatherForPlayer(entityplayermp, worldserver); + worldserver.getPlayerManager().addPlayer(entityplayermp); + worldserver.spawnEntityInWorld(entityplayermp); + this.playerEntityList.add(entityplayermp); + this.uuidToPlayerMap.put(entityplayermp.getUniqueID(), entityplayermp); + entityplayermp.addSelfToInternalCraftingInventory(); + entityplayermp.setHealth(entityplayermp.getHealth()); + return entityplayermp; + } + + /**+ + * moves provided player from overworld to nether or vice versa + */ + public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension) { + int i = playerIn.dimension; + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + playerIn.dimension = dimension; + WorldServer worldserver1 = this.mcServer.worldServerForDimension(playerIn.dimension); + playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, + playerIn.worldObj.getDifficulty(), playerIn.worldObj.getWorldInfo().getTerrainType(), + playerIn.theItemInWorldManager.getGameType())); + worldserver.removePlayerEntityDangerously(playerIn); + playerIn.isDead = false; + this.transferEntityToWorld(playerIn, i, worldserver, worldserver1); + this.preparePlayer(playerIn, worldserver); + playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, + playerIn.rotationYaw, playerIn.rotationPitch); + playerIn.theItemInWorldManager.setWorld(worldserver1); + this.updateTimeAndWeatherForPlayer(playerIn, worldserver1); + this.syncPlayerInventory(playerIn); + + for (PotionEffect potioneffect : playerIn.getActivePotionEffects()) { + playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); + } + + } + + /**+ + * Transfers an entity from a world to another world. + */ + public void transferEntityToWorld(Entity entityIn, int parInt1, WorldServer parWorldServer, + WorldServer parWorldServer2) { + double d0 = entityIn.posX; + double d1 = entityIn.posZ; + double d2 = 8.0D; + float f = entityIn.rotationYaw; + parWorldServer.theProfiler.startSection("moving"); + if (entityIn.dimension == -1) { + d0 = MathHelper.clamp_double(d0 / d2, parWorldServer2.getWorldBorder().minX() + 16.0D, + parWorldServer2.getWorldBorder().maxX() - 16.0D); + d1 = MathHelper.clamp_double(d1 / d2, parWorldServer2.getWorldBorder().minZ() + 16.0D, + parWorldServer2.getWorldBorder().maxZ() - 16.0D); + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + if (entityIn.isEntityAlive()) { + parWorldServer.updateEntityWithOptionalForce(entityIn, false); + } + } else if (entityIn.dimension == 0) { + d0 = MathHelper.clamp_double(d0 * d2, parWorldServer2.getWorldBorder().minX() + 16.0D, + parWorldServer2.getWorldBorder().maxX() - 16.0D); + d1 = MathHelper.clamp_double(d1 * d2, parWorldServer2.getWorldBorder().minZ() + 16.0D, + parWorldServer2.getWorldBorder().maxZ() - 16.0D); + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + if (entityIn.isEntityAlive()) { + parWorldServer.updateEntityWithOptionalForce(entityIn, false); + } + } else { + BlockPos blockpos; + if (parInt1 == 1) { + blockpos = parWorldServer2.getSpawnPoint(); + } else { + blockpos = parWorldServer2.getSpawnCoordinate(); + } + + d0 = (double) blockpos.getX(); + entityIn.posY = (double) blockpos.getY(); + d1 = (double) blockpos.getZ(); + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, 90.0F, 0.0F); + if (entityIn.isEntityAlive()) { + parWorldServer.updateEntityWithOptionalForce(entityIn, false); + } + } + + parWorldServer.theProfiler.endSection(); + if (parInt1 != 1) { + parWorldServer.theProfiler.startSection("placing"); + d0 = (double) MathHelper.clamp_int((int) d0, -29999872, 29999872); + d1 = (double) MathHelper.clamp_int((int) d1, -29999872, 29999872); + if (entityIn.isEntityAlive()) { + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + parWorldServer2.getDefaultTeleporter().placeInPortal(entityIn, f); + parWorldServer2.spawnEntityInWorld(entityIn); + parWorldServer2.updateEntityWithOptionalForce(entityIn, false); + } + + parWorldServer.theProfiler.endSection(); + } + + entityIn.setWorld(parWorldServer2); + } + + /**+ + * self explanitory + */ + public void onTick() { + if (++this.playerPingIndex > 600) { + this.sendPacketToAllPlayers( + new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.UPDATE_LATENCY, this.playerEntityList)); + this.playerPingIndex = 0; + } + + } + + public void sendPacketToAllPlayers(Packet packetIn) { + for (int i = 0; i < this.playerEntityList.size(); ++i) { + ((EntityPlayerMP) this.playerEntityList.get(i)).playerNetServerHandler.sendPacket(packetIn); + } + + } + + public void sendPacketToAllPlayersInDimension(Packet packetIn, int dimension) { + for (int i = 0; i < this.playerEntityList.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntityList.get(i); + if (entityplayermp.dimension == dimension) { + entityplayermp.playerNetServerHandler.sendPacket(packetIn); + } + } + + } + + public void sendMessageToAllTeamMembers(EntityPlayer player, IChatComponent message) { + Team team = player.getTeam(); + if (team != null) { + for (String s : team.getMembershipCollection()) { + EntityPlayerMP entityplayermp = this.getPlayerByUsername(s); + if (entityplayermp != null && entityplayermp != player) { + entityplayermp.addChatMessage(message); + } + } + + } + } + + public void sendMessageToTeamOrEvryPlayer(EntityPlayer player, IChatComponent message) { + Team team = player.getTeam(); + if (team == null) { + this.sendChatMsg(message); + } else { + for (int i = 0; i < this.playerEntityList.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntityList.get(i); + if (entityplayermp.getTeam() != team) { + entityplayermp.addChatMessage(message); + } + } + + } + } + + public String func_181058_b(boolean parFlag) { + String s = ""; + ArrayList arraylist = Lists.newArrayList(this.playerEntityList); + + for (int i = 0; i < arraylist.size(); ++i) { + if (i > 0) { + s = s + ", "; + } + + s = s + ((EntityPlayerMP) arraylist.get(i)).getName(); + if (parFlag) { + s = s + " (" + ((EntityPlayerMP) arraylist.get(i)).getUniqueID().toString() + ")"; + } + } + + return s; + } + + /**+ + * Returns an array of the usernames of all the connected + * players. + */ + public String[] getAllUsernames() { + String[] astring = new String[this.playerEntityList.size()]; + + for (int i = 0; i < this.playerEntityList.size(); ++i) { + astring[i] = ((EntityPlayerMP) this.playerEntityList.get(i)).getName(); + } + + return astring; + } + + public GameProfile[] getAllProfiles() { + GameProfile[] agameprofile = new GameProfile[this.playerEntityList.size()]; + + for (int i = 0; i < this.playerEntityList.size(); ++i) { + agameprofile[i] = ((EntityPlayerMP) this.playerEntityList.get(i)).getGameProfile(); + } + + return agameprofile; + } + + public boolean canJoin(GameProfile gameprofile) { + return true; + } + + public boolean canSendCommands(GameProfile profile) { + return lanCheats + || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() + && this.mcServer.getServerOwner().equalsIgnoreCase(profile.getName()) + || this.commandsAllowedForAll; + } + + public EntityPlayerMP getPlayerByUsername(String username) { + for (EntityPlayerMP entityplayermp : this.playerEntityList) { + if (entityplayermp.getName().equalsIgnoreCase(username)) { + return entityplayermp; + } + } + + return null; + } + + /**+ + * params: x,y,z,r,dimension. The packet is sent to all players + * within r radius of x,y,z (r^2>x^2+y^2+z^2) + */ + public void sendToAllNear(double x, double y, double z, double radius, int dimension, Packet packetIn) { + this.sendToAllNearExcept((EntityPlayer) null, x, y, z, radius, dimension, packetIn); + } + + /**+ + * params: srcPlayer,x,y,z,r,dimension. The packet is not sent + * to the srcPlayer, but all other players within the search + * radius + */ + public void sendToAllNearExcept(EntityPlayer x, double y, double z, double radius, double dimension, int parInt1, + Packet parPacket) { + for (int i = 0; i < this.playerEntityList.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntityList.get(i); + if (entityplayermp != x && entityplayermp.dimension == parInt1) { + double d0 = y - entityplayermp.posX; + double d1 = z - entityplayermp.posY; + double d2 = radius - entityplayermp.posZ; + if (d0 * d0 + d1 * d1 + d2 * d2 < dimension * dimension) { + entityplayermp.playerNetServerHandler.sendPacket(parPacket); + } + } + } + + } + + /**+ + * Saves all of the players' current states. + */ + public void saveAllPlayerData() { + for (int i = 0; i < this.playerEntityList.size(); ++i) { + this.writePlayerData((EntityPlayerMP) this.playerEntityList.get(i)); + } + + } + + /**+ + * Updates the time and weather for the given player to those of + * the given world + */ + public void updateTimeAndWeatherForPlayer(EntityPlayerMP playerIn, WorldServer worldIn) { + WorldBorder worldborder = this.mcServer.worldServers[0].getWorldBorder(); + playerIn.playerNetServerHandler + .sendPacket(new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.INITIALIZE)); + playerIn.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(worldIn.getTotalWorldTime(), + worldIn.getWorldTime(), worldIn.getGameRules().getBoolean("doDaylightCycle"))); + if (worldIn.isRaining()) { + playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); + playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, worldIn.getRainStrength(1.0F))); + playerIn.playerNetServerHandler + .sendPacket(new S2BPacketChangeGameState(8, worldIn.getThunderStrength(1.0F))); + } + + } + + /**+ + * sends the players inventory to himself + */ + public void syncPlayerInventory(EntityPlayerMP playerIn) { + playerIn.sendContainerToPlayer(playerIn.inventoryContainer); + playerIn.setPlayerHealthUpdated(); + playerIn.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(playerIn.inventory.currentItem)); + } + + /**+ + * Returns the number of players currently on the server. + */ + public int getCurrentPlayerCount() { + return this.playerEntityList.size(); + } + + /**+ + * Returns the maximum number of players allowed on the server. + */ + public int getMaxPlayers() { + return this.maxPlayers; + } + + /**+ + * Returns an array of usernames for which player.dat exists + * for. + */ + public String[] getAvailablePlayerDat() { + return this.mcServer.worldServers[0].getSaveHandler().getPlayerNBTManager().getAvailablePlayerDat(); + } + + public void setWhiteListEnabled(boolean flag) { + this.whiteListEnforced = flag; + } + + public List getPlayersMatchingAddress(String address) { + ArrayList arraylist = Lists.newArrayList(); + + for (EntityPlayerMP entityplayermp : this.playerEntityList) { + if (entityplayermp.getPlayerIP().equals(address)) { + arraylist.add(entityplayermp); + } + } + + return arraylist; + } + + /**+ + * Gets the View Distance. + */ + public int getViewDistance() { + return this.viewDistance; + } + + public MinecraftServer getServerInstance() { + return this.mcServer; + } + + /**+ + * On integrated servers, returns the host's player data to be + * written to level.dat. + */ + public NBTTagCompound getHostPlayerData() { + return null; + } + + public void setGameType(WorldSettings.GameType parGameType) { + this.gameType = parGameType; + } + + private void setPlayerGameTypeBasedOnOther(EntityPlayerMP worldIn, EntityPlayerMP parEntityPlayerMP2, + World parWorld) { + if (parEntityPlayerMP2 == null || parEntityPlayerMP2.getName().equals(mcServer.getServerOwner())) { + if (parEntityPlayerMP2 != null) { + worldIn.theItemInWorldManager.setGameType(parEntityPlayerMP2.theItemInWorldManager.getGameType()); + } else if (this.gameType != null) { + worldIn.theItemInWorldManager.setGameType(this.gameType); + } + + worldIn.theItemInWorldManager.initializeGameType(parWorld.getWorldInfo().getGameType()); + } else { + parEntityPlayerMP2.theItemInWorldManager.setGameType(lanGamemode); + } + } + + /**+ + * Sets whether all players are allowed to use commands (cheats) + * on the server. + */ + public void setCommandsAllowedForAll(boolean parFlag) { + this.commandsAllowedForAll = parFlag; + } + + /**+ + * Kicks everyone with "Server closed" as reason. + */ + public void removeAllPlayers() { + for (int i = 0; i < this.playerEntityList.size(); ++i) { + ((EntityPlayerMP) this.playerEntityList.get(i)).playerNetServerHandler + .kickPlayerFromServer("Server closed"); + } + + } + + public void sendChatMsgImpl(IChatComponent component, boolean isChat) { + this.mcServer.addChatMessage(component); + int i = isChat ? 1 : 0; + this.sendPacketToAllPlayers(new S02PacketChat(component, (byte) i)); + } + + /**+ + * Sends the given string to every player as chat message. + */ + public void sendChatMsg(IChatComponent component) { + this.sendChatMsgImpl(component, true); + } + + public StatisticsFile getPlayerStatsFile(EntityPlayer playerIn) { + String name = playerIn.getName(); + StatisticsFile statisticsfile = (StatisticsFile) this.playerStatFiles.get(name); + if (statisticsfile == null) { + VFile2 file1 = new VFile2(this.mcServer.worldServerForDimension(0).getSaveHandler().getWorldDirectory(), + "stats"); + VFile2 file2 = new VFile2(file1, name + ".json"); + statisticsfile = new StatisticsFile(this.mcServer, file2); + statisticsfile.readStatFile(); + this.playerStatFiles.put(name, statisticsfile); + } + + return statisticsfile; + } + + public void setViewDistance(int distance) { + this.viewDistance = distance; + if (this.mcServer.worldServers != null) { + for (WorldServer worldserver : this.mcServer.worldServers) { + if (worldserver != null) { + worldserver.getPlayerManager().setPlayerViewRadius(distance); + } + } + } + } + + public List func_181057_v() { + return this.playerEntityList; + } + + /**+ + * Get's the EntityPlayerMP object representing the player with + * the UUID. + */ + public EntityPlayerMP getPlayerByUUID(EaglercraftUUID playerUUID) { + return (EntityPlayerMP) this.uuidToPlayerMap.get(playerUUID); + } + + public boolean func_183023_f(GameProfile var1) { + return false; + } + + public void updatePlayerViewDistance(EntityPlayerMP entityPlayerMP, int viewDistance2) { + if (entityPlayerMP.getName().equals(mcServer.getServerOwner())) { + if (viewDistance != viewDistance2) { + logger.info("Owner is setting view distance: {}", viewDistance2); + setViewDistance(viewDistance2); + } + } + } + + public void configureLAN(int gamemode, boolean cheats) { + lanGamemode = WorldSettings.GameType.getByID(gamemode); + lanCheats = cheats; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/network/NetHandlerLoginServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/network/NetHandlerLoginServer.java new file mode 100644 index 0000000..142e04c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/network/NetHandlerLoginServer.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.network; + +import com.google.common.base.Charsets; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.EnumConnectionState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.INetHandlerLoginServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client.C00PacketLoginStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S00PacketDisconnect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.socket.IntegratedServerPlayerNetworkManager; + +import org.apache.commons.lang3.Validate; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NetHandlerLoginServer implements INetHandlerLoginServer, ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/server/network/NetHandlerLoginServer"); + } + + private static final Logger logger = LogManager.getLogger(); + private static final EaglercraftRandom RANDOM = new EaglercraftRandom(); + private final byte[] verifyToken = new byte[4]; + private final MinecraftServer server; + public final IntegratedServerPlayerNetworkManager networkManager; + private NetHandlerLoginServer.LoginState currentLoginState = NetHandlerLoginServer.LoginState.HELLO; + private int connectionTimer; + private GameProfile loginGameProfile; + private byte[] loginSkinPacket; + private String serverId = ""; + private EntityPlayerMP field_181025_l; + + public NetHandlerLoginServer(MinecraftServer parMinecraftServer, + IntegratedServerPlayerNetworkManager parNetworkManager) { + this.server = parMinecraftServer; + this.networkManager = parNetworkManager; + RANDOM.nextBytes(this.verifyToken); + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + if (this.currentLoginState == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) { + this.tryAcceptPlayer(); + } else if (this.currentLoginState == NetHandlerLoginServer.LoginState.DELAY_ACCEPT) { + EntityPlayerMP entityplayermp = this.server.getConfigurationManager() + .getPlayerByUUID(this.loginGameProfile.getId()); + if (entityplayermp == null) { + this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, + this.field_181025_l); + ((EaglerMinecraftServer) field_181025_l.mcServer).getSkinService() + .processLoginPacket(this.loginSkinPacket, field_181025_l); + this.field_181025_l = null; + } + } + + if (this.connectionTimer++ == 600) { + this.closeConnection("Took too long to log in"); + } + + } + + public void closeConnection(String reason) { + try { + logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason); + ChatComponentText chatcomponenttext = new ChatComponentText(reason); + this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext)); + this.networkManager.closeChannel(chatcomponenttext); + } catch (Exception exception) { + logger.error("Error whilst disconnecting player", exception); + } + + } + + public void tryAcceptPlayer() { + String s = this.server.getConfigurationManager().allowUserToConnect(this.loginGameProfile); + if (s != null) { + this.closeConnection(s); + } else { + this.currentLoginState = NetHandlerLoginServer.LoginState.ACCEPTED; + this.networkManager.sendPacket(new S02PacketLoginSuccess(this.loginGameProfile)); + this.networkManager.setConnectionState(EnumConnectionState.PLAY); + EntityPlayerMP entityplayermp = this.server.getConfigurationManager() + .getPlayerByUUID(this.loginGameProfile.getId()); + if (entityplayermp != null) { + this.currentLoginState = NetHandlerLoginServer.LoginState.DELAY_ACCEPT; + this.field_181025_l = this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile); + } else { + entityplayermp = this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile); + this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, entityplayermp); + ((EaglerMinecraftServer) entityplayermp.mcServer).getSkinService() + .processLoginPacket(this.loginSkinPacket, entityplayermp); + } + } + + } + + /**+ + * Invoked when disconnecting, the parameter is a ChatComponent + * describing the reason for termination + */ + public void onDisconnect(IChatComponent ichatcomponent) { + logger.info(this.getConnectionInfo() + " lost connection: " + ichatcomponent.getUnformattedText()); + } + + public String getConnectionInfo() { + return this.loginGameProfile != null + ? this.loginGameProfile.toString() + " (channel:" + this.networkManager.playerChannel + ")" + : ("channel:" + this.networkManager.playerChannel); + } + + public void processLoginStart(C00PacketLoginStart c00packetloginstart) { + Validate.validState(this.currentLoginState == NetHandlerLoginServer.LoginState.HELLO, "Unexpected hello packet", + new Object[0]); + this.loginGameProfile = this.getOfflineProfile(c00packetloginstart.getProfile()); + this.loginSkinPacket = c00packetloginstart.getSkin(); + this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + + public void processEncryptionResponse(C01PacketEncryptionResponse c01packetencryptionresponse) { + + } + + protected GameProfile getOfflineProfile(GameProfile original) { + EaglercraftUUID uuid = EaglercraftUUID + .nameUUIDFromBytes(("OfflinePlayer:" + original.getName()).getBytes(Charsets.UTF_8)); + return new GameProfile(uuid, original.getName()); + } + + static enum LoginState { + HELLO, KEY, AUTHENTICATING, READY_TO_ACCEPT, DELAY_ACCEPT, ACCEPTED; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/Achievement.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/Achievement.java new file mode 100644 index 0000000..456c34f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/Achievement.java @@ -0,0 +1,157 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.IStatStringFormat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IJsonSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Achievement extends StatBase { + + static { + __checkIntegratedContextValid("net/minecraft/stats/Achievement"); + } + + public final int displayColumn; + public final int displayRow; + public final Achievement parentAchievement; + private final String achievementDescription; + private IStatStringFormat statStringFormatter; + public final ItemStack theItemStack; + private boolean isSpecial; + + public Achievement(String parString1, String parString2, int column, int row, Item parItem, Achievement parent) { + this(parString1, parString2, column, row, new ItemStack(parItem), parent); + } + + public Achievement(String parString1, String parString2, int column, int row, Block parBlock, Achievement parent) { + this(parString1, parString2, column, row, new ItemStack(parBlock), parent); + } + + public Achievement(String parString1, String parString2, int column, int row, ItemStack parItemStack, + Achievement parent) { + super(parString1, new ChatComponentTranslation("achievement." + parString2, new Object[0])); + this.theItemStack = parItemStack; + this.achievementDescription = "achievement." + parString2 + ".desc"; + this.displayColumn = column; + this.displayRow = row; + if (column < AchievementList.minDisplayColumn) { + AchievementList.minDisplayColumn = column; + } + + if (row < AchievementList.minDisplayRow) { + AchievementList.minDisplayRow = row; + } + + if (column > AchievementList.maxDisplayColumn) { + AchievementList.maxDisplayColumn = column; + } + + if (row > AchievementList.maxDisplayRow) { + AchievementList.maxDisplayRow = row; + } + + this.parentAchievement = parent; + } + + /**+ + * Initializes the current stat as independent (i.e., lacking + * prerequisites for being updated) and returns the current + * instance. + */ + public Achievement initIndependentStat() { + this.isIndependent = true; + return this; + } + + /**+ + * Special achievements have a 'spiked' (on normal texture pack) + * frame, special achievements are the hardest ones to achieve. + */ + public Achievement setSpecial() { + this.isSpecial = true; + return this; + } + + /**+ + * Register the stat into StatList. + */ + public Achievement registerStat() { + super.registerStat(); + AchievementList.achievementList.add(this); + return this; + } + + /**+ + * Returns whether or not the StatBase-derived class is a + * statistic (running counter) or an achievement (one-shot). + */ + public boolean isAchievement() { + return true; + } + + public IChatComponent getStatName() { + IChatComponent ichatcomponent = super.getStatName(); + ichatcomponent.getChatStyle() + .setColor(this.getSpecial() ? EnumChatFormatting.DARK_PURPLE : EnumChatFormatting.GREEN); + return ichatcomponent; + } + + public Achievement func_150953_b(Class parClass1) { + return (Achievement) super.func_150953_b(parClass1); + } + + /**+ + * Returns the fully description of the achievement - ready to + * be displayed on screen. + */ + public String getDescription() { + return this.statStringFormatter != null + ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) + : StatCollector.translateToLocal(this.achievementDescription); + } + + /**+ + * Defines a string formatter for the achievement. + */ + public Achievement setStatStringFormatter(IStatStringFormat parIStatStringFormat) { + this.statStringFormatter = parIStatStringFormat; + return this; + } + + /**+ + * Special achievements have a 'spiked' (on normal texture pack) + * frame, special achievements are the hardest ones to achieve. + */ + public boolean getSpecial() { + return this.isSpecial; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/AchievementList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/AchievementList.java new file mode 100644 index 0000000..29ad87e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/AchievementList.java @@ -0,0 +1,215 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.Achievement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.JsonSerializableSet; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 AchievementList { + + static { + __checkIntegratedContextValid("net/minecraft/stats/AchievementList"); + } + + public static int minDisplayColumn; + public static int minDisplayRow; + public static int maxDisplayColumn; + public static int maxDisplayRow; + /**+ + * The list holding all achievements + */ + public static List achievementList = Lists.newArrayList(); + /**+ + * Is the 'open inventory' achievement. + */ + public static Achievement openInventory = (new Achievement("achievement.openInventory", "openInventory", 0, 0, + Items.book, (Achievement) null)).initIndependentStat().registerStat(); + /**+ + * Is the 'getting wood' achievement. + */ + public static Achievement mineWood = (new Achievement("achievement.mineWood", "mineWood", 2, 1, Blocks.log, + openInventory)).registerStat(); + /**+ + * Is the 'benchmarking' achievement. + */ + public static Achievement buildWorkBench = (new Achievement("achievement.buildWorkBench", "buildWorkBench", 4, -1, + Blocks.crafting_table, mineWood)).registerStat(); + /**+ + * Is the 'time to mine' achievement. + */ + public static Achievement buildPickaxe = (new Achievement("achievement.buildPickaxe", "buildPickaxe", 4, 2, + Items.wooden_pickaxe, buildWorkBench)).registerStat(); + /**+ + * Is the 'hot topic' achievement. + */ + public static Achievement buildFurnace = (new Achievement("achievement.buildFurnace", "buildFurnace", 3, 4, + Blocks.furnace, buildPickaxe)).registerStat(); + /**+ + * Is the 'acquire hardware' achievement. + */ + public static Achievement acquireIron = (new Achievement("achievement.acquireIron", "acquireIron", 1, 4, + Items.iron_ingot, buildFurnace)).registerStat(); + /**+ + * Is the 'time to farm' achievement. + */ + public static Achievement buildHoe = (new Achievement("achievement.buildHoe", "buildHoe", 2, -3, Items.wooden_hoe, + buildWorkBench)).registerStat(); + /**+ + * Is the 'bake bread' achievement. + */ + public static Achievement makeBread = (new Achievement("achievement.makeBread", "makeBread", -1, -3, Items.bread, + buildHoe)).registerStat(); + /**+ + * Is the 'the lie' achievement. + */ + public static Achievement bakeCake = (new Achievement("achievement.bakeCake", "bakeCake", 0, -5, Items.cake, + buildHoe)).registerStat(); + /**+ + * Is the 'getting a upgrade' achievement. + */ + public static Achievement buildBetterPickaxe = (new Achievement("achievement.buildBetterPickaxe", + "buildBetterPickaxe", 6, 2, Items.stone_pickaxe, buildPickaxe)).registerStat(); + /**+ + * Is the 'delicious fish' achievement. + */ + public static Achievement cookFish = (new Achievement("achievement.cookFish", "cookFish", 2, 6, Items.cooked_fish, + buildFurnace)).registerStat(); + /**+ + * Is the 'on a rail' achievement + */ + public static Achievement onARail = (new Achievement("achievement.onARail", "onARail", 2, 3, Blocks.rail, + acquireIron)).setSpecial().registerStat(); + /**+ + * Is the 'time to strike' achievement. + */ + public static Achievement buildSword = (new Achievement("achievement.buildSword", "buildSword", 6, -1, + Items.wooden_sword, buildWorkBench)).registerStat(); + /**+ + * Is the 'monster hunter' achievement. + */ + public static Achievement killEnemy = (new Achievement("achievement.killEnemy", "killEnemy", 8, -1, Items.bone, + buildSword)).registerStat(); + /**+ + * is the 'cow tipper' achievement. + */ + public static Achievement killCow = (new Achievement("achievement.killCow", "killCow", 7, -3, Items.leather, + buildSword)).registerStat(); + /**+ + * Is the 'when pig fly' achievement. + */ + public static Achievement flyPig = (new Achievement("achievement.flyPig", "flyPig", 9, -3, Items.saddle, killCow)) + .setSpecial().registerStat(); + /**+ + * The achievement for killing a Skeleton from 50 meters aways. + */ + public static Achievement snipeSkeleton = (new Achievement("achievement.snipeSkeleton", "snipeSkeleton", 7, 0, + Items.bow, killEnemy)).setSpecial().registerStat(); + /**+ + * Is the 'DIAMONDS!' achievement + */ + public static Achievement diamonds = (new Achievement("achievement.diamonds", "diamonds", -1, 5, Blocks.diamond_ore, + acquireIron)).registerStat(); + public static Achievement diamondsToYou = (new Achievement("achievement.diamondsToYou", "diamondsToYou", -1, 2, + Items.diamond, diamonds)).registerStat(); + /**+ + * Is the 'We Need to Go Deeper' achievement + */ + public static Achievement portal = (new Achievement("achievement.portal", "portal", -1, 7, Blocks.obsidian, + diamonds)).registerStat(); + /**+ + * Is the 'Return to Sender' achievement + */ + public static Achievement ghast = (new Achievement("achievement.ghast", "ghast", -4, 8, Items.ghast_tear, portal)) + .setSpecial().registerStat(); + /**+ + * Is the 'Into Fire' achievement + */ + public static Achievement blazeRod = (new Achievement("achievement.blazeRod", "blazeRod", 0, 9, Items.blaze_rod, + portal)).registerStat(); + /**+ + * Is the 'Local Brewery' achievement + */ + public static Achievement potion = (new Achievement("achievement.potion", "potion", 2, 8, Items.potionitem, + blazeRod)).registerStat(); + /**+ + * Is the 'The End?' achievement + */ + public static Achievement theEnd = (new Achievement("achievement.theEnd", "theEnd", 3, 10, Items.ender_eye, + blazeRod)).setSpecial().registerStat(); + /**+ + * Is the 'The End.' achievement + */ + public static Achievement theEnd2 = (new Achievement("achievement.theEnd2", "theEnd2", 4, 13, Blocks.dragon_egg, + theEnd)).setSpecial().registerStat(); + /**+ + * Is the 'Enchanter' achievement + */ + public static Achievement enchantments = (new Achievement("achievement.enchantments", "enchantments", -4, 4, + Blocks.enchanting_table, diamonds)).registerStat(); + public static Achievement overkill = (new Achievement("achievement.overkill", "overkill", -4, 1, + Items.diamond_sword, enchantments)).setSpecial().registerStat(); + /**+ + * Is the 'Librarian' achievement + */ + public static Achievement bookcase = (new Achievement("achievement.bookcase", "bookcase", -3, 6, Blocks.bookshelf, + enchantments)).registerStat(); + /**+ + * Is the 'Repopulation' achievement + */ + public static Achievement breedCow = (new Achievement("achievement.breedCow", "breedCow", 7, -5, Items.wheat, + killCow)).registerStat(); + /**+ + * Is the 'The Beginning?' achievement + */ + public static Achievement spawnWither = (new Achievement("achievement.spawnWither", "spawnWither", 7, 12, + new ItemStack(Items.skull, 1, 1), theEnd2)).registerStat(); + /**+ + * Is the 'The Beginning.' achievement + */ + public static Achievement killWither = (new Achievement("achievement.killWither", "killWither", 7, 10, + Items.nether_star, spawnWither)).registerStat(); + /**+ + * Is the 'Beaconator' achievement + */ + public static Achievement fullBeacon = (new Achievement("achievement.fullBeacon", "fullBeacon", 7, 8, Blocks.beacon, + killWither)).setSpecial().registerStat(); + /**+ + * Is the 'Adventuring Time' achievement + */ + public static Achievement exploreAllBiomes = (new Achievement("achievement.exploreAllBiomes", "exploreAllBiomes", 4, + 8, Items.diamond_boots, theEnd)).func_150953_b(JsonSerializableSet.class).setSpecial().registerStat(); + public static Achievement overpowered = (new Achievement("achievement.overpowered", "overpowered", 6, 4, + new ItemStack(Items.golden_apple, 1, 1), buildBetterPickaxe)).setSpecial().registerStat(); + + /**+ + * A stub functions called to make the static initializer for + * this class run. + */ + public static void init() { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatStringFormat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatStringFormat.java new file mode 100644 index 0000000..b200843 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatStringFormat.java @@ -0,0 +1,28 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IStatStringFormat { + /**+ + * Formats the strings based on 'IStatStringFormat' interface. + */ + String formatString(String var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatType.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatType.java new file mode 100644 index 0000000..aba38f7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatType.java @@ -0,0 +1,28 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IStatType { + /**+ + * Formats a given stat for human consumption. + */ + String format(int var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/ObjectiveStat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/ObjectiveStat.java new file mode 100644 index 0000000..54d67d4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/ObjectiveStat.java @@ -0,0 +1,40 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreDummyCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ObjectiveStat extends ScoreDummyCriteria { + + static { + __checkIntegratedContextValid("net/minecraft/stats/ObjectiveStat"); + } + + private final StatBase field_151459_g; + + public ObjectiveStat(StatBase parStatBase) { + super(parStatBase.statId); + this.field_151459_g = parStatBase; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBase.java new file mode 100644 index 0000000..1575ca3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBase.java @@ -0,0 +1,180 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.HoverEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.IStatType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.ObjectiveStat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IJsonSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatBase { + + static { + __checkIntegratedContextValid("net/minecraft/stats/StatBase"); + } + + public final String statId; + private final IChatComponent statName; + public boolean isIndependent; + private final IStatType type; + private final IScoreObjectiveCriteria field_150957_c; + private Class field_150956_d; + private static NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.US); + public static IStatType simpleStatType = new IStatType() { + public String format(int parInt1) { + return StatBase.numberFormat.format((long) parInt1); + } + }; + private static DecimalFormat decimalFormat = new DecimalFormat("########0.00"); + public static IStatType timeStatType = new IStatType() { + public String format(int i) { + double d0 = (double) i / 20.0D; + double d1 = d0 / 60.0D; + double d2 = d1 / 60.0D; + double d3 = d2 / 24.0D; + double d4 = d3 / 365.0D; + return d4 > 0.5D ? StatBase.decimalFormat.format(d4) + " y" + : (d3 > 0.5D ? StatBase.decimalFormat.format(d3) + " d" + : (d2 > 0.5D ? StatBase.decimalFormat.format(d2) + " h" + : (d1 > 0.5D ? StatBase.decimalFormat.format(d1) + " m" : d0 + " s"))); + } + }; + public static IStatType distanceStatType = new IStatType() { + public String format(int i) { + double d0 = (double) i / 100.0D; + double d1 = d0 / 1000.0D; + return d1 > 0.5D ? StatBase.decimalFormat.format(d1) + " km" + : (d0 > 0.5D ? StatBase.decimalFormat.format(d0) + " m" : i + " cm"); + } + }; + public static IStatType field_111202_k = new IStatType() { + public String format(int i) { + return StatBase.decimalFormat.format((double) i * 0.1D); + } + }; + + public StatBase(String statIdIn, IChatComponent statNameIn, IStatType typeIn) { + this.statId = statIdIn; + this.statName = statNameIn; + this.type = typeIn; + this.field_150957_c = new ObjectiveStat(this); + IScoreObjectiveCriteria.INSTANCES.put(this.field_150957_c.getName(), this.field_150957_c); + } + + public StatBase(String statIdIn, IChatComponent statNameIn) { + this(statIdIn, statNameIn, simpleStatType); + } + + /**+ + * Initializes the current stat as independent (i.e., lacking + * prerequisites for being updated) and returns the current + * instance. + */ + public StatBase initIndependentStat() { + this.isIndependent = true; + return this; + } + + /**+ + * Register the stat into StatList. + */ + public StatBase registerStat() { + if (StatList.oneShotStats.containsKey(this.statId)) { + throw new RuntimeException( + "Duplicate stat id: \"" + ((StatBase) StatList.oneShotStats.get(this.statId)).statName + "\" and \"" + + this.statName + "\" at id " + this.statId); + } else { + StatList.allStats.add(this); + StatList.oneShotStats.put(this.statId, this); + return this; + } + } + + /**+ + * Returns whether or not the StatBase-derived class is a + * statistic (running counter) or an achievement (one-shot). + */ + public boolean isAchievement() { + return false; + } + + public String format(int parInt1) { + return this.type.format(parInt1); + } + + public IChatComponent getStatName() { + IChatComponent ichatcomponent = this.statName.createCopy(); + ichatcomponent.getChatStyle().setColor(EnumChatFormatting.GRAY); + ichatcomponent.getChatStyle().setChatHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_ACHIEVEMENT, new ChatComponentText(this.statId))); + return ichatcomponent; + } + + public IChatComponent func_150955_j() { + IChatComponent ichatcomponent = this.getStatName(); + IChatComponent ichatcomponent1 = (new ChatComponentText("[")).appendSibling(ichatcomponent).appendText("]"); + ichatcomponent1.setChatStyle(ichatcomponent.getChatStyle()); + return ichatcomponent1; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + StatBase statbase = (StatBase) object; + return this.statId.equals(statbase.statId); + } else { + return false; + } + } + + public int hashCode() { + return this.statId.hashCode(); + } + + public String toString() { + return "Stat{id=" + this.statId + ", nameId=" + this.statName + ", awardLocallyOnly=" + this.isIndependent + + ", formatter=" + this.type + ", objectiveCriteria=" + this.field_150957_c + '}'; + } + + public IScoreObjectiveCriteria func_150952_k() { + return this.field_150957_c; + } + + public Class func_150954_l() { + return this.field_150956_d; + } + + public StatBase func_150953_b(Class oclass) { + this.field_150956_d = oclass; + return this; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBasic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBasic.java new file mode 100644 index 0000000..ad6a123 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBasic.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.IStatType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatBasic extends StatBase { + + static { + __checkIntegratedContextValid("net/minecraft/stats/StatBasic"); + } + + public StatBasic(String statIdIn, IChatComponent statNameIn, IStatType typeIn) { + super(statIdIn, statNameIn, typeIn); + } + + public StatBasic(String statIdIn, IChatComponent statNameIn) { + super(statIdIn, statNameIn); + } + + /**+ + * Register the stat into StatList. + */ + public StatBase registerStat() { + super.registerStat(); + StatList.generalStats.add(this); + return this; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatCrafting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatCrafting.java new file mode 100644 index 0000000..5f0ce12 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatCrafting.java @@ -0,0 +1,51 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatCrafting extends StatBase { + + static { + __checkIntegratedContextValid("net/minecraft/stats/StatCrafting"); + } + + private final Item field_150960_a; + + public StatCrafting(String parString1, String parString2, IChatComponent statNameIn, Item parItem) { + super(parString1 + parString2, statNameIn); + this.field_150960_a = parItem; + int i = Item.getIdFromItem(parItem); + if (i != 0) { + IScoreObjectiveCriteria.INSTANCES.put(parString1 + i, this.func_150952_k()); + } + + } + + public Item func_150959_a() { + return this.field_150960_a; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatFileWriter.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatFileWriter.java new file mode 100644 index 0000000..cda13c2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatFileWriter.java @@ -0,0 +1,116 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import com.google.common.collect.Maps; + +import java.util.HashMap; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.Achievement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IJsonSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.TupleIntJsonSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatFileWriter { + + static { + __checkIntegratedContextValid("net/minecraft/stats/StatFileWriter"); + } + + protected final Map statsData = new HashMap(); + + /**+ + * Returns true if the achievement has been unlocked. + */ + public boolean hasAchievementUnlocked(Achievement achievementIn) { + return this.readStat(achievementIn) > 0; + } + + /**+ + * Returns true if the parent has been unlocked, or there is no + * parent + */ + public boolean canUnlockAchievement(Achievement achievementIn) { + return achievementIn.parentAchievement == null || this.hasAchievementUnlocked(achievementIn.parentAchievement); + } + + public int func_150874_c(Achievement parAchievement) { + if (this.hasAchievementUnlocked(parAchievement)) { + return 0; + } else { + int i = 0; + + for (Achievement achievement = parAchievement.parentAchievement; achievement != null + && !this.hasAchievementUnlocked(achievement); ++i) { + achievement = achievement.parentAchievement; + } + + return i; + } + } + + public void increaseStat(EntityPlayer player, StatBase stat, int amount) { + if (!stat.isAchievement() || this.canUnlockAchievement((Achievement) stat)) { + this.unlockAchievement(player, stat, this.readStat(stat) + amount); + } + } + + /**+ + * Triggers the logging of an achievement and attempts to + * announce to server + */ + public void unlockAchievement(EntityPlayer var1, StatBase statbase, int i) { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable) this.statsData.get(statbase); + if (tupleintjsonserializable == null) { + tupleintjsonserializable = new TupleIntJsonSerializable(); + this.statsData.put(statbase, tupleintjsonserializable); + } + + tupleintjsonserializable.setIntegerValue(i); + } + + /**+ + * Reads the given stat and returns its value as an int. + */ + public int readStat(StatBase stat) { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable) this.statsData.get(stat); + return tupleintjsonserializable == null ? 0 : tupleintjsonserializable.getIntegerValue(); + } + + public T func_150870_b(StatBase parStatBase) { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable) this.statsData.get(parStatBase); + return (T) (tupleintjsonserializable != null ? tupleintjsonserializable.getJsonSerializableValue() : null); + } + + public T func_150872_a(StatBase parStatBase, T parIJsonSerializable) { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable) this.statsData.get(parStatBase); + if (tupleintjsonserializable == null) { + tupleintjsonserializable = new TupleIntJsonSerializable(); + this.statsData.put(parStatBase, tupleintjsonserializable); + } + + tupleintjsonserializable.setJsonSerializableValue(parIJsonSerializable); + return (T) parIJsonSerializable; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatList.java new file mode 100644 index 0000000..3a3e3d3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatList.java @@ -0,0 +1,403 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.CraftingManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.FurnaceRecipes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.IRecipe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBasic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatCrafting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatList { + + static { + __checkIntegratedContextValid("net/minecraft/stats/StatList"); + } + + protected static Map oneShotStats = Maps.newHashMap(); + public static List allStats = Lists.newArrayList(); + public static List generalStats = Lists.newArrayList(); + public static List itemStats = Lists.newArrayList(); + /**+ + * Tracks the number of times a given block or item has been + * mined. + */ + public static List objectMineStats = Lists.newArrayList(); + /**+ + * number of times you've left a game + */ + public static StatBase leaveGameStat = (new StatBasic("stat.leaveGame", + new ChatComponentTranslation("stat.leaveGame", new Object[0]))).initIndependentStat().registerStat(); + /**+ + * number of minutes you have played + */ + public static StatBase minutesPlayedStat = (new StatBasic("stat.playOneMinute", + new ChatComponentTranslation("stat.playOneMinute", new Object[0]), StatBase.timeStatType)) + .initIndependentStat().registerStat(); + public static StatBase timeSinceDeathStat = (new StatBasic("stat.timeSinceDeath", + new ChatComponentTranslation("stat.timeSinceDeath", new Object[0]), StatBase.timeStatType)) + .initIndependentStat().registerStat(); + /**+ + * distance you've walked + */ + public static StatBase distanceWalkedStat = (new StatBasic("stat.walkOneCm", + new ChatComponentTranslation("stat.walkOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + public static StatBase distanceCrouchedStat = (new StatBasic("stat.crouchOneCm", + new ChatComponentTranslation("stat.crouchOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + public static StatBase distanceSprintedStat = (new StatBasic("stat.sprintOneCm", + new ChatComponentTranslation("stat.sprintOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * distance you have swam + */ + public static StatBase distanceSwumStat = (new StatBasic("stat.swimOneCm", + new ChatComponentTranslation("stat.swimOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you have fallen + */ + public static StatBase distanceFallenStat = (new StatBasic("stat.fallOneCm", + new ChatComponentTranslation("stat.fallOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you've climbed + */ + public static StatBase distanceClimbedStat = (new StatBasic("stat.climbOneCm", + new ChatComponentTranslation("stat.climbOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you've flown + */ + public static StatBase distanceFlownStat = (new StatBasic("stat.flyOneCm", + new ChatComponentTranslation("stat.flyOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you've dived + */ + public static StatBase distanceDoveStat = (new StatBasic("stat.diveOneCm", + new ChatComponentTranslation("stat.diveOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you've traveled by minecart + */ + public static StatBase distanceByMinecartStat = (new StatBasic("stat.minecartOneCm", + new ChatComponentTranslation("stat.minecartOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you've traveled by boat + */ + public static StatBase distanceByBoatStat = (new StatBasic("stat.boatOneCm", + new ChatComponentTranslation("stat.boatOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the distance you've traveled by pig + */ + public static StatBase distanceByPigStat = (new StatBasic("stat.pigOneCm", + new ChatComponentTranslation("stat.pigOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + public static StatBase distanceByHorseStat = (new StatBasic("stat.horseOneCm", + new ChatComponentTranslation("stat.horseOneCm", new Object[0]), StatBase.distanceStatType)) + .initIndependentStat().registerStat(); + /**+ + * the times you've jumped + */ + public static StatBase jumpStat = (new StatBasic("stat.jump", + new ChatComponentTranslation("stat.jump", new Object[0]))).initIndependentStat().registerStat(); + /**+ + * the distance you've dropped (or times you've fallen?) + */ + public static StatBase dropStat = (new StatBasic("stat.drop", + new ChatComponentTranslation("stat.drop", new Object[0]))).initIndependentStat().registerStat(); + /**+ + * the amount of damage you've dealt + */ + public static StatBase damageDealtStat = (new StatBasic("stat.damageDealt", + new ChatComponentTranslation("stat.damageDealt", new Object[0]), StatBase.field_111202_k)).registerStat(); + /**+ + * the amount of damage you have taken + */ + public static StatBase damageTakenStat = (new StatBasic("stat.damageTaken", + new ChatComponentTranslation("stat.damageTaken", new Object[0]), StatBase.field_111202_k)).registerStat(); + /**+ + * the number of times you have died + */ + public static StatBase deathsStat = (new StatBasic("stat.deaths", + new ChatComponentTranslation("stat.deaths", new Object[0]))).registerStat(); + /**+ + * the number of mobs you have killed + */ + public static StatBase mobKillsStat = (new StatBasic("stat.mobKills", + new ChatComponentTranslation("stat.mobKills", new Object[0]))).registerStat(); + /**+ + * the number of animals you have bred + */ + public static StatBase animalsBredStat = (new StatBasic("stat.animalsBred", + new ChatComponentTranslation("stat.animalsBred", new Object[0]))).registerStat(); + /**+ + * counts the number of times you've killed a player + */ + public static StatBase playerKillsStat = (new StatBasic("stat.playerKills", + new ChatComponentTranslation("stat.playerKills", new Object[0]))).registerStat(); + public static StatBase fishCaughtStat = (new StatBasic("stat.fishCaught", + new ChatComponentTranslation("stat.fishCaught", new Object[0]))).registerStat(); + public static StatBase junkFishedStat = (new StatBasic("stat.junkFished", + new ChatComponentTranslation("stat.junkFished", new Object[0]))).registerStat(); + public static StatBase treasureFishedStat = (new StatBasic("stat.treasureFished", + new ChatComponentTranslation("stat.treasureFished", new Object[0]))).registerStat(); + public static StatBase timesTalkedToVillagerStat = (new StatBasic("stat.talkedToVillager", + new ChatComponentTranslation("stat.talkedToVillager", new Object[0]))).registerStat(); + public static StatBase timesTradedWithVillagerStat = (new StatBasic("stat.tradedWithVillager", + new ChatComponentTranslation("stat.tradedWithVillager", new Object[0]))).registerStat(); + public static StatBase field_181724_H = (new StatBasic("stat.cakeSlicesEaten", + new ChatComponentTranslation("stat.cakeSlicesEaten", new Object[0]))).registerStat(); + public static StatBase field_181725_I = (new StatBasic("stat.cauldronFilled", + new ChatComponentTranslation("stat.cauldronFilled", new Object[0]))).registerStat(); + public static StatBase field_181726_J = (new StatBasic("stat.cauldronUsed", + new ChatComponentTranslation("stat.cauldronUsed", new Object[0]))).registerStat(); + public static StatBase field_181727_K = (new StatBasic("stat.armorCleaned", + new ChatComponentTranslation("stat.armorCleaned", new Object[0]))).registerStat(); + public static StatBase field_181728_L = (new StatBasic("stat.bannerCleaned", + new ChatComponentTranslation("stat.bannerCleaned", new Object[0]))).registerStat(); + public static StatBase field_181729_M = (new StatBasic("stat.brewingstandInteraction", + new ChatComponentTranslation("stat.brewingstandInteraction", new Object[0]))).registerStat(); + public static StatBase field_181730_N = (new StatBasic("stat.beaconInteraction", + new ChatComponentTranslation("stat.beaconInteraction", new Object[0]))).registerStat(); + public static StatBase field_181731_O = (new StatBasic("stat.dropperInspected", + new ChatComponentTranslation("stat.dropperInspected", new Object[0]))).registerStat(); + public static StatBase field_181732_P = (new StatBasic("stat.hopperInspected", + new ChatComponentTranslation("stat.hopperInspected", new Object[0]))).registerStat(); + public static StatBase field_181733_Q = (new StatBasic("stat.dispenserInspected", + new ChatComponentTranslation("stat.dispenserInspected", new Object[0]))).registerStat(); + public static StatBase field_181734_R = (new StatBasic("stat.noteblockPlayed", + new ChatComponentTranslation("stat.noteblockPlayed", new Object[0]))).registerStat(); + public static StatBase field_181735_S = (new StatBasic("stat.noteblockTuned", + new ChatComponentTranslation("stat.noteblockTuned", new Object[0]))).registerStat(); + public static StatBase field_181736_T = (new StatBasic("stat.flowerPotted", + new ChatComponentTranslation("stat.flowerPotted", new Object[0]))).registerStat(); + public static StatBase field_181737_U = (new StatBasic("stat.trappedChestTriggered", + new ChatComponentTranslation("stat.trappedChestTriggered", new Object[0]))).registerStat(); + public static StatBase field_181738_V = (new StatBasic("stat.enderchestOpened", + new ChatComponentTranslation("stat.enderchestOpened", new Object[0]))).registerStat(); + public static StatBase field_181739_W = (new StatBasic("stat.itemEnchanted", + new ChatComponentTranslation("stat.itemEnchanted", new Object[0]))).registerStat(); + public static StatBase field_181740_X = (new StatBasic("stat.recordPlayed", + new ChatComponentTranslation("stat.recordPlayed", new Object[0]))).registerStat(); + public static StatBase field_181741_Y = (new StatBasic("stat.furnaceInteraction", + new ChatComponentTranslation("stat.furnaceInteraction", new Object[0]))).registerStat(); + public static StatBase field_181742_Z = (new StatBasic("stat.craftingTableInteraction", + new ChatComponentTranslation("stat.workbenchInteraction", new Object[0]))).registerStat(); + public static StatBase field_181723_aa = (new StatBasic("stat.chestOpened", + new ChatComponentTranslation("stat.chestOpened", new Object[0]))).registerStat(); + public static final StatBase[] mineBlockStatArray = new StatBase[4096]; + /**+ + * Tracks the number of items a given block or item has been + * crafted. + */ + public static final StatBase[] objectCraftStats = new StatBase[32000]; + /**+ + * Tracks the number of times a given block or item has been + * used. + */ + public static final StatBase[] objectUseStats = new StatBase[32000]; + /**+ + * Tracks the number of times a given block or item has been + * broken. + */ + public static final StatBase[] objectBreakStats = new StatBase[32000]; + + public static void init() { + initMiningStats(); + initStats(); + initItemDepleteStats(); + initCraftableStats(); + AchievementList.init(); + EntityList.func_151514_a(); + } + + /**+ + * Initializes statistics related to craftable items. Is only + * called after both block and item stats have been initialized. + */ + private static void initCraftableStats() { + HashSet hashset = Sets.newHashSet(); + + for (IRecipe irecipe : CraftingManager.getInstance().getRecipeList()) { + if (irecipe.getRecipeOutput() != null) { + hashset.add(irecipe.getRecipeOutput().getItem()); + } + } + + for (ItemStack itemstack : FurnaceRecipes.instance().getSmeltingList().values()) { + hashset.add(itemstack.getItem()); + } + + for (Item item : (HashSet) hashset) { + if (item != null) { + int i = Item.getIdFromItem(item); + String s = func_180204_a(item); + if (s != null) { + objectCraftStats[i] = (new StatCrafting("stat.craftItem.", s, new ChatComponentTranslation( + "stat.craftItem", new Object[] { (new ItemStack(item)).getChatComponent() }), item)) + .registerStat(); + } + } + } + + replaceAllSimilarBlocks(objectCraftStats); + } + + private static void initMiningStats() { + for (Block block : Block.blockRegistry) { + Item item = Item.getItemFromBlock(block); + if (item != null) { + int i = Block.getIdFromBlock(block); + String s = func_180204_a(item); + if (s != null && block.getEnableStats()) { + mineBlockStatArray[i] = (new StatCrafting("stat.mineBlock.", s, new ChatComponentTranslation( + "stat.mineBlock", new Object[] { (new ItemStack(block)).getChatComponent() }), item)) + .registerStat(); + objectMineStats.add((StatCrafting) mineBlockStatArray[i]); + } + } + } + + replaceAllSimilarBlocks(mineBlockStatArray); + } + + private static void initStats() { + for (Item item : Item.itemRegistry) { + if (item != null) { + int i = Item.getIdFromItem(item); + String s = func_180204_a(item); + if (s != null) { + objectUseStats[i] = (new StatCrafting("stat.useItem.", s, new ChatComponentTranslation( + "stat.useItem", new Object[] { (new ItemStack(item)).getChatComponent() }), item)) + .registerStat(); + if (!(item instanceof ItemBlock)) { + itemStats.add((StatCrafting) objectUseStats[i]); + } + } + } + } + + replaceAllSimilarBlocks(objectUseStats); + } + + private static void initItemDepleteStats() { + for (Item item : Item.itemRegistry) { + if (item != null) { + int i = Item.getIdFromItem(item); + String s = func_180204_a(item); + if (s != null && item.isDamageable()) { + objectBreakStats[i] = (new StatCrafting("stat.breakItem.", s, new ChatComponentTranslation( + "stat.breakItem", new Object[] { (new ItemStack(item)).getChatComponent() }), item)) + .registerStat(); + } + } + } + + replaceAllSimilarBlocks(objectBreakStats); + } + + private static String func_180204_a(Item parItem) { + ResourceLocation resourcelocation = (ResourceLocation) Item.itemRegistry.getNameForObject(parItem); + return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null; + } + + /**+ + * Forces all dual blocks to count for each other on the stats + * list + */ + private static void replaceAllSimilarBlocks(StatBase[] parArrayOfStatBase) { + mergeStatBases(parArrayOfStatBase, Blocks.water, Blocks.flowing_water); + mergeStatBases(parArrayOfStatBase, Blocks.lava, Blocks.flowing_lava); + mergeStatBases(parArrayOfStatBase, Blocks.lit_pumpkin, Blocks.pumpkin); + mergeStatBases(parArrayOfStatBase, Blocks.lit_furnace, Blocks.furnace); + mergeStatBases(parArrayOfStatBase, Blocks.lit_redstone_ore, Blocks.redstone_ore); + mergeStatBases(parArrayOfStatBase, Blocks.powered_repeater, Blocks.unpowered_repeater); + mergeStatBases(parArrayOfStatBase, Blocks.powered_comparator, Blocks.unpowered_comparator); + mergeStatBases(parArrayOfStatBase, Blocks.redstone_torch, Blocks.unlit_redstone_torch); + mergeStatBases(parArrayOfStatBase, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); + mergeStatBases(parArrayOfStatBase, Blocks.double_stone_slab, Blocks.stone_slab); + mergeStatBases(parArrayOfStatBase, Blocks.double_wooden_slab, Blocks.wooden_slab); + mergeStatBases(parArrayOfStatBase, Blocks.double_stone_slab2, Blocks.stone_slab2); + mergeStatBases(parArrayOfStatBase, Blocks.grass, Blocks.dirt); + mergeStatBases(parArrayOfStatBase, Blocks.farmland, Blocks.dirt); + } + + /**+ + * Merge {@link StatBase} object references for similar blocks + */ + private static void mergeStatBases(StatBase[] statBaseIn, Block parBlock, Block parBlock2) { + int i = Block.getIdFromBlock(parBlock); + int j = Block.getIdFromBlock(parBlock2); + if (statBaseIn[i] != null && statBaseIn[j] == null) { + statBaseIn[j] = statBaseIn[i]; + } else { + allStats.remove(statBaseIn[i]); + objectMineStats.remove(statBaseIn[i]); + generalStats.remove(statBaseIn[i]); + statBaseIn[i] = statBaseIn[j]; + } + } + + public static StatBase getStatKillEntity(EntityList.EntityEggInfo eggInfo) { + String s = EntityList.getStringFromID(eggInfo.spawnedID); + return s == null ? null + : (new StatBase("stat.killEntity." + s, + new ChatComponentTranslation("stat.entityKill", + new Object[] { new ChatComponentTranslation("entity." + s + ".name", new Object[0]) }))) + .registerStat(); + } + + public static StatBase getStatEntityKilledBy(EntityList.EntityEggInfo eggInfo) { + String s = EntityList.getStringFromID(eggInfo.spawnedID); + return s == null ? null + : (new StatBase("stat.entityKilledBy." + s, + new ChatComponentTranslation("stat.entityKilledBy", + new Object[] { new ChatComponentTranslation("entity." + s + ".name", new Object[0]) }))) + .registerStat(); + } + + public static StatBase getOneShotStat(String parString1) { + return (StatBase) oneShotStats.get(parString1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatisticsFile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatisticsFile.java new file mode 100644 index 0000000..315a3d9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatisticsFile.java @@ -0,0 +1,233 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S37PacketStatistics; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.Achievement; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatFileWriter; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.StatList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IJsonSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.TupleIntJsonSerializable; +import org.json.JSONException; +import org.json.JSONObject; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatisticsFile extends StatFileWriter { + + static { + __checkIntegratedContextValid("net/minecraft/stats/StatisticsFile"); + } + + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer mcServer; + private final VFile2 statsFile; + private final Set field_150888_e = Sets.newHashSet(); + private int field_150885_f = -300; + private boolean field_150886_g = false; + + public StatisticsFile(MinecraftServer serverIn, VFile2 statsFileIn) { + this.mcServer = serverIn; + this.statsFile = statsFileIn; + } + + public void readStatFile() { + if (this.statsFile.exists()) { + try { + this.statsData.clear(); + this.statsData.putAll(this.parseJson(this.statsFile.getAllChars())); + } catch (JSONException jsonparseexception) { + logger.error("Couldn\'t parse statistics file " + this.statsFile, jsonparseexception); + } + } + + } + + public void saveStatFile() { + this.statsFile.setAllChars(dumpJson(this.statsData)); + } + + /**+ + * Triggers the logging of an achievement and attempts to + * announce to server + */ + public void unlockAchievement(EntityPlayer playerIn, StatBase statIn, int parInt1) { + int i = statIn.isAchievement() ? this.readStat(statIn) : 0; + super.unlockAchievement(playerIn, statIn, parInt1); + this.field_150888_e.add(statIn); + if (statIn.isAchievement() && i == 0 && parInt1 > 0) { + this.field_150886_g = true; + if (this.mcServer.isAnnouncingPlayerAchievements()) { + this.mcServer.getConfigurationManager().sendChatMsg(new ChatComponentTranslation( + "chat.type.achievement", new Object[] { playerIn.getDisplayName(), statIn.func_150955_j() })); + } + } + + if (statIn.isAchievement() && i > 0 && parInt1 == 0) { + this.field_150886_g = true; + if (this.mcServer.isAnnouncingPlayerAchievements()) { + this.mcServer.getConfigurationManager() + .sendChatMsg(new ChatComponentTranslation("chat.type.achievement.taken", + new Object[] { playerIn.getDisplayName(), statIn.func_150955_j() })); + } + } + + } + + public Set func_150878_c() { + HashSet hashset = Sets.newHashSet(this.field_150888_e); + this.field_150888_e.clear(); + this.field_150886_g = false; + return hashset; + } + + public Map parseJson(String parString1) { + JSONObject jsonobject = null; + try { + jsonobject = new JSONObject(parString1); + } catch (JSONException ex) { + } + if (jsonobject == null) { + return Maps.newHashMap(); + } else { + HashMap hashmap = Maps.newHashMap(); + + for (Entry entry : jsonobject.toMap().entrySet()) { + StatBase statbase = StatList.getOneShotStat((String) entry.getKey()); + if (statbase != null) { + TupleIntJsonSerializable tupleintjsonserializable = new TupleIntJsonSerializable(); + if (entry.getValue() instanceof Integer) { + tupleintjsonserializable.setIntegerValue((Integer) entry.getValue()); + } else if (entry.getValue() instanceof JSONObject) { + JSONObject jsonobject1 = (JSONObject) entry.getValue(); + Object value = jsonobject1.opt("value"); + if (value != null && (value instanceof Integer)) { + tupleintjsonserializable.setIntegerValue(jsonobject1.getInt("value")); + } + + if (jsonobject1.has("progress") && statbase.func_150954_l() != null) { + try { + Constructor constructor = statbase.func_150954_l().getConstructor(); + IJsonSerializable ijsonserializable = (IJsonSerializable) constructor + .newInstance(new Object[0]); + ijsonserializable.fromJson(jsonobject1.get("progress")); + tupleintjsonserializable.setJsonSerializableValue(ijsonserializable); + } catch (Throwable throwable) { + logger.warn("Invalid statistic progress in " + this.statsFile, throwable); + } + } + } + + hashmap.put(statbase, tupleintjsonserializable); + } else { + logger.warn("Invalid statistic in " + this.statsFile + ": Don\'t know what " + + (String) entry.getKey() + " is"); + } + } + + return hashmap; + } + } + + public static String dumpJson(Map parMap) { + JSONObject jsonobject = new JSONObject(); + + for (Entry entry : parMap.entrySet()) { + if (((TupleIntJsonSerializable) entry.getValue()).getJsonSerializableValue() != null) { + JSONObject jsonobject1 = new JSONObject(); + jsonobject1.put("value", + Integer.valueOf(((TupleIntJsonSerializable) entry.getValue()).getIntegerValue())); + + try { + jsonobject1.put("progress", ((TupleIntJsonSerializable) entry.getValue()).getJsonSerializableValue() + .getSerializableElement()); + } catch (Throwable throwable) { + logger.warn("Couldn\'t save statistic " + ((StatBase) entry.getKey()).getStatName() + + ": error serializing progress", throwable); + } + + jsonobject.put(((StatBase) entry.getKey()).statId, jsonobject1); + } else { + jsonobject.put(((StatBase) entry.getKey()).statId, + Integer.valueOf(((TupleIntJsonSerializable) entry.getValue()).getIntegerValue())); + } + } + + return jsonobject.toString(); + } + + public void func_150877_d() { + for (StatBase statbase : this.statsData.keySet()) { + this.field_150888_e.add(statbase); + } + + } + + public void func_150876_a(EntityPlayerMP parEntityPlayerMP) { + int i = this.mcServer.getTickCounter(); + HashMap hashmap = Maps.newHashMap(); + if (this.field_150886_g || i - this.field_150885_f > 300) { + this.field_150885_f = i; + + for (StatBase statbase : this.func_150878_c()) { + hashmap.put(statbase, Integer.valueOf(this.readStat(statbase))); + } + } + + parEntityPlayerMP.playerNetServerHandler.sendPacket(new S37PacketStatistics(hashmap)); + } + + public void sendAchievements(EntityPlayerMP player) { + HashMap hashmap = Maps.newHashMap(); + + for (Achievement achievement : AchievementList.achievementList) { + if (this.hasAchievementUnlocked(achievement)) { + hashmap.put(achievement, Integer.valueOf(this.readStat(achievement))); + this.field_150888_e.remove(achievement); + } + } + + player.playerNetServerHandler.sendPacket(new S37PacketStatistics(hashmap)); + } + + public boolean func_150879_e() { + return this.field_150886_g; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/IHopper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/IHopper.java new file mode 100644 index 0000000..3813119 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/IHopper.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IHopper extends IInventory { + /**+ + * Returns the worldObj for this tileEntity. + */ + World getWorld(); + + /**+ + * Gets the world X position for this hopper entity. + */ + double getXPos(); + + /**+ + * Gets the world Y position for this hopper entity. + */ + double getYPos(); + + /**+ + * Gets the world Z position for this hopper entity. + */ + double getZPos(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/MobSpawnerBaseLogic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/MobSpawnerBaseLogic.java new file mode 100644 index 0000000..a3b3806 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/MobSpawnerBaseLogic.java @@ -0,0 +1,387 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import com.google.common.collect.Lists; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecart; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class MobSpawnerBaseLogic { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/MobSpawnerBaseLogic"); + } + + /**+ + * The delay to spawn. + */ + private int spawnDelay = 20; + private String mobID = "Pig"; + /**+ + * List of minecart to spawn. + */ + private final List minecartToSpawn = Lists.newArrayList(); + private MobSpawnerBaseLogic.WeightedRandomMinecart randomEntity; + private double mobRotation; + private double prevMobRotation; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 800; + private int spawnCount = 4; + private Entity cachedEntity; + private int maxNearbyEntities = 6; + /**+ + * The distance from which a player activates the spawner. + */ + private int activatingRangeFromPlayer = 16; + /**+ + * The range coefficient for spawning entities around. + */ + private int spawnRange = 4; + + /**+ + * Gets the entity name that should be spawned. + */ + private String getEntityNameToSpawn() { + if (this.getRandomEntity() == null) { + if (this.mobID != null && this.mobID.equals("Minecart")) { + this.mobID = "MinecartRideable"; + } + + return this.mobID; + } else { + return this.getRandomEntity().entityType; + } + } + + public void setEntityName(String name) { + this.mobID = name; + } + + /**+ + * Returns true if there's a player close enough to this mob + * spawner to activate it. + */ + private boolean isActivated() { + BlockPos blockpos = this.getSpawnerPosition(); + return this.getSpawnerWorld().isAnyPlayerWithinRangeAt((double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + 0.5D, (double) blockpos.getZ() + 0.5D, + (double) this.activatingRangeFromPlayer); + } + + public void updateSpawner() { + if (this.isActivated()) { + BlockPos blockpos = this.getSpawnerPosition(); + { + if (this.spawnDelay == -1) { + this.resetTimer(); + } + + if (this.spawnDelay > 0) { + --this.spawnDelay; + return; + } + + boolean flag = false; + + for (int i = 0; i < this.spawnCount; ++i) { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); + if (entity == null) { + return; + } + + int j = this.getSpawnerWorld() + .getEntitiesWithinAABB(entity.getClass(), + (new AxisAlignedBB((double) blockpos.getX(), (double) blockpos.getY(), + (double) blockpos.getZ(), (double) (blockpos.getX() + 1), + (double) (blockpos.getY() + 1), (double) (blockpos.getZ() + 1))).expand( + (double) this.spawnRange, (double) this.spawnRange, + (double) this.spawnRange)) + .size(); + if (j >= this.maxNearbyEntities) { + this.resetTimer(); + return; + } + + double d0 = (double) blockpos.getX() + + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) + * (double) this.spawnRange + + 0.5D; + double d1 = (double) (blockpos.getY() + this.getSpawnerWorld().rand.nextInt(3) - 1); + double d2 = (double) blockpos.getZ() + + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) + * (double) this.spawnRange + + 0.5D; + EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving) entity : null; + entity.setLocationAndAngles(d0, d1, d2, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); + if (entityliving == null || entityliving.getCanSpawnHere() && entityliving.isNotColliding()) { + this.spawnNewEntity(entity, true); + this.getSpawnerWorld().playAuxSFX(2004, blockpos, 0); + if (entityliving != null) { + entityliving.spawnExplosionParticle(); + } + + flag = true; + } + } + + if (flag) { + this.resetTimer(); + } + } + + } + } + + private Entity spawnNewEntity(Entity entityIn, boolean spawn) { + if (this.getRandomEntity() != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entityIn.writeToNBTOptional(nbttagcompound); + + for (String s : this.getRandomEntity().nbtData.getKeySet()) { + NBTBase nbtbase = this.getRandomEntity().nbtData.getTag(s); + nbttagcompound.setTag(s, nbtbase.copy()); + } + + entityIn.readFromNBT(nbttagcompound); + if (entityIn.worldObj != null && spawn) { + entityIn.worldObj.spawnEntityInWorld(entityIn); + } + + NBTTagCompound nbttagcompound2; + for (Entity entity = entityIn; nbttagcompound.hasKey("Riding", 10); nbttagcompound = nbttagcompound2) { + nbttagcompound2 = nbttagcompound.getCompoundTag("Riding"); + Entity entity1 = EntityList.createEntityByName(nbttagcompound2.getString("id"), entityIn.worldObj); + if (entity1 != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity1.writeToNBTOptional(nbttagcompound1); + + for (String s1 : nbttagcompound2.getKeySet()) { + NBTBase nbtbase1 = nbttagcompound2.getTag(s1); + nbttagcompound1.setTag(s1, nbtbase1.copy()); + } + + entity1.readFromNBT(nbttagcompound1); + entity1.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, + entity.rotationPitch); + if (entityIn.worldObj != null && spawn) { + entityIn.worldObj.spawnEntityInWorld(entity1); + } + + entity.mountEntity(entity1); + } + + entity = entity1; + } + } else if (entityIn instanceof EntityLivingBase && entityIn.worldObj != null && spawn) { + if (entityIn instanceof EntityLiving) { + ((EntityLiving) entityIn).onInitialSpawn( + entityIn.worldObj.getDifficultyForLocation(new BlockPos(entityIn)), (IEntityLivingData) null); + } + + entityIn.worldObj.spawnEntityInWorld(entityIn); + } + + return entityIn; + } + + private void resetTimer() { + if (this.maxSpawnDelay <= this.minSpawnDelay) { + this.spawnDelay = this.minSpawnDelay; + } else { + int i = this.maxSpawnDelay - this.minSpawnDelay; + this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i); + } + + if (this.minecartToSpawn.size() > 0) { + this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart) WeightedRandom + .getRandomItem(this.getSpawnerWorld().rand, this.minecartToSpawn)); + } + + this.func_98267_a(1); + } + + public void readFromNBT(NBTTagCompound nbt) { + this.mobID = nbt.getString("EntityId"); + this.spawnDelay = nbt.getShort("Delay"); + this.minecartToSpawn.clear(); + if (nbt.hasKey("SpawnPotentials", 9)) { + NBTTagList nbttaglist = nbt.getTagList("SpawnPotentials", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + this.minecartToSpawn + .add(new MobSpawnerBaseLogic.WeightedRandomMinecart(nbttaglist.getCompoundTagAt(i))); + } + } + + if (nbt.hasKey("SpawnData", 10)) { + this.setRandomEntity( + new MobSpawnerBaseLogic.WeightedRandomMinecart(nbt.getCompoundTag("SpawnData"), this.mobID)); + } else { + this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart) null); + } + + if (nbt.hasKey("MinSpawnDelay", 99)) { + this.minSpawnDelay = nbt.getShort("MinSpawnDelay"); + this.maxSpawnDelay = nbt.getShort("MaxSpawnDelay"); + this.spawnCount = nbt.getShort("SpawnCount"); + } + + if (nbt.hasKey("MaxNearbyEntities", 99)) { + this.maxNearbyEntities = nbt.getShort("MaxNearbyEntities"); + this.activatingRangeFromPlayer = nbt.getShort("RequiredPlayerRange"); + } + + if (nbt.hasKey("SpawnRange", 99)) { + this.spawnRange = nbt.getShort("SpawnRange"); + } + + if (this.getSpawnerWorld() != null) { + this.cachedEntity = null; + } + + } + + public void writeToNBT(NBTTagCompound nbt) { + String s = this.getEntityNameToSpawn(); + if (!StringUtils.isNullOrEmpty(s)) { + nbt.setString("EntityId", s); + nbt.setShort("Delay", (short) this.spawnDelay); + nbt.setShort("MinSpawnDelay", (short) this.minSpawnDelay); + nbt.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); + nbt.setShort("SpawnCount", (short) this.spawnCount); + nbt.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); + nbt.setShort("RequiredPlayerRange", (short) this.activatingRangeFromPlayer); + nbt.setShort("SpawnRange", (short) this.spawnRange); + if (this.getRandomEntity() != null) { + nbt.setTag("SpawnData", this.getRandomEntity().nbtData.copy()); + } + + if (this.getRandomEntity() != null || this.minecartToSpawn.size() > 0) { + NBTTagList nbttaglist = new NBTTagList(); + if (this.minecartToSpawn.size() > 0) { + for (MobSpawnerBaseLogic.WeightedRandomMinecart mobspawnerbaselogic$weightedrandomminecart : this.minecartToSpawn) { + nbttaglist.appendTag(mobspawnerbaselogic$weightedrandomminecart.toNBT()); + } + } else { + nbttaglist.appendTag(this.getRandomEntity().toNBT()); + } + + nbt.setTag("SpawnPotentials", nbttaglist); + } + + } + } + + public Entity func_180612_a(World worldIn) { + if (this.cachedEntity == null) { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), worldIn); + if (entity != null) { + entity = this.spawnNewEntity(entity, false); + this.cachedEntity = entity; + } + } + + return this.cachedEntity; + } + + /**+ + * Sets the delay to minDelay if parameter given is 1, else + * return false. + */ + public boolean setDelayToMin(int delay) { + return false; + } + + private MobSpawnerBaseLogic.WeightedRandomMinecart getRandomEntity() { + return this.randomEntity; + } + + public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart parWeightedRandomMinecart) { + this.randomEntity = parWeightedRandomMinecart; + } + + public abstract void func_98267_a(int var1); + + public abstract World getSpawnerWorld(); + + public abstract BlockPos getSpawnerPosition(); + + public double getMobRotation() { + return this.mobRotation; + } + + public double getPrevMobRotation() { + return this.prevMobRotation; + } + + public class WeightedRandomMinecart extends WeightedRandom.Item { + private final NBTTagCompound nbtData; + private final String entityType; + + public WeightedRandomMinecart(NBTTagCompound tagCompound) { + this(tagCompound.getCompoundTag("Properties"), tagCompound.getString("Type"), + tagCompound.getInteger("Weight")); + } + + public WeightedRandomMinecart(NBTTagCompound tagCompound, String type) { + this(tagCompound, type, 1); + } + + private WeightedRandomMinecart(NBTTagCompound tagCompound, String type, int weight) { + super(weight); + if (type.equals("Minecart")) { + if (tagCompound != null) { + type = EntityMinecart.EnumMinecartType.byNetworkID(tagCompound.getInteger("Type")).getName(); + } else { + type = "MinecartRideable"; + } + } + + this.nbtData = tagCompound; + this.entityType = type; + } + + public NBTTagCompound toNBT() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("Properties", this.nbtData); + nbttagcompound.setString("Type", this.entityType); + nbttagcompound.setInteger("Weight", this.itemWeight); + return nbttagcompound; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntity.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntity.java new file mode 100644 index 0000000..8864c00 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntity.java @@ -0,0 +1,320 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import com.google.common.collect.Maps; + +import java.util.Map; +import java.util.concurrent.Callable; + +import net.lax1dude.eaglercraft.v1_8.sp.server.CrashReportHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockJukebox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBanner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityBrewingStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityCommandBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDaylightDetector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDropper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEndPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityEnderChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityFlowerPot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityNote; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityPiston; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntitySkull; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntity"); + } + + private static final Logger logger = LogManager.getLogger(); + private static Map> nameToClassMap = Maps.newHashMap(); + private static Map, String> classToNameMap = Maps.newHashMap(); + protected World worldObj; + protected BlockPos pos = BlockPos.ORIGIN; + protected boolean tileEntityInvalid; + private int blockMetadata = -1; + protected Block blockType; + + /**+ + * Adds a new two-way mapping between the class and its string + * name in both hashmaps. + */ + private static void addMapping(Class cl, String id) { + if (nameToClassMap.containsKey(id)) { + throw new IllegalArgumentException("Duplicate id: " + id); + } else { + nameToClassMap.put(id, cl); + classToNameMap.put(cl, id); + } + } + + /**+ + * Returns the worldObj for this tileEntity. + */ + public World getWorld() { + return this.worldObj; + } + + /**+ + * Sets the worldObj for this tileEntity. + */ + public void setWorldObj(World worldIn) { + this.worldObj = worldIn; + } + + /**+ + * Returns true if the worldObj isn't null. + */ + public boolean hasWorldObj() { + return this.worldObj != null; + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + this.pos = new BlockPos(nbttagcompound.getInteger("x"), nbttagcompound.getInteger("y"), + nbttagcompound.getInteger("z")); + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + String s = (String) classToNameMap.get(this.getClass()); + if (s == null) { + throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!"); + } else { + nbttagcompound.setString("id", s); + nbttagcompound.setInteger("x", this.pos.getX()); + nbttagcompound.setInteger("y", this.pos.getY()); + nbttagcompound.setInteger("z", this.pos.getZ()); + } + } + + /**+ + * Creates a new entity and loads its data from the specified + * NBT. + */ + public static TileEntity createAndLoadEntity(NBTTagCompound nbt) { + TileEntity tileentity = null; + + try { + Class oclass = (Class) nameToClassMap.get(nbt.getString("id")); + if (oclass != null) { + tileentity = (TileEntity) oclass.newInstance(); + } + } catch (Exception exception) { + logger.error("Caught exception calling tile entity constructor!"); + logger.error(exception); + } + + if (tileentity != null) { + tileentity.readFromNBT(nbt); + } else { + logger.warn("Skipping BlockEntity with id " + nbt.getString("id")); + } + + return tileentity; + } + + public int getBlockMetadata() { + if (this.blockMetadata == -1) { + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.blockMetadata = iblockstate.getBlock().getMetaFromState(iblockstate); + } + + return this.blockMetadata; + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + if (this.worldObj != null) { + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.blockMetadata = iblockstate.getBlock().getMetaFromState(iblockstate); + this.worldObj.markChunkDirty(this.pos, this); + if (this.getBlockType() != Blocks.air) { + this.worldObj.updateComparatorOutputLevel(this.pos, this.getBlockType()); + } + } + + } + + /**+ + * Returns the square of the distance between this entity and + * the passed in coordinates. + */ + public double getDistanceSq(double x, double y, double z) { + double d0 = (double) this.pos.getX() + 0.5D - x; + double d1 = (double) this.pos.getY() + 0.5D - y; + double d2 = (double) this.pos.getZ() + 0.5D - z; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public double getMaxRenderDistanceSquared() { + return 4096.0D; + } + + public BlockPos getPos() { + return this.pos; + } + + /**+ + * Gets the block type at the location of this entity + * (client-only). + */ + public Block getBlockType() { + if (this.blockType == null) { + this.blockType = this.worldObj.getBlockState(this.pos).getBlock(); + } + + return this.blockType; + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + return null; + } + + public boolean isInvalid() { + return this.tileEntityInvalid; + } + + /**+ + * invalidates a tile entity + */ + public void invalidate() { + this.tileEntityInvalid = true; + } + + /**+ + * validates a tile entity + */ + public void validate() { + this.tileEntityInvalid = false; + } + + public boolean receiveClientEvent(int var1, int var2) { + return false; + } + + public void updateContainingBlockInfo() { + this.blockType = null; + this.blockMetadata = -1; + } + + public void addInfoToCrashReport(CrashReportCategory reportCategory) { + reportCategory.addCrashSectionCallable("Name", new Callable() { + public String call() throws Exception { + return (String) TileEntity.classToNameMap.get(TileEntity.this.getClass()) + " // " + + TileEntity.this.getClass().getCanonicalName(); + } + }); + if (this.worldObj != null) { + CrashReportHelper.addIntegratedServerBlockInfo(reportCategory, this.pos, this.getBlockType(), + this.getBlockMetadata()); + reportCategory.addCrashSectionCallable("Actual block type", new Callable() { + public String call() throws Exception { + int i = Block + .getIdFromBlock(TileEntity.this.worldObj.getBlockState(TileEntity.this.pos).getBlock()); + + try { + return HString.format("ID #%d (%s // %s)", + new Object[] { Integer.valueOf(i), Block.getBlockById(i).getUnlocalizedName(), + Block.getBlockById(i).getClass().getCanonicalName() }); + } catch (Throwable var3) { + return "ID #" + i; + } + } + }); + reportCategory.addCrashSectionCallable("Actual block data value", new Callable() { + public String call() throws Exception { + IBlockState iblockstate = TileEntity.this.worldObj.getBlockState(TileEntity.this.pos); + int i = iblockstate.getBlock().getMetaFromState(iblockstate); + if (i < 0) { + return "Unknown? (Got " + i + ")"; + } else { + String s = HString.format("%4s", new Object[] { Integer.toBinaryString(i) }).replace(" ", "0"); + return HString.format("%1$d / 0x%1$X / 0b%2$s", new Object[] { Integer.valueOf(i), s }); + } + } + }); + } + } + + public void setPos(BlockPos posIn) { + this.pos = posIn; + } + + public boolean func_183000_F() { + return false; + } + + static { + addMapping(TileEntityFurnace.class, "Furnace"); + addMapping(TileEntityChest.class, "Chest"); + addMapping(TileEntityEnderChest.class, "EnderChest"); + addMapping(BlockJukebox.TileEntityJukebox.class, "RecordPlayer"); + addMapping(TileEntityDispenser.class, "Trap"); + addMapping(TileEntityDropper.class, "Dropper"); + addMapping(TileEntitySign.class, "Sign"); + addMapping(TileEntityMobSpawner.class, "MobSpawner"); + addMapping(TileEntityNote.class, "Music"); + addMapping(TileEntityPiston.class, "Piston"); + addMapping(TileEntityBrewingStand.class, "Cauldron"); + addMapping(TileEntityEnchantmentTable.class, "EnchantTable"); + addMapping(TileEntityEndPortal.class, "Airportal"); + addMapping(TileEntityCommandBlock.class, "Control"); + addMapping(TileEntityBeacon.class, "Beacon"); + addMapping(TileEntitySkull.class, "Skull"); + addMapping(TileEntityDaylightDetector.class, "DLDetector"); + addMapping(TileEntityHopper.class, "Hopper"); + addMapping(TileEntityComparator.class, "Comparator"); + addMapping(TileEntityFlowerPot.class, "FlowerPot"); + addMapping(TileEntityBanner.class, "Banner"); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBanner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBanner.java new file mode 100644 index 0000000..51922f2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBanner.java @@ -0,0 +1,304 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityBanner extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityBanner"); + } + + private int baseColor; + private NBTTagList patterns; + private boolean field_175119_g; + private List patternList; + private List colorList; + private String patternResourceLocation; + + public void setItemValues(ItemStack stack) { + this.patterns = null; + if (stack.hasTagCompound() && stack.getTagCompound().hasKey("BlockEntityTag", 10)) { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("BlockEntityTag"); + if (nbttagcompound.hasKey("Patterns")) { + this.patterns = (NBTTagList) nbttagcompound.getTagList("Patterns", 10).copy(); + } + + if (nbttagcompound.hasKey("Base", 99)) { + this.baseColor = nbttagcompound.getInteger("Base"); + } else { + this.baseColor = stack.getMetadata() & 15; + } + } else { + this.baseColor = stack.getMetadata() & 15; + } + + this.patternList = null; + this.colorList = null; + this.patternResourceLocation = ""; + this.field_175119_g = true; + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + func_181020_a(nbttagcompound, this.baseColor, this.patterns); + } + + public static void func_181020_a(NBTTagCompound parNBTTagCompound, int parInt1, NBTTagList parNBTTagList) { + parNBTTagCompound.setInteger("Base", parInt1); + if (parNBTTagList != null) { + parNBTTagCompound.setTag("Patterns", parNBTTagList); + } + + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.baseColor = nbttagcompound.getInteger("Base"); + this.patterns = nbttagcompound.getTagList("Patterns", 10); + this.patternList = null; + this.colorList = null; + this.patternResourceLocation = null; + this.field_175119_g = true; + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 6, nbttagcompound); + } + + public int getBaseColor() { + return this.baseColor; + } + + public static int getBaseColor(ItemStack stack) { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + return nbttagcompound != null && nbttagcompound.hasKey("Base") ? nbttagcompound.getInteger("Base") + : stack.getMetadata(); + } + + /**+ + * Retrieves the amount of patterns stored on an ItemStack. If + * the tag does not exist this value will be 0. + */ + public static int getPatterns(ItemStack stack) { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + return nbttagcompound != null && nbttagcompound.hasKey("Patterns") + ? nbttagcompound.getTagList("Patterns", 10).tagCount() + : 0; + } + + /**+ + * Retrieves the list of patterns for this tile entity. The + * banner data will be initialized/refreshed before this + * happens. + */ + public List getPatternList() { + this.initializeBannerData(); + return this.patternList; + } + + public NBTTagList func_181021_d() { + return this.patterns; + } + + /**+ + * Retrieves the list of colors for this tile entity. The banner + * data will be initialized/refreshed before this happens. + */ + public List getColorList() { + this.initializeBannerData(); + return this.colorList; + } + + public String func_175116_e() { + this.initializeBannerData(); + return this.patternResourceLocation; + } + + /**+ + * Establishes all of the basic properties for the banner. This + * will also apply the data from the tile entities nbt tag + * compounds. + */ + private void initializeBannerData() { + if (this.patternList == null || this.colorList == null || this.patternResourceLocation == null) { + if (!this.field_175119_g) { + this.patternResourceLocation = ""; + } else { + this.patternList = Lists.newArrayList(); + this.colorList = Lists.newArrayList(); + this.patternList.add(TileEntityBanner.EnumBannerPattern.BASE); + this.colorList.add(EnumDyeColor.byDyeDamage(this.baseColor)); + this.patternResourceLocation = "b" + this.baseColor; + if (this.patterns != null) { + for (int i = 0; i < this.patterns.tagCount(); ++i) { + NBTTagCompound nbttagcompound = this.patterns.getCompoundTagAt(i); + TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern + .getPatternByID(nbttagcompound.getString("Pattern")); + if (tileentitybanner$enumbannerpattern != null) { + this.patternList.add(tileentitybanner$enumbannerpattern); + int j = nbttagcompound.getInteger("Color"); + this.colorList.add(EnumDyeColor.byDyeDamage(j)); + this.patternResourceLocation = this.patternResourceLocation + + tileentitybanner$enumbannerpattern.getPatternID() + j; + } + } + } + + } + } + } + + /**+ + * Removes all the banner related data from a provided instance + * of ItemStack. + */ + public static void removeBannerData(ItemStack stack) { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + if (nbttagcompound != null && nbttagcompound.hasKey("Patterns", 9)) { + NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10); + if (nbttaglist.tagCount() > 0) { + nbttaglist.removeTag(nbttaglist.tagCount() - 1); + if (nbttaglist.hasNoTags()) { + stack.getTagCompound().removeTag("BlockEntityTag"); + if (stack.getTagCompound().hasNoTags()) { + stack.setTagCompound((NBTTagCompound) null); + } + } + + } + } + } + + public static enum EnumBannerPattern { + BASE("base", "b"), SQUARE_BOTTOM_LEFT("square_bottom_left", "bl", " ", " ", "# "), + SQUARE_BOTTOM_RIGHT("square_bottom_right", "br", " ", " ", " #"), + SQUARE_TOP_LEFT("square_top_left", "tl", "# ", " ", " "), + SQUARE_TOP_RIGHT("square_top_right", "tr", " #", " ", " "), + STRIPE_BOTTOM("stripe_bottom", "bs", " ", " ", "###"), STRIPE_TOP("stripe_top", "ts", "###", " ", " "), + STRIPE_LEFT("stripe_left", "ls", "# ", "# ", "# "), STRIPE_RIGHT("stripe_right", "rs", " #", " #", " #"), + STRIPE_CENTER("stripe_center", "cs", " # ", " # ", " # "), + STRIPE_MIDDLE("stripe_middle", "ms", " ", "###", " "), + STRIPE_DOWNRIGHT("stripe_downright", "drs", "# ", " # ", " #"), + STRIPE_DOWNLEFT("stripe_downleft", "dls", " #", " # ", "# "), + STRIPE_SMALL("small_stripes", "ss", "# #", "# #", " "), CROSS("cross", "cr", "# #", " # ", "# #"), + STRAIGHT_CROSS("straight_cross", "sc", " # ", "###", " # "), + TRIANGLE_BOTTOM("triangle_bottom", "bt", " ", " # ", "# #"), + TRIANGLE_TOP("triangle_top", "tt", "# #", " # ", " "), + TRIANGLES_BOTTOM("triangles_bottom", "bts", " ", "# #", " # "), + TRIANGLES_TOP("triangles_top", "tts", " # ", "# #", " "), + DIAGONAL_LEFT("diagonal_left", "ld", "## ", "# ", " "), + DIAGONAL_RIGHT("diagonal_up_right", "rd", " ", " #", " ##"), + DIAGONAL_LEFT_MIRROR("diagonal_up_left", "lud", " ", "# ", "## "), + DIAGONAL_RIGHT_MIRROR("diagonal_right", "rud", " ##", " #", " "), + CIRCLE_MIDDLE("circle", "mc", " ", " # ", " "), RHOMBUS_MIDDLE("rhombus", "mr", " # ", "# #", " # "), + HALF_VERTICAL("half_vertical", "vh", "## ", "## ", "## "), + HALF_HORIZONTAL("half_horizontal", "hh", "###", "###", " "), + HALF_VERTICAL_MIRROR("half_vertical_right", "vhr", " ##", " ##", " ##"), + HALF_HORIZONTAL_MIRROR("half_horizontal_bottom", "hhb", " ", "###", "###"), + BORDER("border", "bo", "###", "# #", "###"), CURLY_BORDER("curly_border", "cbo", new ItemStack(Blocks.vine)), + CREEPER("creeper", "cre", new ItemStack(Items.skull, 1, 4)), GRADIENT("gradient", "gra", "# #", " # ", " # "), + GRADIENT_UP("gradient_up", "gru", " # ", " # ", "# #"), + BRICKS("bricks", "bri", new ItemStack(Blocks.brick_block)), + SKULL("skull", "sku", new ItemStack(Items.skull, 1, 1)), + FLOWER("flower", "flo", new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.OXEYE_DAISY.getMeta())), + MOJANG("mojang", "moj", new ItemStack(Items.golden_apple, 1, 1)); + + private String patternName; + private String patternID; + private String[] craftingLayers; + private ItemStack patternCraftingStack; + + private EnumBannerPattern(String name, String id) { + this.craftingLayers = new String[3]; + this.patternName = name; + this.patternID = id; + } + + private EnumBannerPattern(String name, String id, ItemStack craftingItem) { + this(name, id); + this.patternCraftingStack = craftingItem; + } + + private EnumBannerPattern(String name, String id, String craftingTop, String craftingMid, String craftingBot) { + this(name, id); + this.craftingLayers[0] = craftingTop; + this.craftingLayers[1] = craftingMid; + this.craftingLayers[2] = craftingBot; + } + + public String getPatternName() { + return this.patternName; + } + + public String getPatternID() { + return this.patternID; + } + + public String[] getCraftingLayers() { + return this.craftingLayers; + } + + public boolean hasValidCrafting() { + return this.patternCraftingStack != null || this.craftingLayers[0] != null; + } + + public boolean hasCraftingStack() { + return this.patternCraftingStack != null; + } + + public ItemStack getCraftingStack() { + return this.patternCraftingStack; + } + + public static TileEntityBanner.EnumBannerPattern getPatternByID(String id) { + for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : values()) { + if (tileentitybanner$enumbannerpattern.patternID.equals(id)) { + return tileentitybanner$enumbannerpattern; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBeacon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBeacon.java new file mode 100644 index 0000000..fdb2d6b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBeacon.java @@ -0,0 +1,463 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStainedGlass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStainedGlassPane; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerBeacon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.Potion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats.AchievementList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityLockable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityBeacon extends TileEntityLockable implements ITickable, IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityBeacon"); + } + + /**+ + * List of effects that Beacon can apply + */ + public static final Potion[][] effectsList = new Potion[][] { { Potion.moveSpeed, Potion.digSpeed }, + { Potion.resistance, Potion.jump }, { Potion.damageBoost }, { Potion.regeneration } }; + /**+ + * A list of beam segments for this beacon + */ + private final List beamSegments = Lists.newArrayList(); + private long beamRenderCounter; + private float field_146014_j; + private boolean isComplete; + /**+ + * Level of this beacon's pyramid. + */ + private int levels = -1; + private int primaryEffect; + private int secondaryEffect; + private ItemStack payment; + private String customName; + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + if (this.worldObj.getTotalWorldTime() % 80L == 0L) { + this.updateBeacon(); + } + + } + + public void updateBeacon() { + this.updateSegmentColors(); + this.addEffectsToPlayers(); + } + + private void addEffectsToPlayers() { + if (this.isComplete && this.levels > 0 && this.primaryEffect > 0) { + double d0 = (double) (this.levels * 10 + 10); + byte b0 = 0; + if (this.levels >= 4 && this.primaryEffect == this.secondaryEffect) { + b0 = 1; + } + + int i = this.pos.getX(); + int j = this.pos.getY(); + int k = this.pos.getZ(); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB((double) i, (double) j, (double) k, (double) (i + 1), + (double) (j + 1), (double) (k + 1))).expand(d0, d0, d0).addCoord(0.0D, + (double) this.worldObj.getHeight(), 0.0D); + List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb); + + for (EntityPlayer entityplayer : (List) list) { + entityplayer.addPotionEffect(new PotionEffect(this.primaryEffect, 180, b0, true, true)); + } + + if (this.levels >= 4 && this.primaryEffect != this.secondaryEffect && this.secondaryEffect > 0) { + for (EntityPlayer entityplayer1 : (List) list) { + entityplayer1.addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true, true)); + } + } + } + + } + + private void updateSegmentColors() { + int i = this.levels; + int j = this.pos.getX(); + int k = this.pos.getY(); + int l = this.pos.getZ(); + this.levels = 0; + this.beamSegments.clear(); + this.isComplete = true; + TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = new TileEntityBeacon.BeamSegment( + EntitySheep.func_175513_a(EnumDyeColor.WHITE)); + this.beamSegments.add(tileentitybeacon$beamsegment); + boolean flag = true; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i1 = k + 1; i1 < 256; ++i1) { + IBlockState iblockstate = this.worldObj.getBlockState(blockpos$mutableblockpos.func_181079_c(j, i1, l)); + float[] afloat; + if (iblockstate.getBlock() == Blocks.stained_glass) { + afloat = EntitySheep.func_175513_a((EnumDyeColor) iblockstate.getValue(BlockStainedGlass.COLOR)); + } else { + if (iblockstate.getBlock() != Blocks.stained_glass_pane) { + if (iblockstate.getBlock().getLightOpacity() >= 15 && iblockstate.getBlock() != Blocks.bedrock) { + this.isComplete = false; + this.beamSegments.clear(); + break; + } + + tileentitybeacon$beamsegment.incrementHeight(); + continue; + } + + afloat = EntitySheep.func_175513_a((EnumDyeColor) iblockstate.getValue(BlockStainedGlassPane.COLOR)); + } + + if (!flag) { + afloat = new float[] { (tileentitybeacon$beamsegment.getColors()[0] + afloat[0]) / 2.0F, + (tileentitybeacon$beamsegment.getColors()[1] + afloat[1]) / 2.0F, + (tileentitybeacon$beamsegment.getColors()[2] + afloat[2]) / 2.0F }; + } + + if (Arrays.equals(afloat, tileentitybeacon$beamsegment.getColors())) { + tileentitybeacon$beamsegment.incrementHeight(); + } else { + tileentitybeacon$beamsegment = new TileEntityBeacon.BeamSegment(afloat); + this.beamSegments.add(tileentitybeacon$beamsegment); + } + + flag = false; + } + + if (this.isComplete) { + for (int l1 = 1; l1 <= 4; this.levels = l1++) { + int i2 = k - l1; + if (i2 < 0) { + break; + } + + boolean flag1 = true; + + for (int j1 = j - l1; j1 <= j + l1 && flag1; ++j1) { + for (int k1 = l - l1; k1 <= l + l1; ++k1) { + Block block = this.worldObj.getBlockState(new BlockPos(j1, i2, k1)).getBlock(); + if (block != Blocks.emerald_block && block != Blocks.gold_block && block != Blocks.diamond_block + && block != Blocks.iron_block) { + flag1 = false; + break; + } + } + } + + if (!flag1) { + break; + } + } + + if (this.levels == 0) { + this.isComplete = false; + } + } + + if (this.levels == 4 && i < this.levels) { + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + (new AxisAlignedBB((double) j, (double) k, (double) l, (double) j, (double) (k - 4), (double) l)) + .expand(10.0D, 5.0D, 10.0D))) { + entityplayer.triggerAchievement(AchievementList.fullBeacon); + } + } + + } + + public List getBeamSegments() { + return this.beamSegments; + } + + public float shouldBeamRender() { + if (!this.isComplete) { + return 0.0F; + } else { + int i = (int) (this.worldObj.getTotalWorldTime() - this.beamRenderCounter); + this.beamRenderCounter = this.worldObj.getTotalWorldTime(); + if (i > 1) { + this.field_146014_j -= (float) i / 40.0F; + if (this.field_146014_j < 0.0F) { + this.field_146014_j = 0.0F; + } + } + + this.field_146014_j += 0.025F; + if (this.field_146014_j > 1.0F) { + this.field_146014_j = 1.0F; + } + + return this.field_146014_j; + } + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 3, nbttagcompound); + } + + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } + + private int func_183001_h(int parInt1) { + if (parInt1 >= 0 && parInt1 < Potion.potionTypes.length && Potion.potionTypes[parInt1] != null) { + Potion potion = Potion.potionTypes[parInt1]; + return potion != Potion.moveSpeed && potion != Potion.digSpeed && potion != Potion.resistance + && potion != Potion.jump && potion != Potion.damageBoost && potion != Potion.regeneration ? 0 + : parInt1; + } else { + return 0; + } + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.primaryEffect = this.func_183001_h(nbttagcompound.getInteger("Primary")); + this.secondaryEffect = this.func_183001_h(nbttagcompound.getInteger("Secondary")); + this.levels = nbttagcompound.getInteger("Levels"); + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setInteger("Primary", this.primaryEffect); + nbttagcompound.setInteger("Secondary", this.secondaryEffect); + nbttagcompound.setInteger("Levels", this.levels); + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 1; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int index) { + return index == 0 ? this.payment : null; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int index, int count) { + if (index == 0 && this.payment != null) { + if (count >= this.payment.stackSize) { + ItemStack itemstack = this.payment; + this.payment = null; + return itemstack; + } else { + this.payment.stackSize -= count; + return new ItemStack(this.payment.getItem(), count, this.payment.getMetadata()); + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int index) { + if (index == 0 && this.payment != null) { + ItemStack itemstack = this.payment; + this.payment = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) { + if (index == 0) { + this.payment = stack; + } + + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.beacon"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setName(String name) { + this.customName = name; + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 1; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer player) { + } + + public void closeInventory(EntityPlayer player) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) { + return stack.getItem() == Items.emerald || stack.getItem() == Items.diamond + || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot; + } + + public String getGuiID() { + return "minecraft:beacon"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer var2) { + return new ContainerBeacon(inventoryplayer, this); + } + + public int getField(int parInt1) { + switch (parInt1) { + case 0: + return this.levels; + case 1: + return this.primaryEffect; + case 2: + return this.secondaryEffect; + default: + return 0; + } + } + + public void setField(int id, int value) { + switch (id) { + case 0: + this.levels = value; + break; + case 1: + this.primaryEffect = this.func_183001_h(value); + break; + case 2: + this.secondaryEffect = this.func_183001_h(value); + } + + } + + public int getFieldCount() { + return 3; + } + + public void clear() { + this.payment = null; + } + + public boolean receiveClientEvent(int id, int type) { + if (id == 1) { + this.updateBeacon(); + return true; + } else { + return super.receiveClientEvent(id, type); + } + } + + public static class BeamSegment { + private final float[] colors; + private int height; + + public BeamSegment(float[] parArrayOfFloat) { + this.colors = parArrayOfFloat; + this.height = 1; + } + + protected void incrementHeight() { + ++this.height; + } + + public float[] getColors() { + return this.colors; + } + + public int getHeight() { + return this.height; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBrewingStand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBrewingStand.java new file mode 100644 index 0000000..0be1fa4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -0,0 +1,399 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import java.util.Arrays; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBrewingStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerBrewingStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ISidedInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemPotion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.potion.PotionHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityLockable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityBrewingStand extends TileEntityLockable implements ITickable, ISidedInventory { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityBrewingStand"); + } + + /**+ + * an array of the input slot indices + */ + private static final int[] inputSlots = new int[] { 3 }; + /**+ + * an array of the output slot indices + */ + private static final int[] outputSlots = new int[] { 0, 1, 2 }; + /**+ + * The ItemStacks currently placed in the slots of the brewing + * stand + */ + private ItemStack[] brewingItemStacks = new ItemStack[4]; + private int brewTime; + private boolean[] filledSlots; + private Item ingredientID; + private String customName; + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.brewing"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setName(String name) { + this.customName = name; + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.brewingItemStacks.length; + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + if (this.brewTime > 0) { + --this.brewTime; + if (this.brewTime == 0) { + this.brewPotions(); + this.markDirty(); + } else if (!this.canBrew()) { + this.brewTime = 0; + this.markDirty(); + } else if (this.ingredientID != this.brewingItemStacks[3].getItem()) { + this.brewTime = 0; + this.markDirty(); + } + } else if (this.canBrew()) { + this.brewTime = 400; + this.ingredientID = this.brewingItemStacks[3].getItem(); + } + + { + boolean[] aboolean = this.func_174902_m(); + if (!Arrays.equals(aboolean, this.filledSlots)) { + this.filledSlots = aboolean; + IBlockState iblockstate = this.worldObj.getBlockState(this.getPos()); + if (!(iblockstate.getBlock() instanceof BlockBrewingStand)) { + return; + } + + for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i) { + iblockstate = iblockstate.withProperty(BlockBrewingStand.HAS_BOTTLE[i], + Boolean.valueOf(aboolean[i])); + } + + this.worldObj.setBlockState(this.pos, iblockstate, 2); + } + } + + } + + private boolean canBrew() { + if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) { + ItemStack itemstack = this.brewingItemStacks[3]; + if (!itemstack.getItem().isPotionIngredient(itemstack)) { + return false; + } else { + boolean flag = false; + + for (int i = 0; i < 3; ++i) { + if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) { + int j = this.brewingItemStacks[i].getMetadata(); + int k = this.getPotionResult(j, itemstack); + if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) { + flag = true; + break; + } + + List list = Items.potionitem.getEffects(j); + List list1 = Items.potionitem.getEffects(k); + if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) + && j != k) { + flag = true; + break; + } + } + } + + return flag; + } + } else { + return false; + } + } + + private void brewPotions() { + if (this.canBrew()) { + ItemStack itemstack = this.brewingItemStacks[3]; + + for (int i = 0; i < 3; ++i) { + if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) { + int j = this.brewingItemStacks[i].getMetadata(); + int k = this.getPotionResult(j, itemstack); + List list = Items.potionitem.getEffects(j); + List list1 = Items.potionitem.getEffects(k); + if (j > 0 && list == list1 || list != null && (list.equals(list1) || list1 == null)) { + if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) { + this.brewingItemStacks[i].setItemDamage(k); + } + } else if (j != k) { + this.brewingItemStacks[i].setItemDamage(k); + } + } + } + + if (itemstack.getItem().hasContainerItem()) { + this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); + } else { + --this.brewingItemStacks[3].stackSize; + if (this.brewingItemStacks[3].stackSize <= 0) { + this.brewingItemStacks[3] = null; + } + } + + } + } + + /**+ + * The result of brewing a potion of the specified damage value + * with an ingredient itemstack. + */ + private int getPotionResult(int meta, ItemStack stack) { + return stack == null ? meta + : (stack.getItem().isPotionIngredient(stack) + ? PotionHelper.applyIngredient(meta, stack.getItem().getPotionEffect(stack)) + : meta); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + if (b0 >= 0 && b0 < this.brewingItemStacks.length) { + this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + this.brewTime = nbttagcompound.getShort("BrewTime"); + if (nbttagcompound.hasKey("CustomName", 8)) { + this.customName = nbttagcompound.getString("CustomName"); + } + + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("BrewTime", (short) this.brewTime); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.brewingItemStacks.length; ++i) { + if (this.brewingItemStacks[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.brewingItemStacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + if (this.hasCustomName()) { + nbttagcompound.setString("CustomName", this.customName); + } + + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return i >= 0 && i < this.brewingItemStacks.length ? this.brewingItemStacks[i] : null; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int var2) { + if (i >= 0 && i < this.brewingItemStacks.length) { + ItemStack itemstack = this.brewingItemStacks[i]; + this.brewingItemStacks[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (i >= 0 && i < this.brewingItemStacks.length) { + ItemStack itemstack = this.brewingItemStacks[i]; + this.brewingItemStacks[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + if (i >= 0 && i < this.brewingItemStacks.length) { + this.brewingItemStacks[i] = itemstack; + } + + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : entityplayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + return i == 3 ? itemstack.getItem().isPotionIngredient(itemstack) + : itemstack.getItem() == Items.potionitem || itemstack.getItem() == Items.glass_bottle; + } + + public boolean[] func_174902_m() { + boolean[] aboolean = new boolean[3]; + + for (int i = 0; i < 3; ++i) { + if (this.brewingItemStacks[i] != null) { + aboolean[i] = true; + } + } + + return aboolean; + } + + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.UP ? inputSlots : outputSlots; + } + + /**+ + * Returns true if automation can insert the given item in the + * given slot from the given side. Args: slot, item, side + */ + public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) { + return this.isItemValidForSlot(index, itemStackIn); + } + + /**+ + * Returns true if automation can extract the given item in the + * given slot from the given side. Args: slot, item, side + */ + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) { + return true; + } + + public String getGuiID() { + return "minecraft:brewing_stand"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer var2) { + return new ContainerBrewingStand(inventoryplayer, this); + } + + public int getField(int i) { + switch (i) { + case 0: + return this.brewTime; + default: + return 0; + } + } + + public void setField(int i, int j) { + switch (i) { + case 0: + this.brewTime = j; + default: + } + } + + public int getFieldCount() { + return 1; + } + + public void clear() { + for (int i = 0; i < this.brewingItemStacks.length; ++i) { + this.brewingItemStacks[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityChest.java new file mode 100644 index 0000000..739594a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityChest.java @@ -0,0 +1,448 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.InventoryLargeChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityLockable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityChest extends TileEntityLockable implements ITickable, IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityChest"); + } + + private ItemStack[] chestContents = new ItemStack[27]; + public boolean adjacentChestChecked; + public TileEntityChest adjacentChestZNeg; + public TileEntityChest adjacentChestXPos; + public TileEntityChest adjacentChestXNeg; + public TileEntityChest adjacentChestZPos; + public float lidAngle; + public float prevLidAngle; + public int numPlayersUsing; + private int ticksSinceSync; + private int cachedChestType; + private String customName; + + public TileEntityChest() { + this.cachedChestType = -1; + } + + public TileEntityChest(int chestType) { + this.cachedChestType = chestType; + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 27; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return this.chestContents[i]; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.chestContents[i] != null) { + if (this.chestContents[i].stackSize <= j) { + ItemStack itemstack1 = this.chestContents[i]; + this.chestContents[i] = null; + this.markDirty(); + return itemstack1; + } else { + ItemStack itemstack = this.chestContents[i].splitStack(j); + if (this.chestContents[i].stackSize == 0) { + this.chestContents[i] = null; + } + + this.markDirty(); + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.chestContents[i] != null) { + ItemStack itemstack = this.chestContents[i]; + this.chestContents[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.chestContents[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.chest"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String name) { + this.customName = name; + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.chestContents = new ItemStack[this.getSizeInventory()]; + if (nbttagcompound.hasKey("CustomName", 8)) { + this.customName = nbttagcompound.getString("CustomName"); + } + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + if (j >= 0 && j < this.chestContents.length) { + this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.chestContents.length; ++i) { + if (this.chestContents[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.chestContents[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + if (this.hasCustomName()) { + nbttagcompound.setString("CustomName", this.customName); + } + + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : entityplayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void updateContainingBlockInfo() { + super.updateContainingBlockInfo(); + this.adjacentChestChecked = false; + } + + private void func_174910_a(TileEntityChest chestTe, EnumFacing side) { + if (chestTe.isInvalid()) { + this.adjacentChestChecked = false; + } else if (this.adjacentChestChecked) { + switch (side) { + case NORTH: + if (this.adjacentChestZNeg != chestTe) { + this.adjacentChestChecked = false; + } + break; + case SOUTH: + if (this.adjacentChestZPos != chestTe) { + this.adjacentChestChecked = false; + } + break; + case EAST: + if (this.adjacentChestXPos != chestTe) { + this.adjacentChestChecked = false; + } + break; + case WEST: + if (this.adjacentChestXNeg != chestTe) { + this.adjacentChestChecked = false; + } + } + } + + } + + /**+ + * Performs the check for adjacent chests to determine if this + * chest is double or not. + */ + public void checkForAdjacentChests() { + if (!this.adjacentChestChecked) { + this.adjacentChestChecked = true; + this.adjacentChestXNeg = this.getAdjacentChest(EnumFacing.WEST); + this.adjacentChestXPos = this.getAdjacentChest(EnumFacing.EAST); + this.adjacentChestZNeg = this.getAdjacentChest(EnumFacing.NORTH); + this.adjacentChestZPos = this.getAdjacentChest(EnumFacing.SOUTH); + } + } + + protected TileEntityChest getAdjacentChest(EnumFacing side) { + BlockPos blockpos = this.pos.offset(side); + if (this.isChestAt(blockpos)) { + TileEntity tileentity = this.worldObj.getTileEntity(blockpos); + if (tileentity instanceof TileEntityChest) { + TileEntityChest tileentitychest = (TileEntityChest) tileentity; + tileentitychest.func_174910_a(this, side.getOpposite()); + return tileentitychest; + } + } + + return null; + } + + private boolean isChestAt(BlockPos posIn) { + if (this.worldObj == null) { + return false; + } else { + Block block = this.worldObj.getBlockState(posIn).getBlock(); + return block instanceof BlockChest && ((BlockChest) block).chestType == this.getChestType(); + } + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + this.checkForAdjacentChests(); + int i = this.pos.getX(); + int j = this.pos.getY(); + int k = this.pos.getZ(); + ++this.ticksSinceSync; + if (this.numPlayersUsing != 0 && (this.ticksSinceSync + i + j + k) % 200 == 0) { + this.numPlayersUsing = 0; + float f = 5.0F; + + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + new AxisAlignedBB((double) ((float) i - f), (double) ((float) j - f), (double) ((float) k - f), + (double) ((float) (i + 1) + f), (double) ((float) (j + 1) + f), + (double) ((float) (k + 1) + f)))) { + if (entityplayer.openContainer instanceof ContainerChest) { + IInventory iinventory = ((ContainerChest) entityplayer.openContainer).getLowerChestInventory(); + if (iinventory == this || iinventory instanceof InventoryLargeChest + && ((InventoryLargeChest) iinventory).isPartOfLargeChest(this)) { + ++this.numPlayersUsing; + } + } + } + } + + this.prevLidAngle = this.lidAngle; + float f1 = 0.1F; + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null + && this.adjacentChestXNeg == null) { + double d1 = (double) i + 0.5D; + double d2 = (double) k + 0.5D; + if (this.adjacentChestZPos != null) { + d2 += 0.5D; + } + + if (this.adjacentChestXPos != null) { + d1 += 0.5D; + } + + this.worldObj.playSoundEffect(d1, (double) j + 0.5D, d2, "random.chestopen", 0.5F, + this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { + float f2 = this.lidAngle; + if (this.numPlayersUsing > 0) { + this.lidAngle += f1; + } else { + this.lidAngle -= f1; + } + + if (this.lidAngle > 1.0F) { + this.lidAngle = 1.0F; + } + + float f3 = 0.5F; + if (this.lidAngle < f3 && f2 >= f3 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { + double d3 = (double) i + 0.5D; + double d0 = (double) k + 0.5D; + if (this.adjacentChestZPos != null) { + d0 += 0.5D; + } + + if (this.adjacentChestXPos != null) { + d3 += 0.5D; + } + + this.worldObj.playSoundEffect(d3, (double) j + 0.5D, d0, "random.chestclosed", 0.5F, + this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.lidAngle < 0.0F) { + this.lidAngle = 0.0F; + } + } + + } + + public boolean receiveClientEvent(int i, int j) { + if (i == 1) { + this.numPlayersUsing = j; + return true; + } else { + return super.receiveClientEvent(i, j); + } + } + + public void openInventory(EntityPlayer entityplayer) { + if (!entityplayer.isSpectator()) { + if (this.numPlayersUsing < 0) { + this.numPlayersUsing = 0; + } + + ++this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing); + this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType()); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType()); + } + + } + + public void closeInventory(EntityPlayer entityplayer) { + if (!entityplayer.isSpectator() && this.getBlockType() instanceof BlockChest) { + --this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing); + this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType()); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType()); + } + + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + /**+ + * invalidates a tile entity + */ + public void invalidate() { + super.invalidate(); + this.updateContainingBlockInfo(); + this.checkForAdjacentChests(); + } + + public int getChestType() { + if (this.cachedChestType == -1) { + if (this.worldObj == null || !(this.getBlockType() instanceof BlockChest)) { + return 0; + } + + this.cachedChestType = ((BlockChest) this.getBlockType()).chestType; + } + + return this.cachedChestType; + } + + public String getGuiID() { + return "minecraft:chest"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer) { + return new ContainerChest(inventoryplayer, this, entityplayer); + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.chestContents.length; ++i) { + this.chestContents[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityCommandBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityCommandBlock.java new file mode 100644 index 0000000..6c85828 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityCommandBlock.java @@ -0,0 +1,115 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server.CommandBlockLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityCommandBlock extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityCommandBlock"); + } + + private final CommandBlockLogic commandBlockLogic = new CommandBlockLogic() { + public BlockPos getPosition() { + return TileEntityCommandBlock.this.pos; + } + + public Vec3 getPositionVector() { + return new Vec3((double) TileEntityCommandBlock.this.pos.getX() + 0.5D, + (double) TileEntityCommandBlock.this.pos.getY() + 0.5D, + (double) TileEntityCommandBlock.this.pos.getZ() + 0.5D); + } + + public World getEntityWorld() { + return TileEntityCommandBlock.this.getWorld(); + } + + public void setCommand(String s) { + super.setCommand(s); + TileEntityCommandBlock.this.markDirty(); + } + + public void updateCommand() { + TileEntityCommandBlock.this.getWorld().markBlockForUpdate(TileEntityCommandBlock.this.pos); + } + + public int func_145751_f() { + return 0; + } + + public void func_145757_a(ByteBuf bytebuf) { + bytebuf.writeInt(TileEntityCommandBlock.this.pos.getX()); + bytebuf.writeInt(TileEntityCommandBlock.this.pos.getY()); + bytebuf.writeInt(TileEntityCommandBlock.this.pos.getZ()); + } + + public Entity getCommandSenderEntity() { + return null; + } + }; + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + this.commandBlockLogic.writeDataToNBT(nbttagcompound); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.commandBlockLogic.readDataFromNBT(nbttagcompound); + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 2, nbttagcompound); + } + + public boolean func_183000_F() { + return true; + } + + public CommandBlockLogic getCommandBlockLogic() { + return this.commandBlockLogic; + } + + public CommandResultStats getCommandResultStats() { + return this.commandBlockLogic.getCommandResultStats(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityComparator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityComparator.java new file mode 100644 index 0000000..33ea3d9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityComparator.java @@ -0,0 +1,53 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityComparator extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityComparator"); + } + + private int outputSignal; + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setInteger("OutputSignal", this.outputSignal); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.outputSignal = nbttagcompound.getInteger("OutputSignal"); + } + + public int getOutputSignal() { + return this.outputSignal; + } + + public void setOutputSignal(int parInt1) { + this.outputSignal = parInt1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDaylightDetector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDaylightDetector.java new file mode 100644 index 0000000..0ce5ec6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDaylightDetector.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDaylightDetector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityDaylightDetector extends TileEntity implements ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityDaylightDetector"); + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + if (this.worldObj != null && this.worldObj.getTotalWorldTime() % 20L == 0L) { + this.blockType = this.getBlockType(); + if (this.blockType instanceof BlockDaylightDetector) { + ((BlockDaylightDetector) this.blockType).updatePower(this.worldObj, this.pos); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDispenser.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDispenser.java new file mode 100644 index 0000000..bde1f13 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDispenser.java @@ -0,0 +1,254 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityLockable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityDispenser extends TileEntityLockable implements IInventory { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityDispenser"); + } + + private static final EaglercraftRandom RNG = new EaglercraftRandom(); + private ItemStack[] stacks = new ItemStack[9]; + protected String customName; + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 9; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return this.stacks[i]; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.stacks[i] != null) { + if (this.stacks[i].stackSize <= j) { + ItemStack itemstack1 = this.stacks[i]; + this.stacks[i] = null; + this.markDirty(); + return itemstack1; + } else { + ItemStack itemstack = this.stacks[i].splitStack(j); + if (this.stacks[i].stackSize == 0) { + this.stacks[i] = null; + } + + this.markDirty(); + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.stacks[i] != null) { + ItemStack itemstack = this.stacks[i]; + this.stacks[i] = null; + return itemstack; + } else { + return null; + } + } + + public int getDispenseSlot() { + int i = -1; + int j = 1; + + for (int k = 0; k < this.stacks.length; ++k) { + if (this.stacks[k] != null && RNG.nextInt(j++) == 0) { + i = k; + } + } + + return i; + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.stacks[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + /**+ + * Add the given ItemStack to this Dispenser. Return the Slot + * the Item was placed in or -1 if no free slot is available. + */ + public int addItemStack(ItemStack stack) { + for (int i = 0; i < this.stacks.length; ++i) { + if (this.stacks[i] == null || this.stacks[i].getItem() == null) { + this.setInventorySlotContents(i, stack); + return i; + } + } + + return -1; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.dispenser"; + } + + public void setCustomName(String customName) { + this.customName = customName; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.customName != null; + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.stacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + if (j >= 0 && j < this.stacks.length) { + this.stacks[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + if (nbttagcompound.hasKey("CustomName", 8)) { + this.customName = nbttagcompound.getString("CustomName"); + } + + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.stacks.length; ++i) { + if (this.stacks[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.stacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + if (this.hasCustomName()) { + nbttagcompound.setString("CustomName", this.customName); + } + + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : entityplayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + public String getGuiID() { + return "minecraft:dispenser"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer var2) { + return new ContainerDispenser(inventoryplayer, this); + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.stacks.length; ++i) { + this.stacks[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDropper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDropper.java new file mode 100644 index 0000000..39d3c0b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDropper.java @@ -0,0 +1,44 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityDropper extends TileEntityDispenser { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityDropper"); + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.dropper"; + } + + public String getGuiID() { + return "minecraft:dropper"; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnchantmentTable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnchantmentTable.java new file mode 100644 index 0000000..4ac3fa7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnchantmentTable.java @@ -0,0 +1,173 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityEnchantmentTable extends TileEntity implements ITickable, IInteractionObject { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityEnchantmentTable"); + } + + public int tickCount; + public float pageFlip; + public float pageFlipPrev; + public float field_145932_k; + public float field_145929_l; + public float bookSpread; + public float bookSpreadPrev; + public float bookRotation; + public float bookRotationPrev; + public float field_145924_q; + private static EaglercraftRandom rand = new EaglercraftRandom(); + private String customName; + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + if (this.hasCustomName()) { + nbttagcompound.setString("CustomName", this.customName); + } + + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("CustomName", 8)) { + this.customName = nbttagcompound.getString("CustomName"); + } + + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + this.bookSpreadPrev = this.bookSpread; + this.bookRotationPrev = this.bookRotation; + EntityPlayer entityplayer = this.worldObj.getClosestPlayer((double) ((float) this.pos.getX() + 0.5F), + (double) ((float) this.pos.getY() + 0.5F), (double) ((float) this.pos.getZ() + 0.5F), 3.0D); + if (entityplayer != null) { + double d0 = entityplayer.posX - (double) ((float) this.pos.getX() + 0.5F); + double d1 = entityplayer.posZ - (double) ((float) this.pos.getZ() + 0.5F); + this.field_145924_q = (float) MathHelper.func_181159_b(d1, d0); + this.bookSpread += 0.1F; + if (this.bookSpread < 0.5F || rand.nextInt(40) == 0) { + float f1 = this.field_145932_k; + + while (true) { + this.field_145932_k += (float) (rand.nextInt(4) - rand.nextInt(4)); + if (f1 != this.field_145932_k) { + break; + } + } + } + } else { + this.field_145924_q += 0.02F; + this.bookSpread -= 0.1F; + } + + while (this.bookRotation >= 3.1415927F) { + this.bookRotation -= 6.2831855F; + } + + while (this.bookRotation < -3.1415927F) { + this.bookRotation += 6.2831855F; + } + + while (this.field_145924_q >= 3.1415927F) { + this.field_145924_q -= 6.2831855F; + } + + while (this.field_145924_q < -3.1415927F) { + this.field_145924_q += 6.2831855F; + } + + float f2; + for (f2 = this.field_145924_q - this.bookRotation; f2 >= 3.1415927F; f2 -= 6.2831855F) { + ; + } + + while (f2 < -3.1415927F) { + f2 += 6.2831855F; + } + + this.bookRotation += f2 * 0.4F; + this.bookSpread = MathHelper.clamp_float(this.bookSpread, 0.0F, 1.0F); + ++this.tickCount; + this.pageFlipPrev = this.pageFlip; + float f = (this.field_145932_k - this.pageFlip) * 0.4F; + float f3 = 0.2F; + f = MathHelper.clamp_float(f, -f3, f3); + this.field_145929_l += (f - this.field_145929_l) * 0.9F; + this.pageFlip += this.field_145929_l; + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.enchant"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String customNameIn) { + this.customName = customNameIn; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer var2) { + return new ContainerEnchantment(inventoryplayer, this.worldObj, this.pos); + } + + public String getGuiID() { + return "minecraft:enchanting_table"; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEndPortal.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEndPortal.java new file mode 100644 index 0000000..9f153ee --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEndPortal.java @@ -0,0 +1,33 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityEndPortal extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityEndPortal"); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnderChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnderChest.java new file mode 100644 index 0000000..0e39698 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnderChest.java @@ -0,0 +1,120 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityEnderChest extends TileEntity implements ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityEnderChest"); + } + + public float lidAngle; + public float prevLidAngle; + public int numPlayersUsing; + private int ticksSinceSync; + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + if (++this.ticksSinceSync % 20 * 4 == 0) { + this.worldObj.addBlockEvent(this.pos, Blocks.ender_chest, 1, this.numPlayersUsing); + } + + this.prevLidAngle = this.lidAngle; + int i = this.pos.getX(); + int j = this.pos.getY(); + int k = this.pos.getZ(); + float f = 0.1F; + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) { + double d0 = (double) i + 0.5D; + double d1 = (double) k + 0.5D; + this.worldObj.playSoundEffect(d0, (double) j + 0.5D, d1, "random.chestopen", 0.5F, + this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { + float f2 = this.lidAngle; + if (this.numPlayersUsing > 0) { + this.lidAngle += f; + } else { + this.lidAngle -= f; + } + + if (this.lidAngle > 1.0F) { + this.lidAngle = 1.0F; + } + + float f1 = 0.5F; + if (this.lidAngle < f1 && f2 >= f1) { + double d3 = (double) i + 0.5D; + double d2 = (double) k + 0.5D; + this.worldObj.playSoundEffect(d3, (double) j + 0.5D, d2, "random.chestclosed", 0.5F, + this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.lidAngle < 0.0F) { + this.lidAngle = 0.0F; + } + } + + } + + public boolean receiveClientEvent(int i, int j) { + if (i == 1) { + this.numPlayersUsing = j; + return true; + } else { + return super.receiveClientEvent(i, j); + } + } + + /**+ + * invalidates a tile entity + */ + public void invalidate() { + this.updateContainingBlockInfo(); + super.invalidate(); + } + + public void openChest() { + ++this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, Blocks.ender_chest, 1, this.numPlayersUsing); + } + + public void closeChest() { + --this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, Blocks.ender_chest, 1, this.numPlayersUsing); + } + + public boolean canBeUsed(EntityPlayer parEntityPlayer) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : parEntityPlayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFlowerPot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFlowerPot.java new file mode 100644 index 0000000..e473358 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFlowerPot.java @@ -0,0 +1,93 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityFlowerPot extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityFlowerPot"); + } + + private Item flowerPotItem; + private int flowerPotData; + + public TileEntityFlowerPot() { + } + + public TileEntityFlowerPot(Item potItem, int potData) { + this.flowerPotItem = potItem; + this.flowerPotData = potData; + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + ResourceLocation resourcelocation = (ResourceLocation) Item.itemRegistry.getNameForObject(this.flowerPotItem); + nbttagcompound.setString("Item", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound.setInteger("Data", this.flowerPotData); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + if (nbttagcompound.hasKey("Item", 8)) { + this.flowerPotItem = Item.getByNameOrId(nbttagcompound.getString("Item")); + } else { + this.flowerPotItem = Item.getItemById(nbttagcompound.getInteger("Item")); + } + + this.flowerPotData = nbttagcompound.getInteger("Data"); + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("Item"); + nbttagcompound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem)); + return new S35PacketUpdateTileEntity(this.pos, 5, nbttagcompound); + } + + public void setFlowerPotData(Item potItem, int potData) { + this.flowerPotItem = potItem; + this.flowerPotData = potData; + } + + public Item getFlowerPotItem() { + return this.flowerPotItem; + } + + public int getFlowerPotData() { + return this.flowerPotData; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFurnace.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFurnace.java new file mode 100644 index 0000000..b5f9604 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFurnace.java @@ -0,0 +1,476 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerFurnace; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ISidedInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.SlotFurnaceFuel; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemHoe; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemSword; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemTool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityLockable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityFurnace extends TileEntityLockable implements ITickable, ISidedInventory { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityFurnace"); + } + + private static final int[] slotsTop = new int[] { 0 }; + private static final int[] slotsBottom = new int[] { 2, 1 }; + private static final int[] slotsSides = new int[] { 1 }; + /**+ + * The ItemStacks that hold the items currently being used in + * the furnace + */ + private ItemStack[] furnaceItemStacks = new ItemStack[3]; + private int furnaceBurnTime; + private int currentItemBurnTime; + private int cookTime; + private int totalCookTime; + private String furnaceCustomName; + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.furnaceItemStacks.length; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return this.furnaceItemStacks[i]; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.furnaceItemStacks[i] != null) { + if (this.furnaceItemStacks[i].stackSize <= j) { + ItemStack itemstack1 = this.furnaceItemStacks[i]; + this.furnaceItemStacks[i] = null; + return itemstack1; + } else { + ItemStack itemstack = this.furnaceItemStacks[i].splitStack(j); + if (this.furnaceItemStacks[i].stackSize == 0) { + this.furnaceItemStacks[i] = null; + } + + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.furnaceItemStacks[i] != null) { + ItemStack itemstack = this.furnaceItemStacks[i]; + this.furnaceItemStacks[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + boolean flag = itemstack != null && itemstack.isItemEqual(this.furnaceItemStacks[i]) + && ItemStack.areItemStackTagsEqual(itemstack, this.furnaceItemStacks[i]); + this.furnaceItemStacks[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + if (i == 0 && !flag) { + this.totalCookTime = this.getCookTime(itemstack); + this.cookTime = 0; + this.markDirty(); + } + + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.furnaceCustomName : "container.furnace"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.furnaceCustomName != null && this.furnaceCustomName.length() > 0; + } + + public void setCustomInventoryName(String parString1) { + this.furnaceCustomName = parString1; + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.furnaceItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + if (b0 >= 0 && b0 < this.furnaceItemStacks.length) { + this.furnaceItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + this.furnaceBurnTime = nbttagcompound.getShort("BurnTime"); + this.cookTime = nbttagcompound.getShort("CookTime"); + this.totalCookTime = nbttagcompound.getShort("CookTimeTotal"); + this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); + if (nbttagcompound.hasKey("CustomName", 8)) { + this.furnaceCustomName = nbttagcompound.getString("CustomName"); + } + + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("BurnTime", (short) this.furnaceBurnTime); + nbttagcompound.setShort("CookTime", (short) this.cookTime); + nbttagcompound.setShort("CookTimeTotal", (short) this.totalCookTime); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.furnaceItemStacks.length; ++i) { + if (this.furnaceItemStacks[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.furnaceItemStacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + if (this.hasCustomName()) { + nbttagcompound.setString("CustomName", this.furnaceCustomName); + } + + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Furnace isBurning + */ + public boolean isBurning() { + return this.furnaceBurnTime > 0; + } + + /**+ + * Furnace isBurning + */ + public static boolean isBurning(IInventory parIInventory) { + return parIInventory.getField(0) > 0; + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + boolean flag = this.isBurning(); + boolean flag1 = false; + if (this.isBurning()) { + --this.furnaceBurnTime; + } + + { + if (this.isBurning() || this.furnaceItemStacks[1] != null && this.furnaceItemStacks[0] != null) { + if (!this.isBurning() && this.canSmelt()) { + this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); + if (this.isBurning()) { + flag1 = true; + if (this.furnaceItemStacks[1] != null) { + --this.furnaceItemStacks[1].stackSize; + if (this.furnaceItemStacks[1].stackSize == 0) { + Item item = this.furnaceItemStacks[1].getItem().getContainerItem(); + this.furnaceItemStacks[1] = item != null ? new ItemStack(item) : null; + } + } + } + } + + if (this.isBurning() && this.canSmelt()) { + ++this.cookTime; + if (this.cookTime == this.totalCookTime) { + this.cookTime = 0; + this.totalCookTime = this.getCookTime(this.furnaceItemStacks[0]); + this.smeltItem(); + flag1 = true; + } + } else { + this.cookTime = 0; + } + } else if (!this.isBurning() && this.cookTime > 0) { + this.cookTime = MathHelper.clamp_int(this.cookTime - 2, 0, this.totalCookTime); + } + + if (flag != this.isBurning()) { + flag1 = true; + BlockFurnace.setState(this.isBurning(), this.worldObj, this.pos); + } + } + + if (flag1) { + this.markDirty(); + } + + } + + public int getCookTime(ItemStack stack) { + return 200; + } + + /**+ + * Returns true if the furnace can smelt an item, i.e. has a + * source item, destination stack isn't full, etc. + */ + private boolean canSmelt() { + if (this.furnaceItemStacks[0] == null) { + return false; + } else { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[0]); + return itemstack == null ? false + : (this.furnaceItemStacks[2] == null ? true + : (!this.furnaceItemStacks[2].isItemEqual(itemstack) ? false + : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() + && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2] + .getMaxStackSize() ? true + : this.furnaceItemStacks[2].stackSize < itemstack + .getMaxStackSize()))); + } + } + + /**+ + * Turn one item from the furnace source stack into the + * appropriate smelted item in the furnace result stack + */ + public void smeltItem() { + if (this.canSmelt()) { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[0]); + if (this.furnaceItemStacks[2] == null) { + this.furnaceItemStacks[2] = itemstack.copy(); + } else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) { + ++this.furnaceItemStacks[2].stackSize; + } + + if (this.furnaceItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) + && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null + && this.furnaceItemStacks[1].getItem() == Items.bucket) { + this.furnaceItemStacks[1] = new ItemStack(Items.water_bucket); + } + + --this.furnaceItemStacks[0].stackSize; + if (this.furnaceItemStacks[0].stackSize <= 0) { + this.furnaceItemStacks[0] = null; + } + + } + } + + /**+ + * Returns the number of ticks that the supplied fuel item will + * keep the furnace burning, or 0 if the item isn't fuel + */ + public static int getItemBurnTime(ItemStack parItemStack) { + if (parItemStack == null) { + return 0; + } else { + Item item = parItemStack.getItem(); + if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) { + Block block = Block.getBlockFromItem(item); + if (block == Blocks.wooden_slab) { + return 150; + } + + if (block.getMaterial() == Material.wood) { + return 300; + } + + if (block == Blocks.coal_block) { + return 16000; + } + } + + return item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD") ? 200 + : (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD") ? 200 + : (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD") ? 200 + : (item == Items.stick ? 100 + : (item == Items.coal ? 1600 + : (item == Items.lava_bucket ? 20000 + : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 + : (item == Items.blaze_rod ? 2400 : 0))))))); + } + } + + public static boolean isItemFuel(ItemStack parItemStack) { + /**+ + * Returns the number of ticks that the supplied fuel item will + * keep the furnace burning, or 0 if the item isn't fuel + */ + return getItemBurnTime(parItemStack) > 0; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : entityplayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + return i == 2 ? false : (i != 1 ? true : isItemFuel(itemstack) || SlotFurnaceFuel.isBucket(itemstack)); + } + + public int[] getSlotsForFace(EnumFacing enumfacing) { + return enumfacing == EnumFacing.DOWN ? slotsBottom : (enumfacing == EnumFacing.UP ? slotsTop : slotsSides); + } + + /**+ + * Returns true if automation can insert the given item in the + * given slot from the given side. Args: slot, item, side + */ + public boolean canInsertItem(int i, ItemStack itemstack, EnumFacing var3) { + return this.isItemValidForSlot(i, itemstack); + } + + /**+ + * Returns true if automation can extract the given item in the + * given slot from the given side. Args: slot, item, side + */ + public boolean canExtractItem(int i, ItemStack itemstack, EnumFacing enumfacing) { + if (enumfacing == EnumFacing.DOWN && i == 1) { + Item item = itemstack.getItem(); + if (item != Items.water_bucket && item != Items.bucket) { + return false; + } + } + + return true; + } + + public String getGuiID() { + return "minecraft:furnace"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer var2) { + return new ContainerFurnace(inventoryplayer, this); + } + + public int getField(int i) { + switch (i) { + case 0: + return this.furnaceBurnTime; + case 1: + return this.currentItemBurnTime; + case 2: + return this.cookTime; + case 3: + return this.totalCookTime; + default: + return 0; + } + } + + public void setField(int i, int j) { + switch (i) { + case 0: + this.furnaceBurnTime = j; + break; + case 1: + this.currentItemBurnTime = j; + break; + case 2: + this.cookTime = j; + break; + case 3: + this.totalCookTime = j; + } + + } + + public int getFieldCount() { + return 4; + } + + public void clear() { + for (int i = 0; i < this.furnaceItemStacks.length; ++i) { + this.furnaceItemStacks[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityHopper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityHopper.java new file mode 100644 index 0000000..1c971aa --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityHopper.java @@ -0,0 +1,664 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ContainerHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.ISidedInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.IHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityLockable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityHopper extends TileEntityLockable implements IHopper, ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityHopper"); + } + + private ItemStack[] inventory = new ItemStack[5]; + private String customName; + private int transferCooldown = -1; + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + this.inventory = new ItemStack[this.getSizeInventory()]; + if (nbttagcompound.hasKey("CustomName", 8)) { + this.customName = nbttagcompound.getString("CustomName"); + } + + this.transferCooldown = nbttagcompound.getInteger("TransferCooldown"); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + if (b0 >= 0 && b0 < this.inventory.length) { + this.inventory[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.inventory.length; ++i) { + if (this.inventory[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.inventory[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + nbttagcompound.setTag("Items", nbttaglist); + nbttagcompound.setInteger("TransferCooldown", this.transferCooldown); + if (this.hasCustomName()) { + nbttagcompound.setString("CustomName", this.customName); + } + + } + + /**+ + * For tile entities, ensures the chunk containing the tile + * entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() { + super.markDirty(); + } + + /**+ + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.inventory.length; + } + + /**+ + * Returns the stack in the given slot. + */ + public ItemStack getStackInSlot(int i) { + return this.inventory[i]; + } + + /**+ + * Removes up to a specified number of items from an inventory + * slot and returns them in a new stack. + */ + public ItemStack decrStackSize(int i, int j) { + if (this.inventory[i] != null) { + if (this.inventory[i].stackSize <= j) { + ItemStack itemstack1 = this.inventory[i]; + this.inventory[i] = null; + return itemstack1; + } else { + ItemStack itemstack = this.inventory[i].splitStack(j); + if (this.inventory[i].stackSize == 0) { + this.inventory[i] = null; + } + + return itemstack; + } + } else { + return null; + } + } + + /**+ + * Removes a stack from the given slot and returns it. + */ + public ItemStack removeStackFromSlot(int i) { + if (this.inventory[i] != null) { + ItemStack itemstack = this.inventory[i]; + this.inventory[i] = null; + return itemstack; + } else { + return null; + } + } + + /**+ + * Sets the given item stack to the specified slot in the + * inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.inventory[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { + itemstack.stackSize = this.getInventoryStackLimit(); + } + + } + + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + public String getName() { + return this.hasCustomName() ? this.customName : "container.hopper"; + } + + /**+ + * Returns true if this thing is named + */ + public boolean hasCustomName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String customNameIn) { + this.customName = customNameIn; + } + + /**+ + * Returns the maximum stack size for a inventory slot. Seems to + * always be 64, possibly will be extended. + */ + public int getInventoryStackLimit() { + return 64; + } + + /**+ + * Do not make give this method the name canInteractWith because + * it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.pos) != this ? false + : entityplayer.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, + (double) this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer var1) { + } + + public void closeInventory(EntityPlayer var1) { + } + + /**+ + * Returns true if automation is allowed to insert the given + * stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int var1, ItemStack var2) { + return true; + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + if (this.worldObj != null) { + --this.transferCooldown; + if (!this.isOnTransferCooldown()) { + this.setTransferCooldown(0); + this.updateHopper(); + } + + } + } + + public boolean updateHopper() { + if (this.worldObj != null) { + if (!this.isOnTransferCooldown() && BlockHopper.isEnabled(this.getBlockMetadata())) { + boolean flag = false; + if (!this.isEmpty()) { + flag = this.transferItemsOut(); + } + + if (!this.isFull()) { + flag = captureDroppedItems(this) || flag; + } + + if (flag) { + this.setTransferCooldown(8); + this.markDirty(); + return true; + } + } + + return false; + } else { + return false; + } + } + + private boolean isEmpty() { + for (ItemStack itemstack : this.inventory) { + if (itemstack != null) { + return false; + } + } + + return true; + } + + private boolean isFull() { + for (ItemStack itemstack : this.inventory) { + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) { + return false; + } + } + + return true; + } + + private boolean transferItemsOut() { + IInventory iinventory = this.getInventoryForHopperTransfer(); + if (iinventory == null) { + return false; + } else { + EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()).getOpposite(); + if (this.isInventoryFull(iinventory, enumfacing)) { + return false; + } else { + for (int i = 0; i < this.getSizeInventory(); ++i) { + if (this.getStackInSlot(i) != null) { + ItemStack itemstack = this.getStackInSlot(i).copy(); + ItemStack itemstack1 = putStackInInventoryAllSlots(iinventory, this.decrStackSize(i, 1), + enumfacing); + if (itemstack1 == null || itemstack1.stackSize == 0) { + iinventory.markDirty(); + return true; + } + + this.setInventorySlotContents(i, itemstack); + } + } + + return false; + } + } + } + + /**+ + * Returns false if the inventory has any room to place items in + */ + private boolean isInventoryFull(IInventory inventoryIn, EnumFacing side) { + if (inventoryIn instanceof ISidedInventory) { + ISidedInventory isidedinventory = (ISidedInventory) inventoryIn; + int[] aint = isidedinventory.getSlotsForFace(side); + + for (int k = 0; k < aint.length; ++k) { + ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[k]); + if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize()) { + return false; + } + } + } else { + int i = inventoryIn.getSizeInventory(); + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = inventoryIn.getStackInSlot(j); + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) { + return false; + } + } + } + + return true; + } + + /**+ + * Returns false if the specified IInventory contains any items + */ + private static boolean isInventoryEmpty(IInventory inventoryIn, EnumFacing side) { + if (inventoryIn instanceof ISidedInventory) { + ISidedInventory isidedinventory = (ISidedInventory) inventoryIn; + int[] aint = isidedinventory.getSlotsForFace(side); + + for (int i = 0; i < aint.length; ++i) { + if (isidedinventory.getStackInSlot(aint[i]) != null) { + return false; + } + } + } else { + int j = inventoryIn.getSizeInventory(); + + for (int k = 0; k < j; ++k) { + if (inventoryIn.getStackInSlot(k) != null) { + return false; + } + } + } + + return true; + } + + public static boolean captureDroppedItems(IHopper parIHopper) { + IInventory iinventory = getHopperInventory(parIHopper); + if (iinventory != null) { + EnumFacing enumfacing = EnumFacing.DOWN; + if (isInventoryEmpty(iinventory, enumfacing)) { + return false; + } + + if (iinventory instanceof ISidedInventory) { + ISidedInventory isidedinventory = (ISidedInventory) iinventory; + int[] aint = isidedinventory.getSlotsForFace(enumfacing); + + for (int i = 0; i < aint.length; ++i) { + if (pullItemFromSlot(parIHopper, iinventory, aint[i], enumfacing)) { + return true; + } + } + } else { + int j = iinventory.getSizeInventory(); + + for (int k = 0; k < j; ++k) { + if (pullItemFromSlot(parIHopper, iinventory, k, enumfacing)) { + return true; + } + } + } + } else { + for (EntityItem entityitem : func_181556_a(parIHopper.getWorld(), parIHopper.getXPos(), + parIHopper.getYPos() + 1.0D, parIHopper.getZPos())) { + if (putDropInInventoryAllSlots(parIHopper, entityitem)) { + return true; + } + } + } + + return false; + } + + /**+ + * Pulls from the specified slot in the inventory and places in + * any available slot in the hopper. Returns true if the entire + * stack was moved + */ + private static boolean pullItemFromSlot(IHopper hopper, IInventory inventoryIn, int index, EnumFacing direction) { + ItemStack itemstack = inventoryIn.getStackInSlot(index); + if (itemstack != null && canExtractItemFromSlot(inventoryIn, itemstack, index, direction)) { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = putStackInInventoryAllSlots(hopper, inventoryIn.decrStackSize(index, 1), + (EnumFacing) null); + if (itemstack2 == null || itemstack2.stackSize == 0) { + inventoryIn.markDirty(); + return true; + } + + inventoryIn.setInventorySlotContents(index, itemstack1); + } + + return false; + } + + /**+ + * Attempts to place the passed EntityItem's stack into the + * inventory using as many slots as possible. Returns false if + * the stackSize of the drop was not depleted. + */ + public static boolean putDropInInventoryAllSlots(IInventory itemIn, EntityItem parEntityItem) { + boolean flag = false; + if (parEntityItem == null) { + return false; + } else { + ItemStack itemstack = parEntityItem.getEntityItem().copy(); + ItemStack itemstack1 = putStackInInventoryAllSlots(itemIn, itemstack, (EnumFacing) null); + if (itemstack1 != null && itemstack1.stackSize != 0) { + parEntityItem.setEntityItemStack(itemstack1); + } else { + flag = true; + parEntityItem.setDead(); + } + + return flag; + } + } + + /**+ + * Attempts to place the passed stack in the inventory, using as + * many slots as required. Returns leftover items + */ + public static ItemStack putStackInInventoryAllSlots(IInventory inventoryIn, ItemStack stack, EnumFacing side) { + if (inventoryIn instanceof ISidedInventory && side != null) { + ISidedInventory isidedinventory = (ISidedInventory) inventoryIn; + int[] aint = isidedinventory.getSlotsForFace(side); + + for (int k = 0; k < aint.length && stack != null && stack.stackSize > 0; ++k) { + stack = insertStack(inventoryIn, stack, aint[k], side); + } + } else { + int i = inventoryIn.getSizeInventory(); + + for (int j = 0; j < i && stack != null && stack.stackSize > 0; ++j) { + stack = insertStack(inventoryIn, stack, j, side); + } + } + + if (stack != null && stack.stackSize == 0) { + stack = null; + } + + return stack; + } + + /**+ + * Can this hopper insert the specified item from the specified + * slot on the specified side? + */ + private static boolean canInsertItemInSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side) { + return !inventoryIn.isItemValidForSlot(index, stack) ? false + : !(inventoryIn instanceof ISidedInventory) + || ((ISidedInventory) inventoryIn).canInsertItem(index, stack, side); + } + + /**+ + * Can this hopper extract the specified item from the specified + * slot on the specified side? + */ + private static boolean canExtractItemFromSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side) { + return !(inventoryIn instanceof ISidedInventory) + || ((ISidedInventory) inventoryIn).canExtractItem(index, stack, side); + } + + /**+ + * Insert the specified stack to the specified inventory and + * return any leftover items + */ + private static ItemStack insertStack(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side) { + ItemStack itemstack = inventoryIn.getStackInSlot(index); + if (canInsertItemInSlot(inventoryIn, stack, index, side)) { + boolean flag = false; + if (itemstack == null) { + inventoryIn.setInventorySlotContents(index, stack); + stack = null; + flag = true; + } else if (canCombine(itemstack, stack)) { + int i = stack.getMaxStackSize() - itemstack.stackSize; + int j = Math.min(stack.stackSize, i); + stack.stackSize -= j; + itemstack.stackSize += j; + flag = j > 0; + } + + if (flag) { + if (inventoryIn instanceof TileEntityHopper) { + TileEntityHopper tileentityhopper = (TileEntityHopper) inventoryIn; + if (tileentityhopper.mayTransfer()) { + tileentityhopper.setTransferCooldown(8); + } + + inventoryIn.markDirty(); + } + + inventoryIn.markDirty(); + } + } + + return stack; + } + + /**+ + * Returns the IInventory that this hopper is pointing into + */ + private IInventory getInventoryForHopperTransfer() { + EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()); + /**+ + * Returns the IInventory (if applicable) of the TileEntity at + * the specified position + */ + return getInventoryAtPosition(this.getWorld(), (double) (this.pos.getX() + enumfacing.getFrontOffsetX()), + (double) (this.pos.getY() + enumfacing.getFrontOffsetY()), + (double) (this.pos.getZ() + enumfacing.getFrontOffsetZ())); + } + + /**+ + * Returns the IInventory for the specified hopper + */ + public static IInventory getHopperInventory(IHopper hopper) { + /**+ + * Returns the IInventory (if applicable) of the TileEntity at + * the specified position + */ + return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + 1.0D, hopper.getZPos()); + } + + public static List func_181556_a(World parWorld, double parDouble1, double parDouble2, + double parDouble3) { + return parWorld + .getEntitiesWithinAABB( + EntityItem.class, new AxisAlignedBB(parDouble1 - 0.5D, parDouble2 - 0.5D, parDouble3 - 0.5D, + parDouble1 + 0.5D, parDouble2 + 0.5D, parDouble3 + 0.5D), + EntitySelectors.selectAnything); + } + + /**+ + * Returns the IInventory (if applicable) of the TileEntity at + * the specified position + */ + public static IInventory getInventoryAtPosition(World worldIn, double x, double y, double z) { + Object object = null; + int i = MathHelper.floor_double(x); + int j = MathHelper.floor_double(y); + int k = MathHelper.floor_double(z); + BlockPos blockpos = new BlockPos(i, j, k); + Block block = worldIn.getBlockState(blockpos).getBlock(); + if (block.hasTileEntity()) { + TileEntity tileentity = worldIn.getTileEntity(blockpos); + if (tileentity instanceof IInventory) { + object = (IInventory) tileentity; + if (object instanceof TileEntityChest && block instanceof BlockChest) { + object = ((BlockChest) block).getLockableContainer(worldIn, blockpos); + } + } + } + + if (object == null) { + List list = worldIn.getEntitiesInAABBexcluding((Entity) null, + new AxisAlignedBB(x - 0.5D, y - 0.5D, z - 0.5D, x + 0.5D, y + 0.5D, z + 0.5D), + EntitySelectors.selectInventories); + if (list.size() > 0) { + object = (IInventory) list.get(worldIn.rand.nextInt(list.size())); + } + } + + return (IInventory) object; + } + + private static boolean canCombine(ItemStack stack1, ItemStack stack2) { + return stack1.getItem() != stack2.getItem() ? false + : (stack1.getMetadata() != stack2.getMetadata() ? false + : (stack1.stackSize > stack1.getMaxStackSize() ? false + : ItemStack.areItemStackTagsEqual(stack1, stack2))); + } + + /**+ + * Gets the world X position for this hopper entity. + */ + public double getXPos() { + return (double) this.pos.getX() + 0.5D; + } + + /**+ + * Gets the world Y position for this hopper entity. + */ + public double getYPos() { + return (double) this.pos.getY() + 0.5D; + } + + /**+ + * Gets the world Z position for this hopper entity. + */ + public double getZPos() { + return (double) this.pos.getZ() + 0.5D; + } + + public void setTransferCooldown(int ticks) { + this.transferCooldown = ticks; + } + + public boolean isOnTransferCooldown() { + return this.transferCooldown > 0; + } + + public boolean mayTransfer() { + return this.transferCooldown <= 1; + } + + public String getGuiID() { + return "minecraft:hopper"; + } + + public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer) { + return new ContainerHopper(inventoryplayer, this, entityplayer); + } + + public int getField(int var1) { + return 0; + } + + public void setField(int var1, int var2) { + } + + public int getFieldCount() { + return 0; + } + + public void clear() { + for (int i = 0; i < this.inventory.length; ++i) { + this.inventory[i] = null; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityLockable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityLockable.java new file mode 100644 index 0000000..9ea4f53 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityLockable.java @@ -0,0 +1,75 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ILockableContainer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.LockCode; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class TileEntityLockable extends TileEntity implements IInteractionObject, ILockableContainer { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityLockable"); + } + + private LockCode code = LockCode.EMPTY_CODE; + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.code = LockCode.fromNBT(nbttagcompound); + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + if (this.code != null) { + this.code.toNBT(nbttagcompound); + } + + } + + public boolean isLocked() { + return this.code != null && !this.code.isEmpty(); + } + + public LockCode getLockCode() { + return this.code; + } + + public void setLockCode(LockCode code) { + this.code = code; + } + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + public IChatComponent getDisplayName() { + return (IChatComponent) (this.hasCustomName() ? new ChatComponentText(this.getName()) + : new ChatComponentTranslation(this.getName(), new Object[0])); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityMobSpawner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityMobSpawner.java new file mode 100644 index 0000000..169f84b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityMobSpawner.java @@ -0,0 +1,105 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityMobSpawner extends TileEntity implements ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityMobSpawner"); + } + + private final MobSpawnerBaseLogic spawnerLogic = new MobSpawnerBaseLogic() { + public void func_98267_a(int i) { + TileEntityMobSpawner.this.worldObj.addBlockEvent(TileEntityMobSpawner.this.pos, Blocks.mob_spawner, i, 0); + } + + public World getSpawnerWorld() { + return TileEntityMobSpawner.this.worldObj; + } + + public BlockPos getSpawnerPosition() { + return TileEntityMobSpawner.this.pos; + } + + public void setRandomEntity( + MobSpawnerBaseLogic.WeightedRandomMinecart mobspawnerbaselogic$weightedrandomminecart) { + super.setRandomEntity(mobspawnerbaselogic$weightedrandomminecart); + if (this.getSpawnerWorld() != null) { + this.getSpawnerWorld().markBlockForUpdate(TileEntityMobSpawner.this.pos); + } + + } + }; + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.spawnerLogic.readFromNBT(nbttagcompound); + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + this.spawnerLogic.writeToNBT(nbttagcompound); + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + this.spawnerLogic.updateSpawner(); + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("SpawnPotentials"); + return new S35PacketUpdateTileEntity(this.pos, 1, nbttagcompound); + } + + public boolean receiveClientEvent(int i, int j) { + return this.spawnerLogic.setDelayToMin(i) ? true : super.receiveClientEvent(i, j); + } + + public boolean func_183000_F() { + return true; + } + + public MobSpawnerBaseLogic getSpawnerBaseLogic() { + return this.spawnerLogic; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityNote.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityNote.java new file mode 100644 index 0000000..68d28d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityNote.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityNote extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityNote"); + } + + public byte note; + public boolean previousRedstoneState; + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setByte("note", this.note); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.note = nbttagcompound.getByte("note"); + this.note = (byte) MathHelper.clamp_int(this.note, 0, 24); + } + + /**+ + * change pitch by -> (currentPitch + 1) % 25 + */ + public void changePitch() { + this.note = (byte) ((this.note + 1) % 25); + this.markDirty(); + } + + public void triggerNote(World worldIn, BlockPos parBlockPos) { + if (worldIn.getBlockState(parBlockPos.up()).getBlock().getMaterial() == Material.air) { + Material material = worldIn.getBlockState(parBlockPos.down()).getBlock().getMaterial(); + byte b0 = 0; + if (material == Material.rock) { + b0 = 1; + } + + if (material == Material.sand) { + b0 = 2; + } + + if (material == Material.glass) { + b0 = 3; + } + + if (material == Material.wood) { + b0 = 4; + } + + worldIn.addBlockEvent(parBlockPos, Blocks.noteblock, b0, this.note); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityPiston.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityPiston.java new file mode 100644 index 0000000..9dd2e29 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityPiston.java @@ -0,0 +1,213 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntityPiston extends TileEntity implements ITickable { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntityPiston"); + } + + private IBlockState pistonState; + private EnumFacing pistonFacing; + private boolean extending; + private boolean shouldHeadBeRendered; + private float progress; + private float lastProgress; + private List field_174933_k = Lists.newArrayList(); + + public TileEntityPiston() { + } + + public TileEntityPiston(IBlockState pistonStateIn, EnumFacing pistonFacingIn, boolean extendingIn, + boolean shouldHeadBeRenderedIn) { + this.pistonState = pistonStateIn; + this.pistonFacing = pistonFacingIn; + this.extending = extendingIn; + this.shouldHeadBeRendered = shouldHeadBeRenderedIn; + } + + public IBlockState getPistonState() { + return this.pistonState; + } + + public int getBlockMetadata() { + return 0; + } + + /**+ + * Returns true if a piston is extending + */ + public boolean isExtending() { + return this.extending; + } + + public EnumFacing getFacing() { + return this.pistonFacing; + } + + public boolean shouldPistonHeadBeRendered() { + return this.shouldHeadBeRendered; + } + + /**+ + * Get interpolated progress value (between lastProgress and + * progress) given the fractional time between ticks as an + * argument + */ + public float getProgress(float ticks) { + if (ticks > 1.0F) { + ticks = 1.0F; + } + + return this.lastProgress + (this.progress - this.lastProgress) * ticks; + } + + public float getOffsetX(float ticks) { + return this.extending ? (this.getProgress(ticks) - 1.0F) * (float) this.pistonFacing.getFrontOffsetX() + : (1.0F - this.getProgress(ticks)) * (float) this.pistonFacing.getFrontOffsetX(); + } + + public float getOffsetY(float ticks) { + return this.extending ? (this.getProgress(ticks) - 1.0F) * (float) this.pistonFacing.getFrontOffsetY() + : (1.0F - this.getProgress(ticks)) * (float) this.pistonFacing.getFrontOffsetY(); + } + + public float getOffsetZ(float ticks) { + return this.extending ? (this.getProgress(ticks) - 1.0F) * (float) this.pistonFacing.getFrontOffsetZ() + : (1.0F - this.getProgress(ticks)) * (float) this.pistonFacing.getFrontOffsetZ(); + } + + private void launchWithSlimeBlock(float parFloat1, float parFloat2) { + if (this.extending) { + parFloat1 = 1.0F - parFloat1; + } else { + --parFloat1; + } + + AxisAlignedBB axisalignedbb = Blocks.piston_extension.getBoundingBox(this.worldObj, this.pos, this.pistonState, + parFloat1, this.pistonFacing); + if (axisalignedbb != null) { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity) null, axisalignedbb); + if (!list.isEmpty()) { + this.field_174933_k.addAll(list); + + for (Entity entity : this.field_174933_k) { + if (this.pistonState.getBlock() == Blocks.slime_block && this.extending) { + switch (this.pistonFacing.getAxis()) { + case X: + entity.motionX = (double) this.pistonFacing.getFrontOffsetX(); + break; + case Y: + entity.motionY = (double) this.pistonFacing.getFrontOffsetY(); + break; + case Z: + entity.motionZ = (double) this.pistonFacing.getFrontOffsetZ(); + } + } else { + entity.moveEntity((double) (parFloat2 * (float) this.pistonFacing.getFrontOffsetX()), + (double) (parFloat2 * (float) this.pistonFacing.getFrontOffsetY()), + (double) (parFloat2 * (float) this.pistonFacing.getFrontOffsetZ())); + } + } + + this.field_174933_k.clear(); + } + } + + } + + /**+ + * removes a piston's tile entity (and if the piston is moving, + * stops it) + */ + public void clearPistonTileEntity() { + if (this.lastProgress < 1.0F && this.worldObj != null) { + this.lastProgress = this.progress = 1.0F; + this.worldObj.removeTileEntity(this.pos); + this.invalidate(); + if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) { + this.worldObj.setBlockState(this.pos, this.pistonState, 3); + this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); + } + } + + } + + /**+ + * Like the old updateEntity(), except more generic. + */ + public void update() { + this.lastProgress = this.progress; + if (this.lastProgress >= 1.0F) { + this.launchWithSlimeBlock(1.0F, 0.25F); + this.worldObj.removeTileEntity(this.pos); + this.invalidate(); + if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) { + this.worldObj.setBlockState(this.pos, this.pistonState, 3); + this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); + } + + } else { + this.progress += 0.5F; + if (this.progress >= 1.0F) { + this.progress = 1.0F; + } + + if (this.extending) { + this.launchWithSlimeBlock(this.progress, this.progress - this.lastProgress + 0.0625F); + } + + } + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.pistonState = Block.getBlockById(nbttagcompound.getInteger("blockId")) + .getStateFromMeta(nbttagcompound.getInteger("blockData")); + this.pistonFacing = EnumFacing.getFront(nbttagcompound.getInteger("facing")); + this.lastProgress = this.progress = nbttagcompound.getFloat("progress"); + this.extending = nbttagcompound.getBoolean("extending"); + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setInteger("blockId", Block.getIdFromBlock(this.pistonState.getBlock())); + nbttagcompound.setInteger("blockData", this.pistonState.getBlock().getMetaFromState(this.pistonState)); + nbttagcompound.setInteger("facing", this.pistonFacing.getIndex()); + nbttagcompound.setFloat("progress", this.lastProgress); + nbttagcompound.setBoolean("extending", this.extending); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySign.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySign.java new file mode 100644 index 0000000..4e059c5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySign.java @@ -0,0 +1,246 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandResultStats; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.ClickEvent; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S33PacketUpdateSign; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentProcessor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import org.json.JSONException; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntitySign extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntitySign"); + } + + public final IChatComponent[] signText = new IChatComponent[] { new ChatComponentText(""), + new ChatComponentText(""), new ChatComponentText(""), new ChatComponentText("") }; + /**+ + * The index of the line currently being edited. Only used on + * client side, but defined on both. Note this is only really + * used when the > < are going to be visible. + */ + public int lineBeingEdited = -1; + private boolean isEditable = true; + private EntityPlayer player; + private final CommandResultStats stats = new CommandResultStats(); + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + + for (int i = 0; i < 4; ++i) { + String s = IChatComponent.Serializer.componentToJson(this.signText[i]); + nbttagcompound.setString("Text" + (i + 1), s); + } + + this.stats.writeStatsToNBT(nbttagcompound); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + this.isEditable = false; + super.readFromNBT(nbttagcompound); + ICommandSender icommandsender = new ICommandSender() { + public String getName() { + return "Sign"; + } + + public IChatComponent getDisplayName() { + return new ChatComponentText(this.getName()); + } + + public void addChatMessage(IChatComponent var1) { + } + + public boolean canCommandSenderUseCommand(int var1, String var2) { + return true; + } + + public BlockPos getPosition() { + return TileEntitySign.this.pos; + } + + public Vec3 getPositionVector() { + return new Vec3((double) TileEntitySign.this.pos.getX() + 0.5D, + (double) TileEntitySign.this.pos.getY() + 0.5D, (double) TileEntitySign.this.pos.getZ() + 0.5D); + } + + public World getEntityWorld() { + return TileEntitySign.this.worldObj; + } + + public Entity getCommandSenderEntity() { + return null; + } + + public boolean sendCommandFeedback() { + return false; + } + + public void setCommandStat(CommandResultStats.Type var1, int var2) { + } + }; + + for (int i = 0; i < 4; ++i) { + String s = nbttagcompound.getString("Text" + (i + 1)); + + try { + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + + try { + this.signText[i] = ChatComponentProcessor.processComponent(icommandsender, ichatcomponent, + (Entity) null); + } catch (CommandException var7) { + this.signText[i] = ichatcomponent; + } + } catch (JSONException var8) { + this.signText[i] = new ChatComponentText(s); + } + } + + this.stats.readStatsFromNBT(nbttagcompound); + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + IChatComponent[] aichatcomponent = new IChatComponent[4]; + System.arraycopy(this.signText, 0, aichatcomponent, 0, 4); + return new S33PacketUpdateSign(this.worldObj, this.pos, aichatcomponent); + } + + public boolean func_183000_F() { + return true; + } + + public boolean getIsEditable() { + return this.isEditable; + } + + /**+ + * Sets the sign's isEditable flag to the specified parameter. + */ + public void setEditable(boolean isEditableIn) { + this.isEditable = isEditableIn; + if (!isEditableIn) { + this.player = null; + } + + } + + public void setPlayer(EntityPlayer playerIn) { + this.player = playerIn; + } + + public EntityPlayer getPlayer() { + return this.player; + } + + public boolean executeCommand(final EntityPlayer playerIn) { + ICommandSender icommandsender = new ICommandSender() { + public String getName() { + return playerIn.getName(); + } + + public IChatComponent getDisplayName() { + return playerIn.getDisplayName(); + } + + public void addChatMessage(IChatComponent var1) { + } + + public boolean canCommandSenderUseCommand(int j, String var2) { + return j <= 2; + } + + public BlockPos getPosition() { + return TileEntitySign.this.pos; + } + + public Vec3 getPositionVector() { + return new Vec3((double) TileEntitySign.this.pos.getX() + 0.5D, + (double) TileEntitySign.this.pos.getY() + 0.5D, (double) TileEntitySign.this.pos.getZ() + 0.5D); + } + + public World getEntityWorld() { + return playerIn.getEntityWorld(); + } + + public Entity getCommandSenderEntity() { + return playerIn; + } + + public boolean sendCommandFeedback() { + return false; + } + + public void setCommandStat(CommandResultStats.Type commandresultstats$type, int j) { + TileEntitySign.this.stats.func_179672_a(this, commandresultstats$type, j); + } + }; + + boolean didSomething = false; + + for (int i = 0; i < this.signText.length; ++i) { + ChatStyle chatstyle = this.signText[i] == null ? null : this.signText[i].getChatStyle(); + if (chatstyle != null && chatstyle.getChatClickEvent() != null) { + ClickEvent clickevent = chatstyle.getChatClickEvent(); + if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) { + didSomething = true; + MinecraftServer.getServer().getCommandManager().executeCommand(icommandsender, + clickevent.getValue()); + } + } + } + + if (!didSomething && MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("doSignEditing")) { + playerIn.openEditSign(this); + } + + return true; + } + + public CommandResultStats getStats() { + return this.stats; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySkull.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySkull.java new file mode 100644 index 0000000..149080e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySkull.java @@ -0,0 +1,124 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity; + +import com.google.common.collect.Iterables; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.Property; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TileEntitySkull extends TileEntity { + + static { + __checkIntegratedContextValid("net/minecraft/tileentity/TileEntitySkull"); + } + + private int skullType; + private int skullRotation; + private GameProfile playerProfile = null; + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setByte("SkullType", (byte) (this.skullType & 255)); + nbttagcompound.setByte("Rot", (byte) (this.skullRotation & 255)); + if (this.playerProfile != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTUtil.writeGameProfile(nbttagcompound1, this.playerProfile); + nbttagcompound.setTag("Owner", nbttagcompound1); + } + + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.skullType = nbttagcompound.getByte("SkullType"); + this.skullRotation = nbttagcompound.getByte("Rot"); + if (this.skullType == 3) { + if (nbttagcompound.hasKey("Owner", 10)) { + this.playerProfile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("Owner")); + } else if (nbttagcompound.hasKey("ExtraType", 8)) { + String s = nbttagcompound.getString("ExtraType"); + if (!StringUtils.isNullOrEmpty(s)) { + this.playerProfile = new GameProfile((EaglercraftUUID) null, s); + this.updatePlayerProfile(); + } + } + } + + } + + public GameProfile getPlayerProfile() { + return this.playerProfile; + } + + /**+ + * Allows for a specialized description packet to be created. + * This is often used to sync tile entity data from the server + * to the client easily. For example this is used by signs to + * synchronise the text to be displayed. + */ + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 4, nbttagcompound); + } + + public void setType(int type) { + this.skullType = type; + this.playerProfile = null; + } + + public void setPlayerProfile(GameProfile playerProfile) { + this.skullType = 3; + this.playerProfile = playerProfile; + this.updatePlayerProfile(); + } + + private void updatePlayerProfile() { + this.playerProfile = updateGameprofile(this.playerProfile); + this.markDirty(); + } + + public static GameProfile updateGameprofile(GameProfile input) { + return input; + } + + public int getSkullType() { + return this.skullType; + } + + public int getSkullRotation() { + return this.skullRotation; + } + + public void setSkullRotation(int rotation) { + this.skullRotation = rotation; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/AxisAlignedBB.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/AxisAlignedBB.java new file mode 100644 index 0000000..5ea83b4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/AxisAlignedBB.java @@ -0,0 +1,382 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 AxisAlignedBB { + + static { + __checkIntegratedContextValid("net/minecraft/util/AxisAlignedBB"); + } + + public final double minX; + public final double minY; + public final double minZ; + public final double maxX; + public final double maxY; + public final double maxZ; + + public AxisAlignedBB(double x1, double y1, double z1, double x2, double y2, double z2) { + this.minX = Math.min(x1, x2); + this.minY = Math.min(y1, y2); + this.minZ = Math.min(z1, z2); + this.maxX = Math.max(x1, x2); + this.maxY = Math.max(y1, y2); + this.maxZ = Math.max(z1, z2); + } + + public AxisAlignedBB(BlockPos pos1, BlockPos pos2) { + this.minX = (double) pos1.getX(); + this.minY = (double) pos1.getY(); + this.minZ = (double) pos1.getZ(); + this.maxX = (double) pos2.getX(); + this.maxY = (double) pos2.getY(); + this.maxZ = (double) pos2.getZ(); + } + + /**+ + * Adds the coordinates to the bounding box extending it if the + * point lies outside the current ranges. Args: x, y, z + */ + public AxisAlignedBB addCoord(double x, double y, double z) { + double d0 = this.minX; + double d1 = this.minY; + double d2 = this.minZ; + double d3 = this.maxX; + double d4 = this.maxY; + double d5 = this.maxZ; + if (x < 0.0D) { + d0 += x; + } else if (x > 0.0D) { + d3 += x; + } + + if (y < 0.0D) { + d1 += y; + } else if (y > 0.0D) { + d4 += y; + } + + if (z < 0.0D) { + d2 += z; + } else if (z > 0.0D) { + d5 += z; + } + + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + /**+ + * Returns a bounding box expanded by the specified vector (if + * negative numbers are given it will shrink). Args: x, y, z + */ + public AxisAlignedBB expand(double x, double y, double z) { + double d0 = this.minX - x; + double d1 = this.minY - y; + double d2 = this.minZ - z; + double d3 = this.maxX + x; + double d4 = this.maxY + y; + double d5 = this.maxZ + z; + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public AxisAlignedBB union(AxisAlignedBB other) { + double d0 = Math.min(this.minX, other.minX); + double d1 = Math.min(this.minY, other.minY); + double d2 = Math.min(this.minZ, other.minZ); + double d3 = Math.max(this.maxX, other.maxX); + double d4 = Math.max(this.maxY, other.maxY); + double d5 = Math.max(this.maxZ, other.maxZ); + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + /**+ + * returns an AABB with corners x1, y1, z1 and x2, y2, z2 + */ + public static AxisAlignedBB fromBounds(double x1, double y1, double z1, double x2, double y2, double z2) { + double d0 = Math.min(x1, x2); + double d1 = Math.min(y1, y2); + double d2 = Math.min(z1, z2); + double d3 = Math.max(x1, x2); + double d4 = Math.max(y1, y2); + double d5 = Math.max(z1, z2); + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + /**+ + * Offsets the current bounding box by the specified + * coordinates. Args: x, y, z + */ + public AxisAlignedBB offset(double x, double y, double z) { + return new AxisAlignedBB(this.minX + x, this.minY + y, this.minZ + z, this.maxX + x, this.maxY + y, + this.maxZ + z); + } + + /**+ + * if instance and the argument bounding boxes overlap in the Y + * and Z dimensions, calculate the offset between them in the X + * dimension. return var2 if the bounding boxes do not overlap + * or if var2 is closer to 0 then the calculated offset. + * Otherwise return the calculated offset. + */ + public double calculateXOffset(AxisAlignedBB other, double offsetX) { + if (other.maxY > this.minY && other.minY < this.maxY && other.maxZ > this.minZ && other.minZ < this.maxZ) { + if (offsetX > 0.0D && other.maxX <= this.minX) { + double d1 = this.minX - other.maxX; + if (d1 < offsetX) { + offsetX = d1; + } + } else if (offsetX < 0.0D && other.minX >= this.maxX) { + double d0 = this.maxX - other.minX; + if (d0 > offsetX) { + offsetX = d0; + } + } + + return offsetX; + } else { + return offsetX; + } + } + + /**+ + * if instance and the argument bounding boxes overlap in the X + * and Z dimensions, calculate the offset between them in the Y + * dimension. return var2 if the bounding boxes do not overlap + * or if var2 is closer to 0 then the calculated offset. + * Otherwise return the calculated offset. + */ + public double calculateYOffset(AxisAlignedBB other, double offsetY) { + if (other.maxX > this.minX && other.minX < this.maxX && other.maxZ > this.minZ && other.minZ < this.maxZ) { + if (offsetY > 0.0D && other.maxY <= this.minY) { + double d1 = this.minY - other.maxY; + if (d1 < offsetY) { + offsetY = d1; + } + } else if (offsetY < 0.0D && other.minY >= this.maxY) { + double d0 = this.maxY - other.minY; + if (d0 > offsetY) { + offsetY = d0; + } + } + + return offsetY; + } else { + return offsetY; + } + } + + /**+ + * if instance and the argument bounding boxes overlap in the Y + * and X dimensions, calculate the offset between them in the Z + * dimension. return var2 if the bounding boxes do not overlap + * or if var2 is closer to 0 then the calculated offset. + * Otherwise return the calculated offset. + */ + public double calculateZOffset(AxisAlignedBB other, double offsetZ) { + if (other.maxX > this.minX && other.minX < this.maxX && other.maxY > this.minY && other.minY < this.maxY) { + if (offsetZ > 0.0D && other.maxZ <= this.minZ) { + double d1 = this.minZ - other.maxZ; + if (d1 < offsetZ) { + offsetZ = d1; + } + } else if (offsetZ < 0.0D && other.minZ >= this.maxZ) { + double d0 = this.maxZ - other.minZ; + if (d0 > offsetZ) { + offsetZ = d0; + } + } + + return offsetZ; + } else { + return offsetZ; + } + } + + /**+ + * Returns whether the given bounding box intersects with this + * one. Args: axisAlignedBB + */ + public boolean intersectsWith(AxisAlignedBB other) { + return other.maxX > this.minX && other.minX < this.maxX + ? (other.maxY > this.minY && other.minY < this.maxY ? other.maxZ > this.minZ && other.minZ < this.maxZ + : false) + : false; + } + + /**+ + * Returns if the supplied Vec3D is completely inside the + * bounding box + */ + public boolean isVecInside(Vec3 vec) { + return vec.xCoord > this.minX && vec.xCoord < this.maxX + ? (vec.yCoord > this.minY && vec.yCoord < this.maxY ? vec.zCoord > this.minZ && vec.zCoord < this.maxZ + : false) + : false; + } + + /**+ + * Returns the average length of the edges of the bounding box. + */ + public double getAverageEdgeLength() { + double d0 = this.maxX - this.minX; + double d1 = this.maxY - this.minY; + double d2 = this.maxZ - this.minZ; + return (d0 + d1 + d2) / 3.0D; + } + + /**+ + * Returns a bounding box that is inset by the specified amounts + */ + public AxisAlignedBB contract(double x, double y, double z) { + double d0 = this.minX + x; + double d1 = this.minY + y; + double d2 = this.minZ + z; + double d3 = this.maxX - x; + double d4 = this.maxY - y; + double d5 = this.maxZ - z; + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public MovingObjectPosition calculateIntercept(Vec3 vecA, Vec3 vecB) { + Vec3 vec3 = vecA.getIntermediateWithXValue(vecB, this.minX); + Vec3 vec31 = vecA.getIntermediateWithXValue(vecB, this.maxX); + Vec3 vec32 = vecA.getIntermediateWithYValue(vecB, this.minY); + Vec3 vec33 = vecA.getIntermediateWithYValue(vecB, this.maxY); + Vec3 vec34 = vecA.getIntermediateWithZValue(vecB, this.minZ); + Vec3 vec35 = vecA.getIntermediateWithZValue(vecB, this.maxZ); + if (!this.isVecInYZ(vec3)) { + vec3 = null; + } + + if (!this.isVecInYZ(vec31)) { + vec31 = null; + } + + if (!this.isVecInXZ(vec32)) { + vec32 = null; + } + + if (!this.isVecInXZ(vec33)) { + vec33 = null; + } + + if (!this.isVecInXY(vec34)) { + vec34 = null; + } + + if (!this.isVecInXY(vec35)) { + vec35 = null; + } + + Vec3 vec36 = null; + if (vec3 != null) { + vec36 = vec3; + } + + if (vec31 != null && (vec36 == null || vecA.squareDistanceTo(vec31) < vecA.squareDistanceTo(vec36))) { + vec36 = vec31; + } + + if (vec32 != null && (vec36 == null || vecA.squareDistanceTo(vec32) < vecA.squareDistanceTo(vec36))) { + vec36 = vec32; + } + + if (vec33 != null && (vec36 == null || vecA.squareDistanceTo(vec33) < vecA.squareDistanceTo(vec36))) { + vec36 = vec33; + } + + if (vec34 != null && (vec36 == null || vecA.squareDistanceTo(vec34) < vecA.squareDistanceTo(vec36))) { + vec36 = vec34; + } + + if (vec35 != null && (vec36 == null || vecA.squareDistanceTo(vec35) < vecA.squareDistanceTo(vec36))) { + vec36 = vec35; + } + + if (vec36 == null) { + return null; + } else { + EnumFacing enumfacing = null; + if (vec36 == vec3) { + enumfacing = EnumFacing.WEST; + } else if (vec36 == vec31) { + enumfacing = EnumFacing.EAST; + } else if (vec36 == vec32) { + enumfacing = EnumFacing.DOWN; + } else if (vec36 == vec33) { + enumfacing = EnumFacing.UP; + } else if (vec36 == vec34) { + enumfacing = EnumFacing.NORTH; + } else { + enumfacing = EnumFacing.SOUTH; + } + + return new MovingObjectPosition(vec36, enumfacing); + } + } + + /**+ + * Checks if the specified vector is within the YZ dimensions of + * the bounding box. Args: Vec3D + */ + private boolean isVecInYZ(Vec3 vec) { + return vec == null ? false + : vec.yCoord >= this.minY && vec.yCoord <= this.maxY && vec.zCoord >= this.minZ + && vec.zCoord <= this.maxZ; + } + + /**+ + * Checks if the specified vector is within the XZ dimensions of + * the bounding box. Args: Vec3D + */ + private boolean isVecInXZ(Vec3 vec) { + return vec == null ? false + : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.zCoord >= this.minZ + && vec.zCoord <= this.maxZ; + } + + /**+ + * Checks if the specified vector is within the XY dimensions of + * the bounding box. Args: Vec3D + */ + private boolean isVecInXY(Vec3 vec) { + return vec == null ? false + : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.yCoord >= this.minY + && vec.yCoord <= this.maxY; + } + + public String toString() { + return "box[" + this.minX + ", " + this.minY + ", " + this.minZ + " -> " + this.maxX + ", " + this.maxY + ", " + + this.maxZ + "]"; + } + + public boolean func_181656_b() { + return Double.isNaN(this.minX) || Double.isNaN(this.minY) || Double.isNaN(this.minZ) || Double.isNaN(this.maxX) + || Double.isNaN(this.maxY) || Double.isNaN(this.maxZ); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/BlockPos.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/BlockPos.java new file mode 100644 index 0000000..da9acea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/BlockPos.java @@ -0,0 +1,358 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.AbstractIterator; +import java.util.Iterator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3i; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BlockPos extends Vec3i { + + static { + __checkIntegratedContextValid("net/minecraft/util/BlockPos"); + } + + /**+ + * The BlockPos with all coordinates 0 + */ + public static final BlockPos ORIGIN = new BlockPos(0, 0, 0); + private static final int NUM_X_BITS = 1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000)); + private static final int NUM_Z_BITS = NUM_X_BITS; + private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS; + private static final int Y_SHIFT = 0 + NUM_Z_BITS; + private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS; + private static final long X_MASK = (1L << NUM_X_BITS) - 1L; + private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L; + private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L; + + public BlockPos(int x, int y, int z) { + super(x, y, z); + } + + public BlockPos(double x, double y, double z) { + super(x, y, z); + } + + public BlockPos(Entity source) { + this(source.posX, source.posY, source.posZ); + } + + public BlockPos(Vec3 source) { + this(source.xCoord, source.yCoord, source.zCoord); + } + + public BlockPos(Vec3i source) { + this(source.getX(), source.getY(), source.getZ()); + } + + /**+ + * Add the given coordinates to the coordinates of this BlockPos + */ + public BlockPos add(double x, double y, double z) { + return x == 0.0D && y == 0.0D && z == 0.0D ? this + : new BlockPos((double) this.getX() + x, (double) this.getY() + y, (double) this.getZ() + z); + } + + /**+ + * Add the given coordinates to the coordinates of this BlockPos + */ + public BlockPos add(int x, int y, int z) { + return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z); + } + + /**+ + * Add the given coordinates to the coordinates of this BlockPos + */ + public BlockPos add(Vec3i vec) { + return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this + : new BlockPos(this.getX() + vec.getX(), this.getY() + vec.getY(), this.getZ() + vec.getZ()); + } + + /**+ + * Subtract the given Vector from this BlockPos + */ + public BlockPos subtract(Vec3i vec) { + return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this + : new BlockPos(this.getX() - vec.getX(), this.getY() - vec.getY(), this.getZ() - vec.getZ()); + } + + /**+ + * Offset this BlockPos 1 block up + */ + public BlockPos up() { + return this.up(1); + } + + /**+ + * Offset this BlockPos 1 block up + */ + public BlockPos up(int n) { + return this.offset(EnumFacing.UP, n); + } + + /**+ + * Offset this BlockPos 1 block down + */ + public BlockPos down() { + return this.down(1); + } + + /**+ + * Offset this BlockPos 1 block down + */ + public BlockPos down(int n) { + return this.offset(EnumFacing.DOWN, n); + } + + /**+ + * Offset this BlockPos 1 block in northern direction + */ + public BlockPos north() { + return this.north(1); + } + + /**+ + * Offset this BlockPos 1 block in northern direction + */ + public BlockPos north(int n) { + return this.offset(EnumFacing.NORTH, n); + } + + /**+ + * Offset this BlockPos 1 block in southern direction + */ + public BlockPos south() { + return this.south(1); + } + + /**+ + * Offset this BlockPos 1 block in southern direction + */ + public BlockPos south(int n) { + return this.offset(EnumFacing.SOUTH, n); + } + + /**+ + * Offset this BlockPos 1 block in western direction + */ + public BlockPos west() { + return this.west(1); + } + + /**+ + * Offset this BlockPos 1 block in western direction + */ + public BlockPos west(int n) { + return this.offset(EnumFacing.WEST, n); + } + + /**+ + * Offset this BlockPos 1 block in eastern direction + */ + public BlockPos east() { + return this.east(1); + } + + /**+ + * Offset this BlockPos 1 block in eastern direction + */ + public BlockPos east(int n) { + return this.offset(EnumFacing.EAST, n); + } + + /**+ + * Offset this BlockPos 1 block in the given direction + */ + public BlockPos offset(EnumFacing facing) { + return this.offset(facing, 1); + } + + /**+ + * Offset this BlockPos 1 block in the given direction + */ + public BlockPos offset(EnumFacing facing, int n) { + return n == 0 ? this + : new BlockPos(this.getX() + facing.getFrontOffsetX() * n, this.getY() + facing.getFrontOffsetY() * n, + this.getZ() + facing.getFrontOffsetZ() * n); + } + + /**+ + * Calculate the cross product of this and the given Vector + */ + public BlockPos crossProduct(Vec3i vec3i) { + return new BlockPos(this.getY() * vec3i.getZ() - this.getZ() * vec3i.getY(), + this.getZ() * vec3i.getX() - this.getX() * vec3i.getZ(), + this.getX() * vec3i.getY() - this.getY() * vec3i.getX()); + } + + /**+ + * Serialize this BlockPos into a long value + */ + public long toLong() { + return ((long) this.getX() & X_MASK) << X_SHIFT | ((long) this.getY() & Y_MASK) << Y_SHIFT + | ((long) this.getZ() & Z_MASK) << 0; + } + + /**+ + * Create a BlockPos from a serialized long value (created by + * toLong) + */ + public static BlockPos fromLong(long serialized) { + int i = (int) (serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); + int j = (int) (serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS); + int k = (int) (serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS); + return new BlockPos(i, j, k); + } + + /**+ + * Create an Iterable that returns all positions in the box + * specified by the given corners + */ + public static Iterable getAllInBox(BlockPos from, BlockPos to) { + final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), + Math.min(from.getZ(), to.getZ())); + final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), + Math.max(from.getZ(), to.getZ())); + return new Iterable() { + public Iterator iterator() { + return new AbstractIterator() { + private BlockPos lastReturned = null; + + protected BlockPos computeNext() { + if (this.lastReturned == null) { + this.lastReturned = blockpos; + return this.lastReturned; + } else if (this.lastReturned.equals(blockpos1)) { + return (BlockPos) this.endOfData(); + } else { + int i = this.lastReturned.getX(); + int j = this.lastReturned.getY(); + int k = this.lastReturned.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.lastReturned = new BlockPos(i, j, k); + return this.lastReturned; + } + } + }; + } + }; + } + + /**+ + * Like getAllInBox but reuses a single MutableBlockPos instead. + * If this method is used, the resulting BlockPos instances can + * only be used inside the iteration loop. + */ + public static Iterable getAllInBoxMutable(BlockPos from, BlockPos to) { + final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), + Math.min(from.getZ(), to.getZ())); + final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), + Math.max(from.getZ(), to.getZ())); + return new Iterable() { + public Iterator iterator() { + return new AbstractIterator() { + private BlockPos.MutableBlockPos theBlockPos = null; + + protected BlockPos.MutableBlockPos computeNext() { + if (this.theBlockPos == null) { + this.theBlockPos = new BlockPos.MutableBlockPos(blockpos.getX(), blockpos.getY(), + blockpos.getZ()); + return this.theBlockPos; + } else if (this.theBlockPos.equals(blockpos1)) { + return (BlockPos.MutableBlockPos) this.endOfData(); + } else { + int i = this.theBlockPos.getX(); + int j = this.theBlockPos.getY(); + int k = this.theBlockPos.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.theBlockPos.x = i; + this.theBlockPos.y = j; + this.theBlockPos.z = k; + return this.theBlockPos; + } + } + }; + } + }; + } + + public static final class MutableBlockPos extends BlockPos { + private int x; + private int y; + private int z; + + public MutableBlockPos() { + this(0, 0, 0); + } + + public MutableBlockPos(int x_, int y_, int z_) { + super(0, 0, 0); + this.x = x_; + this.y = y_; + this.z = z_; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getZ() { + return this.z; + } + + public BlockPos.MutableBlockPos func_181079_c(int parInt1, int parInt2, int parInt3) { + this.x = parInt1; + this.y = parInt2; + this.z = parInt3; + return this; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Cartesian.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Cartesian.java new file mode 100644 index 0000000..fdf9beb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Cartesian.java @@ -0,0 +1,173 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.UnmodifiableIterator; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Cartesian { + + static { + __checkIntegratedContextValid("net/minecraft/util/Cartesian"); + } + + public static Iterable cartesianProduct(Class clazz, Iterable> sets) { + return new Cartesian.Product(clazz, (Iterable[]) toArray(Iterable.class, sets)); + } + + public static Iterable> cartesianProduct(Iterable> sets) { + /**+ + * Convert an Iterable of Arrays (Object[]) to an Iterable of + * Lists + */ + return arraysAsLists(cartesianProduct(Object.class, sets)); + } + + private static Iterable> arraysAsLists(Iterable arrays) { + return Iterables.transform(arrays, new Cartesian.GetList()); + } + + private static T[] toArray(Class clazz, Iterable it) { + ArrayList arraylist = Lists.newArrayList(); + + for (Object object : it) { + arraylist.add(object); + } + + return (T[]) ((Object[]) arraylist.toArray(createArray(clazz, arraylist.size()))); + } + + private static T[] createArray(Class parClass1, int parInt1) { + return (T[]) ((Object[]) ((Object[]) Array.newInstance(parClass1, parInt1))); + } + + static class GetList implements Function> { + private GetList() { + } + + public List apply(Object[] aobject) { + return (List) Arrays.asList(aobject); + } + } + + static class Product implements Iterable { + private final Class clazz; + private final Iterable[] iterables; + + private Product(Class clazz, Iterable[] iterables) { + this.clazz = clazz; + this.iterables = iterables; + } + + public Iterator iterator() { + return (Iterator) (this.iterables.length <= 0 + ? Collections.singletonList((T[]) Cartesian.createArray(this.clazz, 0)).iterator() + : new Cartesian.Product.ProductIterator(this.clazz, this.iterables)); + } + + static class ProductIterator extends UnmodifiableIterator { + private int index; + private final Iterable[] iterables; + private final Iterator[] iterators; + private final T[] results; + + private ProductIterator(Class clazz, Iterable[] iterables) { + this.index = -2; + this.iterables = iterables; + this.iterators = (Iterator[]) Cartesian.createArray(Iterator.class, this.iterables.length); + + for (int i = 0; i < this.iterables.length; ++i) { + this.iterators[i] = iterables[i].iterator(); + } + + this.results = Cartesian.createArray(clazz, this.iterators.length); + } + + private void endOfData() { + this.index = -1; + Arrays.fill(this.iterators, (Object) null); + Arrays.fill(this.results, (Object) null); + } + + public boolean hasNext() { + if (this.index == -2) { + this.index = 0; + + for (Iterator iterator1 : this.iterators) { + if (!iterator1.hasNext()) { + this.endOfData(); + break; + } + } + + return true; + } else { + if (this.index >= this.iterators.length) { + for (this.index = this.iterators.length - 1; this.index >= 0; --this.index) { + Iterator iterator = this.iterators[this.index]; + if (iterator.hasNext()) { + break; + } + + if (this.index == 0) { + this.endOfData(); + break; + } + + iterator = this.iterables[this.index].iterator(); + this.iterators[this.index] = iterator; + if (!iterator.hasNext()) { + this.endOfData(); + break; + } + } + } + + return this.index >= 0; + } + } + + public T[] next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } else { + while (this.index < this.iterators.length) { + this.results[this.index] = this.iterators[this.index].next(); + ++this.index; + } + + return (T[]) ((Object[]) this.results.clone()); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatAllowedCharacters.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatAllowedCharacters.java new file mode 100644 index 0000000..e246cbc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatAllowedCharacters.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatAllowedCharacters { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatAllowedCharacters"); + } + + /**+ + * Array of the special characters that are allowed in any text + * drawing of Minecraft. + */ + public static final char[] allowedCharactersArray = new char[] { '/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', + '*', '\\', '<', '>', '|', '\"', ':' }; + + public static boolean isAllowedCharacter(char character) { + return character != 167 && character >= 32 && character != 127; + } + + /**+ + * Filter string by only keeping those characters for which + * isAllowedCharacter() returns true. + */ + public static String filterAllowedCharacters(String input) { + StringBuilder stringbuilder = new StringBuilder(); + + for (char c0 : input.toCharArray()) { + if (isAllowedCharacter(c0)) { + stringbuilder.append(c0); + } + } + + return stringbuilder.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentProcessor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentProcessor.java new file mode 100644 index 0000000..9b0ad0d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentProcessor.java @@ -0,0 +1,99 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.CommandException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.EntityNotFoundException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.ICommandSender; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.PlayerSelector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentScore; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentSelector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatComponentProcessor { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentProcessor"); + } + + public static IChatComponent processComponent(ICommandSender commandSender, IChatComponent component, + Entity entityIn) throws CommandException { + Object object = null; + if (component instanceof ChatComponentScore) { + ChatComponentScore chatcomponentscore = (ChatComponentScore) component; + String s = chatcomponentscore.getName(); + if (PlayerSelector.hasArguments(s)) { + List list = PlayerSelector.matchEntities(commandSender, s, Entity.class); + if (list.size() != 1) { + throw new EntityNotFoundException(); + } + + s = ((Entity) list.get(0)).getName(); + } + + object = entityIn != null && s.equals("*") + ? new ChatComponentScore(entityIn.getName(), chatcomponentscore.getObjective()) + : new ChatComponentScore(s, chatcomponentscore.getObjective()); + ((ChatComponentScore) object).setValue(chatcomponentscore.getUnformattedTextForChat()); + } else if (component instanceof ChatComponentSelector) { + String s1 = ((ChatComponentSelector) component).getSelector(); + object = PlayerSelector.matchEntitiesToChatComponent(commandSender, s1); + if (object == null) { + object = new ChatComponentText(""); + } + } else if (component instanceof ChatComponentText) { + object = new ChatComponentText(((ChatComponentText) component).getChatComponentText_TextValue()); + } else { + if (!(component instanceof ChatComponentTranslation)) { + return component; + } + + Object[] aobject = ((ChatComponentTranslation) component).getFormatArgs(); + + for (int i = 0; i < aobject.length; ++i) { + Object object1 = aobject[i]; + if (object1 instanceof IChatComponent) { + aobject[i] = processComponent(commandSender, (IChatComponent) object1, entityIn); + } + } + + object = new ChatComponentTranslation(((ChatComponentTranslation) component).getKey(), aobject); + } + + ChatStyle chatstyle = component.getChatStyle(); + if (chatstyle != null) { + ((IChatComponent) object).setChatStyle(chatstyle.createShallowCopy()); + } + + for (IChatComponent ichatcomponent : component.getSiblings()) { + ((IChatComponent) object).appendSibling(processComponent(commandSender, ichatcomponent, entityIn)); + } + + return (IChatComponent) object; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentScore.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentScore.java new file mode 100644 index 0000000..925fdec --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentScore.java @@ -0,0 +1,121 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Score; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreObjective; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringUtils; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.lax1dude.eaglercraft.v1_8.HString; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatComponentScore extends ChatComponentStyle { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentScore"); + } + + private final String name; + private final String objective; + /**+ + * The value displayed instead of the real score (may be null) + */ + private String value = ""; + + public ChatComponentScore(String nameIn, String objectiveIn) { + this.name = nameIn; + this.objective = objectiveIn; + } + + public String getName() { + return this.name; + } + + public String getObjective() { + return this.objective; + } + + /**+ + * Sets the value displayed instead of the real score. + */ + public void setValue(String valueIn) { + this.value = valueIn; + } + + /**+ + * Gets the text of this component, without any special + * formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + if (minecraftserver != null && StringUtils.isNullOrEmpty(this.value)) { + Scoreboard scoreboard = minecraftserver.worldServerForDimension(0).getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(this.objective); + if (scoreboard.entityHasObjective(this.name, scoreobjective)) { + Score score = scoreboard.getValueFromObjective(this.name, scoreobjective); + this.setValue(HString.format("%d", new Object[] { Integer.valueOf(score.getScorePoints()) })); + } else { + this.value = ""; + } + } + + return this.value; + } + + /**+ + * Creates a copy of this component. Almost a deep copy, except + * the style is shallow-copied. + */ + public ChatComponentScore createCopy() { + ChatComponentScore chatcomponentscore = new ChatComponentScore(this.name, this.objective); + chatcomponentscore.setValue(this.value); + chatcomponentscore.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) { + chatcomponentscore.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponentscore; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChatComponentScore)) { + return false; + } else { + ChatComponentScore chatcomponentscore = (ChatComponentScore) object; + return this.name.equals(chatcomponentscore.name) && this.objective.equals(chatcomponentscore.objective) + && super.equals(object); + } + } + + public String toString() { + return "ScoreComponent{name=\'" + this.name + '\'' + "objective=\'" + this.objective + '\'' + ", siblings=" + + this.siblings + ", style=" + this.getChatStyle() + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentSelector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentSelector.java new file mode 100644 index 0000000..f981f06 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentSelector.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatComponentSelector extends ChatComponentStyle { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentSelector"); + } + + private final String selector; + + public ChatComponentSelector(String selectorIn) { + this.selector = selectorIn; + } + + /**+ + * Gets the selector of this component, in plain text. + */ + public String getSelector() { + return this.selector; + } + + /**+ + * Gets the text of this component, without any special + * formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() { + return this.selector; + } + + /**+ + * Creates a copy of this component. Almost a deep copy, except + * the style is shallow-copied. + */ + public ChatComponentSelector createCopy() { + ChatComponentSelector chatcomponentselector = new ChatComponentSelector(this.selector); + chatcomponentselector.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) { + chatcomponentselector.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponentselector; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChatComponentSelector)) { + return false; + } else { + ChatComponentSelector chatcomponentselector = (ChatComponentSelector) object; + return this.selector.equals(chatcomponentselector.selector) && super.equals(object); + } + } + + public String toString() { + return "SelectorComponent{pattern=\'" + this.selector + '\'' + ", siblings=" + this.siblings + ", style=" + + this.getChatStyle() + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentStyle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentStyle.java new file mode 100644 index 0000000..a0431b8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentStyle.java @@ -0,0 +1,172 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Function; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; + +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class ChatComponentStyle implements IChatComponent { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentStyle"); + } + + /**+ + * The later siblings of this component. If this component turns + * the text bold, that will apply to all the siblings until a + * later sibling turns the text something else. + */ + protected List siblings = Lists.newArrayList(); + private ChatStyle style; + + /**+ + * Appends the given component to the end of this one. + */ + public IChatComponent appendSibling(IChatComponent component) { + component.getChatStyle().setParentStyle(this.getChatStyle()); + this.siblings.add(component); + return this; + } + + /**+ + * Gets the sibling components of this one. + */ + public List getSiblings() { + return this.siblings; + } + + /**+ + * Appends the given text to the end of this component. + */ + public IChatComponent appendText(String text) { + return this.appendSibling(new ChatComponentText(text)); + } + + public IChatComponent setChatStyle(ChatStyle style) { + this.style = style; + + for (IChatComponent ichatcomponent : this.siblings) { + ichatcomponent.getChatStyle().setParentStyle(this.getChatStyle()); + } + + return this; + } + + public ChatStyle getChatStyle() { + if (this.style == null) { + this.style = new ChatStyle(); + + for (IChatComponent ichatcomponent : this.siblings) { + ichatcomponent.getChatStyle().setParentStyle(this.style); + } + } + + return this.style; + } + + public Iterator iterator() { + return Iterators.concat(Iterators.forArray(new ChatComponentStyle[] { this }), + createDeepCopyIterator(this.siblings)); + } + + /**+ + * Get the text of this component, and all child + * components, with all special formatting codes removed. + */ + public final String getUnformattedText() { + StringBuilder stringbuilder = new StringBuilder(); + + for (IChatComponent ichatcomponent : this) { + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + } + + return stringbuilder.toString(); + } + + /**+ + * Gets the text of this component, with formatting codes added + * for rendering. + */ + public final String getFormattedText() { + StringBuilder stringbuilder = new StringBuilder(); + + for (IChatComponent ichatcomponent : this) { + stringbuilder.append(ichatcomponent.getChatStyle().getFormattingCode()); + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + stringbuilder.append(EnumChatFormatting.RESET); + } + + return stringbuilder.toString(); + } + + /**+ + * Creates an iterator that iterates over the given components, + * returning deep copies of each component in turn so that the + * properties of the returned objects will remain externally + * consistent after being returned. + */ + public static Iterator createDeepCopyIterator(Iterable components) { + Iterator iterator = Iterators.concat( + Iterators.transform(components.iterator(), new Function>() { + public Iterator apply(IChatComponent ichatcomponent) { + return ichatcomponent.iterator(); + } + })); + iterator = Iterators.transform(iterator, new Function() { + public IChatComponent apply(IChatComponent ichatcomponent) { + IChatComponent ichatcomponent1 = ichatcomponent.createCopy(); + ichatcomponent1.setChatStyle(ichatcomponent1.getChatStyle().createDeepCopy()); + return ichatcomponent1; + } + }); + return iterator; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChatComponentStyle)) { + return false; + } else { + ChatComponentStyle chatcomponentstyle = (ChatComponentStyle) object; + return this.siblings.equals(chatcomponentstyle.siblings) + && this.getChatStyle().equals(chatcomponentstyle.getChatStyle()); + } + } + + public int hashCode() { + return 31 * this.style.hashCode() + this.siblings.hashCode(); + } + + public String toString() { + return "BaseComponent{style=" + this.style + ", siblings=" + this.siblings + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentText.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentText.java new file mode 100644 index 0000000..1924413 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentText.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatComponentText extends ChatComponentStyle { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentText"); + } + + private final String text; + + public ChatComponentText(String msg) { + this.text = msg; + } + + /**+ + * Gets the text value of this ChatComponentText. TODO: what are + * getUnformattedText and getUnformattedTextForChat missing that + * made someone decide to create a third equivalent method that + * only ChatComponentText can implement? + */ + public String getChatComponentText_TextValue() { + return this.text; + } + + /**+ + * Gets the text of this component, without any special + * formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() { + return this.text; + } + + /**+ + * Creates a copy of this component. Almost a deep copy, except + * the style is shallow-copied. + */ + public ChatComponentText createCopy() { + ChatComponentText chatcomponenttext = new ChatComponentText(this.text); + chatcomponenttext.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) { + chatcomponenttext.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponenttext; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChatComponentText)) { + return false; + } else { + ChatComponentText chatcomponenttext = (ChatComponentText) object; + return this.text.equals(chatcomponenttext.getChatComponentText_TextValue()) && super.equals(object); + } + } + + public String toString() { + return "TextComponent{text=\'" + this.text + '\'' + ", siblings=" + this.siblings + ", style=" + + this.getChatStyle() + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslation.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslation.java new file mode 100644 index 0000000..5513420 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslation.java @@ -0,0 +1,261 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslationFormatException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatStyle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatComponentTranslation extends ChatComponentStyle { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentTranslation"); + } + + private final String key; + private final Object[] formatArgs; + private final Object syncLock = new Object(); + private long lastTranslationUpdateTimeInMilliseconds = -1L; + List children = Lists.newArrayList(); + public static final Pattern stringVariablePattern = Pattern.compile("%(?:(\\d+)\\$)?([A-Za-z%]|$)"); + + public ChatComponentTranslation(String translationKey, Object... args) { + this.key = translationKey; + this.formatArgs = args; + + for (Object object : args) { + if (object instanceof IChatComponent) { + ((IChatComponent) object).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + + } + + /**+ + * ensures that our children are initialized from the most + * recent string translation mapping. + */ + synchronized void ensureInitialized() { + synchronized (this.syncLock) { + long i = StatCollector.getLastTranslationUpdateTimeInMilliseconds(); + if (i == this.lastTranslationUpdateTimeInMilliseconds) { + return; + } + + this.lastTranslationUpdateTimeInMilliseconds = i; + this.children.clear(); + } + + try { + this.initializeFromFormat(StatCollector.translateToLocal(this.key)); + } catch (ChatComponentTranslationFormatException chatcomponenttranslationformatexception) { + this.children.clear(); + + try { + this.initializeFromFormat(StatCollector.translateToFallback(this.key)); + } catch (ChatComponentTranslationFormatException var5) { + throw chatcomponenttranslationformatexception; + } + } + + } + + /**+ + * initializes our children from a format string, using the + * format args to fill in the placeholder variables. + */ + protected void initializeFromFormat(String format) { + boolean flag = false; + Matcher matcher = stringVariablePattern.matcher(format); + int i = 0; + int j = 0; + + try { + int l; + for (; matcher.find(j); j = l) { + int k = matcher.start(); + l = matcher.end(); + if (k > j) { + ChatComponentText chatcomponenttext = new ChatComponentText( + HString.format(format.substring(j, k), new Object[0])); + chatcomponenttext.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext); + } + + String s2 = matcher.group(2); + String s = format.substring(k, l); + if ("%".equals(s2) && "%%".equals(s)) { + ChatComponentText chatcomponenttext2 = new ChatComponentText("%"); + chatcomponenttext2.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext2); + } else { + if (!"s".equals(s2)) { + throw new ChatComponentTranslationFormatException(this, "Unsupported format: \'" + s + "\'"); + } + + String s1 = matcher.group(1); + int i1 = s1 != null ? Integer.parseInt(s1) - 1 : i++; + if (i1 < this.formatArgs.length) { + this.children.add(this.getFormatArgumentAsComponent(i1)); + } + } + } + + if (j < format.length()) { + ChatComponentText chatcomponenttext1 = new ChatComponentText( + HString.format(format.substring(j), new Object[0])); + chatcomponenttext1.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext1); + } + + } catch (IllegalFormatException illegalformatexception) { + throw new ChatComponentTranslationFormatException(this, illegalformatexception); + } + } + + private IChatComponent getFormatArgumentAsComponent(int index) { + if (index >= this.formatArgs.length) { + throw new ChatComponentTranslationFormatException(this, index); + } else { + Object object = this.formatArgs[index]; + Object object1; + if (object instanceof IChatComponent) { + object1 = (IChatComponent) object; + } else { + object1 = new ChatComponentText(object == null ? "null" : object.toString()); + ((IChatComponent) object1).getChatStyle().setParentStyle(this.getChatStyle()); + } + + return (IChatComponent) object1; + } + } + + public IChatComponent setChatStyle(ChatStyle chatstyle) { + super.setChatStyle(chatstyle); + + for (Object object : this.formatArgs) { + if (object instanceof IChatComponent) { + ((IChatComponent) object).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + + if (this.lastTranslationUpdateTimeInMilliseconds > -1L) { + for (IChatComponent ichatcomponent : this.children) { + ichatcomponent.getChatStyle().setParentStyle(chatstyle); + } + } + + return this; + } + + public Iterator iterator() { + this.ensureInitialized(); + return Iterators.concat(createDeepCopyIterator(this.children), createDeepCopyIterator(this.siblings)); + } + + /**+ + * Gets the text of this component, without any special + * formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() { + this.ensureInitialized(); + StringBuilder stringbuilder = new StringBuilder(); + + for (IChatComponent ichatcomponent : this.children) { + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + } + + return stringbuilder.toString(); + } + + /**+ + * Creates a copy of this component. Almost a deep copy, except + * the style is shallow-copied. + */ + public ChatComponentTranslation createCopy() { + Object[] aobject = new Object[this.formatArgs.length]; + + for (int i = 0; i < this.formatArgs.length; ++i) { + if (this.formatArgs[i] instanceof IChatComponent) { + aobject[i] = ((IChatComponent) this.formatArgs[i]).createCopy(); + } else { + aobject[i] = this.formatArgs[i]; + } + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(this.key, aobject); + chatcomponenttranslation.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) { + chatcomponenttranslation.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponenttranslation; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChatComponentTranslation)) { + return false; + } else { + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation) object; + return Arrays.equals(this.formatArgs, chatcomponenttranslation.formatArgs) + && this.key.equals(chatcomponenttranslation.key) && super.equals(object); + } + } + + public int hashCode() { + int i = super.hashCode(); + i = 31 * i + this.key.hashCode(); + i = 31 * i + Arrays.hashCode(this.formatArgs); + return i; + } + + public String toString() { + return "TranslatableComponent{key=\'" + this.key + '\'' + ", args=" + Arrays.toString(this.formatArgs) + + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } + + public String getKey() { + return this.key; + } + + public Object[] getFormatArgs() { + return this.formatArgs; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslationFormatException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslationFormatException.java new file mode 100644 index 0000000..d027b5e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslationFormatException.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.lax1dude.eaglercraft.v1_8.HString; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatComponentTranslationFormatException extends IllegalArgumentException { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatComponentTranslationFormatException"); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, String message) { + super(HString.format("Error parsing: %s: %s", new Object[] { component, message })); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, int index) { + super(HString.format("Invalid index %d requested for %s", new Object[] { Integer.valueOf(index), component })); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, Throwable cause) { + super(HString.format("Error while parsing: %s", new Object[] { component }), cause); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatStyle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatStyle.java new file mode 100644 index 0000000..9b04bc1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatStyle.java @@ -0,0 +1,683 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import org.json.JSONException; +import org.json.JSONObject; + +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeCodec; +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.ClickEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.event.HoverEvent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChatStyle { + + static { + __checkIntegratedContextValid("net/minecraft/util/ChatStyle"); + } + + private ChatStyle parentStyle; + private EnumChatFormatting color; + private Boolean bold; + private Boolean italic; + private Boolean underlined; + private Boolean strikethrough; + private Boolean obfuscated; + private ClickEvent chatClickEvent; + private HoverEvent chatHoverEvent; + private String insertion; + /**+ + * The base of the ChatStyle hierarchy. All ChatStyle instances + * are implicitly children of this. + */ + private static final ChatStyle rootStyle = new ChatStyle() { + /**+ + * Gets the effective color of this ChatStyle. + */ + public EnumChatFormatting getColor() { + return null; + } + + /**+ + * Whether or not text of this ChatStyle should be in bold. + */ + public boolean getBold() { + return false; + } + + /**+ + * Whether or not text of this ChatStyle should be italicized. + */ + public boolean getItalic() { + return false; + } + + /**+ + * Whether or not to format text of this ChatStyle using + * strikethrough. + */ + public boolean getStrikethrough() { + return false; + } + + /**+ + * Whether or not text of this ChatStyle should be underlined. + */ + public boolean getUnderlined() { + return false; + } + + /**+ + * Whether or not text of this ChatStyle should be obfuscated. + */ + public boolean getObfuscated() { + return false; + } + + /**+ + * The effective chat click event. + */ + public ClickEvent getChatClickEvent() { + return null; + } + + /**+ + * The effective chat hover event. + */ + public HoverEvent getChatHoverEvent() { + return null; + } + + /**+ + * Get the text to be inserted into Chat when the component is + * shift-clicked + */ + public String getInsertion() { + return null; + } + + /**+ + * Sets the color for this ChatStyle to the given value. Only + * use color values for this; set other values using the + * specific methods. + */ + public ChatStyle setColor(EnumChatFormatting color) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets whether or not text of this ChatStyle should be in bold. + * Set to false if, e.g., the parent style is bold and you want + * text of this style to be unbolded. + */ + public ChatStyle setBold(Boolean boldIn) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets whether or not text of this ChatStyle should be + * italicized. Set to false if, e.g., the parent style is + * italicized and you want to override that for this style. + */ + public ChatStyle setItalic(Boolean italic) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets whether or not to format text of this ChatStyle using + * strikethrough. Set to false if, e.g., the parent style uses + * strikethrough and you want to override that for this style. + */ + public ChatStyle setStrikethrough(Boolean strikethrough) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets whether or not text of this ChatStyle should be + * underlined. Set to false if, e.g., the parent style is + * underlined and you want to override that for this style. + */ + public ChatStyle setUnderlined(Boolean underlined) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets whether or not text of this ChatStyle should be + * obfuscated. Set to false if, e.g., the parent style is + * obfuscated and you want to override that for this style. + */ + public ChatStyle setObfuscated(Boolean obfuscated) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets the event that should be run when text of this ChatStyle + * is clicked on. + */ + public ChatStyle setChatClickEvent(ClickEvent event) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets the event that should be run when text of this ChatStyle + * is hovered over. + */ + public ChatStyle setChatHoverEvent(HoverEvent event) { + throw new UnsupportedOperationException(); + } + + /**+ + * Sets the fallback ChatStyle to use if this ChatStyle does not + * override some value. Without a parent, obvious defaults are + * used (bold: false, underlined: false, etc). + */ + public ChatStyle setParentStyle(ChatStyle parent) { + throw new UnsupportedOperationException(); + } + + public String toString() { + return "Style.ROOT"; + } + + /**+ + * Creates a shallow copy of this style. Changes to this + * instance's values will not be reflected in the copy, but + * changes to the parent style's values WILL be reflected in + * both this instance and the copy, wherever either does not + * override a value. + */ + public ChatStyle createShallowCopy() { + return this; + } + + /**+ + * Creates a deep copy of this style. No changes to this + * instance or its parent style will be reflected in the copy. + */ + public ChatStyle createDeepCopy() { + return this; + } + + /**+ + * Gets the equivalent text formatting code for this style, + * without the initial section sign (U+00A7) character. + */ + public String getFormattingCode() { + return ""; + } + }; + + /**+ + * Gets the effective color of this ChatStyle. + */ + public EnumChatFormatting getColor() { + return this.color == null ? this.getParent().getColor() : this.color; + } + + /**+ + * Whether or not text of this ChatStyle should be in bold. + */ + public boolean getBold() { + return this.bold == null ? this.getParent().getBold() : this.bold.booleanValue(); + } + + /**+ + * Whether or not text of this ChatStyle should be italicized. + */ + public boolean getItalic() { + return this.italic == null ? this.getParent().getItalic() : this.italic.booleanValue(); + } + + /**+ + * Whether or not to format text of this ChatStyle using + * strikethrough. + */ + public boolean getStrikethrough() { + return this.strikethrough == null ? this.getParent().getStrikethrough() : this.strikethrough.booleanValue(); + } + + /**+ + * Whether or not text of this ChatStyle should be underlined. + */ + public boolean getUnderlined() { + return this.underlined == null ? this.getParent().getUnderlined() : this.underlined.booleanValue(); + } + + /**+ + * Whether or not text of this ChatStyle should be obfuscated. + */ + public boolean getObfuscated() { + return this.obfuscated == null ? this.getParent().getObfuscated() : this.obfuscated.booleanValue(); + } + + /**+ + * Whether or not this style is empty (inherits everything from + * the parent). + */ + public boolean isEmpty() { + return this.bold == null && this.italic == null && this.strikethrough == null && this.underlined == null + && this.obfuscated == null && this.color == null && this.chatClickEvent == null + && this.chatHoverEvent == null; + } + + /**+ + * The effective chat click event. + */ + public ClickEvent getChatClickEvent() { + return this.chatClickEvent == null ? this.getParent().getChatClickEvent() : this.chatClickEvent; + } + + /**+ + * The effective chat hover event. + */ + public HoverEvent getChatHoverEvent() { + return this.chatHoverEvent == null ? this.getParent().getChatHoverEvent() : this.chatHoverEvent; + } + + /**+ + * Get the text to be inserted into Chat when the component is + * shift-clicked + */ + public String getInsertion() { + return this.insertion == null ? this.getParent().getInsertion() : this.insertion; + } + + /**+ + * Sets the color for this ChatStyle to the given value. Only + * use color values for this; set other values using the + * specific methods. + */ + public ChatStyle setColor(EnumChatFormatting enumchatformatting) { + this.color = enumchatformatting; + return this; + } + + /**+ + * Sets whether or not text of this ChatStyle should be in bold. + * Set to false if, e.g., the parent style is bold and you want + * text of this style to be unbolded. + */ + public ChatStyle setBold(Boolean obool) { + this.bold = obool; + return this; + } + + /**+ + * Sets whether or not text of this ChatStyle should be + * italicized. Set to false if, e.g., the parent style is + * italicized and you want to override that for this style. + */ + public ChatStyle setItalic(Boolean obool) { + this.italic = obool; + return this; + } + + /**+ + * Sets whether or not to format text of this ChatStyle using + * strikethrough. Set to false if, e.g., the parent style uses + * strikethrough and you want to override that for this style. + */ + public ChatStyle setStrikethrough(Boolean obool) { + this.strikethrough = obool; + return this; + } + + /**+ + * Sets whether or not text of this ChatStyle should be + * underlined. Set to false if, e.g., the parent style is + * underlined and you want to override that for this style. + */ + public ChatStyle setUnderlined(Boolean obool) { + this.underlined = obool; + return this; + } + + /**+ + * Sets whether or not text of this ChatStyle should be + * obfuscated. Set to false if, e.g., the parent style is + * obfuscated and you want to override that for this style. + */ + public ChatStyle setObfuscated(Boolean obool) { + this.obfuscated = obool; + return this; + } + + /**+ + * Sets the event that should be run when text of this ChatStyle + * is clicked on. + */ + public ChatStyle setChatClickEvent(ClickEvent clickevent) { + this.chatClickEvent = clickevent; + return this; + } + + /**+ + * Sets the event that should be run when text of this ChatStyle + * is hovered over. + */ + public ChatStyle setChatHoverEvent(HoverEvent hoverevent) { + this.chatHoverEvent = hoverevent; + return this; + } + + /**+ + * Set a text to be inserted into Chat when the component is + * shift-clicked + */ + public ChatStyle setInsertion(String insertion) { + this.insertion = insertion; + return this; + } + + /**+ + * Sets the fallback ChatStyle to use if this ChatStyle does not + * override some value. Without a parent, obvious defaults are + * used (bold: false, underlined: false, etc). + */ + public ChatStyle setParentStyle(ChatStyle chatstyle) { + this.parentStyle = chatstyle; + return this; + } + + /**+ + * Gets the equivalent text formatting code for this style, + * without the initial section sign (U+00A7) character. + */ + public String getFormattingCode() { + if (this.isEmpty()) { + return this.parentStyle != null ? this.parentStyle.getFormattingCode() : ""; + } else { + StringBuilder stringbuilder = new StringBuilder(); + if (this.getColor() != null) { + stringbuilder.append(this.getColor()); + } + + if (this.getBold()) { + stringbuilder.append(EnumChatFormatting.BOLD); + } + + if (this.getItalic()) { + stringbuilder.append(EnumChatFormatting.ITALIC); + } + + if (this.getUnderlined()) { + stringbuilder.append(EnumChatFormatting.UNDERLINE); + } + + if (this.getObfuscated()) { + stringbuilder.append(EnumChatFormatting.OBFUSCATED); + } + + if (this.getStrikethrough()) { + stringbuilder.append(EnumChatFormatting.STRIKETHROUGH); + } + + return stringbuilder.toString(); + } + } + + /**+ + * Gets the immediate parent of this ChatStyle. + */ + private ChatStyle getParent() { + return this.parentStyle == null ? rootStyle : this.parentStyle; + } + + public String toString() { + return "Style{hasParent=" + (this.parentStyle != null) + ", color=" + this.color + ", bold=" + this.bold + + ", italic=" + this.italic + ", underlined=" + this.underlined + ", obfuscated=" + this.obfuscated + + ", clickEvent=" + this.getChatClickEvent() + ", hoverEvent=" + this.getChatHoverEvent() + + ", insertion=" + this.getInsertion() + '}'; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChatStyle)) { + return false; + } else { + boolean flag; + label0: { + ChatStyle chatstyle = (ChatStyle) object; + if (this.getBold() == chatstyle.getBold() && this.getColor() == chatstyle.getColor() + && this.getItalic() == chatstyle.getItalic() + && this.getObfuscated() == chatstyle.getObfuscated() + && this.getStrikethrough() == chatstyle.getStrikethrough() + && this.getUnderlined() == chatstyle.getUnderlined()) { + label85: { + if (this.getChatClickEvent() != null) { + if (!this.getChatClickEvent().equals(chatstyle.getChatClickEvent())) { + break label85; + } + } else if (chatstyle.getChatClickEvent() != null) { + break label85; + } + + if (this.getChatHoverEvent() != null) { + if (!this.getChatHoverEvent().equals(chatstyle.getChatHoverEvent())) { + break label85; + } + } else if (chatstyle.getChatHoverEvent() != null) { + break label85; + } + + if (this.getInsertion() != null) { + if (this.getInsertion().equals(chatstyle.getInsertion())) { + break label0; + } + } else if (chatstyle.getInsertion() == null) { + break label0; + } + } + } + + flag = false; + return flag; + } + + flag = true; + return flag; + } + } + + public int hashCode() { + int i = this.color.hashCode(); + i = 31 * i + this.bold.hashCode(); + i = 31 * i + this.italic.hashCode(); + i = 31 * i + this.underlined.hashCode(); + i = 31 * i + this.strikethrough.hashCode(); + i = 31 * i + this.obfuscated.hashCode(); + i = 31 * i + this.chatClickEvent.hashCode(); + i = 31 * i + this.chatHoverEvent.hashCode(); + i = 31 * i + this.insertion.hashCode(); + return i; + } + + /**+ + * Creates a shallow copy of this style. Changes to this + * instance's values will not be reflected in the copy, but + * changes to the parent style's values WILL be reflected in + * both this instance and the copy, wherever either does not + * override a value. + */ + public ChatStyle createShallowCopy() { + ChatStyle chatstyle = new ChatStyle(); + chatstyle.bold = this.bold; + chatstyle.italic = this.italic; + chatstyle.strikethrough = this.strikethrough; + chatstyle.underlined = this.underlined; + chatstyle.obfuscated = this.obfuscated; + chatstyle.color = this.color; + chatstyle.chatClickEvent = this.chatClickEvent; + chatstyle.chatHoverEvent = this.chatHoverEvent; + chatstyle.parentStyle = this.parentStyle; + chatstyle.insertion = this.insertion; + return chatstyle; + } + + /**+ + * Creates a deep copy of this style. No changes to this + * instance or its parent style will be reflected in the copy. + */ + public ChatStyle createDeepCopy() { + ChatStyle chatstyle = new ChatStyle(); + chatstyle.setBold(Boolean.valueOf(this.getBold())); + chatstyle.setItalic(Boolean.valueOf(this.getItalic())); + chatstyle.setStrikethrough(Boolean.valueOf(this.getStrikethrough())); + chatstyle.setUnderlined(Boolean.valueOf(this.getUnderlined())); + chatstyle.setObfuscated(Boolean.valueOf(this.getObfuscated())); + chatstyle.setColor(this.getColor()); + chatstyle.setChatClickEvent(this.getChatClickEvent()); + chatstyle.setChatHoverEvent(this.getChatHoverEvent()); + chatstyle.setInsertion(this.getInsertion()); + return chatstyle; + } + + public static class Serializer implements JSONTypeCodec { + public ChatStyle deserialize(JSONObject jsonobject) throws JSONException { + ChatStyle chatstyle = new ChatStyle(); + if (jsonobject == null) { + return null; + } else { + if (jsonobject.has("bold")) { + chatstyle.bold = jsonobject.getBoolean("bold"); + } + + if (jsonobject.has("italic")) { + chatstyle.italic = jsonobject.getBoolean("italic"); + } + + if (jsonobject.has("underlined")) { + chatstyle.underlined = jsonobject.getBoolean("underlined"); + } + + if (jsonobject.has("strikethrough")) { + chatstyle.strikethrough = jsonobject.getBoolean("strikethrough"); + } + + if (jsonobject.has("obfuscated")) { + chatstyle.obfuscated = jsonobject.getBoolean("obfuscated"); + } + + if (jsonobject.has("color")) { + chatstyle.color = EnumChatFormatting.getValueByName(jsonobject.getString("color")); + } + + if (jsonobject.has("insertion")) { + chatstyle.insertion = jsonobject.getString("insertion"); + } + + if (jsonobject.has("clickEvent")) { + JSONObject jsonobject1 = jsonobject.getJSONObject("clickEvent"); + if (jsonobject1 != null) { + String jsonprimitive = jsonobject1.optString("action"); + ClickEvent.Action clickevent$action = jsonprimitive == null ? null + : ClickEvent.Action.getValueByCanonicalName(jsonprimitive); + String jsonprimitive1 = jsonobject1.optString("value"); + if (clickevent$action != null && jsonprimitive1 != null + && clickevent$action.shouldAllowInChat()) { + chatstyle.chatClickEvent = new ClickEvent(clickevent$action, jsonprimitive1); + } + } + } + + if (jsonobject.has("hoverEvent")) { + JSONObject jsonobject2 = jsonobject.getJSONObject("hoverEvent"); + if (jsonobject2 != null) { + String jsonprimitive2 = jsonobject2.getString("action"); + HoverEvent.Action hoverevent$action = jsonprimitive2 == null ? null + : HoverEvent.Action.getValueByCanonicalName(jsonprimitive2); + IChatComponent ichatcomponent = JSONTypeProvider.deserializeNoCast(jsonobject2.get("value"), + IChatComponent.class); + if (hoverevent$action != null && ichatcomponent != null + && hoverevent$action.shouldAllowInChat()) { + chatstyle.chatHoverEvent = new HoverEvent(hoverevent$action, ichatcomponent); + } + } + } + + return chatstyle; + } + } + + public JSONObject serialize(ChatStyle chatstyle) { + if (chatstyle.isEmpty()) { + return null; + } else { + JSONObject jsonobject = new JSONObject(); + if (chatstyle.bold != null) { + jsonobject.put("bold", chatstyle.bold); + } + + if (chatstyle.italic != null) { + jsonobject.put("italic", chatstyle.italic); + } + + if (chatstyle.underlined != null) { + jsonobject.put("underlined", chatstyle.underlined); + } + + if (chatstyle.strikethrough != null) { + jsonobject.put("strikethrough", chatstyle.strikethrough); + } + + if (chatstyle.obfuscated != null) { + jsonobject.put("obfuscated", chatstyle.obfuscated); + } + + if (chatstyle.color != null) { + jsonobject.put("color", chatstyle.color.getFriendlyName()); + } + + if (chatstyle.insertion != null) { + jsonobject.put("insertion", chatstyle.insertion); + } + + if (chatstyle.chatClickEvent != null) { + JSONObject jsonobject1 = new JSONObject(); + jsonobject1.put("action", chatstyle.chatClickEvent.getAction().getCanonicalName()); + jsonobject1.put("value", chatstyle.chatClickEvent.getValue()); + jsonobject.put("clickEvent", jsonobject1); + } + + if (chatstyle.chatHoverEvent != null) { + JSONObject jsonobject2 = new JSONObject(); + jsonobject2.put("action", chatstyle.chatHoverEvent.getAction().getCanonicalName()); + Object obj = JSONTypeProvider.serialize(chatstyle.chatHoverEvent.getValue()); + if (obj instanceof String) { + jsonobject2.put("value", (String) obj); + } else if (obj instanceof JSONObject) { + jsonobject2.put("value", (JSONObject) obj); + } else { + throw new ClassCastException(); + } + jsonobject.put("hoverEvent", jsonobject2); + } + + return jsonobject; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ClassInheritanceMultiMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ClassInheritanceMultiMap.java new file mode 100644 index 0000000..4b8080e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ClassInheritanceMultiMap.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.AbstractSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ClassInheritanceMultiMap extends AbstractSet { + + static { + __checkIntegratedContextValid("net/minecraft/util/ClassInheritanceMultiMap"); + } + + private static final Set> field_181158_a = Sets.newHashSet(); + private final Map, List> map = Maps.newHashMap(); + private final Set> knownKeys = Sets.newIdentityHashSet(); + private final Class baseClass; + private final List field_181745_e = Lists.newArrayList(); + + public ClassInheritanceMultiMap(Class baseClassIn) { + this.baseClass = baseClassIn; + this.knownKeys.add(baseClassIn); + this.map.put(baseClassIn, this.field_181745_e); + + for (Class oclass : field_181158_a) { + this.createLookup(oclass); + } + + } + + protected void createLookup(Class clazz) { + field_181158_a.add(clazz); + + for (T object : this.field_181745_e) { + if (clazz.isAssignableFrom(object.getClass())) { + this.func_181743_a(object, clazz); + } + } + + this.knownKeys.add(clazz); + } + + protected Class func_181157_b(Class parClass1) { + if (this.baseClass.isAssignableFrom(parClass1)) { + if (!this.knownKeys.contains(parClass1)) { + this.createLookup(parClass1); + } + + return parClass1; + } else { + throw new IllegalArgumentException("Don\'t know how to search for " + parClass1); + } + } + + public boolean add(T parObject) { + for (Class oclass : this.knownKeys) { + if (oclass.isAssignableFrom(parObject.getClass())) { + this.func_181743_a(parObject, oclass); + } + } + + return true; + } + + private void func_181743_a(T parObject, Class parClass1) { + List list = (List) this.map.get(parClass1); + if (list == null) { + this.map.put(parClass1, Lists.newArrayList(parObject)); + } else { + list.add(parObject); + } + + } + + public boolean remove(Object parObject) { + Object object = parObject; + boolean flag = false; + + for (Class oclass : this.knownKeys) { + if (oclass.isAssignableFrom(object.getClass())) { + List list = (List) this.map.get(oclass); + if (list != null && list.remove(object)) { + flag = true; + } + } + } + + return flag; + } + + public boolean contains(Object parObject) { + return Iterators.contains(this.getByClass(parObject.getClass()).iterator(), parObject); + } + + public Iterable getByClass(final Class clazz) { + return new Iterable() { + public Iterator iterator() { + List list = (List) ClassInheritanceMultiMap.this.map + .get(ClassInheritanceMultiMap.this.func_181157_b(clazz)); + if (list == null) { + return Iterators.emptyIterator(); + } else { + Iterator iterator = list.iterator(); + return Iterators.filter(iterator, clazz); + } + } + }; + } + + public Iterator iterator() { + return this.field_181745_e.isEmpty() ? Iterators.emptyIterator() + : Iterators.unmodifiableIterator(this.field_181745_e.iterator()); + } + + public int size() { + return this.field_181745_e.size(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatEntry.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatEntry.java new file mode 100644 index 0000000..49fc0d5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatEntry.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CombatEntry { + + static { + __checkIntegratedContextValid("net/minecraft/util/CombatEntry"); + } + + private final DamageSource damageSrc; + private final int field_94567_b; + private final float damage; + private final float health; + private final String field_94566_e; + private final float fallDistance; + + public CombatEntry(DamageSource damageSrcIn, int parInt1, float healthAmount, float damageAmount, String parString1, + float fallDistanceIn) { + this.damageSrc = damageSrcIn; + this.field_94567_b = parInt1; + this.damage = damageAmount; + this.health = healthAmount; + this.field_94566_e = parString1; + this.fallDistance = fallDistanceIn; + } + + /**+ + * Get the DamageSource of the CombatEntry instance. + */ + public DamageSource getDamageSrc() { + return this.damageSrc; + } + + public float func_94563_c() { + return this.damage; + } + + /**+ + * Returns true if {@link + * net.minecraft.util.DamageSource#getEntity() damage source} is + * a living entity + */ + public boolean isLivingDamageSrc() { + return this.damageSrc.getEntity() instanceof EntityLivingBase; + } + + public String func_94562_g() { + return this.field_94566_e; + } + + public IChatComponent getDamageSrcDisplayName() { + return this.getDamageSrc().getEntity() == null ? null : this.getDamageSrc().getEntity().getDisplayName(); + } + + public float getDamageAmount() { + return this.damageSrc == DamageSource.outOfWorld ? Float.MAX_VALUE : this.fallDistance; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatTracker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatTracker.java new file mode 100644 index 0000000..ae5173f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatTracker.java @@ -0,0 +1,253 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.CombatEntry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 CombatTracker { + + static { + __checkIntegratedContextValid("net/minecraft/util/CombatTracker"); + } + + /**+ + * The CombatEntry objects that we've tracked so far. + */ + private final List combatEntries = Lists.newArrayList(); + private final EntityLivingBase fighter; + private int field_94555_c; + private int field_152775_d; + private int field_152776_e; + private boolean field_94552_d; + private boolean field_94553_e; + private String field_94551_f; + + public CombatTracker(EntityLivingBase fighterIn) { + this.fighter = fighterIn; + } + + public void func_94545_a() { + this.func_94542_g(); + if (this.fighter.isOnLadder()) { + Block block = this.fighter.worldObj.getBlockState( + new BlockPos(this.fighter.posX, this.fighter.getEntityBoundingBox().minY, this.fighter.posZ)) + .getBlock(); + if (block == Blocks.ladder) { + this.field_94551_f = "ladder"; + } else if (block == Blocks.vine) { + this.field_94551_f = "vines"; + } + } else if (this.fighter.isInWater()) { + this.field_94551_f = "water"; + } + + } + + /**+ + * Adds an entry for the combat tracker + */ + public void trackDamage(DamageSource damageSrc, float healthIn, float damageAmount) { + this.reset(); + this.func_94545_a(); + CombatEntry combatentry = new CombatEntry(damageSrc, this.fighter.ticksExisted, healthIn, damageAmount, + this.field_94551_f, this.fighter.fallDistance); + this.combatEntries.add(combatentry); + this.field_94555_c = this.fighter.ticksExisted; + this.field_94553_e = true; + if (combatentry.isLivingDamageSrc() && !this.field_94552_d && this.fighter.isEntityAlive()) { + this.field_94552_d = true; + this.field_152775_d = this.fighter.ticksExisted; + this.field_152776_e = this.field_152775_d; + this.fighter.sendEnterCombat(); + } + + } + + public IChatComponent getDeathMessage() { + if (this.combatEntries.size() == 0) { + return new ChatComponentTranslation("death.attack.generic", new Object[] { this.fighter.getDisplayName() }); + } else { + CombatEntry combatentry = this.func_94544_f(); + CombatEntry combatentry1 = (CombatEntry) this.combatEntries.get(this.combatEntries.size() - 1); + IChatComponent ichatcomponent = combatentry1.getDamageSrcDisplayName(); + Entity entity = combatentry1.getDamageSrc().getEntity(); + Object object; + if (combatentry != null && combatentry1.getDamageSrc() == DamageSource.fall) { + IChatComponent ichatcomponent1 = combatentry.getDamageSrcDisplayName(); + if (combatentry.getDamageSrc() != DamageSource.fall + && combatentry.getDamageSrc() != DamageSource.outOfWorld) { + if (ichatcomponent1 != null + && (ichatcomponent == null || !ichatcomponent1.equals(ichatcomponent))) { + Entity entity1 = combatentry.getDamageSrc().getEntity(); + ItemStack itemstack1 = entity1 instanceof EntityLivingBase + ? ((EntityLivingBase) entity1).getHeldItem() + : null; + if (itemstack1 != null && itemstack1.hasDisplayName()) { + object = new ChatComponentTranslation("death.fell.assist.item", new Object[] { + this.fighter.getDisplayName(), ichatcomponent1, itemstack1.getChatComponent() }); + } else { + object = new ChatComponentTranslation("death.fell.assist", + new Object[] { this.fighter.getDisplayName(), ichatcomponent1 }); + } + } else if (ichatcomponent != null) { + ItemStack itemstack = entity instanceof EntityLivingBase + ? ((EntityLivingBase) entity).getHeldItem() + : null; + if (itemstack != null && itemstack.hasDisplayName()) { + object = new ChatComponentTranslation("death.fell.finish.item", new Object[] { + this.fighter.getDisplayName(), ichatcomponent, itemstack.getChatComponent() }); + } else { + object = new ChatComponentTranslation("death.fell.finish", + new Object[] { this.fighter.getDisplayName(), ichatcomponent }); + } + } else { + object = new ChatComponentTranslation("death.fell.killer", + new Object[] { this.fighter.getDisplayName() }); + } + } else { + object = new ChatComponentTranslation("death.fell.accident." + this.func_94548_b(combatentry), + new Object[] { this.fighter.getDisplayName() }); + } + } else { + object = combatentry1.getDamageSrc().getDeathMessage(this.fighter); + } + + return (IChatComponent) object; + } + } + + public EntityLivingBase func_94550_c() { + EntityLivingBase entitylivingbase = null; + EntityPlayer entityplayer = null; + float f = 0.0F; + float f1 = 0.0F; + + for (CombatEntry combatentry : this.combatEntries) { + if (combatentry.getDamageSrc().getEntity() instanceof EntityPlayer + && (entityplayer == null || combatentry.func_94563_c() > f1)) { + f1 = combatentry.func_94563_c(); + entityplayer = (EntityPlayer) combatentry.getDamageSrc().getEntity(); + } + + if (combatentry.getDamageSrc().getEntity() instanceof EntityLivingBase + && (entitylivingbase == null || combatentry.func_94563_c() > f)) { + f = combatentry.func_94563_c(); + entitylivingbase = (EntityLivingBase) combatentry.getDamageSrc().getEntity(); + } + } + + if (entityplayer != null && f1 >= f / 3.0F) { + return entityplayer; + } else { + return entitylivingbase; + } + } + + private CombatEntry func_94544_f() { + CombatEntry combatentry = null; + CombatEntry combatentry1 = null; + byte b0 = 0; + float f = 0.0F; + + for (int i = 0; i < this.combatEntries.size(); ++i) { + CombatEntry combatentry2 = (CombatEntry) this.combatEntries.get(i); + CombatEntry combatentry3 = i > 0 ? (CombatEntry) this.combatEntries.get(i - 1) : null; + if ((combatentry2.getDamageSrc() == DamageSource.fall + || combatentry2.getDamageSrc() == DamageSource.outOfWorld) && combatentry2.getDamageAmount() > 0.0F + && (combatentry == null || combatentry2.getDamageAmount() > f)) { + if (i > 0) { + combatentry = combatentry3; + } else { + combatentry = combatentry2; + } + + f = combatentry2.getDamageAmount(); + } + + if (combatentry2.func_94562_g() != null + && (combatentry1 == null || combatentry2.func_94563_c() > (float) b0)) { + combatentry1 = combatentry2; + } + } + + if (f > 5.0F && combatentry != null) { + return combatentry; + } else if (b0 > 5 && combatentry1 != null) { + return combatentry1; + } else { + return null; + } + } + + private String func_94548_b(CombatEntry parCombatEntry) { + return parCombatEntry.func_94562_g() == null ? "generic" : parCombatEntry.func_94562_g(); + } + + public int func_180134_f() { + return this.field_94552_d ? this.fighter.ticksExisted - this.field_152775_d + : this.field_152776_e - this.field_152775_d; + } + + private void func_94542_g() { + this.field_94551_f = null; + } + + /**+ + * Resets this trackers list of combat entries + */ + public void reset() { + int i = this.field_94552_d ? 300 : 100; + if (this.field_94553_e + && (!this.fighter.isEntityAlive() || this.fighter.ticksExisted - this.field_94555_c > i)) { + boolean flag = this.field_94552_d; + this.field_94553_e = false; + this.field_94552_d = false; + this.field_152776_e = this.fighter.ticksExisted; + if (flag) { + this.fighter.sendEndCombat(); + } + + this.combatEntries.clear(); + } + + } + + /**+ + * Returns EntityLivingBase assigned for this CombatTracker + */ + public EntityLivingBase getFighter() { + return this.fighter; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/DamageSource.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/DamageSource.java new file mode 100644 index 0000000..b44d50a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/DamageSource.java @@ -0,0 +1,272 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityArrow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.projectile.EntityFireball; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSourceIndirect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DamageSource { + + static { + __checkIntegratedContextValid("net/minecraft/util/DamageSource"); + } + + public static DamageSource inFire = (new DamageSource("inFire")).setFireDamage(); + public static DamageSource lightningBolt = new DamageSource("lightningBolt"); + public static DamageSource onFire = (new DamageSource("onFire")).setDamageBypassesArmor().setFireDamage(); + public static DamageSource lava = (new DamageSource("lava")).setFireDamage(); + public static DamageSource inWall = (new DamageSource("inWall")).setDamageBypassesArmor(); + public static DamageSource drown = (new DamageSource("drown")).setDamageBypassesArmor(); + public static DamageSource starve = (new DamageSource("starve")).setDamageBypassesArmor().setDamageIsAbsolute(); + public static DamageSource cactus = new DamageSource("cactus"); + public static DamageSource fall = (new DamageSource("fall")).setDamageBypassesArmor(); + public static DamageSource outOfWorld = (new DamageSource("outOfWorld")).setDamageBypassesArmor() + .setDamageAllowedInCreativeMode(); + public static DamageSource generic = (new DamageSource("generic")).setDamageBypassesArmor(); + public static DamageSource magic = (new DamageSource("magic")).setDamageBypassesArmor().setMagicDamage(); + public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); + public static DamageSource anvil = new DamageSource("anvil"); + public static DamageSource fallingBlock = new DamageSource("fallingBlock"); + private boolean isUnblockable; + private boolean isDamageAllowedInCreativeMode; + private boolean damageIsAbsolute; + private float hungerDamage = 0.3F; + private boolean fireDamage; + private boolean projectile; + private boolean difficultyScaled; + private boolean magicDamage; + private boolean explosion; + public String damageType; + + public static DamageSource causeMobDamage(EntityLivingBase mob) { + return new EntityDamageSource("mob", mob); + } + + /**+ + * returns an EntityDamageSource of type player + */ + public static DamageSource causePlayerDamage(EntityPlayer player) { + return new EntityDamageSource("player", player); + } + + /**+ + * returns EntityDamageSourceIndirect of an arrow + */ + public static DamageSource causeArrowDamage(EntityArrow arrow, Entity parEntity) { + return (new EntityDamageSourceIndirect("arrow", arrow, parEntity)).setProjectile(); + } + + /**+ + * returns EntityDamageSourceIndirect of a fireball + */ + public static DamageSource causeFireballDamage(EntityFireball fireball, Entity parEntity) { + return parEntity == null + ? (new EntityDamageSourceIndirect("onFire", fireball, fireball)).setFireDamage().setProjectile() + : (new EntityDamageSourceIndirect("fireball", fireball, parEntity)).setFireDamage().setProjectile(); + } + + public static DamageSource causeThrownDamage(Entity parEntity, Entity parEntity2) { + return (new EntityDamageSourceIndirect("thrown", parEntity, parEntity2)).setProjectile(); + } + + public static DamageSource causeIndirectMagicDamage(Entity parEntity, Entity parEntity2) { + return (new EntityDamageSourceIndirect("indirectMagic", parEntity, parEntity2)).setDamageBypassesArmor() + .setMagicDamage(); + } + + /**+ + * Returns the EntityDamageSource of the Thorns enchantment + */ + public static DamageSource causeThornsDamage(Entity parEntity) { + return (new EntityDamageSource("thorns", parEntity)).setIsThornsDamage().setMagicDamage(); + } + + public static DamageSource setExplosionSource(Explosion explosionIn) { + return explosionIn != null && explosionIn.getExplosivePlacedBy() != null + ? (new EntityDamageSource("explosion.player", explosionIn.getExplosivePlacedBy())).setDifficultyScaled() + .setExplosion() + : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); + } + + /**+ + * Returns true if the damage is projectile based. + */ + public boolean isProjectile() { + return this.projectile; + } + + /**+ + * Define the damage type as projectile based. + */ + public DamageSource setProjectile() { + this.projectile = true; + return this; + } + + public boolean isExplosion() { + return this.explosion; + } + + public DamageSource setExplosion() { + this.explosion = true; + return this; + } + + public boolean isUnblockable() { + return this.isUnblockable; + } + + /**+ + * How much satiate(food) is consumed by this DamageSource + */ + public float getHungerDamage() { + return this.hungerDamage; + } + + public boolean canHarmInCreative() { + return this.isDamageAllowedInCreativeMode; + } + + /**+ + * Whether or not the damage ignores modification by potion + * effects or enchantments. + */ + public boolean isDamageAbsolute() { + return this.damageIsAbsolute; + } + + protected DamageSource(String damageTypeIn) { + this.damageType = damageTypeIn; + } + + public Entity getSourceOfDamage() { + return this.getEntity(); + } + + public Entity getEntity() { + return null; + } + + protected DamageSource setDamageBypassesArmor() { + this.isUnblockable = true; + this.hungerDamage = 0.0F; + return this; + } + + protected DamageSource setDamageAllowedInCreativeMode() { + this.isDamageAllowedInCreativeMode = true; + return this; + } + + /**+ + * Sets a value indicating whether the damage is absolute + * (ignores modification by potion effects or enchantments), and + * also clears out hunger damage. + */ + protected DamageSource setDamageIsAbsolute() { + this.damageIsAbsolute = true; + this.hungerDamage = 0.0F; + return this; + } + + /**+ + * Define the damage type as fire based. + */ + protected DamageSource setFireDamage() { + this.fireDamage = true; + return this; + } + + /**+ + * Gets the death message that is displayed when the player dies + */ + public IChatComponent getDeathMessage(EntityLivingBase parEntityLivingBase) { + EntityLivingBase entitylivingbase = parEntityLivingBase.func_94060_bK(); + String s = "death.attack." + this.damageType; + String s1 = s + ".player"; + return entitylivingbase != null && StatCollector.canTranslate(s1) + ? new ChatComponentTranslation(s1, + new Object[] { parEntityLivingBase.getDisplayName(), entitylivingbase.getDisplayName() }) + : new ChatComponentTranslation(s, new Object[] { parEntityLivingBase.getDisplayName() }); + } + + /**+ + * Returns true if the damage is fire based. + */ + public boolean isFireDamage() { + return this.fireDamage; + } + + /**+ + * Return the name of damage type. + */ + public String getDamageType() { + return this.damageType; + } + + /**+ + * Set whether this damage source will have its damage amount + * scaled based on the current difficulty. + */ + public DamageSource setDifficultyScaled() { + this.difficultyScaled = true; + return this; + } + + /**+ + * Return whether this damage source will have its damage amount + * scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() { + return this.difficultyScaled; + } + + /**+ + * Returns true if the damage is magic based. + */ + public boolean isMagicDamage() { + return this.magicDamage; + } + + /**+ + * Define the damage type as magic based. + */ + public DamageSource setMagicDamage() { + this.magicDamage = true; + return this; + } + + public boolean isCreativePlayer() { + Entity entity = this.getEntity(); + return entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnchantmentNameParts.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnchantmentNameParts.java new file mode 100644 index 0000000..eca54e7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnchantmentNameParts.java @@ -0,0 +1,68 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EnchantmentNameParts { + + static { + __checkIntegratedContextValid("net/minecraft/util/EnchantmentNameParts"); + } + + private static final EnchantmentNameParts instance = new EnchantmentNameParts(); + private EaglercraftRandom rand = new EaglercraftRandom(); + private String[] namePartsArray = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale " + .split(" "); + + public static EnchantmentNameParts getInstance() { + return instance; + } + + /**+ + * Randomly generates a new name built up of 3 or 4 randomly + * selected words. + */ + public String generateNewRandomName() { + int i = this.rand.nextInt(2) + 3; + String s = ""; + + for (int j = 0; j < i; ++j) { + if (j > 0) { + s = s + " "; + } + + s = s + this.namePartsArray[this.rand.nextInt(this.namePartsArray.length)]; + } + + return s; + } + + /**+ + * Resets the underlying random number generator using a given + * seed. + */ + public void reseedRandomGenerator(long seed) { + this.rand.setSeed(seed); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSource.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSource.java new file mode 100644 index 0000000..8e2c6df --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSource.java @@ -0,0 +1,93 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityDamageSource extends DamageSource { + + static { + __checkIntegratedContextValid("net/minecraft/util/EntityDamageSource"); + } + + protected Entity damageSourceEntity; + /**+ + * Whether this EntityDamageSource is from an entity wearing + * Thorns-enchanted armor. + */ + private boolean isThornsDamage = false; + + public EntityDamageSource(String parString1, Entity damageSourceEntityIn) { + super(parString1); + this.damageSourceEntity = damageSourceEntityIn; + } + + /**+ + * Sets this EntityDamageSource as originating from Thorns armor + */ + public EntityDamageSource setIsThornsDamage() { + this.isThornsDamage = true; + return this; + } + + public boolean getIsThornsDamage() { + return this.isThornsDamage; + } + + public Entity getEntity() { + return this.damageSourceEntity; + } + + /**+ + * Gets the death message that is displayed when the player dies + */ + public IChatComponent getDeathMessage(EntityLivingBase entitylivingbase) { + ItemStack itemstack = this.damageSourceEntity instanceof EntityLivingBase + ? ((EntityLivingBase) this.damageSourceEntity).getHeldItem() + : null; + String s = "death.attack." + this.damageType; + String s1 = s + ".item"; + return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) + ? new ChatComponentTranslation(s1, + new Object[] { entitylivingbase.getDisplayName(), this.damageSourceEntity.getDisplayName(), + itemstack.getChatComponent() }) + : new ChatComponentTranslation(s, + new Object[] { entitylivingbase.getDisplayName(), this.damageSourceEntity.getDisplayName() }); + } + + /**+ + * Return whether this damage source will have its damage amount + * scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() { + return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase + && !(this.damageSourceEntity instanceof EntityPlayer); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSourceIndirect.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSourceIndirect.java new file mode 100644 index 0000000..8971498 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSourceIndirect.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntityDamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StatCollector; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EntityDamageSourceIndirect extends EntityDamageSource { + + static { + __checkIntegratedContextValid("net/minecraft/util/EntityDamageSourceIndirect"); + } + + private Entity indirectEntity; + + public EntityDamageSourceIndirect(String parString1, Entity parEntity, Entity indirectEntityIn) { + super(parString1, parEntity); + this.indirectEntity = indirectEntityIn; + } + + public Entity getSourceOfDamage() { + return this.damageSourceEntity; + } + + public Entity getEntity() { + return this.indirectEntity; + } + + /**+ + * Gets the death message that is displayed when the player dies + */ + public IChatComponent getDeathMessage(EntityLivingBase entitylivingbase) { + IChatComponent ichatcomponent = this.indirectEntity == null ? this.damageSourceEntity.getDisplayName() + : this.indirectEntity.getDisplayName(); + ItemStack itemstack = this.indirectEntity instanceof EntityLivingBase + ? ((EntityLivingBase) this.indirectEntity).getHeldItem() + : null; + String s = "death.attack." + this.damageType; + String s1 = s + ".item"; + return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) + ? new ChatComponentTranslation(s1, + new Object[] { entitylivingbase.getDisplayName(), ichatcomponent, + itemstack.getChatComponent() }) + : new ChatComponentTranslation(s, new Object[] { entitylivingbase.getDisplayName(), ichatcomponent }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntitySelectors.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntitySelectors.java new file mode 100644 index 0000000..0d7eae8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntitySelectors.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityArmorStand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class EntitySelectors { + + static { + __checkIntegratedContextValid("net/minecraft/util/EntitySelectors"); + } + + public static final Predicate selectAnything = new Predicate() { + public boolean apply(Entity entity) { + return entity.isEntityAlive(); + } + }; + /**+ + * Selects only entities which are neither ridden by anything + * nor ride on anything + */ + public static final Predicate IS_STANDALONE = new Predicate() { + public boolean apply(Entity entity) { + return entity.isEntityAlive() && entity.riddenByEntity == null && entity.ridingEntity == null; + } + }; + public static final Predicate selectInventories = new Predicate() { + public boolean apply(Entity entity) { + return entity instanceof IInventory && entity.isEntityAlive(); + } + }; + /**+ + * Selects entities which are either not players or players that + * are not spectating + */ + public static final Predicate NOT_SPECTATING = new Predicate() { + public boolean apply(Entity entity) { + return !(entity instanceof EntityPlayer) || !((EntityPlayer) entity).isSpectator(); + } + }; + + public static class ArmoredMob implements Predicate { + private final ItemStack armor; + + public ArmoredMob(ItemStack armor) { + this.armor = armor; + } + + public boolean apply(Entity entity) { + if (!entity.isEntityAlive()) { + return false; + } else if (!(entity instanceof EntityLivingBase)) { + return false; + } else { + EntityLivingBase entitylivingbase = (EntityLivingBase) entity; + return entitylivingbase.getEquipmentInSlot(EntityLiving.getArmorPosition(this.armor)) != null ? false + : (entitylivingbase instanceof EntityLiving ? ((EntityLiving) entitylivingbase).canPickUpLoot() + : (entitylivingbase instanceof EntityArmorStand ? true + : entitylivingbase instanceof EntityPlayer)); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumChatFormatting.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumChatFormatting.java new file mode 100644 index 0000000..5db15e1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumChatFormatting.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; +import java.util.regex.Pattern; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumChatFormatting { + BLACK("BLACK", '0', 0), DARK_BLUE("DARK_BLUE", '1', 1), DARK_GREEN("DARK_GREEN", '2', 2), + DARK_AQUA("DARK_AQUA", '3', 3), DARK_RED("DARK_RED", '4', 4), DARK_PURPLE("DARK_PURPLE", '5', 5), + GOLD("GOLD", '6', 6), GRAY("GRAY", '7', 7), DARK_GRAY("DARK_GRAY", '8', 8), BLUE("BLUE", '9', 9), + GREEN("GREEN", 'a', 10), AQUA("AQUA", 'b', 11), RED("RED", 'c', 12), LIGHT_PURPLE("LIGHT_PURPLE", 'd', 13), + YELLOW("YELLOW", 'e', 14), WHITE("WHITE", 'f', 15), OBFUSCATED("OBFUSCATED", 'k', true), BOLD("BOLD", 'l', true), + STRIKETHROUGH("STRIKETHROUGH", 'm', true), UNDERLINE("UNDERLINE", 'n', true), ITALIC("ITALIC", 'o', true), + RESET("RESET", 'r', -1); + + static { + __checkIntegratedContextValid("net/minecraft/util/EnumChatFormatting"); + } + + private static final Map nameMapping = Maps.newHashMap(); + /**+ + * Matches formatting codes that indicate that the client should + * treat the following text as bold, recolored, obfuscated, etc. + */ + private static final Pattern formattingCodePattern = Pattern + .compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]"); + private final String name; + private final char formattingCode; + private final boolean fancyStyling; + private final String controlString; + private final int colorIndex; + + private static String func_175745_c(String parString1) { + return parString1.toLowerCase().replaceAll("[^a-z]", ""); + } + + private EnumChatFormatting(String formattingName, char formattingCodeIn, int colorIndex) { + this(formattingName, formattingCodeIn, false, colorIndex); + } + + private EnumChatFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn) { + this(formattingName, formattingCodeIn, fancyStylingIn, -1); + } + + private EnumChatFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn, int colorIndex) { + this.name = formattingName; + this.formattingCode = formattingCodeIn; + this.fancyStyling = fancyStylingIn; + this.colorIndex = colorIndex; + this.controlString = "\u00a7" + formattingCodeIn; + } + + /**+ + * Returns the numerical color index that represents this + * formatting + */ + public int getColorIndex() { + return this.colorIndex; + } + + /**+ + * False if this is just changing the color or resetting; true + * otherwise. + */ + public boolean isFancyStyling() { + return this.fancyStyling; + } + + /**+ + * Checks if this is a color code. + */ + public boolean isColor() { + return !this.fancyStyling && this != RESET; + } + + /**+ + * Gets the friendly name of this value. + */ + public String getFriendlyName() { + return this.name().toLowerCase(); + } + + public String toString() { + return this.controlString; + } + + /**+ + * Returns a copy of the given string, with formatting codes + * stripped away. + */ + public static String getTextWithoutFormattingCodes(String text) { + return text == null ? null : formattingCodePattern.matcher(text).replaceAll(""); + } + + /**+ + * Gets a value by its friendly name; null if the given name + * does not map to a defined value. + */ + public static EnumChatFormatting getValueByName(String friendlyName) { + return friendlyName == null ? null : (EnumChatFormatting) nameMapping.get(func_175745_c(friendlyName)); + } + + public static EnumChatFormatting func_175744_a(int parInt1) { + if (parInt1 < 0) { + return RESET; + } else { + for (EnumChatFormatting enumchatformatting : values()) { + if (enumchatformatting.getColorIndex() == parInt1) { + return enumchatformatting; + } + } + + return null; + } + } + + /**+ + * Gets all the valid values. Args: @param par0: Whether or not + * to include color values. @param par1: Whether or not to + * include fancy-styling values (anything that isn't a color + * value or the "reset" value). + */ + public static Collection getValidValues(boolean parFlag, boolean parFlag2) { + ArrayList arraylist = Lists.newArrayList(); + + for (EnumChatFormatting enumchatformatting : values()) { + if ((!enumchatformatting.isColor() || parFlag) && (!enumchatformatting.isFancyStyling() || parFlag2)) { + arraylist.add(enumchatformatting.getFriendlyName()); + } + } + + return arraylist; + } + + static { + for (EnumChatFormatting enumchatformatting : values()) { + nameMapping.put(func_175745_c(enumchatformatting.name), enumchatformatting); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumFacing.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumFacing.java new file mode 100644 index 0000000..25a338b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumFacing.java @@ -0,0 +1,454 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Maps; + +import java.util.Iterator; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IStringSerializable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3i; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumFacing implements IStringSerializable { + DOWN(0, 1, -1, "down", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.Y, new Vec3i(0, -1, 0)), + UP(1, 0, -1, "up", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.Y, new Vec3i(0, 1, 0)), + NORTH(2, 3, 2, "north", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.Z, new Vec3i(0, 0, -1)), + SOUTH(3, 2, 0, "south", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.Z, new Vec3i(0, 0, 1)), + WEST(4, 5, 1, "west", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.X, new Vec3i(-1, 0, 0)), + EAST(5, 4, 3, "east", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.X, new Vec3i(1, 0, 0)); + + static { + __checkIntegratedContextValid("net/minecraft/util/EnumFacing"); + } + + private final int index; + private final int opposite; + private final int horizontalIndex; + private final String name; + private final EnumFacing.Axis axis; + private final EnumFacing.AxisDirection axisDirection; + private final Vec3i directionVec; + /**+ + * All facings in D-U-N-S-W-E order + */ + public static final EnumFacing[] VALUES = new EnumFacing[6]; + /**+ + * All Facings with horizontal axis in order S-W-N-E + */ + private static final EnumFacing[] HORIZONTALS = new EnumFacing[4]; + private static final Map NAME_LOOKUP = Maps.newHashMap(); + + private EnumFacing(int indexIn, int oppositeIn, int horizontalIndexIn, String nameIn, + EnumFacing.AxisDirection axisDirectionIn, EnumFacing.Axis axisIn, Vec3i directionVecIn) { + this.index = indexIn; + this.horizontalIndex = horizontalIndexIn; + this.opposite = oppositeIn; + this.name = nameIn; + this.axis = axisIn; + this.axisDirection = axisDirectionIn; + this.directionVec = directionVecIn; + } + + /**+ + * Get the Index of this Facing (0-5). The order is D-U-N-S-W-E + */ + public int getIndex() { + return this.index; + } + + /**+ + * Get the index of this horizontal facing (0-3). The order is + * S-W-N-E + */ + public int getHorizontalIndex() { + return this.horizontalIndex; + } + + /**+ + * Get the AxisDirection of this Facing. + */ + public EnumFacing.AxisDirection getAxisDirection() { + return this.axisDirection; + } + + /**+ + * Get the opposite Facing (e.g. DOWN => UP) + */ + public EnumFacing getOpposite() { + /**+ + * Get a Facing by it's index (0-5). The order is D-U-N-S-W-E. + * Named getFront for legacy reasons. + */ + return getFront(this.opposite); + } + + /**+ + * Rotate this Facing around the given axis clockwise. If this + * facing cannot be rotated around the given axis, returns this + * facing without rotating. + */ + public EnumFacing rotateAround(EnumFacing.Axis axis) { + switch (axis) { + case X: + if (this != WEST && this != EAST) { + return this.rotateX(); + } + + return this; + case Y: + if (this != UP && this != DOWN) { + return this.rotateY(); + } + + return this; + case Z: + if (this != NORTH && this != SOUTH) { + return this.rotateZ(); + } + + return this; + default: + throw new IllegalStateException("Unable to get CW facing for axis " + axis); + } + } + + /**+ + * Rotate this Facing around the Y axis clockwise (NORTH => EAST + * => SOUTH => WEST => NORTH) + */ + public EnumFacing rotateY() { + switch (this) { + case NORTH: + return EAST; + case EAST: + return SOUTH; + case SOUTH: + return WEST; + case WEST: + return NORTH; + default: + throw new IllegalStateException("Unable to get Y-rotated facing of " + this); + } + } + + /**+ + * Rotate this Facing around the X axis (NORTH => DOWN => SOUTH + * => UP => NORTH) + */ + private EnumFacing rotateX() { + switch (this) { + case NORTH: + return DOWN; + case EAST: + case WEST: + default: + throw new IllegalStateException("Unable to get X-rotated facing of " + this); + case SOUTH: + return UP; + case UP: + return NORTH; + case DOWN: + return SOUTH; + } + } + + /**+ + * Rotate this Facing around the Z axis (EAST => DOWN => WEST => + * UP => EAST) + */ + private EnumFacing rotateZ() { + switch (this) { + case EAST: + return DOWN; + case SOUTH: + default: + throw new IllegalStateException("Unable to get Z-rotated facing of " + this); + case WEST: + return UP; + case UP: + return EAST; + case DOWN: + return WEST; + } + } + + /**+ + * Rotate this Facing around the Y axis counter-clockwise (NORTH + * => WEST => SOUTH => EAST => NORTH) + */ + public EnumFacing rotateYCCW() { + switch (this) { + case NORTH: + return WEST; + case EAST: + return NORTH; + case SOUTH: + return EAST; + case WEST: + return SOUTH; + default: + throw new IllegalStateException("Unable to get CCW facing of " + this); + } + } + + /**+ + * Returns a offset that addresses the block in front of this + * facing. + */ + public int getFrontOffsetX() { + return this.axis == EnumFacing.Axis.X ? this.axisDirection.getOffset() : 0; + } + + public int getFrontOffsetY() { + return this.axis == EnumFacing.Axis.Y ? this.axisDirection.getOffset() : 0; + } + + /**+ + * Returns a offset that addresses the block in front of this + * facing. + */ + public int getFrontOffsetZ() { + return this.axis == EnumFacing.Axis.Z ? this.axisDirection.getOffset() : 0; + } + + /**+ + * Same as getName, but does not override the method from Enum. + */ + public String getName2() { + return this.name; + } + + public EnumFacing.Axis getAxis() { + return this.axis; + } + + /**+ + * Get the facing specified by the given name + */ + public static EnumFacing byName(String name) { + return name == null ? null : (EnumFacing) NAME_LOOKUP.get(name.toLowerCase()); + } + + /**+ + * Get a Facing by it's index (0-5). The order is D-U-N-S-W-E. + * Named getFront for legacy reasons. + */ + public static EnumFacing getFront(int index) { + return VALUES[MathHelper.abs_int(index % VALUES.length)]; + } + + /**+ + * Get a Facing by it's horizontal index (0-3). The order is + * S-W-N-E. + */ + public static EnumFacing getHorizontal(int parInt1) { + return HORIZONTALS[MathHelper.abs_int(parInt1 % HORIZONTALS.length)]; + } + + /**+ + * Get the Facing corresponding to the given angle (0-360). An + * angle of 0 is SOUTH, an angle of 90 would be WEST. + */ + public static EnumFacing fromAngle(double angle) { + /**+ + * Get a Facing by it's horizontal index (0-3). The order is + * S-W-N-E. + */ + return getHorizontal(MathHelper.floor_double(angle / 90.0D + 0.5D) & 3); + } + + /**+ + * Choose a random Facing using the given Random + */ + public static EnumFacing random(EaglercraftRandom rand) { + return values()[rand.nextInt(values().length)]; + } + + public static EnumFacing getFacingFromVector(float parFloat1, float parFloat2, float parFloat3) { + EnumFacing enumfacing = NORTH; + float f = Float.MIN_VALUE; + + for (EnumFacing enumfacing1 : values()) { + float f1 = parFloat1 * (float) enumfacing1.directionVec.getX() + + parFloat2 * (float) enumfacing1.directionVec.getY() + + parFloat3 * (float) enumfacing1.directionVec.getZ(); + if (f1 > f) { + f = f1; + enumfacing = enumfacing1; + } + } + + return enumfacing; + } + + public String toString() { + return this.name; + } + + public String getName() { + return this.name; + } + + public static EnumFacing func_181076_a(EnumFacing.AxisDirection parAxisDirection, EnumFacing.Axis parAxis) { + for (EnumFacing enumfacing : values()) { + if (enumfacing.getAxisDirection() == parAxisDirection && enumfacing.getAxis() == parAxis) { + return enumfacing; + } + } + + throw new IllegalArgumentException("No such direction: " + parAxisDirection + " " + parAxis); + } + + /**+ + * Get a normalized Vector that points in the direction of this + * Facing. + */ + public Vec3i getDirectionVec() { + return this.directionVec; + } + + static { + for (EnumFacing enumfacing : values()) { + VALUES[enumfacing.index] = enumfacing; + if (enumfacing.getAxis().isHorizontal()) { + HORIZONTALS[enumfacing.horizontalIndex] = enumfacing; + } + + NAME_LOOKUP.put(enumfacing.getName2().toLowerCase(), enumfacing); + } + + } + + public static enum Axis implements Predicate, IStringSerializable { + X("x", EnumFacing.Plane.HORIZONTAL), Y("y", EnumFacing.Plane.VERTICAL), Z("z", EnumFacing.Plane.HORIZONTAL); + + private static final Map NAME_LOOKUP = Maps.newHashMap(); + private final String name; + private final EnumFacing.Plane plane; + + private Axis(String name, EnumFacing.Plane plane) { + this.name = name; + this.plane = plane; + } + + /**+ + * Get the facing specified by the given name + */ + public static EnumFacing.Axis byName(String name) { + return name == null ? null : (EnumFacing.Axis) NAME_LOOKUP.get(name.toLowerCase()); + } + + /**+ + * Same as getName, but does not override the method from Enum. + */ + public String getName2() { + return this.name; + } + + public boolean isVertical() { + return this.plane == EnumFacing.Plane.VERTICAL; + } + + public boolean isHorizontal() { + return this.plane == EnumFacing.Plane.HORIZONTAL; + } + + public String toString() { + return this.name; + } + + public boolean apply(EnumFacing enumfacing) { + return enumfacing != null && enumfacing.getAxis() == this; + } + + public EnumFacing.Plane getPlane() { + return this.plane; + } + + public String getName() { + return this.name; + } + + static { + for (EnumFacing.Axis enumfacing$axis : values()) { + NAME_LOOKUP.put(enumfacing$axis.getName2().toLowerCase(), enumfacing$axis); + } + + } + } + + public static enum AxisDirection { + POSITIVE(1, "Towards positive"), NEGATIVE(-1, "Towards negative"); + + private final int offset; + private final String description; + + private AxisDirection(int offset, String description) { + this.offset = offset; + this.description = description; + } + + public int getOffset() { + return this.offset; + } + + public String toString() { + return this.description; + } + } + + public static enum Plane implements Predicate, Iterable { + HORIZONTAL, VERTICAL; + + public EnumFacing[] facings() { + switch (this) { + case HORIZONTAL: + return new EnumFacing[] { EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST }; + case VERTICAL: + return new EnumFacing[] { EnumFacing.UP, EnumFacing.DOWN }; + default: + throw new Error("Someone\'s been tampering with the universe!"); + } + } + + /**+ + * Choose a random Facing using the given Random + */ + public EnumFacing random(EaglercraftRandom rand) { + EnumFacing[] aenumfacing = this.facings(); + return aenumfacing[rand.nextInt(aenumfacing.length)]; + } + + public boolean apply(EnumFacing enumfacing) { + return enumfacing != null && enumfacing.getAxis().getPlane() == this; + } + + public Iterator iterator() { + return Iterators.forArray(this.facings()); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumParticleTypes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumParticleTypes.java new file mode 100644 index 0000000..1a31c07 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumParticleTypes.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.util.ArrayList; +import java.util.Map; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumParticleTypes { + EXPLOSION_NORMAL("explode", 0, true), EXPLOSION_LARGE("largeexplode", 1, true), + EXPLOSION_HUGE("hugeexplosion", 2, true), FIREWORKS_SPARK("fireworksSpark", 3, false), + WATER_BUBBLE("bubble", 4, false), WATER_SPLASH("splash", 5, false), WATER_WAKE("wake", 6, false), + SUSPENDED("suspended", 7, false), SUSPENDED_DEPTH("depthsuspend", 8, false), CRIT("crit", 9, false), + CRIT_MAGIC("magicCrit", 10, false), SMOKE_NORMAL("smoke", 11, false), SMOKE_LARGE("largesmoke", 12, false), + SPELL("spell", 13, false), SPELL_INSTANT("instantSpell", 14, false), SPELL_MOB("mobSpell", 15, false), + SPELL_MOB_AMBIENT("mobSpellAmbient", 16, false), SPELL_WITCH("witchMagic", 17, false), + DRIP_WATER("dripWater", 18, false), DRIP_LAVA("dripLava", 19, false), VILLAGER_ANGRY("angryVillager", 20, false), + VILLAGER_HAPPY("happyVillager", 21, false), TOWN_AURA("townaura", 22, false), NOTE("note", 23, false), + PORTAL("portal", 24, false), ENCHANTMENT_TABLE("enchantmenttable", 25, false), FLAME("flame", 26, false), + LAVA("lava", 27, false), FOOTSTEP("footstep", 28, false), CLOUD("cloud", 29, false), REDSTONE("reddust", 30, false), + SNOWBALL("snowballpoof", 31, false), SNOW_SHOVEL("snowshovel", 32, false), SLIME("slime", 33, false), + HEART("heart", 34, false), BARRIER("barrier", 35, false), ITEM_CRACK("iconcrack_", 36, false, 2), + BLOCK_CRACK("blockcrack_", 37, false, 1), BLOCK_DUST("blockdust_", 38, false, 1), WATER_DROP("droplet", 39, false), + ITEM_TAKE("take", 40, false), MOB_APPEARANCE("mobappearance", 41, true); + + static { + __checkIntegratedContextValid("net/minecraft/util/EnumParticleTypes"); + } + + private final String particleName; + private final int particleID; + private final boolean shouldIgnoreRange; + private final int argumentCount; + private static final Map PARTICLES = Maps.newHashMap(); + private static final String[] PARTICLE_NAMES; + + private EnumParticleTypes(String particleNameIn, int particleIDIn, boolean parFlag, int argumentCountIn) { + this.particleName = particleNameIn; + this.particleID = particleIDIn; + this.shouldIgnoreRange = parFlag; + this.argumentCount = argumentCountIn; + } + + private EnumParticleTypes(String particleNameIn, int particleIDIn, boolean parFlag) { + this(particleNameIn, particleIDIn, parFlag, 0); + } + + public static String[] getParticleNames() { + return PARTICLE_NAMES; + } + + public String getParticleName() { + return this.particleName; + } + + public int getParticleID() { + return this.particleID; + } + + public int getArgumentCount() { + return this.argumentCount; + } + + public boolean getShouldIgnoreRange() { + return this.shouldIgnoreRange; + } + + public boolean hasArguments() { + return this.argumentCount > 0; + } + + /**+ + * Gets the relative EnumParticleTypes by id. + */ + public static EnumParticleTypes getParticleFromId(int particleId) { + return (EnumParticleTypes) PARTICLES.get(Integer.valueOf(particleId)); + } + + static { + ArrayList arraylist = Lists.newArrayList(); + + for (EnumParticleTypes enumparticletypes : values()) { + PARTICLES.put(Integer.valueOf(enumparticletypes.getParticleID()), enumparticletypes); + if (!enumparticletypes.getParticleName().endsWith("_")) { + arraylist.add(enumparticletypes.getParticleName()); + } + } + + PARTICLE_NAMES = (String[]) arraylist.toArray(new String[arraylist.size()]); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumWorldBlockLayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumWorldBlockLayer.java new file mode 100644 index 0000000..b14f131 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumWorldBlockLayer.java @@ -0,0 +1,41 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumWorldBlockLayer { + SOLID("Solid"), CUTOUT_MIPPED("Mipped Cutout"), CUTOUT("Cutout"), TRANSLUCENT("Translucent"); + + static { + __checkIntegratedContextValid("net/minecraft/util/EnumWorldBlockLayer"); + } + + private final String layerName; + + private EnumWorldBlockLayer(String layerNameIn) { + this.layerName = layerNameIn; + } + + public String toString() { + return this.layerName; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FoodStats.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FoodStats.java new file mode 100644 index 0000000..90f8ccd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FoodStats.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemFood; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 FoodStats { + + static { + __checkIntegratedContextValid("net/minecraft/util/FoodStats"); + } + + /**+ + * The player's food level. + */ + private int foodLevel = 20; + /**+ + * The player's food saturation. + */ + private float foodSaturationLevel = 5.0F; + private float foodExhaustionLevel; + private int foodTimer; + private int prevFoodLevel = 20; + + /**+ + * Add food stats. + */ + public void addStats(int foodLevelIn, float foodSaturationModifier) { + this.foodLevel = Math.min(foodLevelIn + this.foodLevel, 20); + this.foodSaturationLevel = Math.min( + this.foodSaturationLevel + (float) foodLevelIn * foodSaturationModifier * 2.0F, (float) this.foodLevel); + } + + /**+ + * Add food stats. + */ + public void addStats(ItemFood foodItem, ItemStack parItemStack) { + this.addStats(foodItem.getHealAmount(parItemStack), foodItem.getSaturationModifier(parItemStack)); + } + + /**+ + * Handles the food game logic. + */ + public void onUpdate(EntityPlayer player) { + EnumDifficulty enumdifficulty = player.worldObj.getDifficulty(); + this.prevFoodLevel = this.foodLevel; + if (this.foodExhaustionLevel > 4.0F) { + this.foodExhaustionLevel -= 4.0F; + if (this.foodSaturationLevel > 0.0F) { + this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); + } else if (enumdifficulty != EnumDifficulty.PEACEFUL) { + this.foodLevel = Math.max(this.foodLevel - 1, 0); + } + } + + if (player.worldObj.getGameRules().getBoolean("naturalRegeneration") && this.foodLevel >= 18 + && player.shouldHeal()) { + ++this.foodTimer; + if (this.foodTimer >= 80) { + player.heal(1.0F); + this.addExhaustion(3.0F); + this.foodTimer = 0; + } + } else if (this.foodLevel <= 0) { + ++this.foodTimer; + if (this.foodTimer >= 80) { + if (player.getHealth() > 10.0F || enumdifficulty == EnumDifficulty.HARD + || player.getHealth() > 1.0F && enumdifficulty == EnumDifficulty.NORMAL) { + player.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.foodTimer = 0; + } + } else { + this.foodTimer = 0; + } + + } + + /**+ + * Reads the food data for the player. + */ + public void readNBT(NBTTagCompound parNBTTagCompound) { + if (parNBTTagCompound.hasKey("foodLevel", 99)) { + this.foodLevel = parNBTTagCompound.getInteger("foodLevel"); + this.foodTimer = parNBTTagCompound.getInteger("foodTickTimer"); + this.foodSaturationLevel = parNBTTagCompound.getFloat("foodSaturationLevel"); + this.foodExhaustionLevel = parNBTTagCompound.getFloat("foodExhaustionLevel"); + } + + } + + /**+ + * Writes the food data for the player. + */ + public void writeNBT(NBTTagCompound parNBTTagCompound) { + parNBTTagCompound.setInteger("foodLevel", this.foodLevel); + parNBTTagCompound.setInteger("foodTickTimer", this.foodTimer); + parNBTTagCompound.setFloat("foodSaturationLevel", this.foodSaturationLevel); + parNBTTagCompound.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); + } + + /**+ + * Get the player's food level. + */ + public int getFoodLevel() { + return this.foodLevel; + } + + public int getPrevFoodLevel() { + return this.prevFoodLevel; + } + + /**+ + * Get whether the player must eat food. + */ + public boolean needFood() { + return this.foodLevel < 20; + } + + /**+ + * adds input to foodExhaustionLevel to a max of 40 + */ + public void addExhaustion(float parFloat1) { + this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + parFloat1, 40.0F); + } + + /**+ + * Get the player's food saturation level. + */ + public float getSaturationLevel() { + return this.foodSaturationLevel; + } + + public void setFoodLevel(int foodLevelIn) { + this.foodLevel = foodLevelIn; + } + + public void setFoodSaturationLevel(float foodSaturationLevelIn) { + this.foodSaturationLevel = foodSaturationLevelIn; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FrameTimer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FrameTimer.java new file mode 100644 index 0000000..8b6bc14 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FrameTimer.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 FrameTimer { + + static { + __checkIntegratedContextValid("net/minecraft/util/FrameTimer"); + } + + private final long[] field_181752_a = new long[240]; + private int field_181753_b; + private int field_181754_c; + private int field_181755_d; + + public void func_181747_a(long parLong1) { + this.field_181752_a[this.field_181755_d] = parLong1; + ++this.field_181755_d; + if (this.field_181755_d == 240) { + this.field_181755_d = 0; + } + + if (this.field_181754_c < 240) { + this.field_181753_b = 0; + ++this.field_181754_c; + } else { + this.field_181753_b = this.func_181751_b(this.field_181755_d + 1); + } + + } + + public int func_181748_a(long parLong1, int parInt1) { + double d0 = (double) parLong1 / 1.6666666E7D; + return (int) (d0 * (double) parInt1); + } + + public int func_181749_a() { + return this.field_181753_b; + } + + public int func_181750_b() { + return this.field_181755_d; + } + + public int func_181751_b(int parInt1) { + return parInt1 % 240; + } + + public long[] func_181746_c() { + return this.field_181752_a; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IChatComponent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IChatComponent.java new file mode 100644 index 0000000..363e578 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IChatComponent.java @@ -0,0 +1,269 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import java.lang.reflect.Type; +import java.util.List; +import java.util.Map.Entry; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeCodec; +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IChatComponent extends Iterable { + IChatComponent setChatStyle(ChatStyle var1); + + ChatStyle getChatStyle(); + + /**+ + * Appends the given text to the end of this component. + */ + IChatComponent appendText(String var1); + + /**+ + * Appends the given component to the end of this one. + */ + IChatComponent appendSibling(IChatComponent var1); + + /**+ + * Gets the text of this component, without any special + * formatting codes added, for chat. TODO: why is this two + * different methods? + */ + String getUnformattedTextForChat(); + + /**+ + * Get the text of this component, and all child + * components, with all special formatting codes removed. + */ + String getUnformattedText(); + + /**+ + * Gets the text of this component, with formatting codes added + * for rendering. + */ + String getFormattedText(); + + /**+ + * Gets the sibling components of this one. + */ + List getSiblings(); + + /**+ + * Creates a copy of this component. Almost a deep copy, except + * the style is shallow-copied. + */ + IChatComponent createCopy(); + + public static class Serializer implements JSONTypeCodec { + + public IChatComponent deserialize(Object parJsonElement) throws JSONException { + if (parJsonElement instanceof String) { + return new ChatComponentText((String) parJsonElement); + } else if (!(parJsonElement instanceof JSONObject)) { + if (parJsonElement instanceof JSONArray) { + JSONArray jsonarray1 = (JSONArray) parJsonElement; + IChatComponent ichatcomponent = null; + + for (Object jsonelement : jsonarray1) { + IChatComponent ichatcomponent1 = this.deserialize(jsonelement); + if (ichatcomponent == null) { + ichatcomponent = ichatcomponent1; + } else { + ichatcomponent.appendSibling(ichatcomponent1); + } + } + + return ichatcomponent; + } else { + throw new JSONException("Don\'t know how to turn " + parJsonElement.getClass().getSimpleName() + + " into a Component"); + } + } else { + JSONObject jsonobject = (JSONObject) parJsonElement; + Object object; + if (jsonobject.has("text")) { + object = new ChatComponentText(jsonobject.getString("text")); + } else if (jsonobject.has("translate")) { + String s = jsonobject.getString("translate"); + if (jsonobject.has("with")) { + JSONArray jsonarray = jsonobject.getJSONArray("with"); + Object[] aobject = new Object[jsonarray.length()]; + + for (int i = 0; i < aobject.length; ++i) { + aobject[i] = this.deserialize(jsonarray.get(i)); + if (aobject[i] instanceof ChatComponentText) { + ChatComponentText chatcomponenttext = (ChatComponentText) aobject[i]; + if (chatcomponenttext.getChatStyle().isEmpty() + && chatcomponenttext.getSiblings().isEmpty()) { + aobject[i] = chatcomponenttext.getChatComponentText_TextValue(); + } + } + } + + object = new ChatComponentTranslation(s, aobject); + } else { + object = new ChatComponentTranslation(s, new Object[0]); + } + } else if (jsonobject.has("score")) { + JSONObject jsonobject1 = jsonobject.getJSONObject("score"); + if (!jsonobject1.has("name") || !jsonobject1.has("objective")) { + throw new JSONException("A score component needs a least a name and an objective"); + } + + object = new ChatComponentScore(jsonobject1.getString("name"), jsonobject1.getString("objective")); + if (jsonobject1.has("value")) { + ((ChatComponentScore) object).setValue(jsonobject1.getString("value")); + } + } else { + if (!jsonobject.has("selector")) { + throw new JSONException( + "Don\'t know how to turn " + parJsonElement.toString() + " into a Component"); + } + + object = new ChatComponentSelector(jsonobject.getString("selector")); + } + + if (jsonobject.has("extra")) { + JSONArray jsonarray2 = jsonobject.getJSONArray("extra"); + if (jsonarray2.length() <= 0) { + throw new JSONException("Unexpected empty array of components"); + } + + for (int j = 0; j < jsonarray2.length(); ++j) { + ((IChatComponent) object).appendSibling(this.deserialize(jsonarray2.get(j))); + } + } + + ((IChatComponent) object).setChatStyle(JSONTypeProvider.deserialize(parJsonElement, ChatStyle.class)); + return (IChatComponent) object; + } + } + + private void serializeChatStyle(ChatStyle style, JSONObject object) { + JSONObject jsonelement = JSONTypeProvider.serialize(style); + for (String entry : jsonelement.keySet()) { + object.put(entry, jsonelement.get(entry)); + } + } + + public Object serialize(IChatComponent ichatcomponent) { + if (ichatcomponent instanceof ChatComponentText && ichatcomponent.getChatStyle().isEmpty() + && ichatcomponent.getSiblings().isEmpty()) { + return ((ChatComponentText) ichatcomponent).getChatComponentText_TextValue(); + } else { + JSONObject jsonobject = new JSONObject(); + if (!ichatcomponent.getChatStyle().isEmpty()) { + this.serializeChatStyle(ichatcomponent.getChatStyle(), jsonobject); + } + + if (!ichatcomponent.getSiblings().isEmpty()) { + JSONArray jsonarray = new JSONArray(); + + for (IChatComponent ichatcomponent1 : ichatcomponent.getSiblings()) { + jsonarray.put(this.serialize(ichatcomponent1)); + } + + jsonobject.put("extra", jsonarray); + } + + if (ichatcomponent instanceof ChatComponentText) { + jsonobject.put("text", ((ChatComponentText) ichatcomponent).getChatComponentText_TextValue()); + } else if (ichatcomponent instanceof ChatComponentTranslation) { + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation) ichatcomponent; + jsonobject.put("translate", chatcomponenttranslation.getKey()); + if (chatcomponenttranslation.getFormatArgs() != null + && chatcomponenttranslation.getFormatArgs().length > 0) { + JSONArray jsonarray1 = new JSONArray(); + + for (Object object : chatcomponenttranslation.getFormatArgs()) { + if (object instanceof IChatComponent) { + jsonarray1.put(this.serialize((IChatComponent) object)); + } else { + jsonarray1.put(String.valueOf(object)); + } + } + + jsonobject.put("with", jsonarray1); + } + } else if (ichatcomponent instanceof ChatComponentScore) { + ChatComponentScore chatcomponentscore = (ChatComponentScore) ichatcomponent; + JSONObject jsonobject1 = new JSONObject(); + jsonobject1.put("name", chatcomponentscore.getName()); + jsonobject1.put("objective", chatcomponentscore.getObjective()); + jsonobject1.put("value", chatcomponentscore.getUnformattedTextForChat()); + jsonobject.put("score", jsonobject1); + } else { + if (!(ichatcomponent instanceof ChatComponentSelector)) { + throw new IllegalArgumentException( + "Don\'t know how to serialize " + ichatcomponent + " as a Component"); + } + + ChatComponentSelector chatcomponentselector = (ChatComponentSelector) ichatcomponent; + jsonobject.put("selector", chatcomponentselector.getSelector()); + } + + return jsonobject; + } + } + + /** + * So sorry for this implementation + */ + public static String componentToJson(IChatComponent component) { + if ((component instanceof ChatComponentText) && component.getChatStyle().isEmpty() + && component.getSiblings().isEmpty()) { + String escaped = new JSONObject().put("E", component.getUnformattedTextForChat()).toString(); + return escaped.substring(5, escaped.length() - 1); + } else { + return JSONTypeProvider.serialize(component).toString(); + } + } + + public static IChatComponent jsonToComponent(String json) { + if (json.equals("null")) { + return new ChatComponentText(""); + } + return (IChatComponent) JSONTypeProvider.deserialize(json, IChatComponent.class); + } + } + + public static IChatComponent join(List components) { + ChatComponentText chatcomponenttext = new ChatComponentText(""); + + for (int i = 0; i < components.size(); ++i) { + if (i > 0) { + if (i == components.size() - 1) { + chatcomponenttext.appendText(" and "); + } else if (i > 0) { + chatcomponenttext.appendText(", "); + } + } + + chatcomponenttext.appendSibling((IChatComponent) components.get(i)); + } + + return chatcomponenttext; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IJsonSerializable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IJsonSerializable.java new file mode 100644 index 0000000..b97c2cc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IJsonSerializable.java @@ -0,0 +1,30 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IJsonSerializable { + void fromJson(Object var1); + + /**+ + * Gets the JsonElement that can be serialized. + */ + Object getSerializableElement(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IObjectIntIterable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IObjectIntIterable.java new file mode 100644 index 0000000..6c3a4f4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IObjectIntIterable.java @@ -0,0 +1,24 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IObjectIntIterable extends Iterable { +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IProgressUpdate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IProgressUpdate.java new file mode 100644 index 0000000..e70c65f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IProgressUpdate.java @@ -0,0 +1,49 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IProgressUpdate { + /**+ + * Shows the 'Saving level' string. + */ + void displaySavingString(String var1); + + /**+ + * this string, followed by "working..." and then the "% + * complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + void resetProgressAndMessage(String var1); + + /**+ + * Displays a string on the loading screen supposed to indicate + * what is being done currently. + */ + void displayLoadingString(String var1); + + /**+ + * Updates the progress bar on the loading screen to the + * specified amount. Args: loadProgress + */ + void setLoadingProgress(int var1); + + void setDoneWorking(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IRegistry.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IRegistry.java new file mode 100644 index 0000000..c3f52c3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IRegistry.java @@ -0,0 +1,30 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IRegistry extends Iterable { + V getObject(K var1); + + /**+ + * Register an object on this registry. + */ + void putObject(K var1, V var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IStringSerializable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IStringSerializable.java new file mode 100644 index 0000000..e6ba43c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IStringSerializable.java @@ -0,0 +1,25 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IStringSerializable { + String getName(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IThreadListener.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IThreadListener.java new file mode 100644 index 0000000..b336996 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IThreadListener.java @@ -0,0 +1,27 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IThreadListener { + void addScheduledTask(Runnable var1); + + boolean isCallingFromMinecraftThread(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ITickable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ITickable.java new file mode 100644 index 0000000..be15494 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ITickable.java @@ -0,0 +1,28 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ITickable { + /**+ + * Like the old updateEntity(), except more generic. + */ + void update(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntHashMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntHashMap.java new file mode 100644 index 0000000..c1926b0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntHashMap.java @@ -0,0 +1,272 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 IntHashMap { + + static { + __checkIntegratedContextValid("net/minecraft/util/IntHashMap"); + } + + /**+ + * An array of HashEntries representing the heads of hash slot + * lists + */ + private transient IntHashMap.Entry[] slots = new IntHashMap.Entry[16]; + private transient int count; + /**+ + * The grow threshold + */ + private int threshold = 12; + /**+ + * The scale factor used to determine when to grow the table + */ + private final float growFactor = 0.75F; + + /**+ + * Makes the passed in integer suitable for hashing by a number + * of shifts + */ + private static int computeHash(int integer) { + integer = integer ^ integer >>> 20 ^ integer >>> 12; + return integer ^ integer >>> 7 ^ integer >>> 4; + } + + /**+ + * Computes the index of the slot for the hash and slot count + * passed in. + */ + private static int getSlotIndex(int hash, int slotCount) { + return hash & slotCount - 1; + } + + /**+ + * Returns the object associated to a key + */ + public V lookup(int parInt1) { + int i = computeHash(parInt1); + + for (IntHashMap.Entry inthashmap$entry = this.slots[getSlotIndex(i, + this.slots.length)]; inthashmap$entry != null; inthashmap$entry = inthashmap$entry.nextEntry) { + if (inthashmap$entry.hashEntry == parInt1) { + return (V) inthashmap$entry.valueEntry; + } + } + + return (V) null; + } + + /**+ + * Returns true if this hash table contains the specified item. + */ + public boolean containsItem(int parInt1) { + return this.lookupEntry(parInt1) != null; + } + + /**+ + * Returns the internal entry for a key + */ + final IntHashMap.Entry lookupEntry(int parInt1) { + int i = computeHash(parInt1); + + for (IntHashMap.Entry inthashmap$entry = this.slots[getSlotIndex(i, + this.slots.length)]; inthashmap$entry != null; inthashmap$entry = inthashmap$entry.nextEntry) { + if (inthashmap$entry.hashEntry == parInt1) { + return inthashmap$entry; + } + } + + return null; + } + + /**+ + * Adds a key and associated value to this map + */ + public void addKey(int parInt1, V parObject) { + int i = computeHash(parInt1); + int j = getSlotIndex(i, this.slots.length); + + for (IntHashMap.Entry inthashmap$entry = this.slots[j]; inthashmap$entry != null; inthashmap$entry = inthashmap$entry.nextEntry) { + if (inthashmap$entry.hashEntry == parInt1) { + inthashmap$entry.valueEntry = parObject; + return; + } + } + + this.insert(i, parInt1, parObject, j); + } + + /**+ + * Increases the number of hash slots + */ + private void grow(int parInt1) { + IntHashMap.Entry[] ainthashmap$entry = this.slots; + int i = ainthashmap$entry.length; + if (i == 1073741824) { + this.threshold = Integer.MAX_VALUE; + } else { + IntHashMap.Entry[] ainthashmap$entry1 = new IntHashMap.Entry[parInt1]; + this.copyTo(ainthashmap$entry1); + this.slots = ainthashmap$entry1; + this.threshold = (int) ((float) parInt1 * this.growFactor); + } + } + + /**+ + * Copies the hash slots to a new array + */ + private void copyTo(IntHashMap.Entry[] parArrayOfEntry) { + IntHashMap.Entry[] ainthashmap$entry = this.slots; + int i = parArrayOfEntry.length; + + for (int j = 0; j < ainthashmap$entry.length; ++j) { + IntHashMap.Entry inthashmap$entry = ainthashmap$entry[j]; + if (inthashmap$entry != null) { + ainthashmap$entry[j] = null; + + while (true) { + IntHashMap.Entry inthashmap$entry1 = inthashmap$entry.nextEntry; + int k = getSlotIndex(inthashmap$entry.slotHash, i); + inthashmap$entry.nextEntry = parArrayOfEntry[k]; + parArrayOfEntry[k] = inthashmap$entry; + inthashmap$entry = inthashmap$entry1; + if (inthashmap$entry1 == null) { + break; + } + } + } + } + + } + + /**+ + * Removes the specified object from the map and returns it + */ + public V removeObject(int parInt1) { + IntHashMap.Entry inthashmap$entry = this.removeEntry(parInt1); + return (V) (inthashmap$entry == null ? null : inthashmap$entry.valueEntry); + } + + /**+ + * Removes the specified entry from the map and returns it + */ + final IntHashMap.Entry removeEntry(int parInt1) { + int i = computeHash(parInt1); + int j = getSlotIndex(i, this.slots.length); + IntHashMap.Entry inthashmap$entry = this.slots[j]; + + IntHashMap.Entry inthashmap$entry1; + IntHashMap.Entry inthashmap$entry2; + for (inthashmap$entry1 = inthashmap$entry; inthashmap$entry1 != null; inthashmap$entry1 = inthashmap$entry2) { + inthashmap$entry2 = inthashmap$entry1.nextEntry; + if (inthashmap$entry1.hashEntry == parInt1) { + --this.count; + if (inthashmap$entry == inthashmap$entry1) { + this.slots[j] = inthashmap$entry2; + } else { + inthashmap$entry.nextEntry = inthashmap$entry2; + } + + return inthashmap$entry1; + } + + inthashmap$entry = inthashmap$entry1; + } + + return inthashmap$entry1; + } + + /**+ + * Removes all entries from the map + */ + public void clearMap() { + IntHashMap.Entry[] ainthashmap$entry = this.slots; + + for (int i = 0; i < ainthashmap$entry.length; ++i) { + ainthashmap$entry[i] = null; + } + + this.count = 0; + } + + /**+ + * Adds an object to a slot + */ + private void insert(int parInt1, int parInt2, V parObject, int parInt3) { + IntHashMap.Entry inthashmap$entry = this.slots[parInt3]; + this.slots[parInt3] = new IntHashMap.Entry(parInt1, parInt2, parObject, inthashmap$entry); + if (this.count++ >= this.threshold) { + this.grow(2 * this.slots.length); + } + + } + + static class Entry { + final int hashEntry; + V valueEntry; + IntHashMap.Entry nextEntry; + final int slotHash; + + Entry(int parInt1, int parInt2, V parObject, IntHashMap.Entry parEntry) { + this.valueEntry = parObject; + this.nextEntry = parEntry; + this.hashEntry = parInt2; + this.slotHash = parInt1; + } + + public final int getHash() { + return this.hashEntry; + } + + public final V getValue() { + return this.valueEntry; + } + + public final boolean equals(Object object) { + if (!(object instanceof IntHashMap.Entry)) { + return false; + } else { + IntHashMap.Entry inthashmap$entry = (IntHashMap.Entry) object; + Integer integer = Integer.valueOf(this.getHash()); + Integer integer1 = Integer.valueOf(inthashmap$entry.getHash()); + if (integer == integer1 || integer != null && integer.equals(integer1)) { + Object object1 = this.getValue(); + Object object2 = inthashmap$entry.getValue(); + if (object1 == object2 || object1 != null && object1.equals(object2)) { + return true; + } + } + + return false; + } + } + + public final int hashCode() { + return IntHashMap.computeHash(this.hashEntry); + } + + public final String toString() { + return this.getHash() + "=" + this.getValue(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntegerCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntegerCache.java new file mode 100644 index 0000000..73e4996 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntegerCache.java @@ -0,0 +1,45 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 IntegerCache { + + static { + __checkIntegratedContextValid("net/minecraft/util/IntegerCache"); + } + + private static final Integer[] field_181757_a = new Integer['\uffff']; + + public static Integer func_181756_a(int parInt1) { + return parInt1 > 0 && parInt1 < field_181757_a.length ? field_181757_a[parInt1] : Integer.valueOf(parInt1); + } + + static { + int i = 0; + + for (int j = field_181757_a.length; i < j; ++i) { + field_181757_a[i] = Integer.valueOf(i); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/JsonSerializableSet.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/JsonSerializableSet.java new file mode 100644 index 0000000..ae01b4a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/JsonSerializableSet.java @@ -0,0 +1,71 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.ForwardingSet; +import com.google.common.collect.Sets; +import java.util.Set; + +import org.json.JSONArray; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IJsonSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 JsonSerializableSet extends ForwardingSet implements IJsonSerializable { + + static { + __checkIntegratedContextValid("net/minecraft/util/JsonSerializableSet"); + } + + /**+ + * The set for this ForwardingSet to forward methods to. + */ + private final Set underlyingSet = Sets.newHashSet(); + + public void fromJson(Object jsonelement) { + if (jsonelement instanceof JSONArray) { + for (Object jsonelement1 : (JSONArray) jsonelement) { + if (jsonelement1 instanceof String) { + this.add((String) jsonelement1); + } + } + } + + } + + /**+ + * Gets the JsonElement that can be serialized. + */ + public Object getSerializableElement() { + JSONArray jsonarray = new JSONArray(); + + for (String s : this) { + jsonarray.put(s); + } + + return jsonarray; + } + + protected Set delegate() { + return this.underlyingSet; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LazyLoadBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LazyLoadBase.java new file mode 100644 index 0000000..958dd7b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LazyLoadBase.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class LazyLoadBase { + private T value; + private boolean isLoaded = false; + + public T getValue() { + if (!this.isLoaded) { + this.isLoaded = true; + this.value = this.load(); + } + + return this.value; + } + + protected abstract T load(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LongHashMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LongHashMap.java new file mode 100644 index 0000000..8c3533e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LongHashMap.java @@ -0,0 +1,276 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 LongHashMap { + + static { + __checkIntegratedContextValid("net/minecraft/util/LongHashMap"); + } + + /**+ + * the array of all elements in the hash + */ + private transient LongHashMap.Entry[] hashArray = new LongHashMap.Entry[4096]; + private transient int numHashElements; + private int mask; + /**+ + * the maximum amount of elements in the hash (probably 3/4 the + * size due to meh hashing function) + */ + private int capacity = 3072; + /**+ + * percent of the hasharray that can be used without hash + * colliding probably + */ + private final float percentUseable = 0.75F; + private transient volatile int modCount; + + public LongHashMap() { + this.mask = this.hashArray.length - 1; + } + + /**+ + * returns the hashed key given the original key + */ + private static int getHashedKey(long originalKey) { + /**+ + * the hash function + */ + return hash((int) (originalKey ^ originalKey >>> 32)); + } + + /**+ + * the hash function + */ + private static int hash(int integer) { + integer = integer ^ integer >>> 20 ^ integer >>> 12; + return integer ^ integer >>> 7 ^ integer >>> 4; + } + + /**+ + * gets the index in the hash given the array length and the + * hashed key + */ + private static int getHashIndex(int parInt1, int parInt2) { + return parInt1 & parInt2; + } + + public int getNumHashElements() { + return this.numHashElements; + } + + /**+ + * get the value from the map given the key + */ + public V getValueByKey(long parLong1) { + int i = getHashedKey(parLong1); + + for (LongHashMap.Entry longhashmap$entry = this.hashArray[getHashIndex(i, + this.mask)]; longhashmap$entry != null; longhashmap$entry = longhashmap$entry.nextEntry) { + if (longhashmap$entry.key == parLong1) { + return (V) longhashmap$entry.value; + } + } + + return (V) null; + } + + public boolean containsItem(long parLong1) { + return this.getEntry(parLong1) != null; + } + + final LongHashMap.Entry getEntry(long parLong1) { + int i = getHashedKey(parLong1); + + for (LongHashMap.Entry longhashmap$entry = this.hashArray[getHashIndex(i, + this.mask)]; longhashmap$entry != null; longhashmap$entry = longhashmap$entry.nextEntry) { + if (longhashmap$entry.key == parLong1) { + return longhashmap$entry; + } + } + + return null; + } + + /**+ + * Add a key-value pair. + */ + public void add(long parLong1, V parObject) { + int i = getHashedKey(parLong1); + int j = getHashIndex(i, this.mask); + + for (LongHashMap.Entry longhashmap$entry = this.hashArray[j]; longhashmap$entry != null; longhashmap$entry = longhashmap$entry.nextEntry) { + if (longhashmap$entry.key == parLong1) { + longhashmap$entry.value = parObject; + return; + } + } + + ++this.modCount; + this.createKey(i, parLong1, parObject, j); + } + + /**+ + * resizes the table + */ + private void resizeTable(int parInt1) { + LongHashMap.Entry[] alonghashmap$entry = this.hashArray; + int i = alonghashmap$entry.length; + if (i == 1073741824) { + this.capacity = Integer.MAX_VALUE; + } else { + LongHashMap.Entry[] alonghashmap$entry1 = new LongHashMap.Entry[parInt1]; + this.copyHashTableTo(alonghashmap$entry1); + this.hashArray = alonghashmap$entry1; + this.mask = this.hashArray.length - 1; + this.capacity = (int) ((float) parInt1 * this.percentUseable); + } + } + + /**+ + * copies the hash table to the specified array + */ + private void copyHashTableTo(LongHashMap.Entry[] parArrayOfEntry) { + LongHashMap.Entry[] alonghashmap$entry = this.hashArray; + int i = parArrayOfEntry.length; + + for (int j = 0; j < alonghashmap$entry.length; ++j) { + LongHashMap.Entry longhashmap$entry = alonghashmap$entry[j]; + if (longhashmap$entry != null) { + alonghashmap$entry[j] = null; + + while (true) { + LongHashMap.Entry longhashmap$entry1 = longhashmap$entry.nextEntry; + int k = getHashIndex(longhashmap$entry.hash, i - 1); + longhashmap$entry.nextEntry = parArrayOfEntry[k]; + parArrayOfEntry[k] = longhashmap$entry; + longhashmap$entry = longhashmap$entry1; + if (longhashmap$entry1 == null) { + break; + } + } + } + } + + } + + /**+ + * calls the removeKey method and returns removed object + */ + public V remove(long parLong1) { + LongHashMap.Entry longhashmap$entry = this.removeKey(parLong1); + return (V) (longhashmap$entry == null ? null : longhashmap$entry.value); + } + + /**+ + * removes the key from the hash linked list + */ + final LongHashMap.Entry removeKey(long parLong1) { + int i = getHashedKey(parLong1); + int j = getHashIndex(i, this.mask); + LongHashMap.Entry longhashmap$entry = this.hashArray[j]; + + LongHashMap.Entry longhashmap$entry1; + LongHashMap.Entry longhashmap$entry2; + for (longhashmap$entry1 = longhashmap$entry; longhashmap$entry1 != null; longhashmap$entry1 = longhashmap$entry2) { + longhashmap$entry2 = longhashmap$entry1.nextEntry; + if (longhashmap$entry1.key == parLong1) { + ++this.modCount; + --this.numHashElements; + if (longhashmap$entry == longhashmap$entry1) { + this.hashArray[j] = longhashmap$entry2; + } else { + longhashmap$entry.nextEntry = longhashmap$entry2; + } + + return longhashmap$entry1; + } + + longhashmap$entry = longhashmap$entry1; + } + + return longhashmap$entry1; + } + + /**+ + * creates the key in the hash table + */ + private void createKey(int parInt1, long parLong1, V parObject, int parInt2) { + LongHashMap.Entry longhashmap$entry = this.hashArray[parInt2]; + this.hashArray[parInt2] = new LongHashMap.Entry(parInt1, parLong1, parObject, longhashmap$entry); + if (this.numHashElements++ >= this.capacity) { + this.resizeTable(2 * this.hashArray.length); + } + + } + + static class Entry { + final long key; + V value; + LongHashMap.Entry nextEntry; + final int hash; + + Entry(int parInt1, long parLong1, V parObject, LongHashMap.Entry parEntry) { + this.value = parObject; + this.nextEntry = parEntry; + this.key = parLong1; + this.hash = parInt1; + } + + public final long getKey() { + return this.key; + } + + public final V getValue() { + return this.value; + } + + public final boolean equals(Object object) { + if (!(object instanceof LongHashMap.Entry)) { + return false; + } else { + LongHashMap.Entry longhashmap$entry = (LongHashMap.Entry) object; + Long olong = Long.valueOf(this.getKey()); + Long olong1 = Long.valueOf(longhashmap$entry.getKey()); + if (olong == olong1 || olong != null && olong.equals(olong1)) { + Object object1 = this.getValue(); + Object object2 = longhashmap$entry.getValue(); + if (object1 == object2 || object1 != null && object1.equals(object2)) { + return true; + } + } + + return false; + } + } + + public final int hashCode() { + return LongHashMap.getHashedKey(this.key); + } + + public final String toString() { + return this.getKey() + "=" + this.getValue(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MapPopulator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MapPopulator.java new file mode 100644 index 0000000..e76752d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MapPopulator.java @@ -0,0 +1,56 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.Map; +import java.util.NoSuchElementException; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapPopulator { + + static { + __checkIntegratedContextValid("net/minecraft/util/MapPopulator"); + } + + public static Map createMap(Iterable keys, Iterable values) { + /**+ + * Populate the given Map with the given keys and values. + */ + return populateMap(keys, values, Maps.newLinkedHashMap()); + } + + public static Map populateMap(Iterable keys, Iterable values, Map map) { + Iterator iterator = values.iterator(); + + for (Object object : keys) { + map.put((K) object, (V) iterator.next()); + } + + if (iterator.hasNext()) { + throw new NoSuchElementException(); + } else { + return map; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MathHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MathHelper.java new file mode 100644 index 0000000..1041f7d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MathHelper.java @@ -0,0 +1,527 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MathHelper { + + static { + __checkIntegratedContextValid("net/minecraft/util/MathHelper"); + } + + public static final float SQRT_2 = sqrt_float(2.0F); + /**+ + * A table of sin values computed from 0 (inclusive) to 2*pi + * (exclusive), with steps of 2*PI / 65536. + */ + private static final float[] SIN_TABLE = new float[65536]; + private static final float[] SIN_TABLE_FAST = new float[4096]; + public static boolean fastMath = false; + private static final int[] multiplyDeBruijnBitPosition; + private static final double field_181163_d; + private static final double[] field_181164_e; + private static final double[] field_181165_f; + + /**+ + * sin looked up in a table + */ + public static float sin(float parFloat1) { + return fastMath ? SIN_TABLE_FAST[(int)(parFloat1 * 651.8986F) & 4095] : SIN_TABLE[(int) (parFloat1 * 10430.378F) & '\uffff']; + } + + /**+ + * cos looked up in the sin table with the appropriate offset + */ + public static float cos(float value) { + return fastMath ? SIN_TABLE_FAST[(int)((value + ((float) Math.PI / 2F)) * 651.8986F) & 4095] : SIN_TABLE[(int) (value * 10430.378F + 16384.0F) & '\uffff']; + } + + public static float sqrt_float(float value) { + return (float) Math.sqrt((double) value); + } + + public static float sqrt_double(double value) { + return (float) Math.sqrt(value); + } + + /**+ + * Returns the greatest integer less than or equal to the float + * argument + */ + public static int floor_float(float value) { + int i = (int) value; + return value < (float) i ? i - 1 : i; + } + + /**+ + * returns par0 cast as an int, and no greater than + * Integer.MAX_VALUE-1024 + */ + public static int truncateDoubleToInt(double value) { + return (int) (value + 1024.0D) - 1024; + } + + /**+ + * Returns the greatest integer less than or equal to the double + * argument + */ + public static int floor_double(double value) { + int i = (int) value; + return value < (double) i ? i - 1 : i; + } + + /**+ + * Long version of floor_double + */ + public static long floor_double_long(double value) { + long i = (long) value; + return value < (double) i ? i - 1L : i; + } + + public static int func_154353_e(double value) { + return (int) (value >= 0.0D ? value : -value + 1.0D); + } + + public static float abs(float value) { + return value >= 0.0F ? value : -value; + } + + /**+ + * Returns the unsigned value of an int. + */ + public static int abs_int(int value) { + return value >= 0 ? value : -value; + } + + public static int ceiling_float_int(float value) { + int i = (int) value; + return value > (float) i ? i + 1 : i; + } + + public static int ceiling_double_int(double value) { + int i = (int) value; + return value > (double) i ? i + 1 : i; + } + + /**+ + * Returns the value of the first parameter, clamped to be + * within the lower and upper limits given by the second and + * third parameters. + */ + public static int clamp_int(int num, int min, int max) { + return num < min ? min : (num > max ? max : num); + } + + /**+ + * Returns the value of the first parameter, clamped to be + * within the lower and upper limits given by the second and + * third parameters + */ + public static float clamp_float(float num, float min, float max) { + return num < min ? min : (num > max ? max : num); + } + + public static double clamp_double(double num, double min, double max) { + return num < min ? min : (num > max ? max : num); + } + + public static double denormalizeClamp(double parDouble1, double parDouble2, double parDouble3) { + return parDouble3 < 0.0D ? parDouble1 + : (parDouble3 > 1.0D ? parDouble2 : parDouble1 + (parDouble2 - parDouble1) * parDouble3); + } + + /**+ + * Maximum of the absolute value of two numbers. + */ + public static double abs_max(double parDouble1, double parDouble2) { + if (parDouble1 < 0.0D) { + parDouble1 = -parDouble1; + } + + if (parDouble2 < 0.0D) { + parDouble2 = -parDouble2; + } + + return parDouble1 > parDouble2 ? parDouble1 : parDouble2; + } + + /**+ + * Buckets an integer with specifed bucket sizes. Args: i, + * bucketSize + */ + public static int bucketInt(int parInt1, int parInt2) { + return parInt1 < 0 ? -((-parInt1 - 1) / parInt2) - 1 : parInt1 / parInt2; + } + + public static int getRandomIntegerInRange(EaglercraftRandom parRandom, int parInt1, int parInt2) { + return parInt1 >= parInt2 ? parInt1 : parRandom.nextInt(parInt2 - parInt1 + 1) + parInt1; + } + + public static float randomFloatClamp(EaglercraftRandom parRandom, float parFloat1, float parFloat2) { + return parFloat1 >= parFloat2 ? parFloat1 : parRandom.nextFloat() * (parFloat2 - parFloat1) + parFloat1; + } + + public static double getRandomDoubleInRange(EaglercraftRandom parRandom, double parDouble1, double parDouble2) { + return parDouble1 >= parDouble2 ? parDouble1 : parRandom.nextDouble() * (parDouble2 - parDouble1) + parDouble1; + } + + public static double average(long[] values) { + long i = 0L; + + for (long j : values) { + i += j; + } + + return (double) i / (double) values.length; + } + + public static boolean epsilonEquals(float parFloat1, float parFloat2) { + return abs(parFloat2 - parFloat1) < 1.0E-5F; + } + + public static int normalizeAngle(int parInt1, int parInt2) { + return (parInt1 % parInt2 + parInt2) % parInt2; + } + + /**+ + * the angle is reduced to an angle between -180 and +180 by + * mod, and a 360 check + */ + public static float wrapAngleTo180_float(float value) { + value = value % 360.0F; + if (value >= 180.0F) { + value -= 360.0F; + } + + if (value < -180.0F) { + value += 360.0F; + } + + return value; + } + + /**+ + * the angle is reduced to an angle between -180 and +180 by + * mod, and a 360 check + */ + public static double wrapAngleTo180_double(double value) { + value = value % 360.0D; + if (value >= 180.0D) { + value -= 360.0D; + } + + if (value < -180.0D) { + value += 360.0D; + } + + return value; + } + + /**+ + * parses the string as integer or returns the second parameter + * if it fails + */ + public static int parseIntWithDefault(String parString1, int parInt1) { + try { + return Integer.parseInt(parString1); + } catch (Throwable var3) { + return parInt1; + } + } + + /**+ + * parses the string as integer or returns the second parameter + * if it fails. this value is capped to par2 + */ + public static int parseIntWithDefaultAndMax(String parString1, int parInt1, int parInt2) { + return Math.max(parInt2, parseIntWithDefault(parString1, parInt1)); + } + + /**+ + * parses the string as double or returns the second parameter + * if it fails. + */ + public static double parseDoubleWithDefault(String parString1, double parDouble1) { + try { + return Double.parseDouble(parString1); + } catch (Throwable var4) { + return parDouble1; + } + } + + public static double parseDoubleWithDefaultAndMax(String parString1, double parDouble1, double parDouble2) { + return Math.max(parDouble2, parseDoubleWithDefault(parString1, parDouble1)); + } + + /**+ + * Returns the input value rounded up to the next highest power + * of two. + */ + public static int roundUpToPowerOfTwo(int value) { + int i = value - 1; + i = i | i >> 1; + i = i | i >> 2; + i = i | i >> 4; + i = i | i >> 8; + i = i | i >> 16; + return i + 1; + } + + /**+ + * Is the given value a power of two? (1, 2, 4, 8, 16, ...) + */ + private static boolean isPowerOfTwo(int value) { + return value != 0 && (value & value - 1) == 0; + } + + /**+ + * Uses a B(2, 5) De Bruijn sequence and a lookup table to + * efficiently calculate the log-base-two of the given value. + * Optimized for cases where the input value is a power-of-two. + * If the input value is not a power-of-two, then subtract 1 + * from the return value. + */ + private static int calculateLogBaseTwoDeBruijn(int value) { + value = isPowerOfTwo(value) ? value : roundUpToPowerOfTwo(value); + return multiplyDeBruijnBitPosition[(int) ((long) value * 125613361L >> 27) & 31]; + } + + /**+ + * Efficiently calculates the floor of the base-2 log of an + * integer value. This is effectively the index of the highest + * bit that is set. For example, if the number in binary is + * 0...100101, this will return 5. + */ + public static int calculateLogBaseTwo(int value) { + /**+ + * Uses a B(2, 5) De Bruijn sequence and a lookup table to + * efficiently calculate the log-base-two of the given value. + * Optimized for cases where the input value is a power-of-two. + * If the input value is not a power-of-two, then subtract 1 + * from the return value. + */ + return calculateLogBaseTwoDeBruijn(value) - (isPowerOfTwo(value) ? 0 : 1); + } + + public static int func_154354_b(int parInt1, int parInt2) { + if (parInt2 == 0) { + return 0; + } else if (parInt1 == 0) { + return parInt2; + } else { + if (parInt1 < 0) { + parInt2 *= -1; + } + + int i = parInt1 % parInt2; + return i == 0 ? parInt1 : parInt1 + parInt2 - i; + } + } + + public static int func_180183_b(float parFloat1, float parFloat2, float parFloat3) { + return func_180181_b(floor_float(parFloat1 * 255.0F), floor_float(parFloat2 * 255.0F), + floor_float(parFloat3 * 255.0F)); + } + + public static int func_180181_b(int parInt1, int parInt2, int parInt3) { + int i = (parInt1 << 8) + parInt2; + i = (i << 8) + parInt3; + return i; + } + + public static int func_180188_d(int parInt1, int parInt2) { + int i = (parInt1 & 16711680) >> 16; + int j = (parInt2 & 16711680) >> 16; + int k = (parInt1 & '\uff00') >> 8; + int l = (parInt2 & '\uff00') >> 8; + int i1 = (parInt1 & 255) >> 0; + int j1 = (parInt2 & 255) >> 0; + int k1 = (int) ((float) i * (float) j / 255.0F); + int l1 = (int) ((float) k * (float) l / 255.0F); + int i2 = (int) ((float) i1 * (float) j1 / 255.0F); + return parInt1 & -16777216 | k1 << 16 | l1 << 8 | i2; + } + + public static double func_181162_h(double parDouble1) { + return parDouble1 - Math.floor(parDouble1); + } + + public static long getPositionRandom(Vec3i pos) { + return getCoordinateRandom(pos.getX(), pos.getY(), pos.getZ()); + } + + public static long getCoordinateRandom(int x, int y, int z) { + long i = (long) (x * 3129871) ^ (long) z * 116129781L ^ (long) y; + i = i * i * 42317861L + i * 11L; + return i; + } + + public static EaglercraftUUID getRandomUuid(EaglercraftRandom rand) { + long i = rand.nextLong() & -61441L | 16384L; + long j = rand.nextLong() & 4611686018427387903L | Long.MIN_VALUE; + return new EaglercraftUUID(i, j); + } + + public static double func_181160_c(double parDouble1, double parDouble2, double parDouble3) { + return (parDouble1 - parDouble2) / (parDouble3 - parDouble2); + } + + public static double func_181159_b(double parDouble1, double parDouble2) { + double d0 = parDouble2 * parDouble2 + parDouble1 * parDouble1; + if (Double.isNaN(d0)) { + return Double.NaN; + } else { + boolean flag = parDouble1 < 0.0D; + if (flag) { + parDouble1 = -parDouble1; + } + + boolean flag1 = parDouble2 < 0.0D; + if (flag1) { + parDouble2 = -parDouble2; + } + + boolean flag2 = parDouble1 > parDouble2; + if (flag2) { + double d1 = parDouble2; + parDouble2 = parDouble1; + parDouble1 = d1; + } + + double d9 = func_181161_i(d0); + parDouble2 = parDouble2 * d9; + parDouble1 = parDouble1 * d9; + double d2 = field_181163_d + parDouble1; + int i = (int) Double.doubleToRawLongBits(d2); + double d3 = field_181164_e[i]; + double d4 = field_181165_f[i]; + double d5 = d2 - field_181163_d; + double d6 = parDouble1 * d4 - parDouble2 * d5; + double d7 = (6.0D + d6 * d6) * d6 * 0.16666666666666666D; + double d8 = d3 + d7; + if (flag2) { + d8 = 1.5707963267948966D - d8; + } + + if (flag1) { + d8 = 3.141592653589793D - d8; + } + + if (flag) { + d8 = -d8; + } + + return d8; + } + } + + public static double func_181161_i(double parDouble1) { + double d0 = 0.5D * parDouble1; + long i = Double.doubleToRawLongBits(parDouble1); + i = 6910469410427058090L - (i >> 1); + parDouble1 = Double.longBitsToDouble(i); + parDouble1 = parDouble1 * (1.5D - d0 * parDouble1 * parDouble1); + return parDouble1; + } + + public static int func_181758_c(float parFloat1, float parFloat2, float parFloat3) { + int i = (int) (parFloat1 * 6.0F) % 6; + float f = parFloat1 * 6.0F - (float) i; + float f1 = parFloat3 * (1.0F - parFloat2); + float f2 = parFloat3 * (1.0F - f * parFloat2); + float f3 = parFloat3 * (1.0F - (1.0F - f) * parFloat2); + float f4; + float f5; + float f6; + switch (i) { + case 0: + f4 = parFloat3; + f5 = f3; + f6 = f1; + break; + case 1: + f4 = f2; + f5 = parFloat3; + f6 = f1; + break; + case 2: + f4 = f1; + f5 = parFloat3; + f6 = f3; + break; + case 3: + f4 = f1; + f5 = f2; + f6 = parFloat3; + break; + case 4: + f4 = f3; + f5 = f1; + f6 = parFloat3; + break; + case 5: + f4 = parFloat3; + f5 = f1; + f6 = f2; + break; + default: + throw new RuntimeException("Something went wrong when converting from HSV to RGB. Input was " + parFloat1 + + ", " + parFloat2 + ", " + parFloat3); + } + + int j = clamp_int((int) (f4 * 255.0F), 0, 255); + int k = clamp_int((int) (f5 * 255.0F), 0, 255); + int l = clamp_int((int) (f6 * 255.0F), 0, 255); + return j << 16 | k << 8 | l; + } + + static { + for (int i = 0; i < 65536; ++i) { + SIN_TABLE[i] = (float) Math.sin((double) i * 3.141592653589793D * 2.0D / 65536.0D); + } + + for (int j = 0; j < 4096; ++j) { + SIN_TABLE_FAST[j] = (float) Math.sin((double)(((float) j + 0.5F) / 4096.0F * ((float) Math.PI * 2F))); + } + + for (int l = 0; l < 360; l += 90) { + SIN_TABLE_FAST[(int)((float) l * 11.377778F) & 4095] = (float) Math.sin((double)((float) l * 0.017453292F)); + } + + multiplyDeBruijnBitPosition = new int[] { 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, + 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; + field_181163_d = Double.longBitsToDouble(4805340802404319232L); + field_181164_e = new double[257]; + field_181165_f = new double[257]; + + for (int j = 0; j < 257; ++j) { + double d0 = (double) j / 256.0D; + double d1 = Math.asin(d0); + field_181165_f[j] = Math.cos(d1); + field_181164_e[j] = d1; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovementInput.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovementInput.java new file mode 100644 index 0000000..be320d0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovementInput.java @@ -0,0 +1,38 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MovementInput { + + static { + __checkIntegratedContextValid("net/minecraft/util/MovementInput"); + } + + public float moveStrafe; + public float moveForward; + public boolean jump; + public boolean sneak; + + public void updatePlayerMoveState() { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovingObjectPosition.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovingObjectPosition.java new file mode 100644 index 0000000..bd89f49 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovingObjectPosition.java @@ -0,0 +1,80 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MovingObjectPosition { + + static { + __checkIntegratedContextValid("net/minecraft/util/MovingObjectPosition"); + } + + private BlockPos blockPos; + public MovingObjectPosition.MovingObjectType typeOfHit; + public EnumFacing sideHit; + public Vec3 hitVec; + public Entity entityHit; + + public MovingObjectPosition(Vec3 hitVecIn, EnumFacing facing, BlockPos blockPosIn) { + this(MovingObjectPosition.MovingObjectType.BLOCK, hitVecIn, facing, blockPosIn); + } + + public MovingObjectPosition(Vec3 parVec3_1, EnumFacing facing) { + this(MovingObjectPosition.MovingObjectType.BLOCK, parVec3_1, facing, BlockPos.ORIGIN); + } + + public MovingObjectPosition(Entity parEntity) { + this(parEntity, new Vec3(parEntity.posX, parEntity.posY, parEntity.posZ)); + } + + public MovingObjectPosition(MovingObjectPosition.MovingObjectType typeOfHitIn, Vec3 hitVecIn, EnumFacing sideHitIn, + BlockPos blockPosIn) { + this.typeOfHit = typeOfHitIn; + this.blockPos = blockPosIn; + this.sideHit = sideHitIn; + this.hitVec = new Vec3(hitVecIn.xCoord, hitVecIn.yCoord, hitVecIn.zCoord); + } + + public MovingObjectPosition(Entity entityHitIn, Vec3 hitVecIn) { + this.typeOfHit = MovingObjectPosition.MovingObjectType.ENTITY; + this.entityHit = entityHitIn; + this.hitVec = hitVecIn; + } + + public BlockPos getBlockPos() { + return this.blockPos; + } + + public String toString() { + return "HitResult{type=" + this.typeOfHit + ", blockpos=" + this.blockPos + ", f=" + this.sideHit + ", pos=" + + this.hitVec + ", entity=" + this.entityHit + '}'; + } + + public static enum MovingObjectType { + MISS, BLOCK, ENTITY; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ObjectIntIdentityMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ObjectIntIdentityMap.java new file mode 100644 index 0000000..c39b490 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ObjectIntIdentityMap.java @@ -0,0 +1,64 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Predicates; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IObjectIntIterable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ObjectIntIdentityMap implements IObjectIntIterable { + + static { + __checkIntegratedContextValid("net/minecraft/util/ObjectIntIdentityMap"); + } + + private final IdentityHashMap identityMap = new IdentityHashMap(512); + private final List objectList = Lists.newArrayList(); + + public void put(T key, int value) { + this.identityMap.put(key, Integer.valueOf(value)); + + while (this.objectList.size() <= value) { + this.objectList.add((T) null); + } + + this.objectList.set(value, key); + } + + public int get(T key) { + Integer integer = (Integer) this.identityMap.get(key); + return integer == null ? -1 : integer.intValue(); + } + + public final T getByValue(int value) { + return (T) (value >= 0 && value < this.objectList.size() ? this.objectList.get(value) : null); + } + + public Iterator iterator() { + return Iterators.filter(this.objectList.iterator(), Predicates.notNull()); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryDefaulted.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryDefaulted.java new file mode 100644 index 0000000..1e0e9a0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryDefaulted.java @@ -0,0 +1,43 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.RegistrySimple; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RegistryDefaulted extends RegistrySimple { + + static { + __checkIntegratedContextValid("net/minecraft/util/RegistryDefaulted"); + } + + private final V defaultObject; + + public RegistryDefaulted(V defaultObjectIn) { + this.defaultObject = defaultObjectIn; + } + + public V getObject(K object) { + Object object1 = super.getObject(object); + return (V) (object1 == null ? this.defaultObject : object1); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespaced.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespaced.java new file mode 100644 index 0000000..5b950be --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespaced.java @@ -0,0 +1,93 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import java.util.Iterator; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IObjectIntIterable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ObjectIntIdentityMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.RegistrySimple; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RegistryNamespaced extends RegistrySimple implements IObjectIntIterable { + + static { + __checkIntegratedContextValid("net/minecraft/util/RegistryNamespaced"); + } + + /**+ + * The backing store that maps Integers to objects. + */ + protected final ObjectIntIdentityMap underlyingIntegerMap = new ObjectIntIdentityMap(); + protected final Map inverseObjectRegistry; + + public RegistryNamespaced() { + this.inverseObjectRegistry = ((BiMap) this.registryObjects).inverse(); + } + + public void register(int i, K object, V object1) { + this.underlyingIntegerMap.put(object1, i); + this.putObject(object, object1); + } + + protected Map createUnderlyingMap() { + return HashBiMap.create(); + } + + public V getObject(K object) { + return super.getObject(object); + } + + /**+ + * Gets the name we use to identify the given object. + */ + public K getNameForObject(V parObject) { + return (K) this.inverseObjectRegistry.get(parObject); + } + + /**+ + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(K parObject) { + return super.containsKey(parObject); + } + + /**+ + * Gets the integer ID we use to identify the given object. + */ + public int getIDForObject(V parObject) { + return this.underlyingIntegerMap.get(parObject); + } + + /**+ + * Gets the object identified by the given ID. + */ + public V getObjectById(int i) { + return (V) this.underlyingIntegerMap.getByValue(i); + } + + public Iterator iterator() { + return this.underlyingIntegerMap.iterator(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespacedDefaultedByKey.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespacedDefaultedByKey.java new file mode 100644 index 0000000..4712e08 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespacedDefaultedByKey.java @@ -0,0 +1,68 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.RegistryNamespaced; +import org.apache.commons.lang3.Validate; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RegistryNamespacedDefaultedByKey extends RegistryNamespaced { + + static { + __checkIntegratedContextValid("net/minecraft/util/RegistryNamespacedDefaultedByKey"); + } + + private final K defaultValueKey; + private V defaultValue; + + public RegistryNamespacedDefaultedByKey(K parObject) { + this.defaultValueKey = parObject; + } + + public void register(int id, K parObject, V parObject2) { + if (this.defaultValueKey.equals(parObject)) { + this.defaultValue = parObject2; + } + + super.register(id, parObject, parObject2); + } + + /**+ + * validates that this registry's key is non-null + */ + public void validateKey() { + Validate.notNull(this.defaultValueKey); + } + + public V getObject(K name) { + Object object = super.getObject(name); + return (V) (object == null ? this.defaultValue : object); + } + + /**+ + * Gets the object identified by the given ID. + */ + public V getObjectById(int id) { + Object object = super.getObjectById(id); + return (V) (object == null ? this.defaultValue : object); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistrySimple.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistrySimple.java new file mode 100644 index 0000000..f378bbd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistrySimple.java @@ -0,0 +1,82 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IRegistry; +import org.apache.commons.lang3.Validate; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RegistrySimple implements IRegistry { + + static { + __checkIntegratedContextValid("net/minecraft/util/RegistrySimple"); + } + + private static final Logger logger = LogManager.getLogger(); + protected final Map registryObjects = this.createUnderlyingMap(); + + protected Map createUnderlyingMap() { + return Maps.newHashMap(); + } + + public V getObject(K object) { + return (V) this.registryObjects.get(object); + } + + /**+ + * Register an object on this registry. + */ + public void putObject(K object, V object1) { + Validate.notNull(object); + Validate.notNull(object1); + if (this.registryObjects.containsKey(object)) { + logger.debug("Adding duplicate key \'" + object + "\' to registry"); + } + + this.registryObjects.put(object, object1); + } + + /**+ + * Gets all the keys recognized by this registry. + */ + public Set getKeys() { + return Collections.unmodifiableSet(this.registryObjects.keySet()); + } + + /**+ + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(K object) { + return this.registryObjects.containsKey(object); + } + + public Iterator iterator() { + return this.registryObjects.values().iterator(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ReportedException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ReportedException.java new file mode 100644 index 0000000..d80a256 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ReportedException.java @@ -0,0 +1,53 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.minecraft.crash.CrashReport; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ReportedException extends RuntimeException { + + static { + __checkIntegratedContextValid("net/minecraft/util/ReportedException"); + } + + private final CrashReport theReportedExceptionCrashReport; + + public ReportedException(CrashReport report) { + this.theReportedExceptionCrashReport = report; + } + + /**+ + * Gets the CrashReport wrapped by this exception. + */ + public CrashReport getCrashReport() { + return this.theReportedExceptionCrashReport; + } + + public Throwable getCause() { + return this.theReportedExceptionCrashReport.getCrashCause(); + } + + public String getMessage() { + return this.theReportedExceptionCrashReport.getDescription(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ResourceLocation.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ResourceLocation.java new file mode 100644 index 0000000..77b486b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ResourceLocation.java @@ -0,0 +1,97 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import org.apache.commons.lang3.Validate; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ResourceLocation { + + static { + __checkIntegratedContextValid("net/minecraft/util/ResourceLocation"); + } + + protected final String resourceDomain; + protected final String resourcePath; + + protected ResourceLocation(int parInt1, String... resourceName) { + this.resourceDomain = org.apache.commons.lang3.StringUtils.isEmpty(resourceName[0]) ? "minecraft" + : resourceName[0].toLowerCase(); + this.resourcePath = resourceName[1]; + Validate.notNull(this.resourcePath); + } + + public ResourceLocation(String resourceName) { + this(0, splitObjectName(resourceName)); + } + + public ResourceLocation(String resourceDomainIn, String resourcePathIn) { + this(0, new String[] { resourceDomainIn, resourcePathIn }); + } + + /**+ + * Splits an object name (such as minecraft:apple) into the + * domain and path parts and returns these as an array of length + * 2. If no colon is present in the passed value the returned + * array will contain {null, toSplit}. + */ + protected static String[] splitObjectName(String toSplit) { + String[] astring = new String[] { null, toSplit }; + int i = toSplit.indexOf(58); + if (i >= 0) { + astring[1] = toSplit.substring(i + 1, toSplit.length()); + if (i > 1) { + astring[0] = toSplit.substring(0, i); + } + } + + return astring; + } + + public String getResourcePath() { + return this.resourcePath; + } + + public String getResourceDomain() { + return this.resourceDomain; + } + + public String toString() { + return this.resourceDomain + ':' + this.resourcePath; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ResourceLocation)) { + return false; + } else { + ResourceLocation resourcelocation = (ResourceLocation) object; + return this.resourceDomain.equals(resourcelocation.resourceDomain) + && this.resourcePath.equals(resourcelocation.resourcePath); + } + } + + public int hashCode() { + return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Rotations.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Rotations.java new file mode 100644 index 0000000..531ac3d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Rotations.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Rotations { + + static { + __checkIntegratedContextValid("net/minecraft/util/Rotations"); + } + + protected final float x; + protected final float y; + protected final float z; + + public Rotations(float x, float y, float z) { + this.x = x; + this.y = y; + this.z = z; + } + + public Rotations(NBTTagList nbt) { + this.x = nbt.getFloatAt(0); + this.y = nbt.getFloatAt(1); + this.z = nbt.getFloatAt(2); + } + + public NBTTagList writeToNBT() { + NBTTagList nbttaglist = new NBTTagList(); + nbttaglist.appendTag(new NBTTagFloat(this.x)); + nbttaglist.appendTag(new NBTTagFloat(this.y)); + nbttaglist.appendTag(new NBTTagFloat(this.z)); + return nbttaglist; + } + + public boolean equals(Object object) { + if (!(object instanceof Rotations)) { + return false; + } else { + Rotations rotations = (Rotations) object; + return this.x == rotations.x && this.y == rotations.y && this.z == rotations.z; + } + } + + /**+ + * Gets the X axis rotation + */ + public float getX() { + return this.x; + } + + /**+ + * Gets the Y axis rotation + */ + public float getY() { + return this.y; + } + + /**+ + * Gets the Z axis rotation + */ + public float getZ() { + return this.z; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StatCollector.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StatCollector.java new file mode 100644 index 0000000..07d63b7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StatCollector.java @@ -0,0 +1,73 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.StringTranslate; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StatCollector { + + static { + __checkIntegratedContextValid("net/minecraft/util/StatCollector"); + } + + private static StringTranslate localizedName = StringTranslate.getInstance(); + + /**+ + * Translates a Stat name + */ + public static String translateToLocal(String key) { + return localizedName.translateKey(key); + } + + /**+ + * Translates a Stat name with format args + */ + public static String translateToLocalFormatted(String key, Object... format) { + return localizedName.translateKeyFormat(key, format); + } + + /**+ + * Translates a Stat name using the fallback (hardcoded en_US) + * locale. Looks like it's only intended to be used if + * translateToLocal fails. + */ + public static String translateToFallback(String key) { + return localizedName.translateKey(key); + } + + /**+ + * Determines whether or not translateToLocal will find a + * translation for the given key. + */ + public static boolean canTranslate(String key) { + return localizedName.isKeyTranslated(key); + } + + /**+ + * Gets the time, in milliseconds since epoch, that the + * translation mapping was last updated + */ + public static long getLastTranslationUpdateTimeInMilliseconds() { + return localizedName.getLastUpdateTimeInMilliseconds(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringTranslate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringTranslate.java new file mode 100644 index 0000000..4d71511 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringTranslate.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; + +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.IllegalFormatException; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StringTranslate { + + static { + __checkIntegratedContextValid("net/minecraft/util/StringTranslate"); + } + + /**+ + * Pattern that matches numeric variable placeholders in a + * resource string, such as "%d", "%3$d", "%.2f" + */ + private static final Pattern numericVariablePattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + /**+ + * A Splitter that splits a string on the first "=". For + * example, "a=b=c" would split into ["a", "b=c"]. + */ + private static final Splitter equalSignSplitter = Splitter.on('=').limit(2); + /**+ + * Is the private singleton instance of StringTranslate. + */ + private static StringTranslate instance = new StringTranslate(); + private final Map languageList = Maps.newHashMap(); + private long lastUpdateTimeInMilliseconds; + + private StringTranslate() { + } + + public static void init(List strs) { + instance.languageList.clear(); + for (String s : strs) { + if (!s.isEmpty() && s.charAt(0) != 35) { + String[] astring = (String[]) Iterables.toArray(equalSignSplitter.split(s), String.class); + if (astring != null && astring.length == 2) { + String s1 = astring[0]; + String s2 = numericVariablePattern.matcher(astring[1]).replaceAll("%s"); // TODO: originally "%$1s" + // but must be "%s" to + // work with TeaVM + // (why?) + instance.languageList.put(s1, s2); + } + } + } + + instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + + /**+ + * Return the StringTranslate singleton instance + */ + static StringTranslate getInstance() { + return instance; + } + + /**+ + * Replaces all the current instance's translations with the + * ones that are passed in. + */ + public static void replaceWith(Map parMap) { + instance.languageList.clear(); + instance.languageList.putAll(parMap); + instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + + /**+ + * Translate a key to current language. + */ + public String translateKey(String key) { + return this.tryTranslateKey(key); + } + + /**+ + * Translate a key to current language applying String.format() + */ + public String translateKeyFormat(String key, Object... format) { + String s = this.tryTranslateKey(key); + + try { + return HString.format(s, format); + } catch (IllegalFormatException var5) { + return "Format error: " + s; + } + } + + /**+ + * Tries to look up a translation for the given key; spits back + * the key if no result was found. + */ + private String tryTranslateKey(String key) { + String s = (String) this.languageList.get(key); + return s == null ? key : s; + } + + /**+ + * Returns true if the passed key is in the translation table. + */ + public boolean isKeyTranslated(String key) { + return this.languageList.containsKey(key); + } + + /**+ + * Gets the time, in milliseconds since epoch, that this + * instance was last updated + */ + public long getLastUpdateTimeInMilliseconds() { + return this.lastUpdateTimeInMilliseconds; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringUtils.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringUtils.java new file mode 100644 index 0000000..99e2b2c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringUtils.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import java.util.regex.Pattern; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StringUtils { + + static { + __checkIntegratedContextValid("net/minecraft/util/StringUtils"); + } + + private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); + + /**+ + * Returns the time elapsed for the given number of ticks, in + * "mm:ss" format. + */ + public static String ticksToElapsedTime(int ticks) { + int i = ticks / 20; + int j = i / 60; + i = i % 60; + return i < 10 ? j + ":0" + i : j + ":" + i; + } + + public static String stripControlCodes(String parString1) { + return patternControlCode.matcher(parString1).replaceAll(""); + } + + /**+ + * Returns a value indicating whether the given string is null + * or empty. + */ + public static boolean isNullOrEmpty(String string) { + return org.apache.commons.lang3.StringUtils.isEmpty(string); + } + + private static final Pattern patternControlCodeAlternate = Pattern.compile("(?i)&([0-9A-FK-OR])"); + + public static String translateControlCodesAlternate(String parString1) { + return patternControlCodeAlternate.matcher(parString1).replaceAll("\u00A7$1"); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Tuple.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Tuple.java new file mode 100644 index 0000000..aa252a2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Tuple.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Tuple { + + static { + __checkIntegratedContextValid("net/minecraft/util/Tuple"); + } + + private A a; + private B b; + + public Tuple(A aIn, B bIn) { + this.a = aIn; + this.b = bIn; + } + + /**+ + * Get the first Object in the Tuple + */ + public A getFirst() { + return this.a; + } + + /**+ + * Get the second Object in the Tuple + */ + public B getSecond() { + return this.b; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/TupleIntJsonSerializable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/TupleIntJsonSerializable.java new file mode 100644 index 0000000..2181681 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/TupleIntJsonSerializable.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IJsonSerializable; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 TupleIntJsonSerializable { + + static { + __checkIntegratedContextValid("net/minecraft/util/TupleIntJsonSerializable"); + } + + private int integerValue; + private IJsonSerializable jsonSerializableValue; + + /**+ + * Gets the integer value stored in this tuple. + */ + public int getIntegerValue() { + return this.integerValue; + } + + /**+ + * Sets this tuple's integer value to the given value. + */ + public void setIntegerValue(int integerValueIn) { + this.integerValue = integerValueIn; + } + + public T getJsonSerializableValue() { + return (T) this.jsonSerializableValue; + } + + /**+ + * Sets this tuple's JsonSerializable value to the given value. + */ + public void setJsonSerializableValue(IJsonSerializable jsonSerializableValueIn) { + this.jsonSerializableValue = jsonSerializableValueIn; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Util.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Util.java new file mode 100644 index 0000000..3b16864 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Util.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.lax1dude.eaglercraft.v1_8.futures.ExecutionException; +import net.lax1dude.eaglercraft.v1_8.futures.FutureTask; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Util { + + static { + __checkIntegratedContextValid("net/minecraft/util/Util"); + } + + public static Util.EnumOS getOSType() { + String s = System.getProperty("os.name").toLowerCase(); + return s.contains("win") ? Util.EnumOS.WINDOWS + : (s.contains("mac") ? Util.EnumOS.OSX + : (s.contains("solaris") ? Util.EnumOS.SOLARIS + : (s.contains("sunos") ? Util.EnumOS.SOLARIS + : (s.contains("linux") ? Util.EnumOS.LINUX + : (s.contains("unix") ? Util.EnumOS.LINUX : Util.EnumOS.UNKNOWN))))); + } + + public static V func_181617_a(FutureTask parFutureTask, Logger parLogger) { + try { + parFutureTask.run(); + return (V) parFutureTask.get(); + } catch (ExecutionException executionexception) { + parLogger.fatal("Error executing task", executionexception); + } catch (InterruptedException interruptedexception) { + parLogger.fatal("Error executing task", interruptedexception); + } + + return (V) null; + } + + public static enum EnumOS { + LINUX, SOLARIS, WINDOWS, OSX, UNKNOWN; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3.java new file mode 100644 index 0000000..8d84594 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3.java @@ -0,0 +1,221 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3i; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Vec3 { + + static { + __checkIntegratedContextValid("net/minecraft/util/Vec3"); + } + + public final double xCoord; + public final double yCoord; + public final double zCoord; + + public Vec3(double x, double y, double z) { + if (x == -0.0D) { + x = 0.0D; + } + + if (y == -0.0D) { + y = 0.0D; + } + + if (z == -0.0D) { + z = 0.0D; + } + + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + } + + public Vec3(Vec3i parVec3i) { + this((double) parVec3i.getX(), (double) parVec3i.getY(), (double) parVec3i.getZ()); + } + + /**+ + * Returns a new vector with the result of the specified vector + * minus this. + */ + public Vec3 subtractReverse(Vec3 vec) { + return new Vec3(vec.xCoord - this.xCoord, vec.yCoord - this.yCoord, vec.zCoord - this.zCoord); + } + + /**+ + * Normalizes the vector to a length of 1 (except if it is the + * zero vector) + */ + public Vec3 normalize() { + double d0 = (double) MathHelper + .sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + return d0 < 1.0E-4D ? new Vec3(0.0D, 0.0D, 0.0D) + : new Vec3(this.xCoord / d0, this.yCoord / d0, this.zCoord / d0); + } + + public double dotProduct(Vec3 vec) { + return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord; + } + + /**+ + * Returns a new vector with the result of this vector x the + * specified vector. + */ + public Vec3 crossProduct(Vec3 vec) { + return new Vec3(this.yCoord * vec.zCoord - this.zCoord * vec.yCoord, + this.zCoord * vec.xCoord - this.xCoord * vec.zCoord, + this.xCoord * vec.yCoord - this.yCoord * vec.xCoord); + } + + public Vec3 subtract(Vec3 vec) { + return this.subtract(vec.xCoord, vec.yCoord, vec.zCoord); + } + + public Vec3 subtract(double x, double y, double z) { + return this.addVector(-x, -y, -z); + } + + public Vec3 add(Vec3 vec) { + return this.addVector(vec.xCoord, vec.yCoord, vec.zCoord); + } + + /**+ + * Adds the specified x,y,z vector components to this vector and + * returns the resulting vector. Does not change this vector. + */ + public Vec3 addVector(double x, double y, double z) { + return new Vec3(this.xCoord + x, this.yCoord + y, this.zCoord + z); + } + + /**+ + * Euclidean distance between this and the specified vector, + * returned as double. + */ + public double distanceTo(Vec3 vec) { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + return (double) MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2); + } + + /**+ + * The square of the Euclidean distance between this and the + * specified vector. + */ + public double squareDistanceTo(Vec3 vec) { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /**+ + * Returns the length of the vector. + */ + public double lengthVector() { + return (double) MathHelper + .sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + } + + /**+ + * Returns a new vector with x value equal to the second + * parameter, along the line between this vector and the passed + * in vector, or null if not possible. + */ + public Vec3 getIntermediateWithXValue(Vec3 vec, double x) { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + if (d0 * d0 < 1.0000000116860974E-7D) { + return null; + } else { + double d3 = (x - this.xCoord) / d0; + return d3 >= 0.0D && d3 <= 1.0D + ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) + : null; + } + } + + /**+ + * Returns a new vector with y value equal to the second + * parameter, along the line between this vector and the passed + * in vector, or null if not possible. + */ + public Vec3 getIntermediateWithYValue(Vec3 vec, double y) { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + if (d1 * d1 < 1.0000000116860974E-7D) { + return null; + } else { + double d3 = (y - this.yCoord) / d1; + return d3 >= 0.0D && d3 <= 1.0D + ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) + : null; + } + } + + /**+ + * Returns a new vector with z value equal to the second + * parameter, along the line between this vector and the passed + * in vector, or null if not possible. + */ + public Vec3 getIntermediateWithZValue(Vec3 vec, double z) { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + if (d2 * d2 < 1.0000000116860974E-7D) { + return null; + } else { + double d3 = (z - this.zCoord) / d2; + return d3 >= 0.0D && d3 <= 1.0D + ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) + : null; + } + } + + public String toString() { + return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")"; + } + + public Vec3 rotatePitch(float pitch) { + float f = MathHelper.cos(pitch); + float f1 = MathHelper.sin(pitch); + double d0 = this.xCoord; + double d1 = this.yCoord * (double) f + this.zCoord * (double) f1; + double d2 = this.zCoord * (double) f - this.yCoord * (double) f1; + return new Vec3(d0, d1, d2); + } + + public Vec3 rotateYaw(float yaw) { + float f = MathHelper.cos(yaw); + float f1 = MathHelper.sin(yaw); + double d0 = this.xCoord * (double) f + this.zCoord * (double) f1; + double d1 = this.yCoord; + double d2 = this.zCoord * (double) f - this.xCoord * (double) f1; + return new Vec3(d0, d1, d2); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3i.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3i.java new file mode 100644 index 0000000..d08e18a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3i.java @@ -0,0 +1,136 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.base.Objects; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Vec3i implements Comparable { + + static { + __checkIntegratedContextValid("net/minecraft/util/Vec3i"); + } + + /**+ + * The Null vector constant (0, 0, 0) + */ + public static final Vec3i NULL_VECTOR = new Vec3i(0, 0, 0); + private final int x; + private final int y; + private final int z; + + public Vec3i(int xIn, int yIn, int zIn) { + this.x = xIn; + this.y = yIn; + this.z = zIn; + } + + public Vec3i(double xIn, double yIn, double zIn) { + this(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn)); + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof Vec3i)) { + return false; + } else { + Vec3i vec3i = (Vec3i) object; + return this.getX() != vec3i.getX() ? false + : (this.getY() != vec3i.getY() ? false : this.getZ() == vec3i.getZ()); + } + } + + public int hashCode() { + return (this.getY() + this.getZ() * 31) * 31 + this.getX(); + } + + public int compareTo(Vec3i vec3i) { + return this.getY() == vec3i.getY() + ? (this.getZ() == vec3i.getZ() ? this.getX() - vec3i.getX() : this.getZ() - vec3i.getZ()) + : this.getY() - vec3i.getY(); + } + + /**+ + * Get the X coordinate + */ + public int getX() { + return this.x; + } + + /**+ + * Get the Y coordinate + */ + public int getY() { + return this.y; + } + + /**+ + * Get the Z coordinate + */ + public int getZ() { + return this.z; + } + + /**+ + * Calculate the cross product of this and the given Vector + */ + public Vec3i crossProduct(Vec3i vec3i) { + return new Vec3i(this.getY() * vec3i.getZ() - this.getZ() * vec3i.getY(), + this.getZ() * vec3i.getX() - this.getX() * vec3i.getZ(), + this.getX() * vec3i.getY() - this.getY() * vec3i.getX()); + } + + /**+ + * Calculate squared distance to the given coordinates + */ + public double distanceSq(double toX, double toY, double toZ) { + double d0 = (double) this.getX() - toX; + double d1 = (double) this.getY() - toY; + double d2 = (double) this.getZ() - toZ; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /**+ + * Compute square of distance from point x, y, z to center of + * this Block + */ + public double distanceSqToCenter(double xIn, double yIn, double zIn) { + double d0 = (double) this.getX() + 0.5D - xIn; + double d1 = (double) this.getY() + 0.5D - yIn; + double d2 = (double) this.getZ() + 0.5D - zIn; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /**+ + * Calculate squared distance to the given coordinates + */ + public double distanceSq(Vec3i to) { + return this.distanceSq((double) to.getX(), (double) to.getY(), (double) to.getZ()); + } + + public String toString() { + return Objects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()) + .toString(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec4b.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec4b.java new file mode 100644 index 0000000..10774e5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec4b.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Vec4b { + + static { + __checkIntegratedContextValid("net/minecraft/util/Vec4b"); + } + + private byte field_176117_a; + private byte field_176115_b; + private byte field_176116_c; + private byte field_176114_d; + + public Vec4b(byte parByte1, byte parByte2, byte parByte3, byte parByte4) { + this.field_176117_a = parByte1; + this.field_176115_b = parByte2; + this.field_176116_c = parByte3; + this.field_176114_d = parByte4; + } + + public Vec4b(Vec4b parVec4b) { + this.field_176117_a = parVec4b.field_176117_a; + this.field_176115_b = parVec4b.field_176115_b; + this.field_176116_c = parVec4b.field_176116_c; + this.field_176114_d = parVec4b.field_176114_d; + } + + public byte func_176110_a() { + return this.field_176117_a; + } + + public byte func_176112_b() { + return this.field_176115_b; + } + + public byte func_176113_c() { + return this.field_176116_c; + } + + public byte func_176111_d() { + return this.field_176114_d; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof Vec4b)) { + return false; + } else { + Vec4b vec4b = (Vec4b) object; + return this.field_176117_a != vec4b.field_176117_a ? false + : (this.field_176114_d != vec4b.field_176114_d ? false + : (this.field_176115_b != vec4b.field_176115_b ? false + : this.field_176116_c == vec4b.field_176116_c)); + } + } + + public int hashCode() { + int i = this.field_176117_a; + i = 31 * i + this.field_176115_b; + i = 31 * i + this.field_176116_c; + i = 31 * i + this.field_176114_d; + return i; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vector3d.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vector3d.java new file mode 100644 index 0000000..56711e9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vector3d.java @@ -0,0 +1,38 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Vector3d { + + static { + __checkIntegratedContextValid("net/minecraft/util/Vector3d"); + } + + public double field_181059_a; + public double field_181060_b; + public double field_181061_c; + + public Vector3d() { + this.field_181059_a = this.field_181060_b = this.field_181061_c = 0.0D; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandom.java new file mode 100644 index 0000000..8a8ffda --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandom.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import java.util.Collection; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WeightedRandom { + + static { + __checkIntegratedContextValid("net/minecraft/util/WeightedRandom"); + } + + /**+ + * Returns the total weight of all items in a collection. + */ + public static int getTotalWeight(Collection collection) { + int i = 0; + + for (WeightedRandom.Item weightedrandom$item : collection) { + i += weightedrandom$item.itemWeight; + } + + return i; + } + + public static T getRandomItem(EaglercraftRandom random, Collection collection, + int totalWeight) { + if (totalWeight <= 0) { + throw new IllegalArgumentException(); + } else { + int i = random.nextInt(totalWeight); + /**+ + * Returns a random choice from the input items. + */ + return getRandomItem(collection, i); + } + } + + public static T getRandomItem(Collection collection, int weight) { + for (WeightedRandom.Item weightedrandom$item : collection) { + weight -= weightedrandom$item.itemWeight; + if (weight < 0) { + return (T) weightedrandom$item; + } + } + + return (T) null; + } + + public static T getRandomItem(EaglercraftRandom random, Collection collection) { + /**+ + * Returns a random choice from the input items. + */ + return getRandomItem(random, collection, getTotalWeight(collection)); + } + + public static class Item { + protected int itemWeight; + + public Item(int itemWeightIn) { + this.itemWeight = itemWeightIn; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomChestContent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomChestContent.java new file mode 100644 index 0000000..63e2273 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomChestContent.java @@ -0,0 +1,111 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WeightedRandomChestContent extends WeightedRandom.Item { + + static { + __checkIntegratedContextValid("net/minecraft/util/WeightedRandomChestContent"); + } + + private ItemStack theItemId; + private int minStackSize; + private int maxStackSize; + + public WeightedRandomChestContent(Item parItem, int parInt1, int minimumChance, int maximumChance, + int itemWeightIn) { + super(itemWeightIn); + this.theItemId = new ItemStack(parItem, 1, parInt1); + this.minStackSize = minimumChance; + this.maxStackSize = maximumChance; + } + + public WeightedRandomChestContent(ItemStack stack, int minimumChance, int maximumChance, int itemWeightIn) { + super(itemWeightIn); + this.theItemId = stack; + this.minStackSize = minimumChance; + this.maxStackSize = maximumChance; + } + + public static void generateChestContents(EaglercraftRandom random, List listIn, + IInventory inv, int max) { + for (int i = 0; i < max; ++i) { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent) WeightedRandom + .getRandomItem(random, listIn); + int j = weightedrandomchestcontent.minStackSize + random + .nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); + if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) { + ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); + itemstack1.stackSize = j; + inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack1); + } else { + for (int k = 0; k < j; ++k) { + ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); + itemstack.stackSize = 1; + inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack); + } + } + } + + } + + public static void generateDispenserContents(EaglercraftRandom random, List listIn, + TileEntityDispenser dispenser, int max) { + for (int i = 0; i < max; ++i) { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent) WeightedRandom + .getRandomItem(random, listIn); + int j = weightedrandomchestcontent.minStackSize + random + .nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); + if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) { + ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); + itemstack1.stackSize = j; + dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack1); + } else { + for (int k = 0; k < j; ++k) { + ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); + itemstack.stackSize = 1; + dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack); + } + } + } + + } + + public static List func_177629_a(List parList, + WeightedRandomChestContent... parArrayOfWeightedRandomChestContent) { + ArrayList arraylist = Lists.newArrayList(parList); + Collections.addAll(arraylist, parArrayOfWeightedRandomChestContent); + return arraylist; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomFishable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomFishable.java new file mode 100644 index 0000000..fcbde9d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomFishable.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WeightedRandomFishable extends WeightedRandom.Item { + + static { + __checkIntegratedContextValid("net/minecraft/util/WeightedRandomFishable"); + } + + private final ItemStack returnStack; + private float maxDamagePercent; + private boolean enchantable; + + public WeightedRandomFishable(ItemStack returnStackIn, int itemWeightIn) { + super(itemWeightIn); + this.returnStack = returnStackIn; + } + + public ItemStack getItemStack(EaglercraftRandom random) { + ItemStack itemstack = this.returnStack.copy(); + if (this.maxDamagePercent > 0.0F) { + int i = (int) (this.maxDamagePercent * (float) this.returnStack.getMaxDamage()); + int j = itemstack.getMaxDamage() - random.nextInt(random.nextInt(i) + 1); + if (j > i) { + j = i; + } + + if (j < 1) { + j = 1; + } + + itemstack.setItemDamage(j); + } + + if (this.enchantable) { + EnchantmentHelper.addRandomEnchantment(random, itemstack, 30); + } + + return itemstack; + } + + public WeightedRandomFishable setMaxDamagePercent(float maxDamagePercentIn) { + this.maxDamagePercent = maxDamagePercentIn; + return this; + } + + public WeightedRandomFishable setEnchantable() { + this.enchantable = true; + return this; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipe.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipe.java new file mode 100644 index 0000000..68a8fa7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipe.java @@ -0,0 +1,169 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MerchantRecipe { + + static { + __checkIntegratedContextValid("net/minecraft/village/MerchantRecipe"); + } + + private ItemStack itemToBuy; + private ItemStack secondItemToBuy; + private ItemStack itemToSell; + private int toolUses; + private int maxTradeUses; + private boolean rewardsExp; + + public MerchantRecipe(NBTTagCompound tagCompound) { + this.readFromTags(tagCompound); + } + + public MerchantRecipe(ItemStack buy1, ItemStack buy2, ItemStack sell) { + this(buy1, buy2, sell, 0, 7); + } + + public MerchantRecipe(ItemStack buy1, ItemStack buy2, ItemStack sell, int toolUsesIn, int maxTradeUsesIn) { + this.itemToBuy = buy1; + this.secondItemToBuy = buy2; + this.itemToSell = sell; + this.toolUses = toolUsesIn; + this.maxTradeUses = maxTradeUsesIn; + this.rewardsExp = true; + } + + public MerchantRecipe(ItemStack buy1, ItemStack sell) { + this(buy1, (ItemStack) null, sell); + } + + public MerchantRecipe(ItemStack buy1, Item sellItem) { + this(buy1, new ItemStack(sellItem)); + } + + /**+ + * Gets the itemToBuy. + */ + public ItemStack getItemToBuy() { + return this.itemToBuy; + } + + /**+ + * Gets secondItemToBuy. + */ + public ItemStack getSecondItemToBuy() { + return this.secondItemToBuy; + } + + /**+ + * Gets if Villager has secondItemToBuy. + */ + public boolean hasSecondItemToBuy() { + return this.secondItemToBuy != null; + } + + /**+ + * Gets itemToSell. + */ + public ItemStack getItemToSell() { + return this.itemToSell; + } + + public int getToolUses() { + return this.toolUses; + } + + public int getMaxTradeUses() { + return this.maxTradeUses; + } + + public void incrementToolUses() { + ++this.toolUses; + } + + public void increaseMaxTradeUses(int increment) { + this.maxTradeUses += increment; + } + + public boolean isRecipeDisabled() { + return this.toolUses >= this.maxTradeUses; + } + + /**+ + * Compensates {@link + * net.minecraft.village.MerchantRecipe#toolUses toolUses} with + * {@link net.minecraft.village.MerchantRecipe#maxTradeUses + * maxTradeUses} + */ + public void compensateToolUses() { + this.toolUses = this.maxTradeUses; + } + + public boolean getRewardsExp() { + return this.rewardsExp; + } + + public void readFromTags(NBTTagCompound tagCompound) { + NBTTagCompound nbttagcompound = tagCompound.getCompoundTag("buy"); + this.itemToBuy = ItemStack.loadItemStackFromNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = tagCompound.getCompoundTag("sell"); + this.itemToSell = ItemStack.loadItemStackFromNBT(nbttagcompound1); + if (tagCompound.hasKey("buyB", 10)) { + this.secondItemToBuy = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("buyB")); + } + + if (tagCompound.hasKey("uses", 99)) { + this.toolUses = tagCompound.getInteger("uses"); + } + + if (tagCompound.hasKey("maxUses", 99)) { + this.maxTradeUses = tagCompound.getInteger("maxUses"); + } else { + this.maxTradeUses = 7; + } + + if (tagCompound.hasKey("rewardExp", 1)) { + this.rewardsExp = tagCompound.getBoolean("rewardExp"); + } else { + this.rewardsExp = true; + } + + } + + public NBTTagCompound writeToTags() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("buy", this.itemToBuy.writeToNBT(new NBTTagCompound())); + nbttagcompound.setTag("sell", this.itemToSell.writeToNBT(new NBTTagCompound())); + if (this.secondItemToBuy != null) { + nbttagcompound.setTag("buyB", this.secondItemToBuy.writeToNBT(new NBTTagCompound())); + } + + nbttagcompound.setInteger("uses", this.toolUses); + nbttagcompound.setInteger("maxUses", this.maxTradeUses); + nbttagcompound.setBoolean("rewardExp", this.rewardsExp); + return nbttagcompound; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipeList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipeList.java new file mode 100644 index 0000000..1fde237 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipeList.java @@ -0,0 +1,152 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; + +import java.io.IOException; +import java.util.ArrayList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTUtil; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.MerchantRecipe; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MerchantRecipeList extends ArrayList { + + static { + __checkIntegratedContextValid("net/minecraft/village/MerchantRecipeList"); + } + + public MerchantRecipeList() { + } + + public MerchantRecipeList(NBTTagCompound compound) { + this.readRecipiesFromTags(compound); + } + + /**+ + * can par1,par2 be used to in crafting recipe par3 + */ + public MerchantRecipe canRecipeBeUsed(ItemStack parItemStack, ItemStack parItemStack2, int parInt1) { + if (parInt1 > 0 && parInt1 < this.size()) { + MerchantRecipe merchantrecipe1 = (MerchantRecipe) this.get(parInt1); + return !this.func_181078_a(parItemStack, merchantrecipe1.getItemToBuy()) + || (parItemStack2 != null || merchantrecipe1.hasSecondItemToBuy()) + && (!merchantrecipe1.hasSecondItemToBuy() + || !this.func_181078_a(parItemStack2, merchantrecipe1.getSecondItemToBuy())) + || parItemStack.stackSize < merchantrecipe1.getItemToBuy().stackSize + || merchantrecipe1.hasSecondItemToBuy() + && parItemStack2.stackSize < merchantrecipe1.getSecondItemToBuy().stackSize ? null + : merchantrecipe1; + } else { + for (int i = 0; i < this.size(); ++i) { + MerchantRecipe merchantrecipe = (MerchantRecipe) this.get(i); + if (this.func_181078_a(parItemStack, merchantrecipe.getItemToBuy()) + && parItemStack.stackSize >= merchantrecipe.getItemToBuy().stackSize + && (!merchantrecipe.hasSecondItemToBuy() && parItemStack2 == null + || merchantrecipe.hasSecondItemToBuy() + && this.func_181078_a(parItemStack2, merchantrecipe.getSecondItemToBuy()) + && parItemStack2.stackSize >= merchantrecipe.getSecondItemToBuy().stackSize)) { + return merchantrecipe; + } + } + + return null; + } + } + + private boolean func_181078_a(ItemStack parItemStack, ItemStack parItemStack2) { + return ItemStack.areItemsEqual(parItemStack, parItemStack2) + && (!parItemStack2.hasTagCompound() || parItemStack.hasTagCompound() + && NBTUtil.func_181123_a(parItemStack2.getTagCompound(), parItemStack.getTagCompound(), false)); + } + + public void writeToBuf(PacketBuffer buffer) { + buffer.writeByte((byte) (this.size() & 255)); + + for (int i = 0; i < this.size(); ++i) { + MerchantRecipe merchantrecipe = (MerchantRecipe) this.get(i); + buffer.writeItemStackToBuffer_server(merchantrecipe.getItemToBuy()); + buffer.writeItemStackToBuffer_server(merchantrecipe.getItemToSell()); + ItemStack itemstack = merchantrecipe.getSecondItemToBuy(); + buffer.writeBoolean(itemstack != null); + if (itemstack != null) { + buffer.writeItemStackToBuffer_server(itemstack); + } + + buffer.writeBoolean(merchantrecipe.isRecipeDisabled()); + buffer.writeInt(merchantrecipe.getToolUses()); + buffer.writeInt(merchantrecipe.getMaxTradeUses()); + } + + } + + public static MerchantRecipeList readFromBuf(PacketBuffer buffer) throws IOException { + MerchantRecipeList merchantrecipelist = new MerchantRecipeList(); + int i = buffer.readByte() & 255; + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = buffer.readItemStackFromBuffer_server(); + ItemStack itemstack1 = buffer.readItemStackFromBuffer_server(); + ItemStack itemstack2 = null; + if (buffer.readBoolean()) { + itemstack2 = buffer.readItemStackFromBuffer_server(); + } + + boolean flag = buffer.readBoolean(); + int k = buffer.readInt(); + int l = buffer.readInt(); + MerchantRecipe merchantrecipe = new MerchantRecipe(itemstack, itemstack2, itemstack1, k, l); + if (flag) { + merchantrecipe.compensateToolUses(); + } + + merchantrecipelist.add(merchantrecipe); + } + + return merchantrecipelist; + } + + public void readRecipiesFromTags(NBTTagCompound compound) { + NBTTagList nbttaglist = compound.getTagList("Recipes", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + this.add(new MerchantRecipe(nbttagcompound)); + } + + } + + public NBTTagCompound getRecipiesAsTags() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.size(); ++i) { + MerchantRecipe merchantrecipe = (MerchantRecipe) this.get(i); + nbttaglist.appendTag(merchantrecipe.writeToTags()); + } + + nbttagcompound.setTag("Recipes", nbttaglist); + return nbttagcompound; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/Village.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/Village.java new file mode 100644 index 0000000..14f7e48 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/Village.java @@ -0,0 +1,527 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; + +import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityIronGolem; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageDoorInfo; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Village { + + static { + __checkIntegratedContextValid("net/minecraft/village/Village"); + } + + private World worldObj; + /**+ + * list of VillageDoorInfo objects + */ + private final List villageDoorInfoList = Lists.newArrayList(); + /**+ + * This is the sum of all door coordinates and used to calculate + * the actual village center by dividing by the number of doors. + */ + private BlockPos centerHelper = BlockPos.ORIGIN; + /**+ + * This is the actual village center. + */ + private BlockPos center = BlockPos.ORIGIN; + private int villageRadius; + private int lastAddDoorTimestamp; + private int tickCounter; + private int numVillagers; + private int noBreedTicks; + private TreeMap playerReputation = new TreeMap(); + private List villageAgressors = Lists.newArrayList(); + private int numIronGolems; + + public Village() { + } + + public Village(World worldIn) { + this.worldObj = worldIn; + } + + public void setWorld(World worldIn) { + this.worldObj = worldIn; + } + + /**+ + * Called periodically by VillageCollection + */ + public void tick(int parInt1) { + this.tickCounter = parInt1; + this.removeDeadAndOutOfRangeDoors(); + this.removeDeadAndOldAgressors(); + if (parInt1 % 20 == 0) { + this.updateNumVillagers(); + } + + if (parInt1 % 30 == 0) { + this.updateNumIronGolems(); + } + + int i = this.numVillagers / 10; + if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0) { + Vec3 vec3 = this.func_179862_a(this.center, 2, 4, 2); + if (vec3 != null) { + EntityIronGolem entityirongolem = new EntityIronGolem(this.worldObj); + entityirongolem.setPosition(vec3.xCoord, vec3.yCoord, vec3.zCoord); + this.worldObj.spawnEntityInWorld(entityirongolem); + ++this.numIronGolems; + } + } + + } + + private Vec3 func_179862_a(BlockPos parBlockPos, int parInt1, int parInt2, int parInt3) { + for (int i = 0; i < 10; ++i) { + BlockPos blockpos = parBlockPos.add(this.worldObj.rand.nextInt(16) - 8, this.worldObj.rand.nextInt(6) - 3, + this.worldObj.rand.nextInt(16) - 8); + if (this.func_179866_a(blockpos) && this.func_179861_a(new BlockPos(parInt1, parInt2, parInt3), blockpos)) { + return new Vec3((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ()); + } + } + + return null; + } + + private boolean func_179861_a(BlockPos parBlockPos, BlockPos parBlockPos2) { + if (!World.doesBlockHaveSolidTopSurface(this.worldObj, parBlockPos2.down())) { + return false; + } else { + int i = parBlockPos2.getX() - parBlockPos.getX() / 2; + int j = parBlockPos2.getZ() - parBlockPos.getZ() / 2; + + for (int k = i; k < i + parBlockPos.getX(); ++k) { + for (int l = parBlockPos2.getY(); l < parBlockPos2.getY() + parBlockPos.getY(); ++l) { + for (int i1 = j; i1 < j + parBlockPos.getZ(); ++i1) { + if (this.worldObj.getBlockState(new BlockPos(k, l, i1)).getBlock().isNormalCube()) { + return false; + } + } + } + } + + return true; + } + } + + private void updateNumIronGolems() { + List list = this.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, + new AxisAlignedBB((double) (this.center.getX() - this.villageRadius), (double) (this.center.getY() - 4), + (double) (this.center.getZ() - this.villageRadius), + (double) (this.center.getX() + this.villageRadius), (double) (this.center.getY() + 4), + (double) (this.center.getZ() + this.villageRadius))); + this.numIronGolems = list.size(); + } + + private void updateNumVillagers() { + List list = this.worldObj.getEntitiesWithinAABB(EntityVillager.class, + new AxisAlignedBB((double) (this.center.getX() - this.villageRadius), (double) (this.center.getY() - 4), + (double) (this.center.getZ() - this.villageRadius), + (double) (this.center.getX() + this.villageRadius), (double) (this.center.getY() + 4), + (double) (this.center.getZ() + this.villageRadius))); + this.numVillagers = list.size(); + if (this.numVillagers == 0) { + this.playerReputation.clear(); + } + + } + + public BlockPos getCenter() { + return this.center; + } + + public int getVillageRadius() { + return this.villageRadius; + } + + /**+ + * Actually get num village door info entries, but that boils + * down to number of doors. Called by EntityAIVillagerMate and + * VillageSiege + */ + public int getNumVillageDoors() { + return this.villageDoorInfoList.size(); + } + + public int getTicksSinceLastDoorAdding() { + return this.tickCounter - this.lastAddDoorTimestamp; + } + + public int getNumVillagers() { + return this.numVillagers; + } + + public boolean func_179866_a(BlockPos pos) { + return this.center.distanceSq(pos) < (double) (this.villageRadius * this.villageRadius); + } + + /**+ + * called only by class EntityAIMoveThroughVillage + */ + public List getVillageDoorInfoList() { + return this.villageDoorInfoList; + } + + public VillageDoorInfo getNearestDoor(BlockPos pos) { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + + for (VillageDoorInfo villagedoorinfo1 : this.villageDoorInfoList) { + int j = villagedoorinfo1.getDistanceToDoorBlockSq(pos); + if (j < i) { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + /**+ + * Returns {@link net.minecraft.village.VillageDoorInfo + * VillageDoorInfo} from given block position + */ + public VillageDoorInfo getDoorInfo(BlockPos pos) { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + + for (VillageDoorInfo villagedoorinfo1 : this.villageDoorInfoList) { + int j = villagedoorinfo1.getDistanceToDoorBlockSq(pos); + if (j > 256) { + j = j * 1000; + } else { + j = villagedoorinfo1.getDoorOpeningRestrictionCounter(); + } + + if (j < i) { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + /**+ + * if door not existed in this village, null will be returned + */ + public VillageDoorInfo getExistedDoor(BlockPos doorBlock) { + if (this.center.distanceSq(doorBlock) > (double) (this.villageRadius * this.villageRadius)) { + return null; + } else { + for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList) { + if (villagedoorinfo.getDoorBlockPos().getX() == doorBlock.getX() + && villagedoorinfo.getDoorBlockPos().getZ() == doorBlock.getZ() + && Math.abs(villagedoorinfo.getDoorBlockPos().getY() - doorBlock.getY()) <= 1) { + return villagedoorinfo; + } + } + + return null; + } + } + + public void addVillageDoorInfo(VillageDoorInfo doorInfo) { + this.villageDoorInfoList.add(doorInfo); + this.centerHelper = this.centerHelper.add(doorInfo.getDoorBlockPos()); + this.updateVillageRadiusAndCenter(); + this.lastAddDoorTimestamp = doorInfo.getInsidePosY(); + } + + /**+ + * Returns true, if there is not a single village door left. + * Called by VillageCollection + */ + public boolean isAnnihilated() { + return this.villageDoorInfoList.isEmpty(); + } + + public void addOrRenewAgressor(EntityLivingBase entitylivingbaseIn) { + for (Village.VillageAggressor village$villageaggressor : this.villageAgressors) { + if (village$villageaggressor.agressor == entitylivingbaseIn) { + village$villageaggressor.agressionTime = this.tickCounter; + return; + } + } + + this.villageAgressors.add(new Village.VillageAggressor(entitylivingbaseIn, this.tickCounter)); + } + + public EntityLivingBase findNearestVillageAggressor(EntityLivingBase entitylivingbaseIn) { + double d0 = Double.MAX_VALUE; + Village.VillageAggressor village$villageaggressor = null; + + for (int i = 0; i < this.villageAgressors.size(); ++i) { + Village.VillageAggressor village$villageaggressor1 = (Village.VillageAggressor) this.villageAgressors + .get(i); + double d1 = village$villageaggressor1.agressor.getDistanceSqToEntity(entitylivingbaseIn); + if (d1 <= d0) { + village$villageaggressor = village$villageaggressor1; + d0 = d1; + } + } + + return village$villageaggressor != null ? village$villageaggressor.agressor : null; + } + + public EntityPlayer getNearestTargetPlayer(EntityLivingBase villageDefender) { + double d0 = Double.MAX_VALUE; + EntityPlayer entityplayer = null; + + for (String s : this.playerReputation.keySet()) { + if (this.isPlayerReputationTooLow(s)) { + EntityPlayer entityplayer1 = this.worldObj.getPlayerEntityByName(s); + if (entityplayer1 != null) { + double d1 = entityplayer1.getDistanceSqToEntity(villageDefender); + if (d1 <= d0) { + entityplayer = entityplayer1; + d0 = d1; + } + } + } + } + + return entityplayer; + } + + private void removeDeadAndOldAgressors() { + Iterator iterator = this.villageAgressors.iterator(); + + while (iterator.hasNext()) { + Village.VillageAggressor village$villageaggressor = (Village.VillageAggressor) iterator.next(); + if (!village$villageaggressor.agressor.isEntityAlive() + || Math.abs(this.tickCounter - village$villageaggressor.agressionTime) > 300) { + iterator.remove(); + } + } + + } + + private void removeDeadAndOutOfRangeDoors() { + boolean flag = false; + boolean flag1 = this.worldObj.rand.nextInt(50) == 0; + Iterator iterator = this.villageDoorInfoList.iterator(); + + while (iterator.hasNext()) { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo) iterator.next(); + if (flag1) { + villagedoorinfo.resetDoorOpeningRestrictionCounter(); + } + + if (!this.isWoodDoor(villagedoorinfo.getDoorBlockPos()) + || Math.abs(this.tickCounter - villagedoorinfo.getInsidePosY()) > 1200) { + this.centerHelper = this.centerHelper.subtract(villagedoorinfo.getDoorBlockPos()); + flag = true; + villagedoorinfo.setIsDetachedFromVillageFlag(true); + iterator.remove(); + } + } + + if (flag) { + this.updateVillageRadiusAndCenter(); + } + + } + + private boolean isWoodDoor(BlockPos pos) { + Block block = this.worldObj.getBlockState(pos).getBlock(); + return block instanceof BlockDoor ? block.getMaterial() == Material.wood : false; + } + + private void updateVillageRadiusAndCenter() { + int i = this.villageDoorInfoList.size(); + if (i == 0) { + this.center = new BlockPos(0, 0, 0); + this.villageRadius = 0; + } else { + this.center = new BlockPos(this.centerHelper.getX() / i, this.centerHelper.getY() / i, + this.centerHelper.getZ() / i); + int j = 0; + + for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList) { + j = Math.max(villagedoorinfo.getDistanceToDoorBlockSq(this.center), j); + } + + this.villageRadius = Math.max(32, (int) Math.sqrt((double) j) + 1); + } + } + + /**+ + * Return the village reputation for a player + */ + public int getReputationForPlayer(String parString1) { + Integer integer = (Integer) this.playerReputation.get(parString1); + return integer != null ? integer.intValue() : 0; + } + + /**+ + * Set the village reputation for a player. + */ + public int setReputationForPlayer(String parString1, int parInt1) { + int i = this.getReputationForPlayer(parString1); + int j = MathHelper.clamp_int(i + parInt1, -30, 10); + this.playerReputation.put(parString1, Integer.valueOf(j)); + return j; + } + + /**+ + * Return whether this player has a too low reputation with this + * village. + */ + public boolean isPlayerReputationTooLow(String parString1) { + return this.getReputationForPlayer(parString1) <= -15; + } + + /**+ + * Read this village's data from NBT. + */ + public void readVillageDataFromNBT(NBTTagCompound parNBTTagCompound) { + this.numVillagers = parNBTTagCompound.getInteger("PopSize"); + this.villageRadius = parNBTTagCompound.getInteger("Radius"); + this.numIronGolems = parNBTTagCompound.getInteger("Golems"); + this.lastAddDoorTimestamp = parNBTTagCompound.getInteger("Stable"); + this.tickCounter = parNBTTagCompound.getInteger("Tick"); + this.noBreedTicks = parNBTTagCompound.getInteger("MTick"); + this.center = new BlockPos(parNBTTagCompound.getInteger("CX"), parNBTTagCompound.getInteger("CY"), + parNBTTagCompound.getInteger("CZ")); + this.centerHelper = new BlockPos(parNBTTagCompound.getInteger("ACX"), parNBTTagCompound.getInteger("ACY"), + parNBTTagCompound.getInteger("ACZ")); + NBTTagList nbttaglist = parNBTTagCompound.getTagList("Doors", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + VillageDoorInfo villagedoorinfo = new VillageDoorInfo( + new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"), + nbttagcompound.getInteger("Z")), + nbttagcompound.getInteger("IDX"), nbttagcompound.getInteger("IDZ"), + nbttagcompound.getInteger("TS")); + this.villageDoorInfoList.add(villagedoorinfo); + } + + NBTTagList nbttaglist1 = parNBTTagCompound.getTagList("Players", 10); + + for (int j = 0; j < nbttaglist1.tagCount(); ++j) { + NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(j); + if (nbttagcompound1.hasKey("Name")) { + this.playerReputation.put(nbttagcompound1.getString("Name"), + Integer.valueOf(nbttagcompound1.getInteger("S"))); + } + } + + } + + /**+ + * Write this village's data to NBT. + */ + public void writeVillageDataToNBT(NBTTagCompound parNBTTagCompound) { + parNBTTagCompound.setInteger("PopSize", this.numVillagers); + parNBTTagCompound.setInteger("Radius", this.villageRadius); + parNBTTagCompound.setInteger("Golems", this.numIronGolems); + parNBTTagCompound.setInteger("Stable", this.lastAddDoorTimestamp); + parNBTTagCompound.setInteger("Tick", this.tickCounter); + parNBTTagCompound.setInteger("MTick", this.noBreedTicks); + parNBTTagCompound.setInteger("CX", this.center.getX()); + parNBTTagCompound.setInteger("CY", this.center.getY()); + parNBTTagCompound.setInteger("CZ", this.center.getZ()); + parNBTTagCompound.setInteger("ACX", this.centerHelper.getX()); + parNBTTagCompound.setInteger("ACY", this.centerHelper.getY()); + parNBTTagCompound.setInteger("ACZ", this.centerHelper.getZ()); + NBTTagList nbttaglist = new NBTTagList(); + + for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setInteger("X", villagedoorinfo.getDoorBlockPos().getX()); + nbttagcompound.setInteger("Y", villagedoorinfo.getDoorBlockPos().getY()); + nbttagcompound.setInteger("Z", villagedoorinfo.getDoorBlockPos().getZ()); + nbttagcompound.setInteger("IDX", villagedoorinfo.getInsideOffsetX()); + nbttagcompound.setInteger("IDZ", villagedoorinfo.getInsideOffsetZ()); + nbttagcompound.setInteger("TS", villagedoorinfo.getInsidePosY()); + nbttaglist.appendTag(nbttagcompound); + } + + parNBTTagCompound.setTag("Doors", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (String s : this.playerReputation.keySet()) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setString("Name", s); + nbttagcompound1.setInteger("S", ((Integer) this.playerReputation.get(s)).intValue()); + nbttaglist1.appendTag(nbttagcompound1); + } + + parNBTTagCompound.setTag("Players", nbttaglist1); + } + + /**+ + * Prevent villager breeding for a fixed interval of time + */ + public void endMatingSeason() { + this.noBreedTicks = this.tickCounter; + } + + /**+ + * Return whether villagers mating refractory period has passed + */ + public boolean isMatingSeason() { + return this.noBreedTicks == 0 || this.tickCounter - this.noBreedTicks >= 3600; + } + + public void setDefaultPlayerReputation(int parInt1) { + for (String s : this.playerReputation.keySet()) { + this.setReputationForPlayer(s, parInt1); + } + + } + + class VillageAggressor { + public EntityLivingBase agressor; + public int agressionTime; + + VillageAggressor(EntityLivingBase parEntityLivingBase, int parInt1) { + this.agressor = parEntityLivingBase; + this.agressionTime = parInt1; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageCollection.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageCollection.java new file mode 100644 index 0000000..a3cb0b1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageCollection.java @@ -0,0 +1,292 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageDoorInfo; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 VillageCollection extends WorldSavedData { + + static { + __checkIntegratedContextValid("net/minecraft/village/VillageCollection"); + } + + private World worldObj; + /**+ + * This is a black hole. You can add data to this list through a + * public interface, but you can't query that information in any + * way and it's not used internally either. + */ + private final List villagerPositionsList = Lists.newArrayList(); + private final List newDoors = Lists.newArrayList(); + private final List villageList = Lists.newArrayList(); + private int tickCounter; + + public VillageCollection(String name) { + super(name); + } + + public VillageCollection(World worldIn) { + super(fileNameForProvider(worldIn.provider)); + this.worldObj = worldIn; + this.markDirty(); + } + + public void setWorldsForAll(World worldIn) { + this.worldObj = worldIn; + + for (Village village : this.villageList) { + village.setWorld(worldIn); + } + + } + + public void addToVillagerPositionList(BlockPos pos) { + if (this.villagerPositionsList.size() <= 64) { + if (!this.positionInList(pos)) { + this.villagerPositionsList.add(pos); + } + + } + } + + /**+ + * Runs a single tick for the village collection + */ + public void tick() { + ++this.tickCounter; + + for (Village village : this.villageList) { + village.tick(this.tickCounter); + } + + this.removeAnnihilatedVillages(); + this.dropOldestVillagerPosition(); + this.addNewDoorsToVillageOrCreateVillage(); + if (this.tickCounter % 400 == 0) { + this.markDirty(); + } + + } + + private void removeAnnihilatedVillages() { + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) { + Village village = (Village) iterator.next(); + if (village.isAnnihilated()) { + iterator.remove(); + this.markDirty(); + } + } + + } + + /**+ + * Get a list of villages. + */ + public List getVillageList() { + return this.villageList; + } + + public Village getNearestVillage(BlockPos doorBlock, int radius) { + Village village = null; + double d0 = 3.4028234663852886E38D; + + for (Village village1 : this.villageList) { + double d1 = village1.getCenter().distanceSq(doorBlock); + if (d1 < d0) { + float f = (float) (radius + village1.getVillageRadius()); + if (d1 <= (double) (f * f)) { + village = village1; + d0 = d1; + } + } + } + + return village; + } + + private void dropOldestVillagerPosition() { + if (!this.villagerPositionsList.isEmpty()) { + this.addDoorsAround((BlockPos) this.villagerPositionsList.remove(0)); + } + } + + private void addNewDoorsToVillageOrCreateVillage() { + for (int i = 0; i < this.newDoors.size(); ++i) { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo) this.newDoors.get(i); + Village village = this.getNearestVillage(villagedoorinfo.getDoorBlockPos(), 32); + if (village == null) { + village = new Village(this.worldObj); + this.villageList.add(village); + this.markDirty(); + } + + village.addVillageDoorInfo(villagedoorinfo); + } + + this.newDoors.clear(); + } + + private void addDoorsAround(BlockPos central) { + byte b0 = 16; + byte b1 = 4; + byte b2 = 16; + + for (int i = -b0; i < b0; ++i) { + for (int j = -b1; j < b1; ++j) { + for (int k = -b2; k < b2; ++k) { + BlockPos blockpos = central.add(i, j, k); + if (this.isWoodDoor(blockpos)) { + VillageDoorInfo villagedoorinfo = this.checkDoorExistence(blockpos); + if (villagedoorinfo == null) { + this.addToNewDoorsList(blockpos); + } else { + villagedoorinfo.func_179849_a(this.tickCounter); + } + } + } + } + } + + } + + /**+ + * returns the VillageDoorInfo if it exists in any village or in + * the newDoor list, otherwise returns null + */ + private VillageDoorInfo checkDoorExistence(BlockPos doorBlock) { + for (VillageDoorInfo villagedoorinfo : this.newDoors) { + if (villagedoorinfo.getDoorBlockPos().getX() == doorBlock.getX() + && villagedoorinfo.getDoorBlockPos().getZ() == doorBlock.getZ() + && Math.abs(villagedoorinfo.getDoorBlockPos().getY() - doorBlock.getY()) <= 1) { + return villagedoorinfo; + } + } + + for (Village village : this.villageList) { + VillageDoorInfo villagedoorinfo1 = village.getExistedDoor(doorBlock); + if (villagedoorinfo1 != null) { + return villagedoorinfo1; + } + } + + return null; + } + + private void addToNewDoorsList(BlockPos doorBlock) { + EnumFacing enumfacing = BlockDoor.getFacing(this.worldObj, doorBlock); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + int i = this.countBlocksCanSeeSky(doorBlock, enumfacing, 5); + int j = this.countBlocksCanSeeSky(doorBlock, enumfacing1, i + 1); + if (i != j) { + this.newDoors.add(new VillageDoorInfo(doorBlock, i < j ? enumfacing : enumfacing1, this.tickCounter)); + } + + } + + /**+ + * Check five blocks in the direction. The centerPos will not be + * checked. + */ + private int countBlocksCanSeeSky(BlockPos centerPos, EnumFacing direction, int limitation) { + int i = 0; + + for (int j = 1; j <= 5; ++j) { + if (this.worldObj.canSeeSky(centerPos.offset(direction, j))) { + ++i; + if (i >= limitation) { + return i; + } + } + } + + return i; + } + + private boolean positionInList(BlockPos pos) { + for (BlockPos blockpos : this.villagerPositionsList) { + if (blockpos.equals(pos)) { + return true; + } + } + + return false; + } + + private boolean isWoodDoor(BlockPos doorPos) { + Block block = this.worldObj.getBlockState(doorPos).getBlock(); + return block instanceof BlockDoor ? block.getMaterial() == Material.wood : false; + } + + /**+ + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbttagcompound) { + this.tickCounter = nbttagcompound.getInteger("Tick"); + NBTTagList nbttaglist = nbttagcompound.getTagList("Villages", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + Village village = new Village(); + village.readVillageDataFromNBT(nbttagcompound1); + this.villageList.add(village); + } + + } + + /**+ + * write data to NBTTagCompound from this MapDataBase, similar + * to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setInteger("Tick", this.tickCounter); + NBTTagList nbttaglist = new NBTTagList(); + + for (Village village : this.villageList) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + village.writeVillageDataToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + + nbttagcompound.setTag("Villages", nbttaglist); + } + + public static String fileNameForProvider(WorldProvider provider) { + return "villages" + provider.getInternalNameSuffix(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageDoorInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageDoorInfo.java new file mode 100644 index 0000000..04a39d2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageDoorInfo.java @@ -0,0 +1,122 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 VillageDoorInfo { + + static { + __checkIntegratedContextValid("net/minecraft/village/VillageDoorInfo"); + } + + private final BlockPos doorBlockPos; + private final BlockPos insideBlock; + private final EnumFacing insideDirection; + private int lastActivityTimestamp; + private boolean isDetachedFromVillageFlag; + private int doorOpeningRestrictionCounter; + + public VillageDoorInfo(BlockPos parBlockPos, int parInt1, int parInt2, int parInt3) { + this(parBlockPos, getFaceDirection(parInt1, parInt2), parInt3); + } + + private static EnumFacing getFaceDirection(int deltaX, int deltaZ) { + return deltaX < 0 ? EnumFacing.WEST + : (deltaX > 0 ? EnumFacing.EAST : (deltaZ < 0 ? EnumFacing.NORTH : EnumFacing.SOUTH)); + } + + public VillageDoorInfo(BlockPos parBlockPos, EnumFacing parEnumFacing, int parInt1) { + this.doorBlockPos = parBlockPos; + this.insideDirection = parEnumFacing; + this.insideBlock = parBlockPos.offset(parEnumFacing, 2); + this.lastActivityTimestamp = parInt1; + } + + /**+ + * Returns the squared distance between this door and the given + * coordinate. + */ + public int getDistanceSquared(int parInt1, int parInt2, int parInt3) { + return (int) this.doorBlockPos.distanceSq((double) parInt1, (double) parInt2, (double) parInt3); + } + + public int getDistanceToDoorBlockSq(BlockPos parBlockPos) { + return (int) parBlockPos.distanceSq(this.getDoorBlockPos()); + } + + public int getDistanceToInsideBlockSq(BlockPos parBlockPos) { + return (int) this.insideBlock.distanceSq(parBlockPos); + } + + public boolean func_179850_c(BlockPos parBlockPos) { + int i = parBlockPos.getX() - this.doorBlockPos.getX(); + int j = parBlockPos.getZ() - this.doorBlockPos.getY(); + return i * this.insideDirection.getFrontOffsetX() + j * this.insideDirection.getFrontOffsetZ() >= 0; + } + + public void resetDoorOpeningRestrictionCounter() { + this.doorOpeningRestrictionCounter = 0; + } + + public void incrementDoorOpeningRestrictionCounter() { + ++this.doorOpeningRestrictionCounter; + } + + public int getDoorOpeningRestrictionCounter() { + return this.doorOpeningRestrictionCounter; + } + + public BlockPos getDoorBlockPos() { + return this.doorBlockPos; + } + + public BlockPos getInsideBlockPos() { + return this.insideBlock; + } + + public int getInsideOffsetX() { + return this.insideDirection.getFrontOffsetX() * 2; + } + + public int getInsideOffsetZ() { + return this.insideDirection.getFrontOffsetZ() * 2; + } + + public int getInsidePosY() { + return this.lastActivityTimestamp; + } + + public void func_179849_a(int parInt1) { + this.lastActivityTimestamp = parInt1; + } + + public boolean getIsDetachedFromVillageFlag() { + return this.isDetachedFromVillageFlag; + } + + public void setIsDetachedFromVillageFlag(boolean parFlag) { + this.isDetachedFromVillageFlag = parFlag; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageSiege.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageSiege.java new file mode 100644 index 0000000..28d989c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageSiege.java @@ -0,0 +1,199 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; + +import java.util.Iterator; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.Village; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.SpawnerAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 VillageSiege { + + static { + __checkIntegratedContextValid("net/minecraft/village/VillageSiege"); + } + + private World worldObj; + private boolean field_75535_b; + private int field_75536_c = -1; + private int field_75533_d; + private int field_75534_e; + private Village theVillage; + private int field_75532_g; + private int field_75538_h; + private int field_75539_i; + + public VillageSiege(World worldIn) { + this.worldObj = worldIn; + } + + /**+ + * Runs a single tick for the village siege + */ + public void tick() { + if (this.worldObj.isDaytime()) { + this.field_75536_c = 0; + } else if (this.field_75536_c != 2) { + if (this.field_75536_c == 0) { + float f = this.worldObj.getCelestialAngle(0.0F); + if ((double) f < 0.5D || (double) f > 0.501D) { + return; + } + + this.field_75536_c = this.worldObj.rand.nextInt(10) == 0 ? 1 : 2; + this.field_75535_b = false; + if (this.field_75536_c == 2) { + return; + } + } + + if (this.field_75536_c != -1) { + if (!this.field_75535_b) { + if (!this.func_75529_b()) { + return; + } + + this.field_75535_b = true; + } + + if (this.field_75534_e > 0) { + --this.field_75534_e; + } else { + this.field_75534_e = 2; + if (this.field_75533_d > 0) { + this.spawnZombie(); + --this.field_75533_d; + } else { + this.field_75536_c = 2; + } + + } + } + } + } + + private boolean func_75529_b() { + List list = this.worldObj.playerEntities; + Iterator iterator = list.iterator(); + + while (true) { + if (!iterator.hasNext()) { + return false; + } + + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + if (!entityplayer.isSpectator()) { + this.theVillage = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(entityplayer), 1); + if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 + && this.theVillage.getTicksSinceLastDoorAdding() >= 20 + && this.theVillage.getNumVillagers() >= 20) { + BlockPos blockpos = this.theVillage.getCenter(); + float f = (float) this.theVillage.getVillageRadius(); + boolean flag = false; + + for (int i = 0; i < 10; ++i) { + float f1 = this.worldObj.rand.nextFloat() * 3.1415927F * 2.0F; + this.field_75532_g = blockpos.getX() + (int) ((double) (MathHelper.cos(f1) * f) * 0.9D); + this.field_75538_h = blockpos.getY(); + this.field_75539_i = blockpos.getZ() + (int) ((double) (MathHelper.sin(f1) * f) * 0.9D); + flag = false; + + for (Village village : this.worldObj.getVillageCollection().getVillageList()) { + if (village != this.theVillage && village.func_179866_a( + new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i))) { + flag = true; + break; + } + } + + if (!flag) { + break; + } + } + + if (flag) { + return false; + } + + Vec3 vec3 = this + .func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)); + if (vec3 != null) { + break; + } + } + } + } + + this.field_75534_e = 0; + this.field_75533_d = 20; + return true; + } + + private boolean spawnZombie() { + Vec3 vec3 = this.func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)); + if (vec3 == null) { + return false; + } else { + EntityZombie entityzombie; + try { + entityzombie = new EntityZombie(this.worldObj); + entityzombie.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), + (IEntityLivingData) null); + entityzombie.setVillager(false); + } catch (Exception exception) { + EagRuntime.debugPrintStackTrace(exception); + return false; + } + + entityzombie.setLocationAndAngles(vec3.xCoord, vec3.yCoord, vec3.zCoord, + this.worldObj.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityzombie); + BlockPos blockpos = this.theVillage.getCenter(); + entityzombie.setHomePosAndDistance(blockpos, this.theVillage.getVillageRadius()); + return true; + } + } + + private Vec3 func_179867_a(BlockPos parBlockPos) { + for (int i = 0; i < 10; ++i) { + BlockPos blockpos = parBlockPos.add(this.worldObj.rand.nextInt(16) - 8, this.worldObj.rand.nextInt(6) - 3, + this.worldObj.rand.nextInt(16) - 8); + if (this.theVillage.func_179866_a(blockpos) && SpawnerAnimals.canCreatureTypeSpawnAtLocation( + EntityLiving.SpawnPlacementType.ON_GROUND, this.worldObj, blockpos)) { + return new Vec3((double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ()); + } + } + + return null; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCache.java new file mode 100644 index 0000000..3a3d061 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCache.java @@ -0,0 +1,175 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkCache implements IBlockAccess { + + static { + __checkIntegratedContextValid("net/minecraft/world/ChunkCache"); + } + + protected int chunkX; + protected int chunkZ; + protected Chunk[][] chunkArray; + protected boolean hasExtendedLevels; + protected World worldObj; + + public ChunkCache(World worldIn, BlockPos posFromIn, BlockPos posToIn, int subIn) { + this.worldObj = worldIn; + this.chunkX = posFromIn.getX() - subIn >> 4; + this.chunkZ = posFromIn.getZ() - subIn >> 4; + int i = posToIn.getX() + subIn >> 4; + int j = posToIn.getZ() + subIn >> 4; + this.chunkArray = new Chunk[i - this.chunkX + 1][j - this.chunkZ + 1]; + this.hasExtendedLevels = true; + + for (int k = this.chunkX; k <= i; ++k) { + for (int l = this.chunkZ; l <= j; ++l) { + this.chunkArray[k - this.chunkX][l - this.chunkZ] = worldIn.getChunkFromChunkCoords(k, l); + } + } + + for (int i1 = posFromIn.getX() >> 4; i1 <= posToIn.getX() >> 4; ++i1) { + for (int j1 = posFromIn.getZ() >> 4; j1 <= posToIn.getZ() >> 4; ++j1) { + Chunk chunk = this.chunkArray[i1 - this.chunkX][j1 - this.chunkZ]; + if (chunk != null && !chunk.getAreLevelsEmpty(posFromIn.getY(), posToIn.getY())) { + this.hasExtendedLevels = false; + } + } + } + + } + + /**+ + * set by !chunk.getAreLevelsEmpty + */ + public boolean extendedLevelsInChunkCache() { + return this.hasExtendedLevels; + } + + public TileEntity getTileEntity(BlockPos blockpos) { + int i = (blockpos.getX() >> 4) - this.chunkX; + int j = (blockpos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getTileEntity(blockpos, Chunk.EnumCreateEntityType.IMMEDIATE); + } + + public int getCombinedLight(BlockPos blockpos, int i) { + int j = this.getLightForExt(EnumSkyBlock.SKY, blockpos); + int k = this.getLightForExt(EnumSkyBlock.BLOCK, blockpos); + if (k < i) { + k = i; + } + + return j << 20 | k << 4; + } + + public IBlockState getBlockState(BlockPos blockpos) { + if (blockpos.getY() >= 0 && blockpos.getY() < 256) { + int i = (blockpos.getX() >> 4) - this.chunkX; + int j = (blockpos.getZ() >> 4) - this.chunkZ; + if (i >= 0 && i < this.chunkArray.length && j >= 0 && j < this.chunkArray[i].length) { + Chunk chunk = this.chunkArray[i][j]; + if (chunk != null) { + return chunk.getBlockState(blockpos); + } + } + } + + return Blocks.air.getDefaultState(); + } + + public BiomeGenBase getBiomeGenForCoords(BlockPos blockpos) { + return this.worldObj.getBiomeGenForCoords(blockpos); + } + + private int getLightForExt(EnumSkyBlock pos, BlockPos parBlockPos) { + if (pos == EnumSkyBlock.SKY && this.worldObj.provider.getHasNoSky()) { + return 0; + } else if (parBlockPos.getY() >= 0 && parBlockPos.getY() < 256) { + if (this.getBlockState(parBlockPos).getBlock().getUseNeighborBrightness()) { + int l = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) { + int k = this.getLightFor(pos, parBlockPos.offset(enumfacing)); + if (k > l) { + l = k; + } + + if (l >= 15) { + return l; + } + } + + return l; + } else { + int i = (parBlockPos.getX() >> 4) - this.chunkX; + int j = (parBlockPos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getLightFor(pos, parBlockPos); + } + } else { + return pos.defaultLightValue; + } + } + + /**+ + * Checks to see if an air block exists at the provided + * location. Note that this only checks to see if the blocks + * material is set to air, meaning it is possible for + * non-vanilla blocks to still pass this check. + */ + public boolean isAirBlock(BlockPos blockpos) { + return this.getBlockState(blockpos).getBlock().getMaterial() == Material.air; + } + + public int getLightFor(EnumSkyBlock pos, BlockPos parBlockPos) { + if (parBlockPos.getY() >= 0 && parBlockPos.getY() < 256) { + int i = (parBlockPos.getX() >> 4) - this.chunkX; + int j = (parBlockPos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getLightFor(pos, parBlockPos); + } else { + return pos.defaultLightValue; + } + } + + public int getStrongPower(BlockPos blockpos, EnumFacing enumfacing) { + IBlockState iblockstate = this.getBlockState(blockpos); + return iblockstate.getBlock().getStrongPower(this, blockpos, iblockstate, enumfacing); + } + + public WorldType getWorldType() { + return this.worldObj.getWorldType(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCoordIntPair.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCoordIntPair.java new file mode 100644 index 0000000..aa1849e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCoordIntPair.java @@ -0,0 +1,121 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkCoordIntPair { + + static { + __checkIntegratedContextValid("net/minecraft/world/ChunkCoordIntPair"); + } + + public final int chunkXPos; + public final int chunkZPos; + + public ChunkCoordIntPair(int x, int z) { + this.chunkXPos = x; + this.chunkZPos = z; + } + + /**+ + * converts a chunk coordinate pair to an integer (suitable for + * hashing) + */ + public static long chunkXZ2Int(int x, int z) { + return (long) x & 4294967295L | ((long) z & 4294967295L) << 32; + } + + public int hashCode() { + int i = 1664525 * this.chunkXPos + 1013904223; + int j = 1664525 * (this.chunkZPos ^ -559038737) + 1013904223; + return i ^ j; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (!(object instanceof ChunkCoordIntPair)) { + return false; + } else { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) object; + return this.chunkXPos == chunkcoordintpair.chunkXPos && this.chunkZPos == chunkcoordintpair.chunkZPos; + } + } + + public int getCenterXPos() { + return (this.chunkXPos << 4) + 8; + } + + public int getCenterZPosition() { + return (this.chunkZPos << 4) + 8; + } + + /**+ + * Get the first world X coordinate that belongs to this Chunk + */ + public int getXStart() { + return this.chunkXPos << 4; + } + + /**+ + * Get the first world Z coordinate that belongs to this Chunk + */ + public int getZStart() { + return this.chunkZPos << 4; + } + + /**+ + * Get the last world X coordinate that belongs to this Chunk + */ + public int getXEnd() { + return (this.chunkXPos << 4) + 15; + } + + /**+ + * Get the last world Z coordinate that belongs to this Chunk + */ + public int getZEnd() { + return (this.chunkZPos << 4) + 15; + } + + /**+ + * Get the World coordinates of the Block with the given Chunk + * coordinates relative to this chunk + */ + public BlockPos getBlock(int x, int y, int z) { + return new BlockPos((this.chunkXPos << 4) + x, y, (this.chunkZPos << 4) + z); + } + + /**+ + * Get the coordinates of the Block in the center of this chunk + * with the given Y coordinate + */ + public BlockPos getCenterBlock(int y) { + return new BlockPos(this.getCenterXPos(), y, this.getCenterZPosition()); + } + + public String toString() { + return "[" + this.chunkXPos + ", " + this.chunkZPos + "]"; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerFoliage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerFoliage.java new file mode 100644 index 0000000..a7846c8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerFoliage.java @@ -0,0 +1,68 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ColorizerFoliage { + + static { + __checkIntegratedContextValid("net/minecraft/world/ColorizerFoliage"); + } + + /**+ + * Color buffer for foliage + */ + private static int[] foliageBuffer = new int[65536]; + + public static void setFoliageBiomeColorizer(int[] parArrayOfInt) { + foliageBuffer = parArrayOfInt; + } + + /**+ + * Gets foliage color from temperature and humidity. Args: + * temperature, humidity + */ + public static int getFoliageColor(double parDouble1, double parDouble2) { + parDouble2 = parDouble2 * parDouble1; + int i = (int) ((1.0D - parDouble1) * 255.0D); + int j = (int) ((1.0D - parDouble2) * 255.0D); + return foliageBuffer[j << 8 | i]; + } + + /**+ + * Gets the foliage color for pine type (metadata 1) trees + */ + public static int getFoliageColorPine() { + return 6396257; + } + + /**+ + * Gets the foliage color for birch type (metadata 2) trees + */ + public static int getFoliageColorBirch() { + return 8431445; + } + + public static int getFoliageColorBasic() { + return 4764952; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerGrass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerGrass.java new file mode 100644 index 0000000..faf0cef --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerGrass.java @@ -0,0 +1,51 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ColorizerGrass { + + static { + __checkIntegratedContextValid("net/minecraft/world/ColorizerGrass"); + } + + /**+ + * Color buffer for grass + */ + private static int[] grassBuffer = new int[65536]; + + public static void setGrassBiomeColorizer(int[] parArrayOfInt) { + grassBuffer = parArrayOfInt; + } + + /**+ + * Gets grass color from temperature and humidity. Args: + * temperature, humidity + */ + public static int getGrassColor(double parDouble1, double parDouble2) { + parDouble2 = parDouble2 * parDouble1; + int i = (int) ((1.0D - parDouble1) * 255.0D); + int j = (int) ((1.0D - parDouble2) * 255.0D); + int k = j << 8 | i; + return k > grassBuffer.length ? -65281 : grassBuffer[k]; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/DifficultyInstance.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/DifficultyInstance.java new file mode 100644 index 0000000..93dc79f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/DifficultyInstance.java @@ -0,0 +1,74 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DifficultyInstance { + + static { + __checkIntegratedContextValid("net/minecraft/world/DifficultyInstance"); + } + + private final EnumDifficulty worldDifficulty; + private final float additionalDifficulty; + + public DifficultyInstance(EnumDifficulty worldDifficulty, long worldTime, long chunkInhabitedTime, + float moonPhaseFactor) { + this.worldDifficulty = worldDifficulty; + this.additionalDifficulty = this.calculateAdditionalDifficulty(worldDifficulty, worldTime, chunkInhabitedTime, + moonPhaseFactor); + } + + public float getAdditionalDifficulty() { + return this.additionalDifficulty; + } + + public float getClampedAdditionalDifficulty() { + return this.additionalDifficulty < 2.0F ? 0.0F + : (this.additionalDifficulty > 4.0F ? 1.0F : (this.additionalDifficulty - 2.0F) / 2.0F); + } + + private float calculateAdditionalDifficulty(EnumDifficulty difficulty, long worldTime, long chunkInhabitedTime, + float moonPhaseFactor) { + if (difficulty == EnumDifficulty.PEACEFUL) { + return 0.0F; + } else { + boolean flag = difficulty == EnumDifficulty.HARD; + float f = 0.75F; + float f1 = MathHelper.clamp_float(((float) worldTime + -72000.0F) / 1440000.0F, 0.0F, 1.0F) * 0.25F; + f = f + f1; + float f2 = 0.0F; + f2 = f2 + MathHelper.clamp_float((float) chunkInhabitedTime / 3600000.0F, 0.0F, 1.0F) + * (flag ? 1.0F : 0.75F); + f2 = f2 + MathHelper.clamp_float(moonPhaseFactor * 0.25F, 0.0F, f1); + if (difficulty == EnumDifficulty.EASY) { + f2 *= 0.5F; + } + + f = f + f2; + return (float) difficulty.getDifficultyId() * f; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumDifficulty.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumDifficulty.java new file mode 100644 index 0000000..0fc9151 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumDifficulty.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumDifficulty { + PEACEFUL(0, "options.difficulty.peaceful"), EASY(1, "options.difficulty.easy"), + NORMAL(2, "options.difficulty.normal"), HARD(3, "options.difficulty.hard"); + + static { + __checkIntegratedContextValid("net/minecraft/world/EnumDifficulty"); + } + + private static final EnumDifficulty[] difficultyEnums = new EnumDifficulty[values().length]; + private final int difficultyId; + private final String difficultyResourceKey; + + private EnumDifficulty(int difficultyIdIn, String difficultyResourceKeyIn) { + this.difficultyId = difficultyIdIn; + this.difficultyResourceKey = difficultyResourceKeyIn; + } + + public int getDifficultyId() { + return this.difficultyId; + } + + public static EnumDifficulty getDifficultyEnum(int parInt1) { + return difficultyEnums[parInt1 % difficultyEnums.length]; + } + + public String getDifficultyResourceKey() { + return this.difficultyResourceKey; + } + + static { + for (EnumDifficulty enumdifficulty : values()) { + difficultyEnums[enumdifficulty.difficultyId] = enumdifficulty; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumSkyBlock.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumSkyBlock.java new file mode 100644 index 0000000..fac0f7c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumSkyBlock.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumSkyBlock { + SKY(15), BLOCK(0); + + static { + __checkIntegratedContextValid("net/minecraft/world/EnumSkyBlock"); + } + + public final int defaultLightValue; + + private EnumSkyBlock(int parInt2) { + this.defaultLightValue = parInt2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Explosion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Explosion.java new file mode 100644 index 0000000..a538b74 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Explosion.java @@ -0,0 +1,269 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.enchantment.EnchantmentProtection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityTNTPrimed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.DamageSource; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Explosion { + + static { + __checkIntegratedContextValid("net/minecraft/world/Explosion"); + } + + private final boolean isFlaming; + private final boolean isSmoking; + private final EaglercraftRandom explosionRNG; + private final World worldObj; + private final double explosionX; + private final double explosionY; + private final double explosionZ; + private final Entity exploder; + private final float explosionSize; + private final List affectedBlockPositions; + private final Map playerKnockbackMap; + + public Explosion(World worldIn, Entity parEntity, double parDouble1, double parDouble2, double parDouble3, + float parFloat1, List parList) { + this(worldIn, parEntity, parDouble1, parDouble2, parDouble3, parFloat1, false, true, parList); + } + + public Explosion(World worldIn, Entity parEntity, double parDouble1, double parDouble2, double parDouble3, + float parFloat1, boolean parFlag, boolean parFlag2, List parList) { + this(worldIn, parEntity, parDouble1, parDouble2, parDouble3, parFloat1, parFlag, parFlag2); + this.affectedBlockPositions.addAll(parList); + } + + public Explosion(World worldIn, Entity parEntity, double parDouble1, double parDouble2, double parDouble3, + float size, boolean parFlag, boolean parFlag2) { + this.explosionRNG = new EaglercraftRandom(); + this.affectedBlockPositions = Lists.newArrayList(); + this.playerKnockbackMap = Maps.newHashMap(); + this.worldObj = worldIn; + this.exploder = parEntity; + this.explosionSize = size; + this.explosionX = parDouble1; + this.explosionY = parDouble2; + this.explosionZ = parDouble3; + this.isFlaming = parFlag; + this.isSmoking = parFlag2; + } + + /**+ + * Does the first part of the explosion (destroy blocks) + */ + public void doExplosionA() { + HashSet hashset = Sets.newHashSet(); + boolean flag = true; + + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + for (int k = 0; k < 16; ++k) { + if (i == 0 || i == 15 || j == 0 || j == 15 || k == 0 || k == 15) { + double d0 = (double) ((float) i / 15.0F * 2.0F - 1.0F); + double d1 = (double) ((float) j / 15.0F * 2.0F - 1.0F); + double d2 = (double) ((float) k / 15.0F * 2.0F - 1.0F); + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + d0 = d0 / d3; + d1 = d1 / d3; + d2 = d2 / d3; + float f = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + double d4 = this.explosionX; + double d6 = this.explosionY; + double d8 = this.explosionZ; + + for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { + BlockPos blockpos = new BlockPos(d4, d6, d8); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + if (iblockstate.getBlock().getMaterial() != Material.air) { + float f2 = this.exploder != null + ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, + iblockstate) + : iblockstate.getBlock().getExplosionResistance((Entity) null); + f -= (f2 + 0.3F) * 0.3F; + } + + if (f > 0.0F && (this.exploder == null + || this.exploder.verifyExplosion(this, this.worldObj, blockpos, iblockstate, f))) { + hashset.add(blockpos); + } + + d4 += d0 * 0.30000001192092896D; + d6 += d1 * 0.30000001192092896D; + d8 += d2 * 0.30000001192092896D; + } + } + } + } + } + + this.affectedBlockPositions.addAll(hashset); + float f3 = this.explosionSize * 2.0F; + int j1 = MathHelper.floor_double(this.explosionX - (double) f3 - 1.0D); + int k1 = MathHelper.floor_double(this.explosionX + (double) f3 + 1.0D); + int l1 = MathHelper.floor_double(this.explosionY - (double) f3 - 1.0D); + int l = MathHelper.floor_double(this.explosionY + (double) f3 + 1.0D); + int i2 = MathHelper.floor_double(this.explosionZ - (double) f3 - 1.0D); + int i1 = MathHelper.floor_double(this.explosionZ + (double) f3 + 1.0D); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, + new AxisAlignedBB((double) j1, (double) l1, (double) i2, (double) k1, (double) l, (double) i1)); + Vec3 vec3 = new Vec3(this.explosionX, this.explosionY, this.explosionZ); + + for (int j2 = 0; j2 < list.size(); ++j2) { + Entity entity = (Entity) list.get(j2); + if (!entity.isImmuneToExplosions()) { + double d12 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double) f3; + if (d12 <= 1.0D) { + double d5 = entity.posX - this.explosionX; + double d7 = entity.posY + (double) entity.getEyeHeight() - this.explosionY; + double d9 = entity.posZ - this.explosionZ; + double d13 = (double) MathHelper.sqrt_double(d5 * d5 + d7 * d7 + d9 * d9); + if (d13 != 0.0D) { + d5 = d5 / d13; + d7 = d7 / d13; + d9 = d9 / d13; + double d14 = (double) this.worldObj.getBlockDensity(vec3, entity.getEntityBoundingBox()); + double d10 = (1.0D - d12) * d14; + entity.attackEntityFrom(DamageSource.setExplosionSource(this), + (float) ((int) ((d10 * d10 + d10) / 2.0D * 8.0D * (double) f3 + 1.0D))); + double d11 = EnchantmentProtection.func_92092_a(entity, d10); + entity.motionX += d5 * d11; + entity.motionY += d7 * d11; + entity.motionZ += d9 * d11; + if (entity instanceof EntityPlayer && !((EntityPlayer) entity).capabilities.disableDamage) { + this.playerKnockbackMap.put((EntityPlayer) entity, new Vec3(d5 * d10, d7 * d10, d9 * d10)); + } + } + } + } + } + + } + + /**+ + * Does the second part of the explosion (sound, particles, drop + * spawn) + */ + public void doExplosionB(boolean spawnParticles) { + this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, + (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + if (this.explosionSize >= 2.0F && this.isSmoking) { + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.explosionX, this.explosionY, + this.explosionZ, 1.0D, 0.0D, 0.0D, new int[0]); + } else { + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.explosionX, this.explosionY, + this.explosionZ, 1.0D, 0.0D, 0.0D, new int[0]); + } + + if (this.isSmoking) { + for (BlockPos blockpos : this.affectedBlockPositions) { + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + if (spawnParticles) { + double d0 = (double) ((float) blockpos.getX() + this.worldObj.rand.nextFloat()); + double d1 = (double) ((float) blockpos.getY() + this.worldObj.rand.nextFloat()); + double d2 = (double) ((float) blockpos.getZ() + this.worldObj.rand.nextFloat()); + double d3 = d0 - this.explosionX; + double d4 = d1 - this.explosionY; + double d5 = d2 - this.explosionZ; + double d6 = (double) MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5); + d3 = d3 / d6; + d4 = d4 / d6; + d5 = d5 / d6; + double d7 = 0.5D / (d6 / (double) this.explosionSize + 0.1D); + d7 = d7 * (double) (this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); + d3 = d3 * d7; + d4 = d4 * d7; + d5 = d5 * d7; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, + (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, + (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5, new int[0]); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + if (block.getMaterial() != Material.air) { + if (block.canDropFromExplosion(this)) { + block.dropBlockAsItemWithChance(this.worldObj, blockpos, this.worldObj.getBlockState(blockpos), + 1.0F / this.explosionSize, 0); + } + + this.worldObj.setBlockState(blockpos, Blocks.air.getDefaultState(), 3); + block.onBlockDestroyedByExplosion(this.worldObj, blockpos, this); + } + } + } + + if (this.isFlaming) { + for (BlockPos blockpos1 : this.affectedBlockPositions) { + if (this.worldObj.getBlockState(blockpos1).getBlock().getMaterial() == Material.air + && this.worldObj.getBlockState(blockpos1.down()).getBlock().isFullBlock() + && this.explosionRNG.nextInt(3) == 0) { + this.worldObj.setBlockState(blockpos1, Blocks.fire.getDefaultState()); + } + } + } + + } + + public Map getPlayerKnockbackMap() { + return this.playerKnockbackMap; + } + + /**+ + * Returns either the entity that placed the explosive block, + * the entity that caused the explosion or null. + */ + public EntityLivingBase getExplosivePlacedBy() { + return this.exploder == null ? null + : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed) this.exploder).getTntPlacedBy() + : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase) this.exploder : null)); + } + + public void func_180342_d() { + this.affectedBlockPositions.clear(); + } + + public List getAffectedBlockPositions() { + return this.affectedBlockPositions; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/GameRules.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/GameRules.java new file mode 100644 index 0000000..bef1e0a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/GameRules.java @@ -0,0 +1,199 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import java.util.Set; +import java.util.TreeMap; +import net.minecraft.nbt.NBTTagCompound; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GameRules { + + static { + __checkIntegratedContextValid("net/minecraft/world/GameRules"); + } + + private TreeMap theGameRules = new TreeMap(); + + public GameRules() { + this.addGameRule("doFireTick", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("mobGriefing", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("keepInventory", "false", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doMobSpawning", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doMobLoot", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doTileDrops", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doEntityDrops", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("commandBlockOutput", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("naturalRegeneration", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doDaylightCycle", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("logAdminCommands", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("showDeathMessages", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("randomTickSpeed", "3", GameRules.ValueType.NUMERICAL_VALUE); + this.addGameRule("sendCommandFeedback", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("reducedDebugInfo", "false", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("loadSpawnChunks", "false", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("bedSpawnPoint", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("clickToRide", "false", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("clickToSit", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("colorCodes", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doSignEditing", "true", GameRules.ValueType.BOOLEAN_VALUE); + } + + public void addGameRule(String key, String value, GameRules.ValueType type) { + this.theGameRules.put(key, new GameRules.Value(value, type)); + } + + public void setOrCreateGameRule(String key, String ruleValue) { + GameRules.Value gamerules$value = (GameRules.Value) this.theGameRules.get(key); + if (gamerules$value != null) { + gamerules$value.setValue(ruleValue); + } else { + this.addGameRule(key, ruleValue, GameRules.ValueType.ANY_VALUE); + } + + } + + /**+ + * Gets the string Game Rule value. + */ + public String getString(String name) { + GameRules.Value gamerules$value = (GameRules.Value) this.theGameRules.get(name); + return gamerules$value != null ? gamerules$value.getString() : ""; + } + + /**+ + * Gets the boolean Game Rule value. + */ + public boolean getBoolean(String name) { + GameRules.Value gamerules$value = (GameRules.Value) this.theGameRules.get(name); + return gamerules$value != null ? gamerules$value.getBoolean() : false; + } + + public int getInt(String name) { + GameRules.Value gamerules$value = (GameRules.Value) this.theGameRules.get(name); + return gamerules$value != null ? gamerules$value.getInt() : 0; + } + + /**+ + * Return the defined game rules as NBT. + */ + public NBTTagCompound writeToNBT() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (String s : this.theGameRules.keySet()) { + GameRules.Value gamerules$value = (GameRules.Value) this.theGameRules.get(s); + nbttagcompound.setString(s, gamerules$value.getString()); + } + + return nbttagcompound; + } + + /**+ + * Set defined game rules from NBT. + */ + public void readFromNBT(NBTTagCompound nbt) { + for (String s : nbt.getKeySet()) { + String s1 = nbt.getString(s); + this.setOrCreateGameRule(s, s1); + } + + } + + /**+ + * Return the defined game rules. + */ + public String[] getRules() { + Set set = this.theGameRules.keySet(); + return (String[]) set.toArray(new String[set.size()]); + } + + /**+ + * Return whether the specified game rule is defined. + */ + public boolean hasRule(String name) { + return this.theGameRules.containsKey(name); + } + + public boolean areSameType(String key, GameRules.ValueType otherValue) { + GameRules.Value gamerules$value = (GameRules.Value) this.theGameRules.get(key); + return gamerules$value != null + && (gamerules$value.getType() == otherValue || otherValue == GameRules.ValueType.ANY_VALUE); + } + + static class Value { + private String valueString; + private boolean valueBoolean; + private int valueInteger; + private double valueDouble; + private final GameRules.ValueType type; + + public Value(String value, GameRules.ValueType type) { + this.type = type; + this.setValue(value); + } + + public void setValue(String value) { + this.valueString = value; + this.valueBoolean = Boolean.parseBoolean(value); + this.valueInteger = this.valueBoolean ? 1 : 0; + + try { + this.valueInteger = Integer.parseInt(value); + } catch (NumberFormatException var4) { + ; + } + + try { + this.valueDouble = Double.parseDouble(value); + } catch (NumberFormatException var3) { + ; + } + + } + + /**+ + * Gets the string Game Rule value. + */ + public String getString() { + return this.valueString; + } + + /**+ + * Gets the boolean Game Rule value. + */ + public boolean getBoolean() { + return this.valueBoolean; + } + + public int getInt() { + return this.valueInteger; + } + + public GameRules.ValueType getType() { + return this.type; + } + } + + public static enum ValueType { + ANY_VALUE, BOOLEAN_VALUE, NUMERICAL_VALUE; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IBlockAccess.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IBlockAccess.java new file mode 100644 index 0000000..d41030c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IBlockAccess.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IBlockAccess { + TileEntity getTileEntity(BlockPos var1); + + int getCombinedLight(BlockPos var1, int var2); + + IBlockState getBlockState(BlockPos var1); + + /**+ + * Checks to see if an air block exists at the provided + * location. Note that this only checks to see if the blocks + * material is set to air, meaning it is possible for + * non-vanilla blocks to still pass this check. + */ + boolean isAirBlock(BlockPos var1); + + BiomeGenBase getBiomeGenForCoords(BlockPos var1); + + /**+ + * set by !chunk.getAreLevelsEmpty + */ + boolean extendedLevelsInChunkCache(); + + int getStrongPower(BlockPos var1, EnumFacing var2); + + WorldType getWorldType(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IInteractionObject.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IInteractionObject.java new file mode 100644 index 0000000..0b6fd37 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IInteractionObject.java @@ -0,0 +1,32 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.InventoryPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.Container; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IWorldNameable; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IInteractionObject extends IWorldNameable { + Container createContainer(InventoryPlayer var1, EntityPlayer var2); + + String getGuiID(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ILockableContainer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ILockableContainer.java new file mode 100644 index 0000000..7044991 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ILockableContainer.java @@ -0,0 +1,33 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.inventory.IInventory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IInteractionObject; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.LockCode; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ILockableContainer extends IInventory, IInteractionObject { + boolean isLocked(); + + void setLockCode(LockCode var1); + + LockCode getLockCode(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldAccess.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldAccess.java new file mode 100644 index 0000000..fee8a5b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldAccess.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IWorldAccess { + void markBlockForUpdate(BlockPos var1); + + void notifyLightSet(BlockPos var1); + + /**+ + * On the client, re-renders all blocks in this range, + * inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6); + + /**+ + * Plays the specified sound. Arg: soundName, x, y, z, volume, + * pitch + */ + void playSound(String var1, double var2, double var4, double var6, float var8, float var9); + + /**+ + * Plays sound to all near players except the player reference + * given + */ + void playSoundToNearExcept(EntityPlayer var1, String var2, double var3, double var5, double var7, float var9, + float var10); + + void spawnParticle(int var1, boolean var2, double var3, double var5, double var7, double var9, double var11, + double var13, int... var15); + + /**+ + * Called on all IWorldAccesses when an entity is created or + * loaded. On client worlds, starts downloading any necessary + * textures. On server worlds, adds the entity to the entity + * tracker. + */ + void onEntityAdded(Entity var1); + + /**+ + * Called on all IWorldAccesses when an entity is unloaded or + * destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the + * entity tracker. + */ + void onEntityRemoved(Entity var1); + + void playRecord(String var1, BlockPos var2); + + void broadcastSound(int var1, BlockPos var2, int var3); + + void playAuxSFX(EntityPlayer var1, int var2, BlockPos var3, int var4); + + void sendBlockBreakProgress(int var1, BlockPos var2, int var3); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldNameable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldNameable.java new file mode 100644 index 0000000..2d8f758 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldNameable.java @@ -0,0 +1,42 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IWorldNameable { + /**+ + * Gets the name of this command sender (usually username, but + * possibly "Rcon") + */ + String getName(); + + /**+ + * Returns true if this thing is named + */ + boolean hasCustomName(); + + /**+ + * Get the formatted ChatComponent that will be used for the + * sender's username in chat + */ + IChatComponent getDisplayName(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/LockCode.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/LockCode.java new file mode 100644 index 0000000..5e00954 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/LockCode.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.minecraft.nbt.NBTTagCompound; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 LockCode { + + static { + __checkIntegratedContextValid("net/minecraft/world/LockCode"); + } + + public static final LockCode EMPTY_CODE = new LockCode(""); + private final String lock; + + public LockCode(String code) { + this.lock = code; + } + + public boolean isEmpty() { + return this.lock == null || this.lock.isEmpty(); + } + + public String getLock() { + return this.lock; + } + + public void toNBT(NBTTagCompound nbt) { + nbt.setString("Lock", this.lock); + } + + public static LockCode fromNBT(NBTTagCompound nbt) { + if (nbt.hasKey("Lock", 8)) { + String s = nbt.getString("Lock"); + return new LockCode(s); + } else { + return EMPTY_CODE; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/MinecraftException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/MinecraftException.java new file mode 100644 index 0000000..0aaaeb9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/MinecraftException.java @@ -0,0 +1,34 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MinecraftException extends Exception { + + static { + __checkIntegratedContextValid("net/minecraft/world/MinecraftException"); + } + + public MinecraftException(String msg) { + super(msg); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/NextTickListEntry.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/NextTickListEntry.java new file mode 100644 index 0000000..e9fab2c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/NextTickListEntry.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NextTickListEntry implements Comparable { + + static { + __checkIntegratedContextValid("net/minecraft/world/NextTickListEntry"); + } + + private static long nextTickEntryID; + private final Block block; + public final BlockPos position; + public long scheduledTime; + public int priority; + private long tickEntryID; + + public NextTickListEntry(BlockPos parBlockPos, Block parBlock) { + this.tickEntryID = (long) (nextTickEntryID++); + this.position = parBlockPos; + this.block = parBlock; + } + + public boolean equals(Object object) { + if (!(object instanceof NextTickListEntry)) { + return false; + } else { + NextTickListEntry nextticklistentry = (NextTickListEntry) object; + return this.position.equals(nextticklistentry.position) + && Block.isEqualTo(this.block, nextticklistentry.block); + } + } + + public int hashCode() { + return this.position.hashCode(); + } + + /**+ + * Sets the scheduled time for this tick entry + */ + public NextTickListEntry setScheduledTime(long parLong1) { + this.scheduledTime = parLong1; + return this; + } + + public void setPriority(int parInt1) { + this.priority = parInt1; + } + + public int compareTo(NextTickListEntry parNextTickListEntry) { + return this.scheduledTime < parNextTickListEntry.scheduledTime ? -1 + : (this.scheduledTime > parNextTickListEntry.scheduledTime ? 1 + : (this.priority != parNextTickListEntry.priority + ? this.priority - parNextTickListEntry.priority + : (this.tickEntryID < parNextTickListEntry.tickEntryID ? -1 + : (this.tickEntryID > parNextTickListEntry.tickEntryID ? 1 : 0)))); + } + + public String toString() { + return Block.getIdFromBlock(this.block) + ": " + this.position + ", " + this.scheduledTime + ", " + + this.priority + ", " + this.tickEntryID; + } + + public Block getBlock() { + return this.block; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/SpawnerAnimals.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/SpawnerAnimals.java new file mode 100644 index 0000000..0b2a50e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/SpawnerAnimals.java @@ -0,0 +1,280 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import com.google.common.collect.Sets; + +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +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.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class SpawnerAnimals { + + static { + __checkIntegratedContextValid("net/minecraft/world/SpawnerAnimals"); + } + + private static final int MOB_COUNT_DIV = (int) Math.pow(17.0D, 2.0D); + /**+ + * The 17x17 area around the player where mobs can spawn + */ + private final Set eligibleChunksForSpawning = Sets.newHashSet(); + + /**+ + * adds all chunks within the spawn radius of the players to + * eligibleChunksForSpawning. pars: the world, hostileCreatures, + * passiveCreatures. returns number of eligible chunks. + */ + public int findChunksForSpawning(WorldServer spawnHostileMobs, boolean spawnPeacefulMobs, boolean parFlag2, + boolean parFlag3) { + if (!spawnPeacefulMobs && !parFlag2) { + return 0; + } else { + this.eligibleChunksForSpawning.clear(); + int i = 0; + + for (EntityPlayer entityplayer : spawnHostileMobs.playerEntities) { + if (!entityplayer.isSpectator()) { + int j = MathHelper.floor_double(entityplayer.posX / 16.0D); + int k = MathHelper.floor_double(entityplayer.posZ / 16.0D); + byte b0 = 8; + + for (int l = -b0; l <= b0; ++l) { + for (int i1 = -b0; i1 <= b0; ++i1) { + boolean flag = l == -b0 || l == b0 || i1 == -b0 || i1 == b0; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(l + j, i1 + k); + if (!this.eligibleChunksForSpawning.contains(chunkcoordintpair) + && spawnHostileMobs.theChunkProviderServer.chunkExists(chunkcoordintpair.chunkXPos, + chunkcoordintpair.chunkZPos)) { + ++i; + if (!flag && spawnHostileMobs.getWorldBorder().contains(chunkcoordintpair)) { + this.eligibleChunksForSpawning.add(chunkcoordintpair); + } + } + } + } + } + } + + int k3 = 0; + BlockPos blockpos2 = spawnHostileMobs.getSpawnPoint(); + + for (EnumCreatureType enumcreaturetype : EnumCreatureType.values()) { + if ((!enumcreaturetype.getPeacefulCreature() || parFlag2) + && (enumcreaturetype.getPeacefulCreature() || spawnPeacefulMobs) + && (!enumcreaturetype.getAnimal() || parFlag3)) { + int l3 = spawnHostileMobs.countEntities(enumcreaturetype.getCreatureClass()); + int i4 = enumcreaturetype.getMaxNumberOfCreature() * i / MOB_COUNT_DIV; + if (l3 <= i4) { + label374: for (ChunkCoordIntPair chunkcoordintpair1 : this.eligibleChunksForSpawning) { + BlockPos blockpos = getRandomChunkPosition(spawnHostileMobs, chunkcoordintpair1.chunkXPos, + chunkcoordintpair1.chunkZPos); + int j1 = blockpos.getX(); + int k1 = blockpos.getY(); + int l1 = blockpos.getZ(); + Block block = spawnHostileMobs.getBlockState(blockpos).getBlock(); + if (!block.isNormalCube()) { + int i2 = 0; + + for (int j2 = 0; j2 < 3; ++j2) { + int k2 = j1; + int l2 = k1; + int i3 = l1; + byte b1 = 6; + BiomeGenBase.SpawnListEntry biomegenbase$spawnlistentry = null; + IEntityLivingData ientitylivingdata = null; + + for (int j3 = 0; j3 < 4; ++j3) { + k2 += spawnHostileMobs.rand.nextInt(b1) - spawnHostileMobs.rand.nextInt(b1); + l2 += spawnHostileMobs.rand.nextInt(1) - spawnHostileMobs.rand.nextInt(1); + i3 += spawnHostileMobs.rand.nextInt(b1) - spawnHostileMobs.rand.nextInt(b1); + BlockPos blockpos1 = new BlockPos(k2, l2, i3); + float f = (float) k2 + 0.5F; + float f1 = (float) i3 + 0.5F; + if (!spawnHostileMobs.isAnyPlayerWithinRangeAt((double) f, (double) l2, + (double) f1, 24.0D) + && blockpos2.distanceSq((double) f, (double) l2, + (double) f1) >= 576.0D) { + if (biomegenbase$spawnlistentry == null) { + biomegenbase$spawnlistentry = spawnHostileMobs + .getSpawnListEntryForTypeAt(enumcreaturetype, blockpos1); + if (biomegenbase$spawnlistentry == null) { + break; + } + } + + if (spawnHostileMobs.canCreatureTypeSpawnHere(enumcreaturetype, + biomegenbase$spawnlistentry, blockpos1) + && canCreatureTypeSpawnAtLocation( + EntitySpawnPlacementRegistry.getPlacementForEntity( + biomegenbase$spawnlistentry.entityClass), + spawnHostileMobs, blockpos1)) { + EntityLiving entityliving; + try { + entityliving = (EntityLiving) EntityList.createEntityByClassUnsafe( + biomegenbase$spawnlistentry.entityClass, spawnHostileMobs); + } catch (Exception exception) { + EagRuntime.debugPrintStackTrace(exception); + return k3; + } + + entityliving.setLocationAndAngles((double) f, (double) l2, (double) f1, + spawnHostileMobs.rand.nextFloat() * 360.0F, 0.0F); + if (entityliving.getCanSpawnHere() && entityliving.isNotColliding()) { + ientitylivingdata = entityliving + .onInitialSpawn( + spawnHostileMobs.getDifficultyForLocation( + new BlockPos(entityliving)), + ientitylivingdata); + if (entityliving.isNotColliding()) { + ++i2; + spawnHostileMobs.spawnEntityInWorld(entityliving); + } + + if (i2 >= entityliving.getMaxSpawnedInChunk()) { + continue label374; + } + } + + k3 += i2; + } + } + } + } + } + } + } + } + } + + return k3; + } + } + + protected static BlockPos getRandomChunkPosition(World worldIn, int x, int z) { + Chunk chunk = worldIn.getChunkFromChunkCoords(x, z); + int i = x * 16 + worldIn.rand.nextInt(16); + int j = z * 16 + worldIn.rand.nextInt(16); + int k = MathHelper.func_154354_b(chunk.getHeight(new BlockPos(i, 0, j)) + 1, 16); + int l = worldIn.rand.nextInt(k > 0 ? k : chunk.getTopFilledSegment() + 16 - 1); + return new BlockPos(i, l, j); + } + + public static boolean canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType worldIn, World pos, + BlockPos parBlockPos) { + if (!pos.getWorldBorder().contains(parBlockPos)) { + return false; + } else { + Block block = pos.getBlockState(parBlockPos).getBlock(); + if (worldIn == EntityLiving.SpawnPlacementType.IN_WATER) { + return block.getMaterial().isLiquid() + && pos.getBlockState(parBlockPos.down()).getBlock().getMaterial().isLiquid() + && !pos.getBlockState(parBlockPos.up()).getBlock().isNormalCube(); + } else { + BlockPos blockpos = parBlockPos.down(); + if (!World.doesBlockHaveSolidTopSurface(pos, blockpos)) { + return false; + } else { + Block block1 = pos.getBlockState(blockpos).getBlock(); + boolean flag = block1 != Blocks.bedrock && block1 != Blocks.barrier; + return flag && !block.isNormalCube() && !block.getMaterial().isLiquid() + && !pos.getBlockState(parBlockPos.up()).getBlock().isNormalCube(); + } + } + } + } + + /**+ + * Called during chunk generation to spawn initial creatures. + */ + public static void performWorldGenSpawning(World worldIn, BiomeGenBase parBiomeGenBase, int parInt1, int parInt2, + int parInt3, int parInt4, EaglercraftRandom parRandom) { + List list = parBiomeGenBase.getSpawnableList(EnumCreatureType.CREATURE); + if (!list.isEmpty()) { + while (parRandom.nextFloat() < parBiomeGenBase.getSpawningChance()) { + BiomeGenBase.SpawnListEntry biomegenbase$spawnlistentry = (BiomeGenBase.SpawnListEntry) WeightedRandom + .getRandomItem(worldIn.rand, list); + int i = biomegenbase$spawnlistentry.minGroupCount + parRandom.nextInt( + 1 + biomegenbase$spawnlistentry.maxGroupCount - biomegenbase$spawnlistentry.minGroupCount); + IEntityLivingData ientitylivingdata = null; + int j = parInt1 + parRandom.nextInt(parInt3); + int k = parInt2 + parRandom.nextInt(parInt4); + int l = j; + int i1 = k; + + for (int j1 = 0; j1 < i; ++j1) { + boolean flag = false; + + for (int k1 = 0; !flag && k1 < 4; ++k1) { + BlockPos blockpos = worldIn.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)); + if (canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType.ON_GROUND, worldIn, + blockpos)) { + EntityLiving entityliving; + try { + entityliving = (EntityLiving) EntityList + .createEntityByClass(biomegenbase$spawnlistentry.entityClass, worldIn); + } catch (Exception exception) { + EagRuntime.debugPrintStackTrace(exception); + continue; + } + + entityliving.setLocationAndAngles((double) ((float) j + 0.5F), (double) blockpos.getY(), + (double) ((float) k + 0.5F), parRandom.nextFloat() * 360.0F, 0.0F); + worldIn.spawnEntityInWorld(entityliving); + ientitylivingdata = entityliving.onInitialSpawn( + worldIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); + flag = true; + } + + j += parRandom.nextInt(5) - parRandom.nextInt(5); + + for (k += parRandom.nextInt(5) - parRandom.nextInt(5); j < parInt1 || j >= parInt1 + parInt3 + || k < parInt2 + || k >= parInt2 + parInt3; k = i1 + parRandom.nextInt(5) - parRandom.nextInt(5)) { + j = l + parRandom.nextInt(5) - parRandom.nextInt(5); + } + } + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Teleporter.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Teleporter.java new file mode 100644 index 0000000..147be2b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Teleporter.java @@ -0,0 +1,410 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPortal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockPattern; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.LongHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Teleporter { + + static { + __checkIntegratedContextValid("net/minecraft/world/Teleporter"); + } + + private final WorldServer worldServerInstance; + private final EaglercraftRandom random; + /**+ + * Stores successful portal placement locations for rapid + * lookup. + */ + private final LongHashMap destinationCoordinateCache = new LongHashMap(); + /**+ + * A list of valid keys for the destinationCoordainteCache. + * These are based on the X & Z of the players initial location. + */ + private final List destinationCoordinateKeys = Lists.newArrayList(); + + public Teleporter(WorldServer worldIn) { + this.worldServerInstance = worldIn; + this.random = new EaglercraftRandom(worldIn.getSeed()); + } + + public void placeInPortal(Entity entityIn, float rotationYaw) { + if (this.worldServerInstance.provider.getDimensionId() != 1) { + if (!this.placeInExistingPortal(entityIn, rotationYaw)) { + this.makePortal(entityIn); + this.placeInExistingPortal(entityIn, rotationYaw); + } + } else { + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posY) - 1; + int k = MathHelper.floor_double(entityIn.posZ); + byte b0 = 1; + byte b1 = 0; + + for (int l = -2; l <= 2; ++l) { + for (int i1 = -2; i1 <= 2; ++i1) { + for (int j1 = -1; j1 < 3; ++j1) { + int k1 = i + i1 * b0 + l * b1; + int l1 = j + j1; + int i2 = k + i1 * b1 - l * b0; + boolean flag = j1 < 0; + this.worldServerInstance.setBlockState(new BlockPos(k1, l1, i2), + flag ? Blocks.obsidian.getDefaultState() : Blocks.air.getDefaultState()); + } + } + } + + entityIn.setLocationAndAngles((double) i, (double) j, (double) k, entityIn.rotationYaw, 0.0F); + entityIn.motionX = entityIn.motionY = entityIn.motionZ = 0.0D; + } + } + + public boolean placeInExistingPortal(Entity entityIn, float rotationYaw) { + boolean flag = true; + double d0 = -1.0D; + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posZ); + boolean flag1 = true; + Object object = BlockPos.ORIGIN; + long k = ChunkCoordIntPair.chunkXZ2Int(i, j); + if (this.destinationCoordinateCache.containsItem(k)) { + Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache + .getValueByKey(k); + d0 = 0.0D; + object = teleporter$portalposition; + teleporter$portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime(); + flag1 = false; + } else { + BlockPos blockpos2 = new BlockPos(entityIn); + + for (int l = -128; l <= 128; ++l) { + BlockPos blockpos1; + for (int i1 = -128; i1 <= 128; ++i1) { + for (BlockPos blockpos = blockpos2.add(l, + this.worldServerInstance.getActualHeight() - 1 - blockpos2.getY(), i1); blockpos + .getY() >= 0; blockpos = blockpos1) { + blockpos1 = blockpos.down(); + if (this.worldServerInstance.getBlockState(blockpos).getBlock() == Blocks.portal) { + while (this.worldServerInstance.getBlockState(blockpos1 = blockpos.down()) + .getBlock() == Blocks.portal) { + blockpos = blockpos1; + } + + double d1 = blockpos.distanceSq(blockpos2); + if (d0 < 0.0D || d1 < d0) { + d0 = d1; + object = blockpos; + } + } + } + } + } + } + + if (d0 >= 0.0D) { + if (flag1) { + this.destinationCoordinateCache.add(k, + new Teleporter.PortalPosition((BlockPos) object, this.worldServerInstance.getTotalWorldTime())); + this.destinationCoordinateKeys.add(Long.valueOf(k)); + } + + double d5 = (double) ((BlockPos) object).getX() + 0.5D; + double d6 = (double) ((BlockPos) object).getY() + 0.5D; + double d7 = (double) ((BlockPos) object).getZ() + 0.5D; + BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.portal + .func_181089_f(this.worldServerInstance, (BlockPos) object); + boolean flag2 = blockpattern$patternhelper.getFinger().rotateY() + .getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE; + double d2 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X + ? (double) blockpattern$patternhelper.func_181117_a().getZ() + : (double) blockpattern$patternhelper.func_181117_a().getX(); + d6 = (double) (blockpattern$patternhelper.func_181117_a().getY() + 1) + - entityIn.func_181014_aG().yCoord * (double) blockpattern$patternhelper.func_181119_e(); + if (flag2) { + ++d2; + } + + if (blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X) { + d7 = d2 + (1.0D - entityIn.func_181014_aG().xCoord) + * (double) blockpattern$patternhelper.func_181118_d() + * (double) blockpattern$patternhelper.getFinger().rotateY().getAxisDirection().getOffset(); + } else { + d5 = d2 + (1.0D - entityIn.func_181014_aG().xCoord) + * (double) blockpattern$patternhelper.func_181118_d() + * (double) blockpattern$patternhelper.getFinger().rotateY().getAxisDirection().getOffset(); + } + + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + float f3 = 0.0F; + if (blockpattern$patternhelper.getFinger().getOpposite() == entityIn.func_181012_aH()) { + f = 1.0F; + f1 = 1.0F; + } else if (blockpattern$patternhelper.getFinger().getOpposite() == entityIn.func_181012_aH() + .getOpposite()) { + f = -1.0F; + f1 = -1.0F; + } else if (blockpattern$patternhelper.getFinger().getOpposite() == entityIn.func_181012_aH().rotateY()) { + f2 = 1.0F; + f3 = -1.0F; + } else { + f2 = -1.0F; + f3 = 1.0F; + } + + double d3 = entityIn.motionX; + double d4 = entityIn.motionZ; + entityIn.motionX = d3 * (double) f + d4 * (double) f3; + entityIn.motionZ = d3 * (double) f2 + d4 * (double) f1; + entityIn.rotationYaw = rotationYaw + - (float) (entityIn.func_181012_aH().getOpposite().getHorizontalIndex() * 90) + + (float) (blockpattern$patternhelper.getFinger().getHorizontalIndex() * 90); + entityIn.setLocationAndAngles(d5, d6, d7, entityIn.rotationYaw, entityIn.rotationPitch); + return true; + } else { + return false; + } + } + + public boolean makePortal(Entity parEntity) { + byte b0 = 16; + double d0 = -1.0D; + int i = MathHelper.floor_double(parEntity.posX); + int j = MathHelper.floor_double(parEntity.posY); + int k = MathHelper.floor_double(parEntity.posZ); + int l = i; + int i1 = j; + int j1 = k; + int k1 = 0; + int l1 = this.random.nextInt(4); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i2 = i - b0; i2 <= i + b0; ++i2) { + double d1 = (double) i2 + 0.5D - parEntity.posX; + + for (int k2 = k - b0; k2 <= k + b0; ++k2) { + double d2 = (double) k2 + 0.5D - parEntity.posZ; + + label142: for (int i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) { + if (this.worldServerInstance.isAirBlock(blockpos$mutableblockpos.func_181079_c(i2, i3, k2))) { + while (i3 > 0 && this.worldServerInstance + .isAirBlock(blockpos$mutableblockpos.func_181079_c(i2, i3 - 1, k2))) { + --i3; + } + + for (int j3 = l1; j3 < l1 + 4; ++j3) { + int k3 = j3 % 2; + int l3 = 1 - k3; + if (j3 % 4 >= 2) { + k3 = -k3; + l3 = -l3; + } + + for (int i4 = 0; i4 < 3; ++i4) { + for (int j4 = 0; j4 < 4; ++j4) { + for (int k4 = -1; k4 < 4; ++k4) { + int l4 = i2 + (j4 - 1) * k3 + i4 * l3; + int i5 = i3 + k4; + int j5 = k2 + (j4 - 1) * l3 - i4 * k3; + blockpos$mutableblockpos.func_181079_c(l4, i5, j5); + if (k4 < 0 + && !this.worldServerInstance.getBlockState(blockpos$mutableblockpos) + .getBlock().getMaterial().isSolid() + || k4 >= 0 && !this.worldServerInstance + .isAirBlock(blockpos$mutableblockpos)) { + continue label142; + } + } + } + } + + double d5 = (double) i3 + 0.5D - parEntity.posY; + double d7 = d1 * d1 + d5 * d5 + d2 * d2; + if (d0 < 0.0D || d7 < d0) { + d0 = d7; + l = i2; + i1 = i3; + j1 = k2; + k1 = j3 % 4; + } + } + } + } + } + } + + if (d0 < 0.0D) { + for (int k5 = i - b0; k5 <= i + b0; ++k5) { + double d3 = (double) k5 + 0.5D - parEntity.posX; + + for (int i6 = k - b0; i6 <= k + b0; ++i6) { + double d4 = (double) i6 + 0.5D - parEntity.posZ; + + label562: for (int l6 = this.worldServerInstance.getActualHeight() - 1; l6 >= 0; --l6) { + if (this.worldServerInstance.isAirBlock(blockpos$mutableblockpos.func_181079_c(k5, l6, i6))) { + while (l6 > 0 && this.worldServerInstance + .isAirBlock(blockpos$mutableblockpos.func_181079_c(k5, l6 - 1, i6))) { + --l6; + } + + for (int j7 = l1; j7 < l1 + 2; ++j7) { + int i8 = j7 % 2; + int i9 = 1 - i8; + + for (int i10 = 0; i10 < 4; ++i10) { + for (int i11 = -1; i11 < 4; ++i11) { + int i12 = k5 + (i10 - 1) * i8; + int l12 = l6 + i11; + int i13 = i6 + (i10 - 1) * i9; + blockpos$mutableblockpos.func_181079_c(i12, l12, i13); + if (i11 < 0 + && !this.worldServerInstance.getBlockState(blockpos$mutableblockpos) + .getBlock().getMaterial().isSolid() + || i11 >= 0 && !this.worldServerInstance + .isAirBlock(blockpos$mutableblockpos)) { + continue label562; + } + } + } + + double d6 = (double) l6 + 0.5D - parEntity.posY; + double d8 = d3 * d3 + d6 * d6 + d4 * d4; + if (d0 < 0.0D || d8 < d0) { + d0 = d8; + l = k5; + i1 = l6; + j1 = i6; + k1 = j7 % 2; + } + } + } + } + } + } + } + + int l5 = l; + int j2 = i1; + int j6 = j1; + int k6 = k1 % 2; + int l2 = 1 - k6; + if (k1 % 4 >= 2) { + k6 = -k6; + l2 = -l2; + } + + if (d0 < 0.0D) { + i1 = MathHelper.clamp_int(i1, 70, this.worldServerInstance.getActualHeight() - 10); + j2 = i1; + + for (int i7 = -1; i7 <= 1; ++i7) { + for (int k7 = 1; k7 < 3; ++k7) { + for (int j8 = -1; j8 < 3; ++j8) { + int j9 = l5 + (k7 - 1) * k6 + i7 * l2; + int j10 = j2 + j8; + int j11 = j6 + (k7 - 1) * l2 - i7 * k6; + boolean flag = j8 < 0; + this.worldServerInstance.setBlockState(new BlockPos(j9, j10, j11), + flag ? Blocks.obsidian.getDefaultState() : Blocks.air.getDefaultState()); + } + } + } + } + + IBlockState iblockstate = Blocks.portal.getDefaultState().withProperty(BlockPortal.AXIS, + k6 != 0 ? EnumFacing.Axis.X : EnumFacing.Axis.Z); + + for (int l7 = 0; l7 < 4; ++l7) { + for (int k8 = 0; k8 < 4; ++k8) { + for (int k9 = -1; k9 < 4; ++k9) { + int k10 = l5 + (k8 - 1) * k6; + int k11 = j2 + k9; + int j12 = j6 + (k8 - 1) * l2; + boolean flag1 = k8 == 0 || k8 == 3 || k9 == -1 || k9 == 3; + this.worldServerInstance.setBlockState(new BlockPos(k10, k11, j12), + flag1 ? Blocks.obsidian.getDefaultState() : iblockstate, 2); + } + } + + for (int l8 = 0; l8 < 4; ++l8) { + for (int l9 = -1; l9 < 4; ++l9) { + int l10 = l5 + (l8 - 1) * k6; + int l11 = j2 + l9; + int k12 = j6 + (l8 - 1) * l2; + BlockPos blockpos = new BlockPos(l10, l11, k12); + this.worldServerInstance.notifyNeighborsOfStateChange(blockpos, + this.worldServerInstance.getBlockState(blockpos).getBlock()); + } + } + } + + return true; + } + + /**+ + * called periodically to remove out-of-date portal locations + * from the cache list. Argument par1 is a + * WorldServer.getTotalWorldTime() value. + */ + public void removeStalePortalLocations(long worldTime) { + if (worldTime % 100L == 0L) { + Iterator iterator = this.destinationCoordinateKeys.iterator(); + long i = worldTime - 300L; + + while (iterator.hasNext()) { + Long olong = (Long) iterator.next(); + Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache + .getValueByKey(olong.longValue()); + if (teleporter$portalposition == null || teleporter$portalposition.lastUpdateTime < i) { + iterator.remove(); + this.destinationCoordinateCache.remove(olong.longValue()); + } + } + } + + } + + public class PortalPosition extends BlockPos { + public long lastUpdateTime; + + public PortalPosition(BlockPos pos, long lastUpdate) { + super(pos.getX(), pos.getY(), pos.getZ()); + this.lastUpdateTime = lastUpdate; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/World.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/World.java new file mode 100644 index 0000000..5647ab8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/World.java @@ -0,0 +1,3225 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import com.google.common.base.Predicate; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.HString; + +import java.util.concurrent.Callable; + +import net.lax1dude.eaglercraft.v1_8.sp.server.CrashReportHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHopper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLiquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStairs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.profiler.Profiler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.Scoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EntitySelectors; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IntHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MovingObjectPosition; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageCollection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.DifficultyInstance; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.GameRules; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IWorldAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.NextTickListEntry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +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.gen.structure.StructureBoundingBox; +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.MapStorage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class World implements IBlockAccess { + + static { + __checkIntegratedContextValid("net/minecraft/world/World"); + } + + private int field_181546_a = 63; + protected boolean scheduledUpdatesAreImmediate; + /**+ + * A list of all Entities in all currently-loaded chunks + */ + public final List loadedEntityList = Lists.newArrayList(); + protected final List unloadedEntityList = Lists.newArrayList(); + /**+ + * A list of the loaded tile entities in the world + */ + public final List loadedTileEntityList = Lists.newArrayList(); + public final List tickableTileEntities = Lists.newArrayList(); + private final List addedTileEntityList = Lists.newArrayList(); + private final List tileEntitiesToBeRemoved = Lists.newArrayList(); + /**+ + * Array list of players in the world. + */ + public final List playerEntities = Lists.newArrayList(); + /**+ + * a list of all the lightning entities + */ + public final List weatherEffects = Lists.newArrayList(); + protected final IntHashMap entitiesById = new IntHashMap(); + private long cloudColour = 16777215L; + private int skylightSubtracted; + /**+ + * Contains the current Linear Congruential Generator seed for + * block updates. Used with an A value of 3 and a C value of + * 0x3c6ef35f, producing a highly planar series of values + * ill-suited for choosing random blocks in a 16x128x16 field. + */ + protected int updateLCG = (new EaglercraftRandom()).nextInt(); + /**+ + * magic number used to generate fast random numbers for 3d + * distribution within a chunk + */ + protected final int DIST_HASH_MAGIC = 1013904223; + protected float prevRainingStrength; + protected float rainingStrength; + protected float prevThunderingStrength; + protected float thunderingStrength; + private int lastLightningBolt; + /**+ + * RNG for World. + */ + public final EaglercraftRandom rand = new EaglercraftRandom(); + public final WorldProvider provider; + protected List worldAccesses = Lists.newArrayList(); + protected IChunkProvider chunkProvider; + protected final ISaveHandler saveHandler; + protected WorldInfo worldInfo; + protected boolean findingSpawnPoint; + protected MapStorage mapStorage; + protected VillageCollection villageCollectionObj; + public final Profiler theProfiler; + private final Calendar theCalendar = EagRuntime.getLocaleCalendar(); + protected Scoreboard worldScoreboard = new Scoreboard(); + /**+ + * populated by chunks that are within 9 chunks of any player + */ + protected Set activeChunkSet = Sets.newHashSet(); + private int ambientTickCountdown; + protected boolean spawnHostileMobs; + protected boolean spawnPeacefulMobs; + private boolean processingLoadedTiles; + private final WorldBorder worldBorder; + int[] lightUpdateBlockList; + + protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, + boolean client) { + if (client) + throw new IllegalArgumentException("Cannot construct client instance!"); + this.ambientTickCountdown = this.rand.nextInt(12000); + this.spawnHostileMobs = true; + this.spawnPeacefulMobs = true; + this.lightUpdateBlockList = new int['\u8000']; + this.saveHandler = saveHandlerIn; + this.theProfiler = profilerIn; + this.worldInfo = info; + this.provider = providerIn; + this.worldBorder = providerIn.getWorldBorder(); + } + + public World init() { + return this; + } + + public BiomeGenBase getBiomeGenForCoords(final BlockPos pos) { + if (this.isBlockLoaded(pos)) { + Chunk chunk = this.getChunkFromBlockCoords(pos); + + try { + return chunk.getBiome(pos, this.provider.getWorldChunkManager()); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() { + public String call() throws Exception { + return CrashReportCategory + .getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ())); + } + }); + throw new ReportedException(crashreport); + } + } else { + return this.provider.getWorldChunkManager().getBiomeGenerator(pos, BiomeGenBase.plains); + } + } + + public WorldChunkManager getWorldChunkManager() { + return this.provider.getWorldChunkManager(); + } + + protected abstract IChunkProvider createChunkProvider(); + + public void initialize(WorldSettings settings) { + this.worldInfo.setServerInitialized(true); + } + + /**+ + * Sets a new spawn location by finding an uncovered block at a + * random (x,z) location in the chunk. + */ + public void setInitialSpawnLocation() { + this.setSpawnPoint(new BlockPos(8, 64, 8)); + } + + public Block getGroundAboveSeaLevel(BlockPos pos) { + BlockPos blockpos; + for (blockpos = new BlockPos(pos.getX(), this.func_181545_F(), pos.getZ()); !this + .isAirBlock(blockpos.up()); blockpos = blockpos.up()) { + ; + } + + return this.getBlockState(blockpos).getBlock(); + } + + /**+ + * Check if the given BlockPos has valid coordinates + */ + private boolean isValid(BlockPos pos) { + return pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000 + && pos.getY() >= 0 && pos.getY() < 256; + } + + /**+ + * Checks to see if an air block exists at the provided + * location. Note that this only checks to see if the blocks + * material is set to air, meaning it is possible for + * non-vanilla blocks to still pass this check. + */ + public boolean isAirBlock(BlockPos pos) { + return this.getBlockState(pos).getBlock().getMaterial() == Material.air; + } + + public boolean isBlockLoaded(BlockPos pos) { + return this.isBlockLoaded(pos, true); + } + + public boolean isBlockLoaded(BlockPos pos, boolean allowEmpty) { + return !this.isValid(pos) ? false : this.isChunkLoaded(pos.getX() >> 4, pos.getZ() >> 4, allowEmpty); + } + + public boolean isAreaLoaded(BlockPos center, int radius) { + return this.isAreaLoaded(center, radius, true); + } + + public boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty) { + return this.isAreaLoaded(center.getX() - radius, center.getY() - radius, center.getZ() - radius, + center.getX() + radius, center.getY() + radius, center.getZ() + radius, allowEmpty); + } + + public boolean isAreaLoaded(BlockPos from, BlockPos to) { + return this.isAreaLoaded(from, to, true); + } + + public boolean isAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty) { + return this.isAreaLoaded(from.getX(), from.getY(), from.getZ(), to.getX(), to.getY(), to.getZ(), allowEmpty); + } + + public boolean isAreaLoaded(StructureBoundingBox box) { + return this.isAreaLoaded(box, true); + } + + public boolean isAreaLoaded(StructureBoundingBox box, boolean allowEmpty) { + return this.isAreaLoaded(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, allowEmpty); + } + + private boolean isAreaLoaded(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty) { + if (yEnd >= 0 && yStart < 256) { + xStart = xStart >> 4; + zStart = zStart >> 4; + xEnd = xEnd >> 4; + zEnd = zEnd >> 4; + + for (int i = xStart; i <= xEnd; ++i) { + for (int j = zStart; j <= zEnd; ++j) { + if (!this.isChunkLoaded(i, j, allowEmpty)) { + return false; + } + } + } + + return true; + } else { + return false; + } + } + + protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) { + return this.chunkProvider.chunkExists(x, z) && (allowEmpty || !this.chunkProvider.provideChunk(x, z).isEmpty()); + } + + public Chunk getChunkFromBlockCoords(BlockPos pos) { + return this.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4); + } + + /**+ + * Returns back a chunk looked up by chunk coordinates Args: x, + * y + */ + public Chunk getChunkFromChunkCoords(int chunkX, int chunkZ) { + return this.chunkProvider.provideChunk(chunkX, chunkZ); + } + + /**+ + * Convenience method to update the block on both the client and + * server + */ + public boolean setBlockState(BlockPos pos, IBlockState newState, int flags) { + if (!this.isValid(pos)) { + return false; + } else if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) { + return false; + } else { + Chunk chunk = this.getChunkFromBlockCoords(pos); + Block block = newState.getBlock(); + IBlockState iblockstate = chunk.setBlockState(pos, newState); + if (iblockstate == null) { + return false; + } else { + Block block1 = iblockstate.getBlock(); + if (block.getLightOpacity() != block1.getLightOpacity() + || block.getLightValue() != block1.getLightValue()) { + this.theProfiler.startSection("checkLight"); + this.checkLight(pos); + this.theProfiler.endSection(); + } + + if ((flags & 2) != 0) { + this.markBlockForUpdate(pos); + } + + if ((flags & 1) != 0) { + this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock()); + if (block.hasComparatorInputOverride()) { + this.updateComparatorOutputLevel(pos, block); + } + } + + return true; + } + } + } + + public boolean setBlockToAir(BlockPos pos) { + return this.setBlockState(pos, Blocks.air.getDefaultState(), 3); + } + + /**+ + * Sets a block to air, but also plays the sound and particles + * and can spawn drops + */ + public boolean destroyBlock(BlockPos pos, boolean dropBlock) { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); + if (block.getMaterial() == Material.air) { + return false; + } else { + this.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); + if (dropBlock) { + block.dropBlockAsItem(this, pos, iblockstate, 0); + } + + return this.setBlockState(pos, Blocks.air.getDefaultState(), 3); + } + } + + /**+ + * Convenience method to update the block on both the client and + * server + */ + public boolean setBlockState(BlockPos pos, IBlockState state) { + return this.setBlockState(pos, state, 3); + } + + public void markBlockForUpdate(BlockPos pos) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).markBlockForUpdate(pos); + } + + } + + public void notifyNeighborsRespectDebug(BlockPos pos, Block blockType) { + if (this.worldInfo.getTerrainType() != WorldType.DEBUG_WORLD) { + this.notifyNeighborsOfStateChange(pos, blockType); + } + + } + + /**+ + * marks a vertical line of blocks as dirty + */ + public void markBlocksDirtyVertical(int x1, int z1, int x2, int z2) { + if (x2 > z2) { + int i = z2; + z2 = x2; + x2 = i; + } + + if (!this.provider.getHasNoSky()) { + for (int j = x2; j <= z2; ++j) { + this.checkLightFor(EnumSkyBlock.SKY, new BlockPos(x1, j, z1)); + } + } + + this.markBlockRangeForRenderUpdate(x1, x2, z1, x1, z2, z1); + } + + public void markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax) { + this.markBlockRangeForRenderUpdate(rangeMin.getX(), rangeMin.getY(), rangeMin.getZ(), rangeMax.getX(), + rangeMax.getY(), rangeMax.getZ()); + } + + public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).markBlockRangeForRenderUpdate(x1, y1, z1, x2, y2, z2); + } + + } + + public void notifyNeighborsOfStateChange(BlockPos pos, Block blockType) { + this.notifyBlockOfStateChange(pos.west(), blockType); + this.notifyBlockOfStateChange(pos.east(), blockType); + this.notifyBlockOfStateChange(pos.down(), blockType); + this.notifyBlockOfStateChange(pos.up(), blockType); + this.notifyBlockOfStateChange(pos.north(), blockType); + this.notifyBlockOfStateChange(pos.south(), blockType); + } + + public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide) { + if (skipSide != EnumFacing.WEST) { + this.notifyBlockOfStateChange(pos.west(), blockType); + } + + if (skipSide != EnumFacing.EAST) { + this.notifyBlockOfStateChange(pos.east(), blockType); + } + + if (skipSide != EnumFacing.DOWN) { + this.notifyBlockOfStateChange(pos.down(), blockType); + } + + if (skipSide != EnumFacing.UP) { + this.notifyBlockOfStateChange(pos.up(), blockType); + } + + if (skipSide != EnumFacing.NORTH) { + this.notifyBlockOfStateChange(pos.north(), blockType); + } + + if (skipSide != EnumFacing.SOUTH) { + this.notifyBlockOfStateChange(pos.south(), blockType); + } + + } + + public void notifyBlockOfStateChange(BlockPos pos, final Block blockIn) { + { + IBlockState iblockstate = this.getBlockState(pos); + + try { + iblockstate.getBlock().onNeighborBlockChange(this, pos, iblockstate, blockIn); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while updating neighbours"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being updated"); + crashreportcategory.addCrashSectionCallable("Source block type", new Callable() { + public String call() throws Exception { + try { + return HString.format("ID #%d (%s // %s)", + new Object[] { Integer.valueOf(Block.getIdFromBlock(blockIn)), + blockIn.getUnlocalizedName(), blockIn.getClass().getCanonicalName() }); + } catch (Throwable var2) { + return "ID #" + Block.getIdFromBlock(blockIn); + } + } + }); + CrashReportHelper.addIntegratedServerBlockInfo(crashreportcategory, pos, iblockstate); + throw new ReportedException(crashreport); + } + } + } + + public boolean isBlockTickPending(BlockPos pos, Block blockType) { + return false; + } + + public boolean canSeeSky(BlockPos pos) { + return this.getChunkFromBlockCoords(pos).canSeeSky(pos); + } + + public boolean canBlockSeeSky(BlockPos pos) { + if (pos.getY() >= this.func_181545_F()) { + return this.canSeeSky(pos); + } else { + BlockPos blockpos = new BlockPos(pos.getX(), this.func_181545_F(), pos.getZ()); + if (!this.canSeeSky(blockpos)) { + return false; + } else { + for (blockpos = blockpos.down(); blockpos.getY() > pos.getY(); blockpos = blockpos.down()) { + Block block = this.getBlockState(blockpos).getBlock(); + if (block.getLightOpacity() > 0 && !block.getMaterial().isLiquid()) { + return false; + } + } + + return true; + } + } + } + + public int getLight(BlockPos pos) { + if (pos.getY() < 0) { + return 0; + } else { + if (pos.getY() >= 256) { + pos = new BlockPos(pos.getX(), 255, pos.getZ()); + } + + return this.getChunkFromBlockCoords(pos).getLightSubtracted(pos, 0); + } + } + + public int getLightFromNeighbors(BlockPos pos) { + return this.getLight(pos, true); + } + + public int getLight(BlockPos pos, boolean checkNeighbors) { + if (pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000) { + if (checkNeighbors && this.getBlockState(pos).getBlock().getUseNeighborBrightness()) { + int i1 = this.getLight(pos.up(), false); + int i = this.getLight(pos.east(), false); + int j = this.getLight(pos.west(), false); + int k = this.getLight(pos.south(), false); + int l = this.getLight(pos.north(), false); + if (i > i1) { + i1 = i; + } + + if (j > i1) { + i1 = j; + } + + if (k > i1) { + i1 = k; + } + + if (l > i1) { + i1 = l; + } + + return i1; + } else if (pos.getY() < 0) { + return 0; + } else { + if (pos.getY() >= 256) { + pos = new BlockPos(pos.getX(), 255, pos.getZ()); + } + + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getLightSubtracted(pos, this.skylightSubtracted); + } + } else { + return 15; + } + } + + /**+ + * Returns maximum world height. + */ + public BlockPos getHeight(BlockPos pos) { + int i; + if (pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000) { + if (this.isChunkLoaded(pos.getX() >> 4, pos.getZ() >> 4, true)) { + i = this.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4).getHeightValue(pos.getX() & 15, + pos.getZ() & 15); + } else { + i = 0; + } + } else { + i = this.func_181545_F() + 1; + } + + return new BlockPos(pos.getX(), i, pos.getZ()); + } + + /**+ + * Gets the lowest height of the chunk where sunlight directly + * reaches + */ + public int getChunksLowestHorizon(int x, int z) { + if (x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000) { + if (!this.isChunkLoaded(x >> 4, z >> 4, true)) { + return 0; + } else { + Chunk chunk = this.getChunkFromChunkCoords(x >> 4, z >> 4); + return chunk.getLowestHeight(); + } + } else { + return this.func_181545_F() + 1; + } + } + + public int getLightFromNeighborsFor(EnumSkyBlock type, BlockPos pos) { + if (this.provider.getHasNoSky() && type == EnumSkyBlock.SKY) { + return 0; + } else { + if (pos.getY() < 0) { + pos = new BlockPos(pos.getX(), 0, pos.getZ()); + } + + if (!this.isValid(pos)) { + return type.defaultLightValue; + } else if (!this.isBlockLoaded(pos)) { + return type.defaultLightValue; + } else if (this.getBlockState(pos).getBlock().getUseNeighborBrightness()) { + int i1 = this.getLightFor(type, pos.up()); + int i = this.getLightFor(type, pos.east()); + int j = this.getLightFor(type, pos.west()); + int k = this.getLightFor(type, pos.south()); + int l = this.getLightFor(type, pos.north()); + if (i > i1) { + i1 = i; + } + + if (j > i1) { + i1 = j; + } + + if (k > i1) { + i1 = k; + } + + if (l > i1) { + i1 = l; + } + + return i1; + } else { + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getLightFor(type, pos); + } + } + } + + public int getLightFor(EnumSkyBlock type, BlockPos pos) { + if (pos.getY() < 0) { + pos = new BlockPos(pos.getX(), 0, pos.getZ()); + } + + if (!this.isValid(pos)) { + return type.defaultLightValue; + } else if (!this.isBlockLoaded(pos)) { + return type.defaultLightValue; + } else { + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getLightFor(type, pos); + } + } + + public void setLightFor(EnumSkyBlock type, BlockPos pos, int lightValue) { + if (this.isValid(pos)) { + if (this.isBlockLoaded(pos)) { + Chunk chunk = this.getChunkFromBlockCoords(pos); + chunk.setLightFor(type, pos, lightValue); + this.notifyLightSet(pos); + } + } + } + + public void notifyLightSet(BlockPos pos) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).notifyLightSet(pos); + } + + } + + public int getCombinedLight(BlockPos pos, int lightValue) { + int i = this.getLightFromNeighborsFor(EnumSkyBlock.SKY, pos); + int j = this.getLightFromNeighborsFor(EnumSkyBlock.BLOCK, pos); + if (j < lightValue) { + j = lightValue; + } + + return i << 20 | j << 4; + } + + public float getLightBrightness(BlockPos pos) { + return this.provider.getLightBrightnessTable()[this.getLightFromNeighbors(pos)]; + } + + public IBlockState getBlockState(BlockPos pos) { + if (!this.isValid(pos)) { + return Blocks.air.getDefaultState(); + } else { + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getBlockState(pos); + } + } + + /**+ + * Checks whether its daytime by seeing if the light subtracted + * from the skylight is less than 4 + */ + public boolean isDaytime() { + return this.skylightSubtracted < 4; + } + + /**+ + * ray traces all blocks, including non-collideable ones + */ + public MovingObjectPosition rayTraceBlocks(Vec3 parVec3_1, Vec3 parVec3_2) { + return this.rayTraceBlocks(parVec3_1, parVec3_2, false, false, false); + } + + /**+ + * ray traces all blocks, including non-collideable ones + */ + public MovingObjectPosition rayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid) { + return this.rayTraceBlocks(start, end, stopOnLiquid, false, false); + } + + /**+ + * ray traces all blocks, including non-collideable ones + */ + public MovingObjectPosition rayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, + boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) { + if (!Double.isNaN(vec31.xCoord) && !Double.isNaN(vec31.yCoord) && !Double.isNaN(vec31.zCoord)) { + if (!Double.isNaN(vec32.xCoord) && !Double.isNaN(vec32.yCoord) && !Double.isNaN(vec32.zCoord)) { + int i = MathHelper.floor_double(vec32.xCoord); + int j = MathHelper.floor_double(vec32.yCoord); + int k = MathHelper.floor_double(vec32.zCoord); + int l = MathHelper.floor_double(vec31.xCoord); + int i1 = MathHelper.floor_double(vec31.yCoord); + int j1 = MathHelper.floor_double(vec31.zCoord); + BlockPos blockpos = new BlockPos(l, i1, j1); + IBlockState iblockstate = this.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + if ((!ignoreBlockWithoutBoundingBox + || block.getCollisionBoundingBox(this, blockpos, iblockstate) != null) + && block.canCollideCheck(iblockstate, stopOnLiquid)) { + MovingObjectPosition movingobjectposition = block.collisionRayTrace(this, blockpos, vec31, vec32); + if (movingobjectposition != null) { + return movingobjectposition; + } + } + + MovingObjectPosition movingobjectposition2 = null; + int k1 = 200; + + while (k1-- >= 0) { + if (Double.isNaN(vec31.xCoord) || Double.isNaN(vec31.yCoord) || Double.isNaN(vec31.zCoord)) { + return null; + } + + if (l == i && i1 == j && j1 == k) { + return returnLastUncollidableBlock ? movingobjectposition2 : null; + } + + boolean flag2 = true; + boolean flag = true; + boolean flag1 = true; + double d0 = 999.0D; + double d1 = 999.0D; + double d2 = 999.0D; + if (i > l) { + d0 = (double) l + 1.0D; + } else if (i < l) { + d0 = (double) l + 0.0D; + } else { + flag2 = false; + } + + if (j > i1) { + d1 = (double) i1 + 1.0D; + } else if (j < i1) { + d1 = (double) i1 + 0.0D; + } else { + flag = false; + } + + if (k > j1) { + d2 = (double) j1 + 1.0D; + } else if (k < j1) { + d2 = (double) j1 + 0.0D; + } else { + flag1 = false; + } + + double d3 = 999.0D; + double d4 = 999.0D; + double d5 = 999.0D; + double d6 = vec32.xCoord - vec31.xCoord; + double d7 = vec32.yCoord - vec31.yCoord; + double d8 = vec32.zCoord - vec31.zCoord; + if (flag2) { + d3 = (d0 - vec31.xCoord) / d6; + } + + if (flag) { + d4 = (d1 - vec31.yCoord) / d7; + } + + if (flag1) { + d5 = (d2 - vec31.zCoord) / d8; + } + + if (d3 == -0.0D) { + d3 = -1.0E-4D; + } + + if (d4 == -0.0D) { + d4 = -1.0E-4D; + } + + if (d5 == -0.0D) { + d5 = -1.0E-4D; + } + + EnumFacing enumfacing; + if (d3 < d4 && d3 < d5) { + enumfacing = i > l ? EnumFacing.WEST : EnumFacing.EAST; + vec31 = new Vec3(d0, vec31.yCoord + d7 * d3, vec31.zCoord + d8 * d3); + } else if (d4 < d5) { + enumfacing = j > i1 ? EnumFacing.DOWN : EnumFacing.UP; + vec31 = new Vec3(vec31.xCoord + d6 * d4, d1, vec31.zCoord + d8 * d4); + } else { + enumfacing = k > j1 ? EnumFacing.NORTH : EnumFacing.SOUTH; + vec31 = new Vec3(vec31.xCoord + d6 * d5, vec31.yCoord + d7 * d5, d2); + } + + l = MathHelper.floor_double(vec31.xCoord) - (enumfacing == EnumFacing.EAST ? 1 : 0); + i1 = MathHelper.floor_double(vec31.yCoord) - (enumfacing == EnumFacing.UP ? 1 : 0); + j1 = MathHelper.floor_double(vec31.zCoord) - (enumfacing == EnumFacing.SOUTH ? 1 : 0); + blockpos = new BlockPos(l, i1, j1); + IBlockState iblockstate1 = this.getBlockState(blockpos); + Block block1 = iblockstate1.getBlock(); + if (!ignoreBlockWithoutBoundingBox + || block1.getCollisionBoundingBox(this, blockpos, iblockstate1) != null) { + if (block1.canCollideCheck(iblockstate1, stopOnLiquid)) { + MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(this, blockpos, vec31, + vec32); + if (movingobjectposition1 != null) { + return movingobjectposition1; + } + } else { + movingobjectposition2 = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, + vec31, enumfacing, blockpos); + } + } + } + + return returnLastUncollidableBlock ? movingobjectposition2 : null; + } else { + return null; + } + } else { + return null; + } + } + + /**+ + * Plays a sound at the entity's position. Args: entity, sound, + * volume (relative to 1.0), and frequency (or pitch, also + * relative to 1.0). + */ + public void playSoundAtEntity(Entity entityIn, String name, float volume, float pitch) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).playSound(name, entityIn.posX, entityIn.posY, entityIn.posZ, + volume, pitch); + } + + } + + /**+ + * Plays sound to all near players except the player reference + * given + */ + public void playSoundToNearExcept(EntityPlayer player, String name, float volume, float pitch) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).playSoundToNearExcept(player, name, player.posX, player.posY, + player.posZ, volume, pitch); + } + + } + + /**+ + * Play a sound effect. Many many parameters for this function. + * Not sure what they do, but a classic call is : (double)i + + * 0.5D, (double)j + 0.5D, (double)k + 0.5D, 'random.door_open', + * 1.0F, world.rand.nextFloat() * 0.1F + 0.9F with i,j,k + * position of the block. + */ + public void playSoundEffect(double x, double y, double z, String soundName, float volume, float pitch) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).playSound(soundName, x, y, z, volume, pitch); + } + + } + + /**+ + * par8 is loudness, all pars passed to + * minecraftInstance.sndManager.playSound + */ + public void playSound(double x, double y, double z, String soundName, float volume, float pitch, + boolean distanceDelay) { + } + + public void playRecord(BlockPos pos, String name) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).playRecord(name, pos); + } + + } + + public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, + double xOffset, double yOffset, double zOffset, int... parArrayOfInt) { + this.spawnParticle(particleType.getParticleID(), particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord, + xOffset, yOffset, zOffset, parArrayOfInt); + } + + public void spawnParticle(EnumParticleTypes particleType, boolean xCoord, double yCoord, double zCoord, + double xOffset, double yOffset, double zOffset, double parDouble6, int... parArrayOfInt) { + this.spawnParticle(particleType.getParticleID(), particleType.getShouldIgnoreRange() | xCoord, yCoord, zCoord, + xOffset, yOffset, zOffset, parDouble6, parArrayOfInt); + } + + private void spawnParticle(int particleID, boolean xCood, double yCoord, double zCoord, double xOffset, + double yOffset, double zOffset, double parDouble6, int... parArrayOfInt) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).spawnParticle(particleID, xCood, yCoord, zCoord, xOffset, + yOffset, zOffset, parDouble6, parArrayOfInt); + } + + } + + /**+ + * adds a lightning bolt to the list of lightning bolts in this + * world. + */ + public boolean addWeatherEffect(Entity entityIn) { + this.weatherEffects.add(entityIn); + return true; + } + + /**+ + * Called when an entity is spawned in the world. This includes + * players. + */ + public boolean spawnEntityInWorld(Entity entityIn) { + int i = MathHelper.floor_double(entityIn.posX / 16.0D); + int j = MathHelper.floor_double(entityIn.posZ / 16.0D); + boolean flag = entityIn.forceSpawn; + if (entityIn instanceof EntityPlayer) { + flag = true; + } + + if (!flag && !this.isChunkLoaded(i, j, true)) { + return false; + } else { + if (entityIn instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) entityIn; + this.playerEntities.add(entityplayer); + this.updateAllPlayersSleepingFlag(); + } + + this.getChunkFromChunkCoords(i, j).addEntity(entityIn); + this.loadedEntityList.add(entityIn); + this.onEntityAdded(entityIn); + return true; + } + } + + protected void onEntityAdded(Entity entityIn) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).onEntityAdded(entityIn); + } + + } + + protected void onEntityRemoved(Entity entityIn) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).onEntityRemoved(entityIn); + } + + } + + /**+ + * Schedule the entity for removal during the next tick. Marks + * the entity dead in anticipation. + */ + public void removeEntity(Entity entityIn) { + if (entityIn.riddenByEntity != null) { + entityIn.riddenByEntity.mountEntity((Entity) null); + } + + if (entityIn.ridingEntity != null) { + entityIn.mountEntity((Entity) null); + } + + entityIn.setDead(); + if (entityIn instanceof EntityPlayer) { + this.playerEntities.remove(entityIn); + this.updateAllPlayersSleepingFlag(); + this.onEntityRemoved(entityIn); + } + + } + + /**+ + * Do NOT use this method to remove normal entities- use normal + * removeEntity + */ + public void removePlayerEntityDangerously(Entity entityIn) { + entityIn.setDead(); + if (entityIn instanceof EntityPlayer) { + this.playerEntities.remove(entityIn); + this.updateAllPlayersSleepingFlag(); + } + + int i = entityIn.chunkCoordX; + int j = entityIn.chunkCoordZ; + if (entityIn.addedToChunk && this.isChunkLoaded(i, j, true)) { + this.getChunkFromChunkCoords(i, j).removeEntity(entityIn); + } + + this.loadedEntityList.remove(entityIn); + this.onEntityRemoved(entityIn); + } + + /**+ + * Adds a IWorldAccess to the list of worldAccesses + */ + public void addWorldAccess(IWorldAccess worldAccess) { + this.worldAccesses.add(worldAccess); + } + + /**+ + * Removes a worldAccess from the worldAccesses object + */ + public void removeWorldAccess(IWorldAccess worldAccess) { + this.worldAccesses.remove(worldAccess); + } + + /**+ + * Returns a list of bounding boxes that collide with aabb + * excluding the passed in entity's collision. Args: entity, + * aabb + */ + public List getCollidingBoundingBoxes(Entity entityIn, AxisAlignedBB bb) { + ArrayList arraylist = Lists.newArrayList(); + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + WorldBorder worldborder = this.getWorldBorder(); + boolean flag = entityIn.isOutsideBorder(); + boolean flag1 = this.isInsideBorder(worldborder, entityIn); + IBlockState iblockstate = Blocks.stone.getDefaultState(); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) { + for (int l1 = i1; l1 < j1; ++l1) { + if (this.isBlockLoaded(blockpos$mutableblockpos.func_181079_c(k1, 64, l1))) { + for (int i2 = k - 1; i2 < l; ++i2) { + blockpos$mutableblockpos.func_181079_c(k1, i2, l1); + if (flag && flag1) { + entityIn.setOutsideBorder(false); + } else if (!flag && !flag1) { + entityIn.setOutsideBorder(true); + } + + IBlockState iblockstate1 = iblockstate; + if (worldborder.contains((BlockPos) blockpos$mutableblockpos) || !flag1) { + iblockstate1 = this.getBlockState(blockpos$mutableblockpos); + } + + iblockstate1.getBlock().addCollisionBoxesToList(this, blockpos$mutableblockpos, iblockstate1, + bb, arraylist, entityIn); + } + } + } + } + + double d0 = 0.25D; + List list = this.getEntitiesWithinAABBExcludingEntity(entityIn, bb.expand(d0, d0, d0)); + + for (int j2 = 0; j2 < list.size(); ++j2) { + if (entityIn.riddenByEntity != list && entityIn.ridingEntity != list) { + AxisAlignedBB axisalignedbb = ((Entity) list.get(j2)).getCollisionBoundingBox(); + if (axisalignedbb != null && axisalignedbb.intersectsWith(bb)) { + arraylist.add(axisalignedbb); + } + + axisalignedbb = entityIn.getCollisionBox((Entity) list.get(j2)); + if (axisalignedbb != null && axisalignedbb.intersectsWith(bb)) { + arraylist.add(axisalignedbb); + } + } + } + + return arraylist; + } + + public boolean isInsideBorder(WorldBorder worldBorderIn, Entity entityIn) { + double d0 = worldBorderIn.minX(); + double d1 = worldBorderIn.minZ(); + double d2 = worldBorderIn.maxX(); + double d3 = worldBorderIn.maxZ(); + if (entityIn.isOutsideBorder()) { + ++d0; + ++d1; + --d2; + --d3; + } else { + --d0; + --d1; + ++d2; + ++d3; + } + + return entityIn.posX > d0 && entityIn.posX < d2 && entityIn.posZ > d1 && entityIn.posZ < d3; + } + + public List func_147461_a(AxisAlignedBB bb) { + ArrayList arraylist = Lists.newArrayList(); + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) { + for (int l1 = i1; l1 < j1; ++l1) { + if (this.isBlockLoaded(blockpos$mutableblockpos.func_181079_c(k1, 64, l1))) { + for (int i2 = k - 1; i2 < l; ++i2) { + blockpos$mutableblockpos.func_181079_c(k1, i2, l1); + IBlockState iblockstate; + if (k1 >= -30000000 && k1 < 30000000 && l1 >= -30000000 && l1 < 30000000) { + iblockstate = this.getBlockState(blockpos$mutableblockpos); + } else { + iblockstate = Blocks.bedrock.getDefaultState(); + } + + iblockstate.getBlock().addCollisionBoxesToList(this, blockpos$mutableblockpos, iblockstate, bb, + arraylist, (Entity) null); + } + } + } + } + + return arraylist; + } + + /**+ + * Returns the amount of skylight subtracted for the current + * time + */ + public int calculateSkylightSubtracted(float parFloat1) { + float f = this.getCelestialAngle(parFloat1); + float f1 = 1.0F - (MathHelper.cos(f * 3.1415927F * 2.0F) * 2.0F + 0.5F); + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f1 = 1.0F - f1; + f1 = (float) ((double) f1 * (1.0D - (double) (this.getRainStrength(parFloat1) * 5.0F) / 16.0D)); + f1 = (float) ((double) f1 * (1.0D - (double) (this.getThunderStrength(parFloat1) * 5.0F) / 16.0D)); + f1 = 1.0F - f1; + return (int) (f1 * 11.0F); + } + + /**+ + * Returns the sun brightness - checks time of day, rain and + * thunder + */ + public float getSunBrightness(float parFloat1) { + float f = this.getCelestialAngle(parFloat1); + float f1 = 1.0F - (MathHelper.cos(f * 3.1415927F * 2.0F) * 2.0F + 0.2F); + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f1 = 1.0F - f1; + f1 = (float) ((double) f1 * (1.0D - (double) (this.getRainStrength(parFloat1) * 5.0F) / 16.0D)); + f1 = (float) ((double) f1 * (1.0D - (double) (this.getThunderStrength(parFloat1) * 5.0F) / 16.0D)); + return f1 * 0.8F + 0.2F; + } + + /**+ + * Calculates the color for the skybox + */ + public Vec3 getSkyColor(Entity entityIn, float partialTicks) { + float f = this.getCelestialAngle(partialTicks); + float f1 = MathHelper.cos(f * 3.1415927F * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posY); + int k = MathHelper.floor_double(entityIn.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(blockpos); + float f2 = biomegenbase.getFloatTemperature(blockpos); + int l = biomegenbase.getSkyColorByTemp(f2); + float f3 = (float) (l >> 16 & 255) / 255.0F; + float f4 = (float) (l >> 8 & 255) / 255.0F; + float f5 = (float) (l & 255) / 255.0F; + f3 = f3 * f1; + f4 = f4 * f1; + f5 = f5 * f1; + float f6 = this.getRainStrength(partialTicks); + if (f6 > 0.0F) { + float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F; + float f8 = 1.0F - f6 * 0.75F; + f3 = f3 * f8 + f7 * (1.0F - f8); + f4 = f4 * f8 + f7 * (1.0F - f8); + f5 = f5 * f8 + f7 * (1.0F - f8); + } + + float f10 = this.getThunderStrength(partialTicks); + if (f10 > 0.0F) { + float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F; + float f9 = 1.0F - f10 * 0.75F; + f3 = f3 * f9 + f11 * (1.0F - f9); + f4 = f4 * f9 + f11 * (1.0F - f9); + f5 = f5 * f9 + f11 * (1.0F - f9); + } + + if (this.lastLightningBolt > 0) { + float f12 = (float) this.lastLightningBolt - partialTicks; + if (f12 > 1.0F) { + f12 = 1.0F; + } + + f12 = f12 * 0.45F; + f3 = f3 * (1.0F - f12) + 0.8F * f12; + f4 = f4 * (1.0F - f12) + 0.8F * f12; + f5 = f5 * (1.0F - f12) + 1.0F * f12; + } + + return new Vec3((double) f3, (double) f4, (double) f5); + } + + /**+ + * calls calculateCelestialAngle + */ + public float getCelestialAngle(float partialTicks) { + return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), partialTicks); + } + + public int getMoonPhase() { + return this.provider.getMoonPhase(this.worldInfo.getWorldTime()); + } + + /**+ + * gets the current fullness of the moon expressed as a float + * between 1.0 and 0.0, in steps of .25 + */ + public float getCurrentMoonPhaseFactor() { + return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; + } + + /**+ + * Return getCelestialAngle()*2*PI + */ + public float getCelestialAngleRadians(float partialTicks) { + float f = this.getCelestialAngle(partialTicks); + return f * 3.1415927F * 2.0F; + } + + public Vec3 getCloudColour(float partialTicks) { + float f = this.getCelestialAngle(partialTicks); + float f1 = MathHelper.cos(f * 3.1415927F * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f2 = (float) (this.cloudColour >> 16 & 255L) / 255.0F; + float f3 = (float) (this.cloudColour >> 8 & 255L) / 255.0F; + float f4 = (float) (this.cloudColour & 255L) / 255.0F; + float f5 = this.getRainStrength(partialTicks); + if (f5 > 0.0F) { + float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F; + float f7 = 1.0F - f5 * 0.95F; + f2 = f2 * f7 + f6 * (1.0F - f7); + f3 = f3 * f7 + f6 * (1.0F - f7); + f4 = f4 * f7 + f6 * (1.0F - f7); + } + + f2 = f2 * (f1 * 0.9F + 0.1F); + f3 = f3 * (f1 * 0.9F + 0.1F); + f4 = f4 * (f1 * 0.85F + 0.15F); + float f9 = this.getThunderStrength(partialTicks); + if (f9 > 0.0F) { + float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F; + float f8 = 1.0F - f9 * 0.95F; + f2 = f2 * f8 + f10 * (1.0F - f8); + f3 = f3 * f8 + f10 * (1.0F - f8); + f4 = f4 * f8 + f10 * (1.0F - f8); + } + + return new Vec3((double) f2, (double) f3, (double) f4); + } + + /**+ + * Returns vector(ish) with R/G/B for fog + */ + public Vec3 getFogColor(float partialTicks) { + float f = this.getCelestialAngle(partialTicks); + return this.provider.getFogColor(f, partialTicks); + } + + public BlockPos getPrecipitationHeight(BlockPos pos) { + return this.getChunkFromBlockCoords(pos).getPrecipitationHeight(pos); + } + + /**+ + * Finds the highest block on the x and z coordinate that is + * solid or liquid, and returns its y coord. + */ + public BlockPos getTopSolidOrLiquidBlock(BlockPos pos) { + Chunk chunk = this.getChunkFromBlockCoords(pos); + + BlockPos blockpos; + BlockPos blockpos1; + for (blockpos = new BlockPos(pos.getX(), chunk.getTopFilledSegment() + 16, pos.getZ()); blockpos + .getY() >= 0; blockpos = blockpos1) { + blockpos1 = blockpos.down(); + Material material = chunk.getBlock(blockpos1).getMaterial(); + if (material.blocksMovement() && material != Material.leaves) { + break; + } + } + + return blockpos; + } + + /**+ + * How bright are stars in the sky + */ + public float getStarBrightness(float partialTicks) { + float f = this.getCelestialAngle(partialTicks); + float f1 = 1.0F - (MathHelper.cos(f * 3.1415927F * 2.0F) * 2.0F + 0.25F); + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + return f1 * f1 * 0.5F; + } + + public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) { + } + + public void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority) { + } + + public void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority) { + } + + /**+ + * Updates (and cleans up) entities and tile entities + */ + public void updateEntities() { + this.theProfiler.startSection("entities"); + this.theProfiler.startSection("global"); + + for (int i = 0; i < this.weatherEffects.size(); ++i) { + Entity entity = (Entity) this.weatherEffects.get(i); + + try { + ++entity.ticksExisted; + entity.onUpdate(); + } catch (Throwable throwable2) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable2, "Ticking entity"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being ticked"); + if (entity == null) { + crashreportcategory.addCrashSection("Entity", "~~NULL~~"); + } else { + entity.addEntityCrashInfo(crashreportcategory); + } + + throw new ReportedException(crashreport); + } + + if (entity.isDead) { + this.weatherEffects.remove(i--); + } + } + + this.theProfiler.endStartSection("remove"); + this.loadedEntityList.removeAll(this.unloadedEntityList); + + for (int k = 0; k < this.unloadedEntityList.size(); ++k) { + Entity entity1 = (Entity) this.unloadedEntityList.get(k); + int j = entity1.chunkCoordX; + int l1 = entity1.chunkCoordZ; + if (entity1.addedToChunk && this.isChunkLoaded(j, l1, true)) { + this.getChunkFromChunkCoords(j, l1).removeEntity(entity1); + } + } + + for (int l = 0; l < this.unloadedEntityList.size(); ++l) { + this.onEntityRemoved((Entity) this.unloadedEntityList.get(l)); + } + + this.unloadedEntityList.clear(); + this.theProfiler.endStartSection("regular"); + + for (int i1 = 0; i1 < this.loadedEntityList.size(); ++i1) { + Entity entity2 = (Entity) this.loadedEntityList.get(i1); + if (entity2.ridingEntity != null) { + if (!entity2.ridingEntity.isDead && entity2.ridingEntity.riddenByEntity == entity2) { + continue; + } + + entity2.ridingEntity.riddenByEntity = null; + entity2.ridingEntity = null; + } + + this.theProfiler.startSection("tick"); + if (!entity2.isDead) { + try { + this.updateEntity(entity2); + } catch (Throwable throwable1) { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable1, "Ticking entity"); + CrashReportCategory crashreportcategory2 = crashreport1.makeCategory("Entity being ticked"); + entity2.addEntityCrashInfo(crashreportcategory2); + throw new ReportedException(crashreport1); + } + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("remove"); + if (entity2.isDead) { + int k1 = entity2.chunkCoordX; + int i2 = entity2.chunkCoordZ; + if (entity2.addedToChunk && this.isChunkLoaded(k1, i2, true)) { + this.getChunkFromChunkCoords(k1, i2).removeEntity(entity2); + } + + this.loadedEntityList.remove(i1--); + this.onEntityRemoved(entity2); + } + + this.theProfiler.endSection(); + } + + this.theProfiler.endStartSection("blockEntities"); + this.processingLoadedTiles = true; + Iterator iterator = this.tickableTileEntities.iterator(); + + while (iterator.hasNext()) { + TileEntity tileentity = (TileEntity) iterator.next(); + if (!tileentity.isInvalid() && tileentity.hasWorldObj()) { + BlockPos blockpos = tileentity.getPos(); + if (this.isBlockLoaded(blockpos) && this.worldBorder.contains(blockpos)) { + try { + ((ITickable) tileentity).update(); + } catch (Throwable throwable) { + CrashReport crashreport2 = CrashReport.makeCrashReport(throwable, "Ticking block entity"); + CrashReportCategory crashreportcategory1 = crashreport2 + .makeCategory("Block entity being ticked"); + tileentity.addInfoToCrashReport(crashreportcategory1); + throw new ReportedException(crashreport2); + } + } + } + + if (tileentity.isInvalid()) { + iterator.remove(); + this.loadedTileEntityList.remove(tileentity); + if (this.isBlockLoaded(tileentity.getPos())) { + this.getChunkFromBlockCoords(tileentity.getPos()).removeTileEntity(tileentity.getPos()); + } + } + } + + this.processingLoadedTiles = false; + if (!this.tileEntitiesToBeRemoved.isEmpty()) { + this.tickableTileEntities.removeAll(this.tileEntitiesToBeRemoved); + this.loadedTileEntityList.removeAll(this.tileEntitiesToBeRemoved); + this.tileEntitiesToBeRemoved.clear(); + } + + this.theProfiler.endStartSection("pendingBlockEntities"); + if (!this.addedTileEntityList.isEmpty()) { + for (int j1 = 0; j1 < this.addedTileEntityList.size(); ++j1) { + TileEntity tileentity1 = (TileEntity) this.addedTileEntityList.get(j1); + if (!tileentity1.isInvalid()) { + if (!this.loadedTileEntityList.contains(tileentity1)) { + this.addTileEntity(tileentity1); + } + + if (this.isBlockLoaded(tileentity1.getPos())) { + this.getChunkFromBlockCoords(tileentity1.getPos()).addTileEntity(tileentity1.getPos(), + tileentity1); + } + + this.markBlockForUpdate(tileentity1.getPos()); + } + } + + this.addedTileEntityList.clear(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public boolean addTileEntity(TileEntity tile) { + boolean flag = this.loadedTileEntityList.add(tile); + if (flag && tile instanceof ITickable) { + this.tickableTileEntities.add(tile); + } + + return flag; + } + + public void addTileEntities(Collection tileEntityCollection) { + if (this.processingLoadedTiles) { + this.addedTileEntityList.addAll(tileEntityCollection); + } else { + for (TileEntity tileentity : tileEntityCollection) { + this.loadedTileEntityList.add(tileentity); + if (tileentity instanceof ITickable) { + this.tickableTileEntities.add(tileentity); + } + } + } + + } + + /**+ + * Will update the entity in the world if the chunk the entity + * is in is currently loaded. Args: entity + */ + public void updateEntity(Entity ent) { + this.updateEntityWithOptionalForce(ent, true); + } + + /**+ + * Will update the entity in the world if the chunk the entity + * is in is currently loaded or its forced to update. Args: + * entity, forceUpdate + */ + public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate) { + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posZ); + byte b0 = 32; + if (!forceUpdate || this.isAreaLoaded(i - b0, 0, j - b0, i + b0, 0, j + b0, true)) { + entityIn.lastTickPosX = entityIn.posX; + entityIn.lastTickPosY = entityIn.posY; + entityIn.lastTickPosZ = entityIn.posZ; + entityIn.prevRotationYaw = entityIn.rotationYaw; + entityIn.prevRotationPitch = entityIn.rotationPitch; + if (forceUpdate && entityIn.addedToChunk) { + ++entityIn.ticksExisted; + if (entityIn.ridingEntity != null) { + entityIn.updateRidden(); + } else { + entityIn.onUpdate(); + } + } + + this.theProfiler.startSection("chunkCheck"); + if (Double.isNaN(entityIn.posX) || Double.isInfinite(entityIn.posX)) { + entityIn.posX = entityIn.lastTickPosX; + } + + if (Double.isNaN(entityIn.posY) || Double.isInfinite(entityIn.posY)) { + entityIn.posY = entityIn.lastTickPosY; + } + + if (Double.isNaN(entityIn.posZ) || Double.isInfinite(entityIn.posZ)) { + entityIn.posZ = entityIn.lastTickPosZ; + } + + if (Double.isNaN((double) entityIn.rotationPitch) || Double.isInfinite((double) entityIn.rotationPitch)) { + entityIn.rotationPitch = entityIn.prevRotationPitch; + } + + if (Double.isNaN((double) entityIn.rotationYaw) || Double.isInfinite((double) entityIn.rotationYaw)) { + entityIn.rotationYaw = entityIn.prevRotationYaw; + } + + int k = MathHelper.floor_double(entityIn.posX / 16.0D); + int l = MathHelper.floor_double(entityIn.posY / 16.0D); + int i1 = MathHelper.floor_double(entityIn.posZ / 16.0D); + if (!entityIn.addedToChunk || entityIn.chunkCoordX != k || entityIn.chunkCoordY != l + || entityIn.chunkCoordZ != i1) { + if (entityIn.addedToChunk && this.isChunkLoaded(entityIn.chunkCoordX, entityIn.chunkCoordZ, true)) { + this.getChunkFromChunkCoords(entityIn.chunkCoordX, entityIn.chunkCoordZ) + .removeEntityAtIndex(entityIn, entityIn.chunkCoordY); + } + + if (this.isChunkLoaded(k, i1, true)) { + entityIn.addedToChunk = true; + this.getChunkFromChunkCoords(k, i1).addEntity(entityIn); + } else { + entityIn.addedToChunk = false; + } + } + + this.theProfiler.endSection(); + if (forceUpdate && entityIn.addedToChunk && entityIn.riddenByEntity != null) { + if (!entityIn.riddenByEntity.isDead && entityIn.riddenByEntity.ridingEntity == entityIn) { + this.updateEntity(entityIn.riddenByEntity); + } else { + entityIn.riddenByEntity.ridingEntity = null; + entityIn.riddenByEntity = null; + } + } + + } + } + + /**+ + * Returns true if there are no solid, live entities in the + * specified AxisAlignedBB, excluding the given entity + */ + public boolean checkNoEntityCollision(AxisAlignedBB bb) { + return this.checkNoEntityCollision(bb, (Entity) null); + } + + /**+ + * Returns true if there are no solid, live entities in the + * specified AxisAlignedBB, excluding the given entity + */ + public boolean checkNoEntityCollision(AxisAlignedBB bb, Entity entityIn) { + List list = this.getEntitiesWithinAABBExcludingEntity((Entity) null, bb); + + for (int i = 0; i < list.size(); ++i) { + Entity entity = (Entity) list.get(i); + if (!entity.isDead && entity.preventEntitySpawning && entity != entityIn + && (entityIn == null || entityIn.ridingEntity != entity && entityIn.riddenByEntity != entity)) { + return false; + } + } + + return true; + } + + /**+ + * Returns true if there are any blocks in the region + * constrained by an AxisAlignedBB + */ + public boolean checkBlockCollision(AxisAlignedBB bb) { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 <= j; ++k1) { + for (int l1 = k; l1 <= l; ++l1) { + for (int i2 = i1; i2 <= j1; ++i2) { + Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); + if (block.getMaterial() != Material.air) { + return true; + } + } + } + } + + return false; + } + + /**+ + * Returns if any of the blocks within the aabb are liquids. + * Args: aabb + */ + public boolean isAnyLiquid(AxisAlignedBB bb) { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 <= j; ++k1) { + for (int l1 = k; l1 <= l; ++l1) { + for (int i2 = i1; i2 <= j1; ++i2) { + Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); + if (block.getMaterial().isLiquid()) { + return true; + } + } + } + } + + return false; + } + + public boolean isFlammableWithin(AxisAlignedBB bb) { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) { + for (int l1 = k; l1 < l; ++l1) { + for (int i2 = i1; i2 < j1; ++i2) { + Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); + if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) { + return true; + } + } + } + } + } + + return false; + } + + /**+ + * handles the acceleration of an object whilst in water. Not + * sure if it is used elsewhere. + */ + public boolean handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn) { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + if (!this.isAreaLoaded(i, k, i1, j, l, j1, true)) { + return false; + } else { + boolean flag = false; + Vec3 vec3 = new Vec3(0.0D, 0.0D, 0.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) { + for (int l1 = k; l1 < l; ++l1) { + for (int i2 = i1; i2 < j1; ++i2) { + blockpos$mutableblockpos.func_181079_c(k1, l1, i2); + IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos); + Block block = iblockstate.getBlock(); + if (block.getMaterial() == materialIn) { + double d0 = (double) ((float) (l1 + 1) - BlockLiquid.getLiquidHeightPercent( + ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue())); + if ((double) l >= d0) { + flag = true; + vec3 = block.modifyAcceleration(this, blockpos$mutableblockpos, entityIn, vec3); + } + } + } + } + } + + if (vec3.lengthVector() > 0.0D && entityIn.isPushedByWater()) { + vec3 = vec3.normalize(); + double d1 = 0.014D; + entityIn.motionX += vec3.xCoord * d1; + entityIn.motionY += vec3.yCoord * d1; + entityIn.motionZ += vec3.zCoord * d1; + } + + return flag; + } + } + + /**+ + * Returns true if the given bounding box contains the given + * material + */ + public boolean isMaterialInBB(AxisAlignedBB bb, Material materialIn) { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) { + for (int l1 = k; l1 < l; ++l1) { + for (int i2 = i1; i2 < j1; ++i2) { + if (this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock() + .getMaterial() == materialIn) { + return true; + } + } + } + } + + return false; + } + + /**+ + * checks if the given AABB is in the material given. Used while + * swimming. + */ + public boolean isAABBInMaterial(AxisAlignedBB bb, Material materialIn) { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) { + for (int l1 = k; l1 < l; ++l1) { + for (int i2 = i1; i2 < j1; ++i2) { + IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)); + Block block = iblockstate.getBlock(); + if (block.getMaterial() == materialIn) { + int j2 = ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue(); + double d0 = (double) (l1 + 1); + if (j2 < 8) { + d0 = (double) (l1 + 1) - (double) j2 / 8.0D; + } + + if (d0 >= bb.minY) { + return true; + } + } + } + } + } + + return false; + } + + /**+ + * Creates an explosion. Args: entity, x, y, z, strength + */ + public Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking) { + return this.newExplosion(entityIn, x, y, z, strength, false, isSmoking); + } + + /**+ + * returns a new explosion. Does initiation (at time of writing + * Explosion is not finished) + */ + public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, + boolean isSmoking) { + Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking); + explosion.doExplosionA(); + explosion.doExplosionB(true); + return explosion; + } + + /**+ + * Gets the percentage of real blocks within within a bounding + * box, along a specified vector. + */ + public float getBlockDensity(Vec3 vec, AxisAlignedBB bb) { + double d0 = 1.0D / ((bb.maxX - bb.minX) * 2.0D + 1.0D); + double d1 = 1.0D / ((bb.maxY - bb.minY) * 2.0D + 1.0D); + double d2 = 1.0D / ((bb.maxZ - bb.minZ) * 2.0D + 1.0D); + double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D; + double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D; + if (d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) { + int i = 0; + int j = 0; + + for (float f = 0.0F; f <= 1.0F; f = (float) ((double) f + d0)) { + for (float f1 = 0.0F; f1 <= 1.0F; f1 = (float) ((double) f1 + d1)) { + for (float f2 = 0.0F; f2 <= 1.0F; f2 = (float) ((double) f2 + d2)) { + double d5 = bb.minX + (bb.maxX - bb.minX) * (double) f; + double d6 = bb.minY + (bb.maxY - bb.minY) * (double) f1; + double d7 = bb.minZ + (bb.maxZ - bb.minZ) * (double) f2; + if (this.rayTraceBlocks(new Vec3(d5 + d3, d6, d7 + d4), vec) == null) { + ++i; + } + + ++j; + } + } + } + + return (float) i / (float) j; + } else { + return 0.0F; + } + } + + /**+ + * Attempts to extinguish a fire + */ + public boolean extinguishFire(EntityPlayer player, BlockPos pos, EnumFacing side) { + pos = pos.offset(side); + if (this.getBlockState(pos).getBlock() == Blocks.fire) { + this.playAuxSFXAtEntity(player, 1004, pos, 0); + this.setBlockToAir(pos); + return true; + } else { + return false; + } + } + + /**+ + * This string is 'All: (number of loaded entities)' Viewable by + * press ing F3 + */ + public String getDebugLoadedEntities() { + return "All: " + this.loadedEntityList.size(); + } + + /**+ + * Returns the name of the current chunk provider, by calling + * chunkprovider.makeString() + */ + public String getProviderName() { + return this.chunkProvider.makeString(); + } + + public TileEntity getTileEntity(BlockPos pos) { + if (!this.isValid(pos)) { + return null; + } else { + TileEntity tileentity = null; + if (this.processingLoadedTiles) { + for (int i = 0; i < this.addedTileEntityList.size(); ++i) { + TileEntity tileentity1 = (TileEntity) this.addedTileEntityList.get(i); + if (!tileentity1.isInvalid() && tileentity1.getPos().equals(pos)) { + tileentity = tileentity1; + break; + } + } + } + + if (tileentity == null) { + tileentity = this.getChunkFromBlockCoords(pos).getTileEntity(pos, Chunk.EnumCreateEntityType.IMMEDIATE); + } + + if (tileentity == null) { + for (int j = 0; j < this.addedTileEntityList.size(); ++j) { + TileEntity tileentity2 = (TileEntity) this.addedTileEntityList.get(j); + if (!tileentity2.isInvalid() && tileentity2.getPos().equals(pos)) { + tileentity = tileentity2; + break; + } + } + } + + return tileentity; + } + } + + public void setTileEntity(BlockPos pos, TileEntity tileEntityIn) { + if (tileEntityIn != null && !tileEntityIn.isInvalid()) { + if (this.processingLoadedTiles) { + tileEntityIn.setPos(pos); + Iterator iterator = this.addedTileEntityList.iterator(); + + while (iterator.hasNext()) { + TileEntity tileentity = (TileEntity) iterator.next(); + if (tileentity.getPos().equals(pos)) { + tileentity.invalidate(); + iterator.remove(); + } + } + + this.addedTileEntityList.add(tileEntityIn); + } else { + this.addTileEntity(tileEntityIn); + this.getChunkFromBlockCoords(pos).addTileEntity(pos, tileEntityIn); + } + } + + } + + public void removeTileEntity(BlockPos pos) { + TileEntity tileentity = this.getTileEntity(pos); + if (tileentity != null && this.processingLoadedTiles) { + tileentity.invalidate(); + this.addedTileEntityList.remove(tileentity); + } else { + if (tileentity != null) { + this.addedTileEntityList.remove(tileentity); + this.loadedTileEntityList.remove(tileentity); + this.tickableTileEntities.remove(tileentity); + } + + this.getChunkFromBlockCoords(pos).removeTileEntity(pos); + } + + } + + /**+ + * Adds the specified TileEntity to the pending removal list. + */ + public void markTileEntityForRemoval(TileEntity tileEntityIn) { + this.tileEntitiesToBeRemoved.add(tileEntityIn); + } + + public boolean isBlockFullCube(BlockPos pos) { + IBlockState iblockstate = this.getBlockState(pos); + AxisAlignedBB axisalignedbb = iblockstate.getBlock().getCollisionBoundingBox(this, pos, iblockstate); + return axisalignedbb != null && axisalignedbb.getAverageEdgeLength() >= 1.0D; + } + + public static boolean doesBlockHaveSolidTopSurface(IBlockAccess blockAccess, BlockPos pos) { + IBlockState iblockstate = blockAccess.getBlockState(pos); + Block block = iblockstate.getBlock(); + return block.getMaterial().isOpaque() && block.isFullCube() ? true + : (block instanceof BlockStairs ? iblockstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP + : (block instanceof BlockSlab + ? iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP + : (block instanceof BlockHopper ? true + : (block instanceof BlockSnow + ? ((Integer) iblockstate.getValue(BlockSnow.LAYERS)).intValue() == 7 + : false)))); + } + + /**+ + * Checks if a block's material is opaque, and that it takes up + * a full cube + */ + public boolean isBlockNormalCube(BlockPos pos, boolean _default) { + if (!this.isValid(pos)) { + return _default; + } else { + Chunk chunk = this.chunkProvider.provideChunk(pos); + if (chunk.isEmpty()) { + return _default; + } else { + Block block = this.getBlockState(pos).getBlock(); + return block.getMaterial().isOpaque() && block.isFullCube(); + } + } + } + + /**+ + * Called on construction of the World class to setup the + * initial skylight values + */ + public void calculateInitialSkylight() { + int i = this.calculateSkylightSubtracted(1.0F); + if (i != this.skylightSubtracted) { + this.skylightSubtracted = i; + } + + } + + /**+ + * first boolean for hostile mobs and second for peaceful mobs + */ + public void setAllowedSpawnTypes(boolean hostile, boolean peaceful) { + this.spawnHostileMobs = hostile; + this.spawnPeacefulMobs = peaceful; + } + + /**+ + * Runs a single tick for the world + */ + public void tick() { + this.updateWeather(); + } + + /**+ + * Called from World constructor to set rainingStrength and + * thunderingStrength + */ + protected void calculateInitialWeather() { + if (this.worldInfo.isRaining()) { + this.rainingStrength = 1.0F; + if (this.worldInfo.isThundering()) { + this.thunderingStrength = 1.0F; + } + } + + } + + /**+ + * Updates all weather states. + */ + protected void updateWeather() { + if (!this.provider.getHasNoSky()) { + { + int i = this.worldInfo.getCleanWeatherTime(); + if (i > 0) { + --i; + this.worldInfo.setCleanWeatherTime(i); + this.worldInfo.setThunderTime(this.worldInfo.isThundering() ? 1 : 2); + this.worldInfo.setRainTime(this.worldInfo.isRaining() ? 1 : 2); + } + + int j = this.worldInfo.getThunderTime(); + if (j <= 0) { + if (this.worldInfo.isThundering()) { + this.worldInfo.setThunderTime((this.rand.nextInt(12000) / 2) + 3600); + } else { + this.worldInfo.setThunderTime((this.rand.nextInt(168000) + 12000) * 2); + } + } else { + --j; + this.worldInfo.setThunderTime(j); + if (j <= 0) { + this.worldInfo.setThundering(!this.worldInfo.isThundering()); + } + } + + this.prevThunderingStrength = this.thunderingStrength; + if (this.worldInfo.isThundering()) { + this.thunderingStrength = (float) ((double) this.thunderingStrength + 0.01D); + } else { + this.thunderingStrength = (float) ((double) this.thunderingStrength - 0.01D); + } + + this.thunderingStrength = MathHelper.clamp_float(this.thunderingStrength, 0.0F, 1.0F); + int k = this.worldInfo.getRainTime(); + if (k <= 0) { + if (this.worldInfo.isRaining()) { + this.worldInfo.setRainTime((this.rand.nextInt(12000) + 12000) / 2); + } else { + this.worldInfo.setRainTime((this.rand.nextInt(168000) + 12000) * 2); + } + } else { + --k; + this.worldInfo.setRainTime(k); + if (k <= 0) { + this.worldInfo.setRaining(!this.worldInfo.isRaining()); + } + } + + this.prevRainingStrength = this.rainingStrength; + if (this.worldInfo.isRaining()) { + this.rainingStrength = (float) ((double) this.rainingStrength + 0.01D); + } else { + this.rainingStrength = (float) ((double) this.rainingStrength - 0.01D); + } + + this.rainingStrength = MathHelper.clamp_float(this.rainingStrength, 0.0F, 1.0F); + } + } + } + + protected void setActivePlayerChunksAndCheckLight() { + this.activeChunkSet.clear(); + this.theProfiler.startSection("buildList"); + + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityplayer = (EntityPlayer) this.playerEntities.get(i); + int j = MathHelper.floor_double(entityplayer.posX / 16.0D); + int k = MathHelper.floor_double(entityplayer.posZ / 16.0D); + int l = this.getRenderDistanceChunks(); + + for (int i1 = -l; i1 <= l; ++i1) { + for (int j1 = -l; j1 <= l; ++j1) { + this.activeChunkSet.add(new ChunkCoordIntPair(i1 + j, j1 + k)); + } + } + } + + this.theProfiler.endSection(); + if (this.ambientTickCountdown > 0) { + --this.ambientTickCountdown; + } + + this.theProfiler.startSection("playerCheckLight"); + if (!this.playerEntities.isEmpty()) { + int k1 = this.rand.nextInt(this.playerEntities.size()); + EntityPlayer entityplayer1 = (EntityPlayer) this.playerEntities.get(k1); + int l1 = MathHelper.floor_double(entityplayer1.posX) + this.rand.nextInt(11) - 5; + int i2 = MathHelper.floor_double(entityplayer1.posY) + this.rand.nextInt(11) - 5; + int j2 = MathHelper.floor_double(entityplayer1.posZ) + this.rand.nextInt(11) - 5; + this.checkLight(new BlockPos(l1, i2, j2)); + } + + this.theProfiler.endSection(); + } + + protected abstract int getRenderDistanceChunks(); + + protected void playMoodSoundAndCheckLight(int chunkIn, int parInt2, Chunk parChunk) { + this.theProfiler.endStartSection("moodSound"); + if (this.ambientTickCountdown == 0) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int i = this.updateLCG >> 2; + int j = i & 15; + int k = i >> 8 & 15; + int l = i >> 16 & 255; + BlockPos blockpos = new BlockPos(j, l, k); + Block block = parChunk.getBlock(blockpos); + j = j + chunkIn; + k = k + parInt2; + if (block.getMaterial() == Material.air && this.getLight(blockpos) <= this.rand.nextInt(8) + && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0) { + EntityPlayer entityplayer = this.getClosestPlayer((double) j + 0.5D, (double) l + 0.5D, + (double) k + 0.5D, 8.0D); + if (entityplayer != null + && entityplayer.getDistanceSq((double) j + 0.5D, (double) l + 0.5D, (double) k + 0.5D) > 4.0D) { + this.playSoundEffect((double) j + 0.5D, (double) l + 0.5D, (double) k + 0.5D, "ambient.cave.cave", + 0.7F, 0.8F + this.rand.nextFloat() * 0.2F); + this.ambientTickCountdown = this.rand.nextInt(12000) + 6000; + } + } + } + + this.theProfiler.endStartSection("checkLight"); + parChunk.enqueueRelightChecks(); + } + + protected void updateBlocks() { + this.setActivePlayerChunksAndCheckLight(); + } + + public void forceBlockUpdateTick(Block blockType, BlockPos pos, EaglercraftRandom random) { + this.scheduledUpdatesAreImmediate = true; + blockType.updateTick(this, pos, this.getBlockState(pos), random); + this.scheduledUpdatesAreImmediate = false; + } + + public boolean canBlockFreezeWater(BlockPos pos) { + return this.canBlockFreeze(pos, false); + } + + public boolean canBlockFreezeNoWater(BlockPos pos) { + return this.canBlockFreeze(pos, true); + } + + /**+ + * Checks to see if a given block is both water and cold enough + * to freeze. + */ + public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj) { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); + float f = biomegenbase.getFloatTemperature(pos); + if (f > 0.15F) { + return false; + } else { + if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); + if ((block == Blocks.water || block == Blocks.flowing_water) + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) { + if (!noWaterAdj) { + return true; + } + + boolean flag = this.isWater(pos.west()) && this.isWater(pos.east()) && this.isWater(pos.north()) + && this.isWater(pos.south()); + if (!flag) { + return true; + } + } + } + + return false; + } + } + + private boolean isWater(BlockPos pos) { + return this.getBlockState(pos).getBlock().getMaterial() == Material.water; + } + + /**+ + * Checks to see if a given block can accumulate snow from it + * snowing + */ + public boolean canSnowAt(BlockPos pos, boolean checkLight) { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); + float f = biomegenbase.getFloatTemperature(pos); + if (f > 0.15F) { + return false; + } else if (!checkLight) { + return true; + } else { + if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) { + Block block = this.getBlockState(pos).getBlock(); + if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, pos)) { + return true; + } + } + + return false; + } + } + + public boolean checkLight(BlockPos pos) { + boolean flag = false; + if (!this.provider.getHasNoSky()) { + flag |= this.checkLightFor(EnumSkyBlock.SKY, pos); + } + + flag = flag | this.checkLightFor(EnumSkyBlock.BLOCK, pos); + return flag; + } + + /**+ + * gets the light level at the supplied position + */ + private int getRawLight(BlockPos pos, EnumSkyBlock lightType) { + if (lightType == EnumSkyBlock.SKY && this.canSeeSky(pos)) { + return 15; + } else { + Block block = this.getBlockState(pos).getBlock(); + int i = lightType == EnumSkyBlock.SKY ? 0 : block.getLightValue(); + int j = block.getLightOpacity(); + if (j >= 15 && block.getLightValue() > 0) { + j = 1; + } + + if (j < 1) { + j = 1; + } + + if (j >= 15) { + return 0; + } else if (i >= 14) { + return i; + } else { + for (EnumFacing enumfacing : EnumFacing.values()) { + BlockPos blockpos = pos.offset(enumfacing); + int k = this.getLightFor(lightType, blockpos) - j; + if (k > i) { + i = k; + } + + if (i >= 14) { + return i; + } + } + + return i; + } + } + } + + public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) { + if (!this.isAreaLoaded(pos, 17, false)) { + return false; + } else { + int i = 0; + int j = 0; + this.theProfiler.startSection("getBrightness"); + int k = this.getLightFor(lightType, pos); + int l = this.getRawLight(pos, lightType); + int i1 = pos.getX(); + int j1 = pos.getY(); + int k1 = pos.getZ(); + if (l > k) { + this.lightUpdateBlockList[j++] = 133152; + } else if (l < k) { + this.lightUpdateBlockList[j++] = 133152 | k << 18; + + while (i < j) { + int l1 = this.lightUpdateBlockList[i++]; + int i2 = (l1 & 63) - 32 + i1; + int j2 = (l1 >> 6 & 63) - 32 + j1; + int k2 = (l1 >> 12 & 63) - 32 + k1; + int l2 = l1 >> 18 & 15; + BlockPos blockpos = new BlockPos(i2, j2, k2); + int i3 = this.getLightFor(lightType, blockpos); + if (i3 == l2) { + this.setLightFor(lightType, blockpos, 0); + if (l2 > 0) { + int j3 = MathHelper.abs_int(i2 - i1); + int k3 = MathHelper.abs_int(j2 - j1); + int l3 = MathHelper.abs_int(k2 - k1); + if (j3 + k3 + l3 < 17) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (EnumFacing enumfacing : EnumFacing.values()) { + int i4 = i2 + enumfacing.getFrontOffsetX(); + int j4 = j2 + enumfacing.getFrontOffsetY(); + int k4 = k2 + enumfacing.getFrontOffsetZ(); + blockpos$mutableblockpos.func_181079_c(i4, j4, k4); + int l4 = Math.max(1, + this.getBlockState(blockpos$mutableblockpos).getBlock().getLightOpacity()); + i3 = this.getLightFor(lightType, blockpos$mutableblockpos); + if (i3 == l2 - l4 && j < this.lightUpdateBlockList.length) { + this.lightUpdateBlockList[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6 + | k4 - k1 + 32 << 12 | l2 - l4 << 18; + } + } + } + } + } + } + + i = 0; + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("checkedPosition < toCheckCount"); + + while (i < j) { + int i5 = this.lightUpdateBlockList[i++]; + int j5 = (i5 & 63) - 32 + i1; + int k5 = (i5 >> 6 & 63) - 32 + j1; + int l5 = (i5 >> 12 & 63) - 32 + k1; + BlockPos blockpos1 = new BlockPos(j5, k5, l5); + int i6 = this.getLightFor(lightType, blockpos1); + int j6 = this.getRawLight(blockpos1, lightType); + if (j6 != i6) { + this.setLightFor(lightType, blockpos1, j6); + if (j6 > i6) { + int k6 = Math.abs(j5 - i1); + int l6 = Math.abs(k5 - j1); + int i7 = Math.abs(l5 - k1); + boolean flag = j < this.lightUpdateBlockList.length - 6; + if (k6 + l6 + i7 < 17 && flag) { + if (this.getLightFor(lightType, blockpos1.west()) < j6) { + this.lightUpdateBlockList[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.east()) < j6) { + this.lightUpdateBlockList[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6) + + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.down()) < j6) { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6) + + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.up()) < j6) { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6) + + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.north()) < j6) { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + + (l5 - 1 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.south()) < j6) { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + + (l5 + 1 - k1 + 32 << 12); + } + } + } + } + } + + this.theProfiler.endSection(); + return true; + } + } + + /**+ + * Runs through the list of updates to run and ticks them + */ + public boolean tickUpdates(boolean parFlag) { + return false; + } + + public List getPendingBlockUpdates(Chunk chunkIn, boolean parFlag) { + return null; + } + + public List func_175712_a(StructureBoundingBox structureBB, boolean parFlag) { + return null; + } + + /**+ + * Will get all entities within the specified AABB excluding the + * one passed into it. Args: entityToExclude, aabb + */ + public List getEntitiesWithinAABBExcludingEntity(Entity entityIn, AxisAlignedBB bb) { + return this.getEntitiesInAABBexcluding(entityIn, bb, EntitySelectors.NOT_SPECTATING); + } + + /**+ + * Gets all entities within the specified AABB excluding the one + * passed into it. Args: entityToExclude, aabb, predicate + */ + public List getEntitiesInAABBexcluding(Entity entityIn, AxisAlignedBB boundingBox, + Predicate predicate) { + ArrayList arraylist = Lists.newArrayList(); + int i = MathHelper.floor_double((boundingBox.minX - 2.0D) / 16.0D); + int j = MathHelper.floor_double((boundingBox.maxX + 2.0D) / 16.0D); + int k = MathHelper.floor_double((boundingBox.minZ - 2.0D) / 16.0D); + int l = MathHelper.floor_double((boundingBox.maxZ + 2.0D) / 16.0D); + + for (int i1 = i; i1 <= j; ++i1) { + for (int j1 = k; j1 <= l; ++j1) { + if (this.isChunkLoaded(i1, j1, true)) { + this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(entityIn, boundingBox, + arraylist, predicate); + } + } + } + + return arraylist; + } + + public List getEntities(Class entityType, Predicate filter) { + ArrayList arraylist = Lists.newArrayList(); + + for (Entity entity : this.loadedEntityList) { + if (entityType.isAssignableFrom(entity.getClass()) && filter.apply((T) entity)) { + arraylist.add(entity); + } + } + + return arraylist; + } + + public List getPlayers(Class playerType, Predicate filter) { + ArrayList arraylist = Lists.newArrayList(); + + for (Entity entity : this.playerEntities) { + if (playerType.isAssignableFrom(entity.getClass()) && filter.apply((T) entity)) { + arraylist.add(entity); + } + } + + return arraylist; + } + + public List getEntitiesWithinAABB(Class classEntity, AxisAlignedBB bb) { + return this.getEntitiesWithinAABB(classEntity, bb, EntitySelectors.NOT_SPECTATING); + } + + public List getEntitiesWithinAABB(Class clazz, AxisAlignedBB aabb, + Predicate filter) { + int i = MathHelper.floor_double((aabb.minX - 2.0D) / 16.0D); + int j = MathHelper.floor_double((aabb.maxX + 2.0D) / 16.0D); + int k = MathHelper.floor_double((aabb.minZ - 2.0D) / 16.0D); + int l = MathHelper.floor_double((aabb.maxZ + 2.0D) / 16.0D); + ArrayList arraylist = Lists.newArrayList(); + + for (int i1 = i; i1 <= j; ++i1) { + for (int j1 = k; j1 <= l; ++j1) { + if (this.isChunkLoaded(i1, j1, true)) { + this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(clazz, aabb, arraylist, filter); + } + } + } + + return arraylist; + } + + public T findNearestEntityWithinAABB(Class entityType, AxisAlignedBB aabb, + T closestTo) { + List list = this.getEntitiesWithinAABB(entityType, aabb); + Entity entity = null; + double d0 = Double.MAX_VALUE; + + for (int i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); + if (entity1 != closestTo && EntitySelectors.NOT_SPECTATING.apply(entity1)) { + double d1 = closestTo.getDistanceSqToEntity(entity1); + if (d1 <= d0) { + entity = entity1; + d0 = d1; + } + } + } + + return (T) entity; + } + + /**+ + * Returns the Entity with the given ID, or null if it doesn't + * exist in this World. + */ + public Entity getEntityByID(int id) { + return (Entity) this.entitiesById.lookup(id); + } + + /**+ + * Accessor for world Loaded Entity List + */ + public List getLoadedEntityList() { + return this.loadedEntityList; + } + + public void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity) { + if (this.isBlockLoaded(pos)) { + this.getChunkFromBlockCoords(pos).setChunkModified(); + } + + } + + /**+ + * Counts how many entities of an entity class exist in the + * world. Args: entityClass + */ + public int countEntities(Class entityType) { + int i = 0; + + for (Entity entity : this.loadedEntityList) { + if ((!(entity instanceof EntityLiving) || !((EntityLiving) entity).isNoDespawnRequired()) + && entityType.isAssignableFrom(entity.getClass())) { + ++i; + } + } + + return i; + } + + public void loadEntities(Collection entityCollection) { + this.loadedEntityList.addAll(entityCollection); + + for (Entity entity : entityCollection) { + this.onEntityAdded(entity); + } + + } + + public void unloadEntities(Collection entityCollection) { + this.unloadedEntityList.addAll(entityCollection); + } + + public boolean canBlockBePlaced(Block blockIn, BlockPos pos, boolean side, EnumFacing entityIn, Entity itemStackIn, + ItemStack parItemStack) { + Block block = this.getBlockState(pos).getBlock(); + AxisAlignedBB axisalignedbb = side ? null + : blockIn.getCollisionBoundingBox(this, pos, blockIn.getDefaultState()); + return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, itemStackIn) ? false + : (block.getMaterial() == Material.circuits && blockIn == Blocks.anvil ? true + : block.getMaterial().isReplaceable() && blockIn.canReplace(this, pos, entityIn, parItemStack)); + } + + public int func_181545_F() { + return this.field_181546_a; + } + + public void func_181544_b(int parInt1) { + this.field_181546_a = parInt1; + } + + /**+ + * Returns the single highest strong power out of all directions + * using getStrongPower(BlockPos, EnumFacing) + */ + public int getStrongPower(BlockPos pos, EnumFacing direction) { + IBlockState iblockstate = this.getBlockState(pos); + return iblockstate.getBlock().getStrongPower(this, pos, iblockstate, direction); + } + + public WorldType getWorldType() { + return this.worldInfo.getTerrainType(); + } + + /**+ + * Returns the single highest strong power out of all directions + * using getStrongPower(BlockPos, EnumFacing) + */ + public int getStrongPower(BlockPos pos) { + int i = 0; + i = Math.max(i, this.getStrongPower(pos.down(), EnumFacing.DOWN)); + if (i >= 15) { + return i; + } else { + i = Math.max(i, this.getStrongPower(pos.up(), EnumFacing.UP)); + if (i >= 15) { + return i; + } else { + i = Math.max(i, this.getStrongPower(pos.north(), EnumFacing.NORTH)); + if (i >= 15) { + return i; + } else { + i = Math.max(i, this.getStrongPower(pos.south(), EnumFacing.SOUTH)); + if (i >= 15) { + return i; + } else { + i = Math.max(i, this.getStrongPower(pos.west(), EnumFacing.WEST)); + if (i >= 15) { + return i; + } else { + i = Math.max(i, this.getStrongPower(pos.east(), EnumFacing.EAST)); + return i >= 15 ? i : i; + } + } + } + } + } + } + + public boolean isSidePowered(BlockPos pos, EnumFacing side) { + return this.getRedstonePower(pos, side) > 0; + } + + public int getRedstonePower(BlockPos pos, EnumFacing facing) { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); + return block.isNormalCube() ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); + } + + public boolean isBlockPowered(BlockPos pos) { + return this.getRedstonePower(pos.down(), EnumFacing.DOWN) > 0 ? true + : (this.getRedstonePower(pos.up(), EnumFacing.UP) > 0 ? true + : (this.getRedstonePower(pos.north(), EnumFacing.NORTH) > 0 ? true + : (this.getRedstonePower(pos.south(), EnumFacing.SOUTH) > 0 ? true + : (this.getRedstonePower(pos.west(), EnumFacing.WEST) > 0 ? true + : this.getRedstonePower(pos.east(), EnumFacing.EAST) > 0)))); + } + + /**+ + * Checks if the specified block or its neighbors are powered by + * a neighboring block. Used by blocks like TNT and Doors. + */ + public int isBlockIndirectlyGettingPowered(BlockPos pos) { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) { + int j = this.getRedstonePower(pos.offset(enumfacing), enumfacing); + if (j >= 15) { + return 15; + } + + if (j > i) { + i = j; + } + } + + return i; + } + + /**+ + * Gets the closest player to the entity within the specified + * distance (if distance is less than 0 then ignored). Args: + * entity, dist + */ + public EntityPlayer getClosestPlayerToEntity(Entity entityIn, double distance) { + return this.getClosestPlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance); + } + + /**+ + * Gets the closest player to the point within the specified + * distance (distance can be set to less than 0 to not limit the + * distance). Args: x, y, z, dist + */ + public EntityPlayer getClosestPlayer(double x, double y, double z, double distance) { + double d0 = -1.0D; + EntityPlayer entityplayer = null; + + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityplayer1 = (EntityPlayer) this.playerEntities.get(i); + if (EntitySelectors.NOT_SPECTATING.apply(entityplayer1)) { + double d1 = entityplayer1.getDistanceSq(x, y, z); + if ((distance < 0.0D || d1 < distance * distance) && (d0 == -1.0D || d1 < d0)) { + d0 = d1; + entityplayer = entityplayer1; + } + } + } + + return entityplayer; + } + + public boolean isAnyPlayerWithinRangeAt(double x, double y, double z, double range) { + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityplayer = (EntityPlayer) this.playerEntities.get(i); + if (EntitySelectors.NOT_SPECTATING.apply(entityplayer)) { + double d0 = entityplayer.getDistanceSq(x, y, z); + if (range < 0.0D || d0 < range * range) { + return true; + } + } + } + + return false; + } + + /**+ + * Find a player by name in this world. + */ + public EntityPlayer getPlayerEntityByName(String name) { + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityplayer = (EntityPlayer) this.playerEntities.get(i); + if (name.equals(entityplayer.getName())) { + return entityplayer; + } + } + + return null; + } + + public EntityPlayer getPlayerEntityByUUID(EaglercraftUUID uuid) { + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityplayer = (EntityPlayer) this.playerEntities.get(i); + if (uuid.equals(entityplayer.getUniqueID())) { + return entityplayer; + } + } + + return null; + } + + /**+ + * If on MP, sends a quitting packet. + */ + public void sendQuittingDisconnectingPacket() { + } + + /**+ + * Checks whether the session lock file was modified by another + * process + */ + public void checkSessionLock() throws MinecraftException { + this.saveHandler.checkSessionLock(); + } + + public void setTotalWorldTime(long worldTime) { + this.worldInfo.setWorldTotalTime(worldTime); + } + + /**+ + * gets the random world seed + */ + public long getSeed() { + return this.worldInfo.getSeed(); + } + + public long getTotalWorldTime() { + return this.worldInfo.getWorldTotalTime(); + } + + public long getWorldTime() { + return this.worldInfo.getWorldTime(); + } + + /**+ + * Sets the world time. + */ + public void setWorldTime(long time) { + this.worldInfo.setWorldTime(time); + } + + /**+ + * Gets the spawn point in the world + */ + public BlockPos getSpawnPoint() { + BlockPos blockpos = new BlockPos(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), + this.worldInfo.getSpawnZ()); + if (!this.getWorldBorder().contains(blockpos)) { + blockpos = this.getHeight( + new BlockPos(this.getWorldBorder().getCenterX(), 0.0D, this.getWorldBorder().getCenterZ())); + } + + return blockpos; + } + + public void setSpawnPoint(BlockPos pos) { + this.worldInfo.setSpawn(pos); + } + + /**+ + * spwans an entity and loads surrounding chunks + */ + public void joinEntityInSurroundings(Entity entityIn) { + int i = MathHelper.floor_double(entityIn.posX / 16.0D); + int j = MathHelper.floor_double(entityIn.posZ / 16.0D); + byte b0 = 2; + + for (int k = i - b0; k <= i + b0; ++k) { + for (int l = j - b0; l <= j + b0; ++l) { + this.getChunkFromChunkCoords(k, l); + } + } + + if (!this.loadedEntityList.contains(entityIn)) { + this.loadedEntityList.add(entityIn); + } + + } + + public boolean isBlockModifiable(EntityPlayer player, BlockPos pos) { + return true; + } + + /**+ + * sends a Packet 38 (Entity Status) to all tracked players of + * that entity + */ + public void setEntityState(Entity entityIn, byte state) { + } + + /**+ + * gets the world's chunk provider + */ + public IChunkProvider getChunkProvider() { + return this.chunkProvider; + } + + public void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam) { + blockIn.onBlockEventReceived(this, pos, this.getBlockState(pos), eventID, eventParam); + } + + /**+ + * Returns this world's current save handler + */ + public ISaveHandler getSaveHandler() { + return this.saveHandler; + } + + /**+ + * Returns the world's WorldInfo object + */ + public WorldInfo getWorldInfo() { + return this.worldInfo; + } + + /**+ + * Gets the GameRules instance. + */ + public GameRules getGameRules() { + return this.worldInfo.getGameRulesInstance(); + } + + /**+ + * Updates the flag that indicates whether or not all players in + * the world are sleeping. + */ + public void updateAllPlayersSleepingFlag() { + } + + public float getThunderStrength(float delta) { + return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * delta) + * this.getRainStrength(delta); + } + + /**+ + * Sets the strength of the thunder. + */ + public void setThunderStrength(float strength) { + this.prevThunderingStrength = strength; + this.thunderingStrength = strength; + } + + /**+ + * Returns rain strength. + */ + public float getRainStrength(float delta) { + return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * delta; + } + + /**+ + * Sets the strength of the rain. + */ + public void setRainStrength(float strength) { + this.prevRainingStrength = strength; + this.rainingStrength = strength; + } + + /**+ + * Returns true if the current thunder strength (weighted with + * the rain strength) is greater than 0.9 + */ + public boolean isThundering() { + return (double) this.getThunderStrength(1.0F) > 0.9D; + } + + /**+ + * Returns true if the current rain strength is greater than 0.2 + */ + public boolean isRaining() { + return (double) this.getRainStrength(1.0F) > 0.2D; + } + + public boolean canLightningStrike(BlockPos strikePosition) { + if (!this.isRaining()) { + return false; + } else if (!this.canSeeSky(strikePosition)) { + return false; + } else if (this.getPrecipitationHeight(strikePosition).getY() > strikePosition.getY()) { + return false; + } else { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(strikePosition); + return biomegenbase.getEnableSnow() ? false + : (this.canSnowAt(strikePosition, false) ? false : biomegenbase.canSpawnLightningBolt()); + } + } + + public boolean isBlockinHighHumidity(BlockPos pos) { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); + return biomegenbase.isHighHumidity(); + } + + public MapStorage getMapStorage() { + return this.mapStorage; + } + + /**+ + * Assigns the given String id to the given MapDataBase using + * the MapStorage, removing any existing ones of the same id. + */ + public void setItemData(String dataID, WorldSavedData worldSavedDataIn) { + this.mapStorage.setData(dataID, worldSavedDataIn); + } + + /**+ + * Loads an existing MapDataBase corresponding to the given + * String id from disk using the MapStorage, instantiating the + * given Class, or returns null if none such file exists. args: + * Class to instantiate, String dataid + */ + public WorldSavedData loadItemData(Class clazz, String dataID) { + return this.mapStorage.loadData(clazz, dataID); + } + + /**+ + * Returns an unique new data id from the MapStorage for the + * given prefix and saves the idCounts map to the 'idcounts' + * file. + */ + public int getUniqueDataId(String key) { + return this.mapStorage.getUniqueDataId(key); + } + + public void playBroadcastSound(int pos, BlockPos parBlockPos, int parInt2) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).broadcastSound(pos, parBlockPos, parInt2); + } + + } + + public void playAuxSFX(int pos, BlockPos parBlockPos, int parInt2) { + this.playAuxSFXAtEntity((EntityPlayer) null, pos, parBlockPos, parInt2); + } + + public void playAuxSFXAtEntity(EntityPlayer player, int sfxType, BlockPos pos, int parInt2) { + try { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + ((IWorldAccess) this.worldAccesses.get(i)).playAuxSFX(player, sfxType, pos, parInt2); + } + + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Playing level event"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Level event being played"); + crashreportcategory.addCrashSection("Block coordinates", CrashReportCategory + .getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ()))); + crashreportcategory.addCrashSection("Event source", player); + crashreportcategory.addCrashSection("Event type", Integer.valueOf(sfxType)); + crashreportcategory.addCrashSection("Event data", Integer.valueOf(parInt2)); + throw new ReportedException(crashreport); + } + } + + /**+ + * Returns maximum world height. + */ + public int getHeight() { + return 256; + } + + /**+ + * Returns current world height. + */ + public int getActualHeight() { + return this.provider.getHasNoSky() ? 128 : 256; + } + + /**+ + * puts the World Random seed to a specific state dependant on + * the inputs + */ + public EaglercraftRandom setRandomSeed(int parInt1, int parInt2, int parInt3) { + long i = (long) parInt1 * 341873128712L + (long) parInt2 * 132897987541L + this.getWorldInfo().getSeed() + + (long) parInt3; + this.rand.setSeed(i); + return this.rand; + } + + public BlockPos getStrongholdPos(String name, BlockPos pos) { + return this.getChunkProvider().getStrongholdGen(this, name, pos); + } + + /**+ + * set by !chunk.getAreLevelsEmpty + */ + public boolean extendedLevelsInChunkCache() { + return false; + } + + /**+ + * Returns horizon height for use in rendering the sky. + */ + public double getHorizon() { + return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D; + } + + /**+ + * Adds some basic stats of the world to the given crash report. + */ + public CrashReportCategory addWorldInfoToCrashReport(CrashReport report) { + CrashReportCategory crashreportcategory = report.makeCategoryDepth("Affected level", 1); + crashreportcategory.addCrashSection("Level name", + this.worldInfo == null ? "????" : this.worldInfo.getWorldName()); + crashreportcategory.addCrashSectionCallable("All players", new Callable() { + public String call() { + return World.this.playerEntities.size() + " total; " + World.this.playerEntities.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Chunk stats", new Callable() { + public String call() { + return World.this.chunkProvider.makeString(); + } + }); + + try { + this.worldInfo.addToCrashReport(crashreportcategory); + } catch (Throwable throwable) { + crashreportcategory.addCrashSectionThrowable("Level Data Unobtainable", throwable); + } + + return crashreportcategory; + } + + public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) { + for (int i = 0; i < this.worldAccesses.size(); ++i) { + IWorldAccess iworldaccess = (IWorldAccess) this.worldAccesses.get(i); + iworldaccess.sendBlockBreakProgress(breakerId, pos, progress); + } + + } + + /**+ + * returns a calendar object containing the current date + */ + public Calendar getCurrentDate() { + if (this.getTotalWorldTime() % 600L == 0L) { + this.theCalendar.setTimeInMillis(MinecraftServer.getCurrentTimeMillis()); + } + + return this.theCalendar; + } + + public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, + NBTTagCompound compund) { + } + + public Scoreboard getScoreboard() { + return this.worldScoreboard; + } + + public void updateComparatorOutputLevel(BlockPos pos, Block blockIn) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + BlockPos blockpos = pos.offset(enumfacing); + if (this.isBlockLoaded(blockpos)) { + IBlockState iblockstate = this.getBlockState(blockpos); + if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) { + iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); + } else if (iblockstate.getBlock().isNormalCube()) { + blockpos = blockpos.offset(enumfacing); + iblockstate = this.getBlockState(blockpos); + if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) { + iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); + } + } + } + } + + } + + public DifficultyInstance getDifficultyForLocation(BlockPos pos) { + long i = 0L; + float f = 0.0F; + if (this.isBlockLoaded(pos)) { + f = this.getCurrentMoonPhaseFactor(); + i = this.getChunkFromBlockCoords(pos).getInhabitedTime(); + } + + return new DifficultyInstance(this.getDifficulty(), this.getWorldTime(), i, f); + } + + public EnumDifficulty getDifficulty() { + return this.getWorldInfo().getDifficulty(); + } + + public int getSkylightSubtracted() { + return this.skylightSubtracted; + } + + public void setSkylightSubtracted(int newSkylightSubtracted) { + this.skylightSubtracted = newSkylightSubtracted; + } + + public int getLastLightningBolt() { + return this.lastLightningBolt; + } + + public void setLastLightningBolt(int lastLightningBoltIn) { + this.lastLightningBolt = lastLightningBoltIn; + } + + public boolean isFindingSpawnPoint() { + return this.findingSpawnPoint; + } + + public VillageCollection getVillageCollection() { + return this.villageCollectionObj; + } + + public WorldBorder getWorldBorder() { + return this.worldBorder; + } + + /**+ + * Returns true if the chunk is located near the spawn point + */ + public boolean isSpawnChunk(int x, int z) { + if (!MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("loadSpawnChunks")) + return false; + BlockPos blockpos = this.getSpawnPoint(); + int i = x * 16 + 8 - blockpos.getX(); + int j = z * 16 + 8 - blockpos.getZ(); + short short1 = 128; + return i >= -short1 && i <= short1 && j >= -short1 && j <= short1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldManager.java new file mode 100644 index 0000000..7878c47 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldManager.java @@ -0,0 +1,137 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S28PacketEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S29PacketSoundEffect; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IWorldAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldManager implements IWorldAccess { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldManager"); + } + + private MinecraftServer mcServer; + private WorldServer theWorldServer; + + public WorldManager(MinecraftServer parMinecraftServer, WorldServer parWorldServer) { + this.mcServer = parMinecraftServer; + this.theWorldServer = parWorldServer; + } + + public void spawnParticle(int var1, boolean var2, double var3, double var5, double var7, double var9, double var11, + double var13, int... var15) { + } + + /**+ + * Called on all IWorldAccesses when an entity is created or + * loaded. On client worlds, starts downloading any necessary + * textures. On server worlds, adds the entity to the entity + * tracker. + */ + public void onEntityAdded(Entity entity) { + this.theWorldServer.getEntityTracker().trackEntity(entity); + } + + /**+ + * Called on all IWorldAccesses when an entity is unloaded or + * destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the + * entity tracker. + */ + public void onEntityRemoved(Entity entity) { + this.theWorldServer.getEntityTracker().untrackEntity(entity); + this.theWorldServer.getScoreboard().func_181140_a(entity); + } + + /**+ + * Plays the specified sound. Arg: soundName, x, y, z, volume, + * pitch + */ + public void playSound(String s, double d0, double d1, double d2, float f, float f1) { + this.mcServer.getConfigurationManager().sendToAllNear(d0, d1, d2, f > 1.0F ? (double) (16.0F * f) : 16.0D, + this.theWorldServer.provider.getDimensionId(), new S29PacketSoundEffect(s, d0, d1, d2, f, f1)); + } + + /**+ + * Plays sound to all near players except the player reference + * given + */ + public void playSoundToNearExcept(EntityPlayer entityplayer, String s, double d0, double d1, double d2, float f, + float f1) { + this.mcServer.getConfigurationManager().sendToAllNearExcept(entityplayer, d0, d1, d2, + f > 1.0F ? (double) (16.0F * f) : 16.0D, this.theWorldServer.provider.getDimensionId(), + new S29PacketSoundEffect(s, d0, d1, d2, f, f1)); + } + + /**+ + * On the client, re-renders all blocks in this range, + * inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + public void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6) { + } + + public void markBlockForUpdate(BlockPos blockpos) { + this.theWorldServer.getPlayerManager().markBlockForUpdate(blockpos); + } + + public void notifyLightSet(BlockPos var1) { + } + + public void playRecord(String var1, BlockPos var2) { + } + + public void playAuxSFX(EntityPlayer entityplayer, int i, BlockPos blockpos, int j) { + this.mcServer.getConfigurationManager().sendToAllNearExcept(entityplayer, (double) blockpos.getX(), + (double) blockpos.getY(), (double) blockpos.getZ(), 64.0D, + this.theWorldServer.provider.getDimensionId(), new S28PacketEffect(i, blockpos, j, false)); + } + + public void broadcastSound(int i, BlockPos blockpos, int j) { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S28PacketEffect(i, blockpos, j, true)); + } + + public void sendBlockBreakProgress(int i, BlockPos blockpos, int j) { + for (EntityPlayerMP entityplayermp : this.mcServer.getConfigurationManager().func_181057_v()) { + if (entityplayermp != null && entityplayermp.worldObj == this.theWorldServer + && entityplayermp.getEntityId() != i) { + double d0 = (double) blockpos.getX() - entityplayermp.posX; + double d1 = (double) blockpos.getY() - entityplayermp.posY; + double d2 = (double) blockpos.getZ() - entityplayermp.posZ; + if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) { + entityplayermp.playerNetServerHandler.sendPacket(new S25PacketBlockBreakAnim(i, blockpos, j)); + } + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProvider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProvider.java new file mode 100644 index 0000000..99f350c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProvider.java @@ -0,0 +1,283 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProviderEnd; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProviderHell; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProviderSurface; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManagerHell; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; +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.gen.ChunkProviderDebug; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderFlat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderGenerate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.FlatGeneratorInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldProvider"); + } + + public static final float[] moonPhaseFactors = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F }; + protected World worldObj; + private WorldType terrainType; + private String generatorSettings; + protected WorldChunkManager worldChunkMgr; + protected boolean isHellWorld; + protected boolean hasNoSky; + /**+ + * Light to brightness conversion table + */ + protected final float[] lightBrightnessTable = new float[16]; + protected int dimensionId; + /**+ + * Array for sunrise/sunset colors (RGBA) + */ + private final float[] colorsSunriseSunset = new float[4]; + + /**+ + * associate an existing world with a World provider, and setup + * its lightbrightness table + */ + public final void registerWorld(World worldIn) { + this.worldObj = worldIn; + this.terrainType = worldIn.getWorldInfo().getTerrainType(); + this.generatorSettings = worldIn.getWorldInfo().getGeneratorOptions(); + this.registerWorldChunkManager(); + this.generateLightBrightnessTable(); + } + + /**+ + * Creates the light to brightness table + */ + protected void generateLightBrightnessTable() { + float f = 0.0F; + + for (int i = 0; i <= 15; ++i) { + float f1 = 1.0F - (float) i / 15.0F; + this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + + } + + /**+ + * creates a new world chunk manager for WorldProvider + */ + protected void registerWorldChunkManager() { + WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType(); + if (worldtype == WorldType.FLAT) { + FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo + .createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); + this.worldChunkMgr = new WorldChunkManagerHell( + BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), BiomeGenBase.field_180279_ad), + 0.5F); + } else if (worldtype == WorldType.DEBUG_WORLD) { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.plains, 0.0F); + } else { + this.worldChunkMgr = new WorldChunkManager(this.worldObj); + } + + } + + /**+ + * Returns a new chunk provider which generates chunks for this + * world + */ + public IChunkProvider createChunkGenerator() { + return (IChunkProvider) (this.terrainType == WorldType.FLAT + ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), + this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) + : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) + : (this.terrainType == WorldType.CUSTOMIZED + ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), + this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) + : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), + this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings)))); + } + + /**+ + * Will check if the x, z position specified is alright to be + * set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int x, int z) { + return this.worldObj.getGroundAboveSeaLevel(new BlockPos(x, 0, z)) == Blocks.grass; + } + + /**+ + * Calculates the angle of sun and moon in the sky relative to a + * specified time (usually worldTime) + */ + public float calculateCelestialAngle(long parLong1, float parFloat1) { + int i = (int) (parLong1 % 24000L); + float f = ((float) i + parFloat1) / 24000.0F - 0.25F; + if (f < 0.0F) { + ++f; + } + + if (f > 1.0F) { + --f; + } + + f = 1.0F - (float) ((Math.cos((double) f * 3.141592653589793D) + 1.0D) / 2.0D); + f = f + (f - f) / 3.0F; + return f; + } + + public int getMoonPhase(long parLong1) { + return (int) (parLong1 / 24000L % 8L + 8L) % 8; + } + + /**+ + * Returns 'true' if in the "main surface world", but 'false' if + * in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() { + return true; + } + + /**+ + * Returns array with sunrise/sunset colors + */ + public float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks) { + float f = 0.4F; + float f1 = MathHelper.cos(celestialAngle * 3.1415927F * 2.0F) - 0.0F; + float f2 = -0.0F; + if (f1 >= f2 - f && f1 <= f2 + f) { + float f3 = (f1 - f2) / f * 0.5F + 0.5F; + float f4 = 1.0F - (1.0F - MathHelper.sin(f3 * 3.1415927F)) * 0.99F; + f4 = f4 * f4; + this.colorsSunriseSunset[0] = f3 * 0.3F + 0.7F; + this.colorsSunriseSunset[1] = f3 * f3 * 0.7F + 0.2F; + this.colorsSunriseSunset[2] = f3 * f3 * 0.0F + 0.2F; + this.colorsSunriseSunset[3] = f4; + return this.colorsSunriseSunset; + } else { + return null; + } + } + + /**+ + * Return Vec3D with biome specific fog color + */ + public Vec3 getFogColor(float parFloat1, float parFloat2) { + float f = MathHelper.cos(parFloat1 * 3.1415927F * 2.0F) * 2.0F + 0.5F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + float f1 = 0.7529412F; + float f2 = 0.84705883F; + float f3 = 1.0F; + f1 = f1 * (f * 0.94F + 0.06F); + f2 = f2 * (f * 0.94F + 0.06F); + f3 = f3 * (f * 0.91F + 0.09F); + return new Vec3((double) f1, (double) f2, (double) f3); + } + + /**+ + * True if the player can respawn in this dimension (true = + * overworld, false = nether). + */ + public boolean canRespawnHere() { + return true; + } + + public static WorldProvider getProviderForDimension(int dimension) { + return (WorldProvider) (dimension == -1 ? new WorldProviderHell() + : (dimension == 0 ? new WorldProviderSurface() : (dimension == 1 ? new WorldProviderEnd() : null))); + } + + /**+ + * the y level at which clouds are rendered. + */ + public float getCloudHeight() { + return 128.0F; + } + + public boolean isSkyColored() { + return true; + } + + public BlockPos getSpawnCoordinate() { + return null; + } + + public int getAverageGroundLevel() { + return this.terrainType == WorldType.FLAT ? 4 : this.worldObj.func_181545_F() + 1; + } + + /**+ + * Returns a double value representing the Y value relative to + * the top of the map at which void fog is at its maximum. The + * default factor of 0.03125 relative to 256, for example, means + * the void fog will be at its maximum at (256*0.03125), or 8. + */ + public double getVoidFogYFactor() { + return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D; + } + + /**+ + * Returns true if the given X,Z coordinate should show + * environmental fog. + */ + public boolean doesXZShowFog(int x, int z) { + return false; + } + + public abstract String getDimensionName(); + + public abstract String getInternalNameSuffix(); + + public WorldChunkManager getWorldChunkManager() { + return this.worldChunkMgr; + } + + public boolean doesWaterVaporize() { + return this.isHellWorld; + } + + public boolean getHasNoSky() { + return this.hasNoSky; + } + + public float[] getLightBrightnessTable() { + return this.lightBrightnessTable; + } + + /**+ + * Gets the dimension of the provider + */ + public int getDimensionId() { + return this.dimensionId; + } + + public WorldBorder getWorldBorder() { + return new WorldBorder(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderEnd.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderEnd.java new file mode 100644 index 0000000..b6df203 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderEnd.java @@ -0,0 +1,153 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManagerHell; +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.gen.ChunkProviderEnd; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.PeytonPlayz585.shadow.Config; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldProviderEnd extends WorldProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldProviderEnd"); + } + + /**+ + * creates a new world chunk manager for WorldProvider + */ + public void registerWorldChunkManager() { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F); + this.dimensionId = 1; + Config.chunkFixEnd = true; + this.hasNoSky = true; + } + + /**+ + * Returns a new chunk provider which generates chunks for this + * world + */ + public IChunkProvider createChunkGenerator() { + return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); + } + + /**+ + * Calculates the angle of sun and moon in the sky relative to a + * specified time (usually worldTime) + */ + public float calculateCelestialAngle(long var1, float var3) { + return 0.0F; + } + + /**+ + * Returns array with sunrise/sunset colors + */ + public float[] calcSunriseSunsetColors(float var1, float var2) { + return null; + } + + /**+ + * Return Vec3D with biome specific fog color + */ + public Vec3 getFogColor(float f, float var2) { + int i = 10518688; + float f1 = MathHelper.cos(f * 3.1415927F * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f2 = (float) (i >> 16 & 255) / 255.0F; + float f3 = (float) (i >> 8 & 255) / 255.0F; + float f4 = (float) (i & 255) / 255.0F; + f2 = f2 * (f1 * 0.0F + 0.15F); + f3 = f3 * (f1 * 0.0F + 0.15F); + f4 = f4 * (f1 * 0.0F + 0.15F); + return new Vec3((double) f2, (double) f3, (double) f4); + } + + public boolean isSkyColored() { + return false; + } + + /**+ + * True if the player can respawn in this dimension (true = + * overworld, false = nether). + */ + public boolean canRespawnHere() { + return false; + } + + /**+ + * Returns 'true' if in the "main surface world", but 'false' if + * in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() { + return false; + } + + /**+ + * the y level at which clouds are rendered. + */ + public float getCloudHeight() { + return 8.0F; + } + + /**+ + * Will check if the x, z position specified is alright to be + * set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int i, int j) { + return this.worldObj.getGroundAboveSeaLevel(new BlockPos(i, 0, j)).getMaterial().blocksMovement(); + } + + public BlockPos getSpawnCoordinate() { + return new BlockPos(100, 50, 0); + } + + public int getAverageGroundLevel() { + return 50; + } + + /**+ + * Returns true if the given X,Z coordinate should show + * environmental fog. + */ + public boolean doesXZShowFog(int var1, int var2) { + return true; + } + + /**+ + * Returns the dimension's name, e.g. "The End", "Nether", or + * "Overworld". + */ + public String getDimensionName() { + return "The End"; + } + + public String getInternalNameSuffix() { + return "_end"; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderHell.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderHell.java new file mode 100644 index 0000000..7ab0a03 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderHell.java @@ -0,0 +1,144 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManagerHell; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; +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.gen.ChunkProviderHell; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.PeytonPlayz585.shadow.Config; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldProviderHell extends WorldProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldProviderHell"); + } + + /**+ + * creates a new world chunk manager for WorldProvider + */ + public void registerWorldChunkManager() { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F); + this.isHellWorld = true; + this.hasNoSky = true; + this.dimensionId = -1; + Config.chunkFixNether = true; + } + + /**+ + * Return Vec3D with biome specific fog color + */ + public Vec3 getFogColor(float var1, float var2) { + return new Vec3(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D); + } + + /**+ + * Creates the light to brightness table + */ + protected void generateLightBrightnessTable() { + float f = 0.1F; + + for (int i = 0; i <= 15; ++i) { + float f1 = 1.0F - (float) i / 15.0F; + this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + + } + + /**+ + * Returns a new chunk provider which generates chunks for this + * world + */ + public IChunkProvider createChunkGenerator() { + return new ChunkProviderHell(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), + this.worldObj.getSeed()); + } + + /**+ + * Returns 'true' if in the "main surface world", but 'false' if + * in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() { + return false; + } + + /**+ + * Will check if the x, z position specified is alright to be + * set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int var1, int var2) { + return false; + } + + /**+ + * Calculates the angle of sun and moon in the sky relative to a + * specified time (usually worldTime) + */ + public float calculateCelestialAngle(long var1, float var3) { + return 0.5F; + } + + /**+ + * True if the player can respawn in this dimension (true = + * overworld, false = nether). + */ + public boolean canRespawnHere() { + return false; + } + + /**+ + * Returns true if the given X,Z coordinate should show + * environmental fog. + */ + public boolean doesXZShowFog(int var1, int var2) { + return true; + } + + /**+ + * Returns the dimension's name, e.g. "The End", "Nether", or + * "Overworld". + */ + public String getDimensionName() { + return "Nether"; + } + + public String getInternalNameSuffix() { + return "_nether"; + } + + public WorldBorder getWorldBorder() { + return new WorldBorder() { + public double getCenterX() { + return super.getCenterX() / 8.0D; + } + + public double getCenterZ() { + return super.getCenterZ() / 8.0D; + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderSurface.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderSurface.java new file mode 100644 index 0000000..58add83 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderSurface.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.PeytonPlayz585.shadow.Config; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldProviderSurface extends WorldProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldProviderSurface"); + } + + @Override + public void registerWorldChunkManager() { + super.registerWorldChunkManager(); + Config.chunkFix = true; + } + + /**+ + * Returns the dimension's name, e.g. "The End", "Nether", or + * "Overworld". + */ + public String getDimensionName() { + return "Overworld"; + } + + public String getInternalNameSuffix() { + return ""; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSavedData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSavedData.java new file mode 100644 index 0000000..d672a61 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSavedData.java @@ -0,0 +1,66 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.minecraft.nbt.NBTTagCompound; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldSavedData { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldSavedData"); + } + + public final String mapName; + private boolean dirty; + + public WorldSavedData(String name) { + this.mapName = name; + } + + public abstract void readFromNBT(NBTTagCompound var1); + + public abstract void writeToNBT(NBTTagCompound var1); + + /**+ + * Marks this MapDataBase dirty, to be saved to disk when the + * level next saves. + */ + public void markDirty() { + this.setDirty(true); + } + + /**+ + * Sets the dirty state of this MapDataBase, whether it needs + * saving to disk. + */ + public void setDirty(boolean isDirty) { + this.dirty = isDirty; + } + + /**+ + * Whether this MapDataBase needs saving to disk. + */ + public boolean isDirty() { + return this.dirty; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServer.java new file mode 100644 index 0000000..edd85a9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServer.java @@ -0,0 +1,1076 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import com.google.common.base.Predicate; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import java.util.TreeSet; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.CrashReportHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEventData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLivingBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityTracker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.INpc; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.effect.EntityLightningBolt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityAnimal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWaterMob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S19PacketEntityStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S24PacketBlockAction; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S27PacketExplosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2APacketParticles; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.profiler.Profiler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreboardSaveData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ServerScoreboard; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.PlayerManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumParticleTypes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IThreadListener; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageCollection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageSiege; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Explosion; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.NextTickListEntry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.SpawnerAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.Teleporter; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +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.chunk.storage.ExtendedBlockStorage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.IChunkLoader; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGeneratorBonusChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +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.MapStorage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldServer extends World implements IThreadListener { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldServer"); + } + + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer mcServer; + private final EntityTracker theEntityTracker; + private final PlayerManager thePlayerManager; + private final Set pendingTickListEntriesHashSet = Sets.newHashSet(); + /**+ + * All work to do in future ticks. + */ + private final TreeSet pendingTickListEntriesTreeSet = new TreeSet(); + private final Map entitiesByUuid = Maps.newHashMap(); + public ChunkProviderServer theChunkProviderServer; + public boolean disableLevelSaving; + private boolean allPlayersSleeping; + private int updateEntityTick; + private final Teleporter worldTeleporter; + private final SpawnerAnimals mobSpawner = new SpawnerAnimals(); + protected final VillageSiege villageSiege = new VillageSiege(this); + private WorldServer.ServerBlockEventList[] field_147490_S = new WorldServer.ServerBlockEventList[] { + new WorldServer.ServerBlockEventList(), new WorldServer.ServerBlockEventList() }; + private int blockEventCacheIndex; + private static final List bonusChestContent = Lists + .newArrayList(new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.stick, 0, 1, 3, 10), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.planks), 0, 1, 3, 10), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log), 0, 1, 3, 10), + new WeightedRandomChestContent(Items.stone_axe, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.wooden_axe, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.stone_pickaxe, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.wooden_pickaxe, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.apple, 0, 2, 3, 5), + new WeightedRandomChestContent(Items.bread, 0, 2, 3, 3), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log2), 0, 1, 3, 10) }); + private List pendingTickListEntriesThisTick = Lists.newArrayList(); + + public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, + Profiler profilerIn) { + super(saveHandlerIn, info, WorldProvider.getProviderForDimension(dimensionId), profilerIn, false); + this.mcServer = server; + this.theEntityTracker = new EntityTracker(this); + this.thePlayerManager = new PlayerManager(this); + this.provider.registerWorld(this); + this.chunkProvider = this.createChunkProvider(); + this.worldTeleporter = new Teleporter(this); + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + this.getWorldBorder().setSize(server.getMaxWorldSize()); + } + + public World init() { + this.mapStorage = new MapStorage(this.saveHandler); + String s = VillageCollection.fileNameForProvider(this.provider); + VillageCollection villagecollection = (VillageCollection) this.mapStorage.loadData(VillageCollection.class, s); + if (villagecollection == null) { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData(s, this.villageCollectionObj); + } else { + this.villageCollectionObj = villagecollection; + this.villageCollectionObj.setWorldsForAll(this); + } + + this.worldScoreboard = new ServerScoreboard(this.mcServer); + ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData) this.mapStorage.loadData(ScoreboardSaveData.class, + "scoreboard"); + if (scoreboardsavedata == null) { + scoreboardsavedata = new ScoreboardSaveData(); + this.mapStorage.setData("scoreboard", scoreboardsavedata); + } + + scoreboardsavedata.setScoreboard(this.worldScoreboard); + ((ServerScoreboard) this.worldScoreboard).func_96547_a(scoreboardsavedata); + this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ()); + this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock()); + this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone()); + this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance()); + this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime()); + if (this.worldInfo.getBorderLerpTime() > 0L) { + this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), + this.worldInfo.getBorderLerpTime()); + } else { + this.getWorldBorder().setTransition(this.worldInfo.getBorderSize()); + } + + return this; + } + + /**+ + * Runs a single tick for the world + */ + public void tick() { + super.tick(); + if (this.getWorldInfo().isHardcoreModeEnabled() && this.getDifficulty() != EnumDifficulty.HARD) { + this.getWorldInfo().setDifficulty(EnumDifficulty.HARD); + } + + this.provider.getWorldChunkManager().cleanupCache(); + if (this.areAllPlayersAsleep()) { + if (this.getGameRules().getBoolean("doDaylightCycle")) { + long i = this.worldInfo.getWorldTime() + 24000L; + this.worldInfo.setWorldTime(i - i % 24000L); + } + + this.wakeAllPlayers(); + } + + this.theProfiler.startSection("mobSpawner"); + if (this.getGameRules().getBoolean("doMobSpawning") + && this.worldInfo.getTerrainType() != WorldType.DEBUG_WORLD) { + this.mobSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, + this.worldInfo.getWorldTotalTime() % 400L == 0L); + } + + this.theProfiler.endStartSection("chunkSource"); + this.chunkProvider.unloadQueuedChunks(); + int j = this.calculateSkylightSubtracted(1.0F); + if (j != this.getSkylightSubtracted()) { + this.setSkylightSubtracted(j); + } + + this.worldInfo.setWorldTotalTime(this.worldInfo.getWorldTotalTime() + 1L); + if (this.getGameRules().getBoolean("doDaylightCycle")) { + this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L); + } + + this.theProfiler.endStartSection("tickPending"); + this.tickUpdates(false); + this.theProfiler.endStartSection("tickBlocks"); + this.updateBlocks(); + this.theProfiler.endStartSection("chunkMap"); + this.thePlayerManager.updatePlayerInstances(); + this.theProfiler.endStartSection("village"); + this.villageCollectionObj.tick(); + this.villageSiege.tick(); + this.theProfiler.endStartSection("portalForcer"); + this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); + this.theProfiler.endSection(); + this.sendQueuedBlockEvents(); + } + + public BiomeGenBase.SpawnListEntry getSpawnListEntryForTypeAt(EnumCreatureType creatureType, BlockPos pos) { + List list = this.getChunkProvider().getPossibleCreatures(creatureType, pos); + return list != null && !list.isEmpty() + ? (BiomeGenBase.SpawnListEntry) WeightedRandom.getRandomItem(this.rand, list) + : null; + } + + public boolean canCreatureTypeSpawnHere(EnumCreatureType creatureType, BiomeGenBase.SpawnListEntry spawnListEntry, + BlockPos pos) { + List list = this.getChunkProvider().getPossibleCreatures(creatureType, pos); + return list != null && !list.isEmpty() ? list.contains(spawnListEntry) : false; + } + + /**+ + * Updates the flag that indicates whether or not all players in + * the world are sleeping. + */ + public void updateAllPlayersSleepingFlag() { + this.allPlayersSleeping = false; + if (!this.playerEntities.isEmpty()) { + int i = 0; + int j = 0; + + for (EntityPlayer entityplayer : this.playerEntities) { + if (entityplayer.isSpectator()) { + ++i; + } else if (entityplayer.isPlayerSleeping()) { + ++j; + } + } + + this.allPlayersSleeping = j > 0 && j >= this.playerEntities.size() - i; + } + + } + + protected void wakeAllPlayers() { + this.allPlayersSleeping = false; + + for (EntityPlayer entityplayer : this.playerEntities) { + if (entityplayer.isPlayerSleeping()) { + entityplayer.wakeUpPlayer(false, false, true); + } + } + + this.resetRainAndThunder(); + } + + private void resetRainAndThunder() { + this.worldInfo.setRainTime(0); + this.worldInfo.setRaining(false); + this.worldInfo.setThunderTime(0); + this.worldInfo.setThundering(false); + } + + public boolean areAllPlayersAsleep() { + if (this.allPlayersSleeping) { + for (EntityPlayer entityplayer : this.playerEntities) { + if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep()) { + return false; + } + } + + return true; + } else { + return false; + } + } + + /**+ + * Sets a new spawn location by finding an uncovered block at a + * random (x,z) location in the chunk. + */ + public void setInitialSpawnLocation() { + if (this.worldInfo.getSpawnY() <= 0) { + this.worldInfo.setSpawnY(this.func_181545_F() + 1); + } + + int i = this.worldInfo.getSpawnX(); + int j = this.worldInfo.getSpawnZ(); + int k = 0; + + while (this.getGroundAboveSeaLevel(new BlockPos(i, 0, j)).getMaterial() == Material.air) { + i += this.rand.nextInt(8) - this.rand.nextInt(8); + j += this.rand.nextInt(8) - this.rand.nextInt(8); + ++k; + if (k == 10000) { + break; + } + } + + this.worldInfo.setSpawnX(i); + this.worldInfo.setSpawnZ(j); + } + + protected void updateBlocks() { + super.updateBlocks(); + if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) { + for (ChunkCoordIntPair chunkcoordintpair1 : this.activeChunkSet) { + this.getChunkFromChunkCoords(chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos) + .func_150804_b(false); + } + + } else { + int i = 0; + int j = 0; + + for (ChunkCoordIntPair chunkcoordintpair : this.activeChunkSet) { + int k = chunkcoordintpair.chunkXPos * 16; + int l = chunkcoordintpair.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + this.playMoodSoundAndCheckLight(k, l, chunk); + this.theProfiler.endStartSection("tickChunk"); + chunk.func_150804_b(false); + this.theProfiler.endStartSection("thunder"); + if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int i1 = this.updateLCG >> 2; + BlockPos blockpos = this + .adjustPosToNearbyEntity(new BlockPos(k + (i1 & 15), 0, l + (i1 >> 8 & 15))); + if (this.canLightningStrike(blockpos)) { + this.addWeatherEffect(new EntityLightningBolt(this, (double) blockpos.getX(), + (double) blockpos.getY(), (double) blockpos.getZ())); + } + } + + this.theProfiler.endStartSection("iceandsnow"); + if (this.rand.nextInt(16) == 0) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int k2 = this.updateLCG >> 2; + BlockPos blockpos2 = this + .getPrecipitationHeight(new BlockPos(k + (k2 & 15), 0, l + (k2 >> 8 & 15))); + BlockPos blockpos1 = blockpos2.down(); + if (this.canBlockFreezeNoWater(blockpos1)) { + this.setBlockState(blockpos1, Blocks.ice.getDefaultState()); + } + + if (this.isRaining() && this.canSnowAt(blockpos2, true)) { + this.setBlockState(blockpos2, Blocks.snow_layer.getDefaultState()); + } + + if (this.isRaining() && this.getBiomeGenForCoords(blockpos1).canSpawnLightningBolt()) { + this.getBlockState(blockpos1).getBlock().fillWithRain(this, blockpos1); + } + } + + this.theProfiler.endStartSection("tickBlocks"); + int l2 = this.getGameRules().getInt("randomTickSpeed"); + if (l2 > 0) { + for (ExtendedBlockStorage extendedblockstorage : chunk.getBlockStorageArray()) { + if (extendedblockstorage != null && extendedblockstorage.getNeedsRandomTick()) { + for (int j1 = 0; j1 < l2; ++j1) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int k1 = this.updateLCG >> 2; + int l1 = k1 & 15; + int i2 = k1 >> 8 & 15; + int j2 = k1 >> 16 & 15; + ++j; + IBlockState iblockstate = extendedblockstorage.get(l1, j2, i2); + Block block = iblockstate.getBlock(); + if (block.getTickRandomly()) { + ++i; + block.randomTick(this, + new BlockPos(l1 + k, j2 + extendedblockstorage.getYLocation(), i2 + l), + iblockstate, this.rand); + ++EaglerMinecraftServer.counterTileUpdate; + } + } + } + } + } + + this.theProfiler.endSection(); + } + + } + } + + protected BlockPos adjustPosToNearbyEntity(BlockPos pos) { + BlockPos blockpos = this.getPrecipitationHeight(pos); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockpos, + new BlockPos(blockpos.getX(), this.getHeight(), blockpos.getZ()))).expand(3.0D, 3.0D, 3.0D); + List list = this.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb, + new Predicate() { + public boolean apply(EntityLivingBase entitylivingbase) { + return entitylivingbase != null && entitylivingbase.isEntityAlive() + && WorldServer.this.canSeeSky(entitylivingbase.getPosition()); + } + }); + return !list.isEmpty() ? ((EntityLivingBase) list.get(this.rand.nextInt(list.size()))).getPosition() : blockpos; + } + + public boolean isBlockTickPending(BlockPos blockpos, Block block) { + NextTickListEntry nextticklistentry = new NextTickListEntry(blockpos, block); + return this.pendingTickListEntriesThisTick.contains(nextticklistentry); + } + + public void scheduleUpdate(BlockPos blockpos, Block block, int i) { + this.updateBlockTick(blockpos, block, i, 0); + } + + public void updateBlockTick(BlockPos blockpos, Block block, int i, int j) { + NextTickListEntry nextticklistentry = new NextTickListEntry(blockpos, block); + byte b0 = 0; + if (this.scheduledUpdatesAreImmediate && block.getMaterial() != Material.air) { + if (block.requiresUpdates()) { + b0 = 8; + if (this.isAreaLoaded(nextticklistentry.position.add(-b0, -b0, -b0), + nextticklistentry.position.add(b0, b0, b0))) { + IBlockState iblockstate = this.getBlockState(nextticklistentry.position); + if (iblockstate.getBlock().getMaterial() != Material.air + && iblockstate.getBlock() == nextticklistentry.getBlock()) { + iblockstate.getBlock().updateTick(this, nextticklistentry.position, iblockstate, this.rand); + ++EaglerMinecraftServer.counterTileUpdate; + } + } + + return; + } + + i = 1; + } + + if (this.isAreaLoaded(blockpos.add(-b0, -b0, -b0), blockpos.add(b0, b0, b0))) { + if (block.getMaterial() != Material.air) { + nextticklistentry.setScheduledTime((long) i + this.worldInfo.getWorldTotalTime()); + nextticklistentry.setPriority(j); + } + + if (!this.pendingTickListEntriesHashSet.contains(nextticklistentry)) { + this.pendingTickListEntriesHashSet.add(nextticklistentry); + this.pendingTickListEntriesTreeSet.add(nextticklistentry); + } + } + + } + + public void scheduleBlockUpdate(BlockPos blockpos, Block block, int i, int j) { + NextTickListEntry nextticklistentry = new NextTickListEntry(blockpos, block); + nextticklistentry.setPriority(j); + if (block.getMaterial() != Material.air) { + nextticklistentry.setScheduledTime((long) i + this.worldInfo.getWorldTotalTime()); + } + + if (!this.pendingTickListEntriesHashSet.contains(nextticklistentry)) { + this.pendingTickListEntriesHashSet.add(nextticklistentry); + this.pendingTickListEntriesTreeSet.add(nextticklistentry); + } + + } + + /**+ + * Updates (and cleans up) entities and tile entities + */ + public void updateEntities() { + if (this.playerEntities.isEmpty()) { + if (this.updateEntityTick++ >= 1200) { + return; + } + } else { + this.resetUpdateEntityTick(); + } + + super.updateEntities(); + } + + /**+ + * Resets the updateEntityTick field to 0 + */ + public void resetUpdateEntityTick() { + this.updateEntityTick = 0; + } + + /**+ + * Runs through the list of updates to run and ticks them + */ + public boolean tickUpdates(boolean flag) { + if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) { + return false; + } else { + int i = this.pendingTickListEntriesTreeSet.size(); + if (i != this.pendingTickListEntriesHashSet.size()) { + throw new IllegalStateException("TickNextTick list out of synch"); + } else { + if (i > 1000) { + i = 1000; + } + + this.theProfiler.startSection("cleaning"); + + for (int j = 0; j < i; ++j) { + NextTickListEntry nextticklistentry = (NextTickListEntry) this.pendingTickListEntriesTreeSet + .first(); + if (!flag && nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime()) { + break; + } + + this.pendingTickListEntriesTreeSet.remove(nextticklistentry); + this.pendingTickListEntriesHashSet.remove(nextticklistentry); + this.pendingTickListEntriesThisTick.add(nextticklistentry); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("ticking"); + Iterator iterator = this.pendingTickListEntriesThisTick.iterator(); + + while (iterator.hasNext()) { + NextTickListEntry nextticklistentry1 = (NextTickListEntry) iterator.next(); + iterator.remove(); + byte b0 = 0; + if (this.isAreaLoaded(nextticklistentry1.position.add(-b0, -b0, -b0), + nextticklistentry1.position.add(b0, b0, b0))) { + IBlockState iblockstate = this.getBlockState(nextticklistentry1.position); + if (iblockstate.getBlock().getMaterial() != Material.air + && Block.isEqualTo(iblockstate.getBlock(), nextticklistentry1.getBlock())) { + try { + iblockstate.getBlock().updateTick(this, nextticklistentry1.position, iblockstate, + this.rand); + ++EaglerMinecraftServer.counterTileUpdate; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, + "Exception while ticking a block"); + CrashReportCategory crashreportcategory = crashreport + .makeCategory("Block being ticked"); + CrashReportHelper.addIntegratedServerBlockInfo(crashreportcategory, + nextticklistentry1.position, iblockstate); + throw new ReportedException(crashreport); + } + } + } else { + this.scheduleUpdate(nextticklistentry1.position, nextticklistentry1.getBlock(), 0); + } + } + + this.theProfiler.endSection(); + this.pendingTickListEntriesThisTick.clear(); + return !this.pendingTickListEntriesTreeSet.isEmpty(); + } + } + } + + public List getPendingBlockUpdates(Chunk chunk, boolean flag) { + ChunkCoordIntPair chunkcoordintpair = chunk.getChunkCoordIntPair(); + int i = (chunkcoordintpair.chunkXPos << 4) - 2; + int j = i + 16 + 2; + int k = (chunkcoordintpair.chunkZPos << 4) - 2; + int l = k + 16 + 2; + return this.func_175712_a(new StructureBoundingBox(i, 0, k, j, 256, l), flag); + } + + public List func_175712_a(StructureBoundingBox structureboundingbox, boolean flag) { + ArrayList arraylist = null; + + for (int i = 0; i < 2; ++i) { + Iterator iterator; + if (i == 0) { + iterator = this.pendingTickListEntriesTreeSet.iterator(); + } else { + iterator = this.pendingTickListEntriesThisTick.iterator(); + } + + while (iterator.hasNext()) { + NextTickListEntry nextticklistentry = (NextTickListEntry) iterator.next(); + BlockPos blockpos = nextticklistentry.position; + if (blockpos.getX() >= structureboundingbox.minX && blockpos.getX() < structureboundingbox.maxX + && blockpos.getZ() >= structureboundingbox.minZ + && blockpos.getZ() < structureboundingbox.maxZ) { + if (flag) { + this.pendingTickListEntriesHashSet.remove(nextticklistentry); + iterator.remove(); + } + + if (arraylist == null) { + arraylist = Lists.newArrayList(); + } + + arraylist.add(nextticklistentry); + } + } + } + + return arraylist; + } + + /**+ + * Will update the entity in the world if the chunk the entity + * is in is currently loaded or its forced to update. Args: + * entity, forceUpdate + */ + public void updateEntityWithOptionalForce(Entity entity, boolean flag) { + if (!this.canSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterMob)) { + entity.setDead(); + } + + if (!this.canSpawnNPCs() && entity instanceof INpc) { + entity.setDead(); + } + + super.updateEntityWithOptionalForce(entity, flag); + } + + private boolean canSpawnNPCs() { + return this.mcServer.getCanSpawnNPCs(); + } + + private boolean canSpawnAnimals() { + return this.mcServer.getCanSpawnAnimals(); + } + + /**+ + * Creates the chunk provider for this world. Called in the + * constructor. Retrieves provider from worldProvider? + */ + protected IChunkProvider createChunkProvider() { + IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider); + this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator()); + return this.theChunkProviderServer; + } + + /**+ + * Returns all the tile entities located between the given + * coordinates + */ + public List getTileEntitiesIn(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < this.loadedTileEntityList.size(); ++i) { + TileEntity tileentity = (TileEntity) this.loadedTileEntityList.get(i); + BlockPos blockpos = tileentity.getPos(); + if (blockpos.getX() >= minX && blockpos.getY() >= minY && blockpos.getZ() >= minZ && blockpos.getX() < maxX + && blockpos.getY() < maxY && blockpos.getZ() < maxZ) { + arraylist.add(tileentity); + } + } + + return arraylist; + } + + public boolean isBlockModifiable(EntityPlayer entityplayer, BlockPos blockpos) { + return !this.mcServer.isBlockProtected(this, blockpos, entityplayer) + && this.getWorldBorder().contains(blockpos); + } + + public void initialize(WorldSettings worldsettings) { + if (!this.worldInfo.isInitialized()) { + try { + this.createSpawnPosition(worldsettings); + if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) { + this.setDebugWorldSettings(); + } + + super.initialize(worldsettings); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception initializing level"); + + try { + this.addWorldInfoToCrashReport(crashreport); + } catch (Throwable var5) { + ; + } + + throw new ReportedException(crashreport); + } + + this.worldInfo.setServerInitialized(true); + } + + } + + private void setDebugWorldSettings() { + this.worldInfo.setMapFeaturesEnabled(false); + this.worldInfo.setAllowCommands(true); + this.worldInfo.setRaining(false); + this.worldInfo.setThundering(false); + this.worldInfo.setCleanWeatherTime(1000000000); + this.worldInfo.setWorldTime(6000L); + this.worldInfo.setGameType(WorldSettings.GameType.SPECTATOR); + this.worldInfo.setHardcore(false); + this.worldInfo.setDifficulty(EnumDifficulty.PEACEFUL); + this.worldInfo.setDifficultyLocked(true); + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false"); + } + + /**+ + * creates a spawn position at random within 256 blocks of 0,0 + */ + private void createSpawnPosition(WorldSettings parWorldSettings) { + if (!this.provider.canRespawnHere()) { + this.worldInfo.setSpawn(BlockPos.ORIGIN.up(this.provider.getAverageGroundLevel())); + } else if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) { + this.worldInfo.setSpawn(BlockPos.ORIGIN.up()); + } else { + this.findingSpawnPoint = true; + WorldChunkManager worldchunkmanager = this.provider.getWorldChunkManager(); + List list = worldchunkmanager.getBiomesToSpawnIn(); + EaglercraftRandom random = new EaglercraftRandom(this.getSeed()); + BlockPos blockpos = worldchunkmanager.findBiomePosition(0, 0, 256, list, random); + int i = 0; + int j = this.provider.getAverageGroundLevel(); + int k = 0; + if (blockpos != null) { + i = blockpos.getX(); + k = blockpos.getZ(); + } else { + logger.warn("Unable to find spawn biome"); + } + + int l = 0; + + while (!this.provider.canCoordinateBeSpawn(i, k)) { + i += random.nextInt(64) - random.nextInt(64); + k += random.nextInt(64) - random.nextInt(64); + ++l; + if (l == 1000) { + break; + } + } + + this.worldInfo.setSpawn(new BlockPos(i, j, k)); + this.findingSpawnPoint = false; + if (parWorldSettings.isBonusChestEnabled()) { + this.createBonusChest(); + } + + } + } + + /**+ + * Creates the bonus chest in the world. + */ + protected void createBonusChest() { + WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10); + + for (int i = 0; i < 10; ++i) { + int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6); + int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6); + BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up(); + if (worldgeneratorbonuschest.generate(this, this.rand, blockpos)) { + break; + } + } + + } + + /**+ + * Returns null for anything other than the End + */ + public BlockPos getSpawnCoordinate() { + return this.provider.getSpawnCoordinate(); + } + + /**+ + * Saves all chunks to disk while updating progress bar. + */ + public void saveAllChunks(boolean progressCallback, IProgressUpdate parIProgressUpdate) throws MinecraftException { + if (this.chunkProvider.canSave()) { + if (parIProgressUpdate != null) { + parIProgressUpdate.displaySavingString("Saving level"); + } + + this.saveLevel(); + if (parIProgressUpdate != null) { + parIProgressUpdate.displayLoadingString("Saving chunks"); + } + + this.chunkProvider.saveChunks(progressCallback, parIProgressUpdate); + + for (Chunk chunk : Lists.newArrayList(this.theChunkProviderServer.func_152380_a())) { + if (chunk != null && !this.thePlayerManager.hasPlayerInstance(chunk.xPosition, chunk.zPosition)) { + this.theChunkProviderServer.dropChunk(chunk.xPosition, chunk.zPosition); + } + } + + } + } + + /**+ + * saves chunk data - currently only called during execution of + * the Save All command + */ + public void saveChunkData() { + if (this.chunkProvider.canSave()) { + this.chunkProvider.saveExtraData(); + } + } + + /**+ + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException { + this.checkSessionLock(); + this.worldInfo.setBorderSize(this.getWorldBorder().getDiameter()); + this.worldInfo.getBorderCenterX(this.getWorldBorder().getCenterX()); + this.worldInfo.getBorderCenterZ(this.getWorldBorder().getCenterZ()); + this.worldInfo.setBorderSafeZone(this.getWorldBorder().getDamageBuffer()); + this.worldInfo.setBorderDamagePerBlock(this.getWorldBorder().getDamageAmount()); + this.worldInfo.setBorderWarningDistance(this.getWorldBorder().getWarningDistance()); + this.worldInfo.setBorderWarningTime(this.getWorldBorder().getWarningTime()); + this.worldInfo.setBorderLerpTarget(this.getWorldBorder().getTargetSize()); + this.worldInfo.setBorderLerpTime(this.getWorldBorder().getTimeUntilTarget()); + this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, + this.mcServer.getConfigurationManager().getHostPlayerData()); + this.mapStorage.saveAllData(); + } + + protected void onEntityAdded(Entity entity) { + super.onEntityAdded(entity); + this.entitiesById.addKey(entity.getEntityId(), entity); + this.entitiesByUuid.put(entity.getUniqueID(), entity); + Entity[] aentity = entity.getParts(); + if (aentity != null) { + for (int i = 0; i < aentity.length; ++i) { + this.entitiesById.addKey(aentity[i].getEntityId(), aentity[i]); + } + } + + } + + protected void onEntityRemoved(Entity entity) { + super.onEntityRemoved(entity); + this.entitiesById.removeObject(entity.getEntityId()); + this.entitiesByUuid.remove(entity.getUniqueID()); + Entity[] aentity = entity.getParts(); + if (aentity != null) { + for (int i = 0; i < aentity.length; ++i) { + this.entitiesById.removeObject(aentity[i].getEntityId()); + } + } + + } + + /**+ + * adds a lightning bolt to the list of lightning bolts in this + * world. + */ + public boolean addWeatherEffect(Entity entity) { + if (super.addWeatherEffect(entity)) { + this.mcServer.getConfigurationManager().sendToAllNear(entity.posX, entity.posY, entity.posZ, 512.0D, + this.provider.getDimensionId(), new S2CPacketSpawnGlobalEntity(entity)); + return true; + } else { + return false; + } + } + + /**+ + * sends a Packet 38 (Entity Status) to all tracked players of + * that entity + */ + public void setEntityState(Entity entity, byte b0) { + this.getEntityTracker().func_151248_b(entity, new S19PacketEntityStatus(entity, b0)); + } + + /**+ + * returns a new explosion. Does initiation (at time of writing + * Explosion is not finished) + */ + public Explosion newExplosion(Entity entity, double d0, double d1, double d2, float f, boolean flag, + boolean flag1) { + Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, flag1); + explosion.doExplosionA(); + explosion.doExplosionB(false); + if (!flag1) { + explosion.func_180342_d(); + } + + for (EntityPlayer entityplayer : this.playerEntities) { + if (entityplayer.getDistanceSq(d0, d1, d2) < 4096.0D) { + ((EntityPlayerMP) entityplayer).playerNetServerHandler + .sendPacket(new S27PacketExplosion(d0, d1, d2, f, explosion.getAffectedBlockPositions(), + (Vec3) explosion.getPlayerKnockbackMap().get(entityplayer))); + } + } + + return explosion; + } + + public void addBlockEvent(BlockPos blockpos, Block block, int i, int j) { + BlockEventData blockeventdata = new BlockEventData(blockpos, block, i, j); + + for (BlockEventData blockeventdata1 : this.field_147490_S[this.blockEventCacheIndex]) { + if (blockeventdata1.equals(blockeventdata)) { + return; + } + } + + this.field_147490_S[this.blockEventCacheIndex].add(blockeventdata); + } + + private void sendQueuedBlockEvents() { + while (!this.field_147490_S[this.blockEventCacheIndex].isEmpty()) { + int i = this.blockEventCacheIndex; + this.blockEventCacheIndex ^= 1; + + for (BlockEventData blockeventdata : this.field_147490_S[i]) { + if (this.fireBlockEvent(blockeventdata)) { + this.mcServer.getConfigurationManager().sendToAllNear((double) blockeventdata.getPosition().getX(), + (double) blockeventdata.getPosition().getY(), (double) blockeventdata.getPosition().getZ(), + 64.0D, this.provider.getDimensionId(), + new S24PacketBlockAction(blockeventdata.getPosition(), blockeventdata.getBlock(), + blockeventdata.getEventID(), blockeventdata.getEventParameter())); + } + } + + this.field_147490_S[i].clear(); + } + + } + + private boolean fireBlockEvent(BlockEventData event) { + IBlockState iblockstate = this.getBlockState(event.getPosition()); + return iblockstate.getBlock() == event.getBlock() ? iblockstate.getBlock().onBlockEventReceived(this, + event.getPosition(), iblockstate, event.getEventID(), event.getEventParameter()) : false; + } + + /**+ + * Syncs all changes to disk and wait for completion. + */ + public void flush() { + this.saveHandler.flush(); + } + + /**+ + * Updates all weather states. + */ + protected void updateWeather() { + boolean flag = this.isRaining(); + super.updateWeather(); + if (this.prevRainingStrength != this.rainingStrength) { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension( + new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.getDimensionId()); + } + + if (this.prevThunderingStrength != this.thunderingStrength) { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension( + new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.getDimensionId()); + } + + if (flag != this.isRaining()) { + if (flag) { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F)); + } else { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(1, 0.0F)); + } + + this.mcServer.getConfigurationManager() + .sendPacketToAllPlayers(new S2BPacketChangeGameState(7, this.rainingStrength)); + this.mcServer.getConfigurationManager() + .sendPacketToAllPlayers(new S2BPacketChangeGameState(8, this.thunderingStrength)); + } + + } + + protected int getRenderDistanceChunks() { + return this.mcServer.getConfigurationManager().getViewDistance(); + } + + public MinecraftServer getMinecraftServer() { + return this.mcServer; + } + + /**+ + * Gets the EntityTracker + */ + public EntityTracker getEntityTracker() { + return this.theEntityTracker; + } + + public PlayerManager getPlayerManager() { + return this.thePlayerManager; + } + + public Teleporter getDefaultTeleporter() { + return this.worldTeleporter; + } + + /**+ + * Spawns the desired particle and sends the necessary packets + * to the relevant connected players. + */ + public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, + int numberOfParticles, double parDouble4, double parDouble5, double parDouble6, double parDouble7, + int... parArrayOfInt) { + this.spawnParticle(particleType, false, xCoord, yCoord, zCoord, numberOfParticles, parDouble4, parDouble5, + parDouble6, parDouble7, parArrayOfInt); + } + + /**+ + * Spawns the desired particle and sends the necessary packets + * to the relevant connected players. + */ + public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, + double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, + int... parArrayOfInt) { + S2APacketParticles s2apacketparticles = new S2APacketParticles(particleType, longDistance, (float) xCoord, + (float) yCoord, (float) zCoord, (float) xOffset, (float) yOffset, (float) zOffset, + (float) particleSpeed, numberOfParticles, parArrayOfInt); + + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntities.get(i); + BlockPos blockpos = entityplayermp.getPosition(); + double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord); + if (d0 <= 256.0D || longDistance && d0 <= 65536.0D) { + entityplayermp.playerNetServerHandler.sendPacket(s2apacketparticles); + } + } + + } + + public Entity getEntityFromUuid(EaglercraftUUID uuid) { + return (Entity) this.entitiesByUuid.get(uuid); + } + + public void addScheduledTask(Runnable runnable) { + this.mcServer.addScheduledTask(runnable); + } + + public boolean isCallingFromMinecraftThread() { + return this.mcServer.isCallingFromMinecraftThread(); + } + + static class ServerBlockEventList extends ArrayList { + private ServerBlockEventList() { + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServerMulti.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServerMulti.java new file mode 100644 index 0000000..baafaa0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServerMulti.java @@ -0,0 +1,100 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +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.village.VillageCollection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +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.border.IBorderListener; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.DerivedWorldInfo; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.ISaveHandler; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldServerMulti extends WorldServer { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldServerMulti"); + } + + private WorldServer delegate; + + public WorldServerMulti(MinecraftServer server, ISaveHandler saveHandlerIn, int dimensionId, WorldServer delegate, + Profiler profilerIn) { + super(server, saveHandlerIn, new DerivedWorldInfo(delegate.getWorldInfo()), dimensionId, profilerIn); + this.delegate = delegate; + delegate.getWorldBorder().addListener(new IBorderListener() { + public void onSizeChanged(WorldBorder var1, double d0) { + WorldServerMulti.this.getWorldBorder().setTransition(d0); + } + + public void onTransitionStarted(WorldBorder var1, double d0, double d1, long i) { + WorldServerMulti.this.getWorldBorder().setTransition(d0, d1, i); + } + + public void onCenterChanged(WorldBorder var1, double d0, double d1) { + WorldServerMulti.this.getWorldBorder().setCenter(d0, d1); + } + + public void onWarningTimeChanged(WorldBorder var1, int i) { + WorldServerMulti.this.getWorldBorder().setWarningTime(i); + } + + public void onWarningDistanceChanged(WorldBorder var1, int i) { + WorldServerMulti.this.getWorldBorder().setWarningDistance(i); + } + + public void onDamageAmountChanged(WorldBorder var1, double d0) { + WorldServerMulti.this.getWorldBorder().setDamageAmount(d0); + } + + public void onDamageBufferChanged(WorldBorder var1, double d0) { + WorldServerMulti.this.getWorldBorder().setDamageBuffer(d0); + } + }); + } + + /**+ + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException { + } + + public World init() { + this.mapStorage = this.delegate.getMapStorage(); + this.worldScoreboard = this.delegate.getScoreboard(); + String s = VillageCollection.fileNameForProvider(this.provider); + VillageCollection villagecollection = (VillageCollection) this.mapStorage.loadData(VillageCollection.class, s); + if (villagecollection == null) { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData(s, this.villageCollectionObj); + } else { + this.villageCollectionObj = villagecollection; + this.villageCollectionObj.setWorldsForAll(this); + } + + return this; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSettings.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSettings.java new file mode 100644 index 0000000..716e142 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSettings.java @@ -0,0 +1,210 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.PlayerCapabilities; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class WorldSettings { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldSettings"); + } + + private final long seed; + private final WorldSettings.GameType theGameType; + private final boolean mapFeaturesEnabled; + private final boolean hardcoreEnabled; + private final WorldType terrainType; + private boolean commandsAllowed; + private boolean bonusChestEnabled; + private String worldName; + + public WorldSettings(long seedIn, WorldSettings.GameType gameType, boolean enableMapFeatures, boolean hardcoreMode, + WorldType worldTypeIn) { + this.worldName = ""; + this.seed = seedIn; + this.theGameType = gameType; + this.mapFeaturesEnabled = enableMapFeatures; + this.hardcoreEnabled = hardcoreMode; + this.terrainType = worldTypeIn; + } + + public WorldSettings(WorldInfo info) { + this(info.getSeed(), info.getGameType(), info.isMapFeaturesEnabled(), info.isHardcoreModeEnabled(), + info.getTerrainType()); + } + + /**+ + * Enables the bonus chest. + */ + public WorldSettings enableBonusChest() { + this.bonusChestEnabled = true; + return this; + } + + /**+ + * Enables Commands (cheats). + */ + public WorldSettings enableCommands() { + this.commandsAllowed = true; + return this; + } + + public WorldSettings setWorldName(String name) { + this.worldName = name; + return this; + } + + /**+ + * Returns true if the Bonus Chest is enabled. + */ + public boolean isBonusChestEnabled() { + return this.bonusChestEnabled; + } + + /**+ + * Returns the seed for the world. + */ + public long getSeed() { + return this.seed; + } + + /**+ + * Gets the game type. + */ + public WorldSettings.GameType getGameType() { + return this.theGameType; + } + + /**+ + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean getHardcoreEnabled() { + return this.hardcoreEnabled; + } + + /**+ + * Get whether the map features (e.g. strongholds) generation is + * enabled or disabled. + */ + public boolean isMapFeaturesEnabled() { + return this.mapFeaturesEnabled; + } + + public WorldType getTerrainType() { + return this.terrainType; + } + + /**+ + * Returns true if Commands (cheats) are allowed. + */ + public boolean areCommandsAllowed() { + return this.commandsAllowed; + } + + /**+ + * Gets the GameType by ID + */ + public static WorldSettings.GameType getGameTypeById(int id) { + return WorldSettings.GameType.getByID(id); + } + + public String getWorldName() { + return this.worldName; + } + + public static enum GameType { + NOT_SET(-1, ""), SURVIVAL(0, "survival"), CREATIVE(1, "creative"), ADVENTURE(2, "adventure"), + SPECTATOR(3, "spectator"); + + int id; + String name; + + private GameType(int typeId, String nameIn) { + this.id = typeId; + this.name = nameIn; + } + + public int getID() { + return this.id; + } + + public String getName() { + return this.name; + } + + public void configurePlayerCapabilities(PlayerCapabilities capabilities) { + if (this == CREATIVE) { + capabilities.allowFlying = true; + capabilities.isCreativeMode = true; + capabilities.disableDamage = true; + } else if (this == SPECTATOR) { + capabilities.allowFlying = true; + capabilities.isCreativeMode = false; + capabilities.disableDamage = true; + capabilities.isFlying = true; + } else { + capabilities.allowFlying = false; + capabilities.isCreativeMode = false; + capabilities.disableDamage = false; + capabilities.isFlying = false; + } + + capabilities.allowEdit = !this.isAdventure(); + } + + public boolean isAdventure() { + return this == ADVENTURE || this == SPECTATOR; + } + + public boolean isCreative() { + return this == CREATIVE; + } + + public boolean isSurvivalOrAdventure() { + return this == SURVIVAL || this == ADVENTURE; + } + + public static WorldSettings.GameType getByID(int idIn) { + for (WorldSettings.GameType worldsettings$gametype : values()) { + if (worldsettings$gametype.id == idIn) { + return worldsettings$gametype; + } + } + + return SURVIVAL; + } + + public static WorldSettings.GameType getByName(String parString1) { + for (WorldSettings.GameType worldsettings$gametype : values()) { + if (worldsettings$gametype.name.equals(parString1)) { + return worldsettings$gametype; + } + } + + return SURVIVAL; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldType.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldType.java new file mode 100644 index 0000000..01b7b1a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldType.java @@ -0,0 +1,164 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldType { + + static { + __checkIntegratedContextValid("net/minecraft/world/WorldType"); + } + + /**+ + * List of world types. + */ + public static final WorldType[] worldTypes = new WorldType[16]; + /**+ + * Default world type. + */ + public static final WorldType DEFAULT = (new WorldType(0, "default", 1)).setVersioned(); + /**+ + * Flat world type. + */ + public static final WorldType FLAT = new WorldType(1, "flat"); + /**+ + * Large Biome world Type. + */ + public static final WorldType LARGE_BIOMES = new WorldType(2, "largeBiomes"); + /**+ + * amplified world type + */ + public static final WorldType AMPLIFIED = (new WorldType(3, "amplified")).setNotificationData(); + public static final WorldType CUSTOMIZED = new WorldType(4, "customized"); + public static final WorldType DEBUG_WORLD = new WorldType(5, "debug_all_block_states"); + /**+ + * Default (1.1) world type. + */ + public static final WorldType DEFAULT_1_1 = (new WorldType(8, "default_1_1", 0)).setCanBeCreated(false); + private final int worldTypeId; + private final String worldType; + private final int generatorVersion; + private boolean canBeCreated; + private boolean isWorldTypeVersioned; + private boolean hasNotificationData; + + private WorldType(int id, String name) { + this(id, name, 0); + } + + private WorldType(int id, String name, int version) { + this.worldType = name; + this.generatorVersion = version; + this.canBeCreated = true; + this.worldTypeId = id; + worldTypes[id] = this; + } + + public String getWorldTypeName() { + return this.worldType; + } + + /**+ + * Gets the translation key for the name of this world type. + */ + public String getTranslateName() { + return "generator." + this.worldType; + } + + public String func_151359_c() { + return this.getTranslateName() + ".info"; + } + + /**+ + * Returns generatorVersion. + */ + public int getGeneratorVersion() { + return this.generatorVersion; + } + + public WorldType getWorldTypeForGeneratorVersion(int version) { + return this == DEFAULT && version == 0 ? DEFAULT_1_1 : this; + } + + /**+ + * Sets canBeCreated to the provided value, and returns this. + */ + private WorldType setCanBeCreated(boolean enable) { + this.canBeCreated = enable; + return this; + } + + /**+ + * Gets whether this WorldType can be used to generate a new + * world. + */ + public boolean getCanBeCreated() { + return this.canBeCreated; + } + + /**+ + * Flags this world type as having an associated version. + */ + private WorldType setVersioned() { + this.isWorldTypeVersioned = true; + return this; + } + + /**+ + * Returns true if this world Type has a version associated with + * it. + */ + public boolean isVersioned() { + return this.isWorldTypeVersioned; + } + + public static WorldType parseWorldType(String type) { + for (int i = 0; i < worldTypes.length; ++i) { + if (worldTypes[i] != null && worldTypes[i].worldType.equalsIgnoreCase(type)) { + return worldTypes[i]; + } + } + + return null; + } + + public int getWorldTypeID() { + return this.worldTypeId; + } + + /**+ + * returns true if selecting this worldtype from the customize + * menu should display the generator.[worldtype].info message + */ + public boolean showWorldInfoNotice() { + return this.hasNotificationData; + } + + /**+ + * enables the display of generator.[worldtype].info message on + * the customize world menu + */ + private WorldType setNotificationData() { + this.hasNotificationData = true; + return this; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeCache.java new file mode 100644 index 0000000..e14e690 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeCache.java @@ -0,0 +1,127 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.LongHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeCache { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeCache"); + } + + private final WorldChunkManager chunkManager; + private long lastCleanupTime; + /**+ + * The map of keys to BiomeCacheBlocks. Keys are based on the + * chunk x, z coordinates as (x | z << 32). + */ + private LongHashMap cacheMap = new LongHashMap(); + /**+ + * The list of cached BiomeCacheBlocks + */ + private List cache = Lists.newArrayList(); + + public BiomeCache(WorldChunkManager chunkManagerIn) { + this.chunkManager = chunkManagerIn; + } + + /**+ + * Returns a biome cache block at location specified. + */ + public BiomeCache.Block getBiomeCacheBlock(int x, int z) { + x = x >> 4; + z = z >> 4; + long i = (long) x & 4294967295L | ((long) z & 4294967295L) << 32; + BiomeCache.Block biomecache$block = (BiomeCache.Block) this.cacheMap.getValueByKey(i); + if (biomecache$block == null) { + biomecache$block = new BiomeCache.Block(x, z); + this.cacheMap.add(i, biomecache$block); + this.cache.add(biomecache$block); + } + + biomecache$block.lastAccessTime = MinecraftServer.getCurrentTimeMillis(); + return biomecache$block; + } + + public BiomeGenBase func_180284_a(int x, int z, BiomeGenBase parBiomeGenBase) { + BiomeGenBase biomegenbase = this.getBiomeCacheBlock(x, z).getBiomeGenAt(x, z); + return biomegenbase == null ? parBiomeGenBase : biomegenbase; + } + + /**+ + * Removes BiomeCacheBlocks from this cache that haven't been + * accessed in at least 30 seconds. + */ + public void cleanupCache() { + long i = MinecraftServer.getCurrentTimeMillis(); + long j = i - this.lastCleanupTime; + if (j > 7500L || j < 0L) { + this.lastCleanupTime = i; + + for (int k = 0; k < this.cache.size(); ++k) { + BiomeCache.Block biomecache$block = (BiomeCache.Block) this.cache.get(k); + long l = i - biomecache$block.lastAccessTime; + if (l > 30000L || l < 0L) { + this.cache.remove(k--); + long i1 = (long) biomecache$block.xPosition & 4294967295L + | ((long) biomecache$block.zPosition & 4294967295L) << 32; + this.cacheMap.remove(i1); + } + } + } + + } + + /**+ + * Returns the array of cached biome types in the + * BiomeCacheBlock at the given location. + */ + public BiomeGenBase[] getCachedBiomes(int x, int z) { + return this.getBiomeCacheBlock(x, z).biomes; + } + + public class Block { + public float[] rainfallValues = new float[256]; + public BiomeGenBase[] biomes = new BiomeGenBase[256]; + public int xPosition; + public int zPosition; + public long lastAccessTime; + + public Block(int x, int z) { + this.xPosition = x; + this.zPosition = z; + BiomeCache.this.chunkManager.getRainfall(this.rainfallValues, x << 4, z << 4, 16, 16); + BiomeCache.this.chunkManager.getBiomeGenAt(this.biomes, x << 4, z << 4, 16, 16, false); + } + + public BiomeGenBase getBiomeGenAt(int x, int z) { + return this.biomes[x & 15 | (z & 15) << 4]; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeColorHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeColorHelper.java new file mode 100644 index 0000000..55e96a5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeColorHelper.java @@ -0,0 +1,84 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeColorHelper { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeColorHelper"); + } + + private static final BiomeColorHelper.ColorResolver field_180291_a = new BiomeColorHelper.ColorResolver() { + public int getColorAtPos(BiomeGenBase blockPosition, BlockPos parBlockPos) { + return blockPosition.getGrassColorAtPos(parBlockPos); + } + }; + private static final BiomeColorHelper.ColorResolver field_180289_b = new BiomeColorHelper.ColorResolver() { + public int getColorAtPos(BiomeGenBase biomegenbase, BlockPos blockpos) { + return biomegenbase.getFoliageColorAtPos(blockpos); + } + }; + private static final BiomeColorHelper.ColorResolver field_180290_c = new BiomeColorHelper.ColorResolver() { + public int getColorAtPos(BiomeGenBase biomegenbase, BlockPos var2) { + return biomegenbase.waterColorMultiplier; + } + }; + + private static int func_180285_a(IBlockAccess parIBlockAccess, BlockPos parBlockPos, + BiomeColorHelper.ColorResolver parColorResolver) { + int i = 0; + int j = 0; + int k = 0; + + for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(parBlockPos.add(-1, 0, -1), + parBlockPos.add(1, 0, 1))) { + int l = parColorResolver.getColorAtPos(parIBlockAccess.getBiomeGenForCoords(blockpos$mutableblockpos), + blockpos$mutableblockpos); + i += (l & 16711680) >> 16; + j += (l & '\uff00') >> 8; + k += l & 255; + } + + return (i / 9 & 255) << 16 | (j / 9 & 255) << 8 | k / 9 & 255; + } + + public static int getGrassColorAtPos(IBlockAccess parIBlockAccess, BlockPos parBlockPos) { + return func_180285_a(parIBlockAccess, parBlockPos, field_180291_a); + } + + public static int getFoliageColorAtPos(IBlockAccess parIBlockAccess, BlockPos parBlockPos) { + return func_180285_a(parIBlockAccess, parBlockPos, field_180289_b); + } + + public static int getWaterColorAtPos(IBlockAccess parIBlockAccess, BlockPos parBlockPos) { + return func_180285_a(parIBlockAccess, parBlockPos, field_180290_c); + } + + interface ColorResolver { + int getColorAtPos(BiomeGenBase var1, BlockPos var2); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeDecorator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeDecorator.java new file mode 100644 index 0000000..92451e7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeDecorator.java @@ -0,0 +1,465 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.GeneratorBushFeature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenCactus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenClay; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenFlowers; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenLiquids; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMinable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenReed; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenWaterlily; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeDecorator { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeDecorator"); + } + + protected World currentWorld; + protected EaglercraftRandom randomGenerator; + protected BlockPos field_180294_c; + protected ChunkProviderSettings chunkProviderSettings; + /**+ + * The clay generator. + */ + protected WorldGenerator clayGen = new WorldGenClay(4); + /**+ + * The sand generator. + */ + protected WorldGenerator sandGen = new WorldGenSand(Blocks.sand, 7); + /**+ + * The gravel generator. + */ + protected WorldGenerator gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6); + protected WorldGenerator dirtGen; + protected WorldGenerator gravelGen; + protected WorldGenerator graniteGen; + protected WorldGenerator dioriteGen; + protected WorldGenerator andesiteGen; + protected WorldGenerator coalGen; + protected WorldGenerator ironGen; + protected WorldGenerator goldGen; + protected WorldGenerator redstoneGen; + protected WorldGenerator diamondGen; + protected WorldGenerator lapisGen; + protected WorldGenFlowers yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower, + BlockFlower.EnumFlowerType.DANDELION); + /**+ + * Field that holds mushroomBrown WorldGenFlowers + */ + protected WorldGenerator mushroomBrownGen = new GeneratorBushFeature(Blocks.brown_mushroom); + /**+ + * Field that holds mushroomRed WorldGenFlowers + */ + protected WorldGenerator mushroomRedGen = new GeneratorBushFeature(Blocks.red_mushroom); + /**+ + * Field that holds big mushroom generator + */ + protected WorldGenerator bigMushroomGen = new WorldGenBigMushroom(); + /**+ + * Field that holds WorldGenReed + */ + protected WorldGenerator reedGen = new WorldGenReed(); + /**+ + * Field that holds WorldGenCactus + */ + protected WorldGenerator cactusGen = new WorldGenCactus(); + /**+ + * The water lily generation! + */ + protected WorldGenerator waterlilyGen = new WorldGenWaterlily(); + protected int waterlilyPerChunk; + protected int treesPerChunk; + /**+ + * The number of yellow flower patches to generate per chunk. + * The game generates much less than this number, since it + * attempts to generate them at a random altitude. + */ + protected int flowersPerChunk = 2; + /**+ + * The amount of tall grass to generate per chunk. + */ + protected int grassPerChunk = 1; + protected int deadBushPerChunk; + protected int mushroomsPerChunk; + protected int reedsPerChunk; + protected int cactiPerChunk; + /**+ + * The number of sand patches to generate per chunk. Sand + * patches only generate when part of it is underwater. + */ + protected int sandPerChunk = 1; + /**+ + * The number of sand patches to generate per chunk. Sand + * patches only generate when part of it is underwater. There + * appear to be two separate fields for this. + */ + protected int sandPerChunk2 = 3; + /**+ + * The number of clay patches to generate per chunk. Only + * generates when part of it is underwater. + */ + protected int clayPerChunk = 1; + protected int bigMushroomsPerChunk; + /**+ + * True if decorator should generate surface lava & water + */ + public boolean generateLakes = true; + + public void decorate(World worldIn, EaglercraftRandom random, BiomeGenBase parBiomeGenBase, BlockPos parBlockPos) { + if (this.currentWorld != null) { + throw new RuntimeException("Already decorating"); + } else { + this.currentWorld = worldIn; + String s = worldIn.getWorldInfo().getGeneratorOptions(); + if (s != null) { + this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(s).func_177864_b(); + } else { + this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory("").func_177864_b(); + } + + this.randomGenerator = random; + this.field_180294_c = parBlockPos; + this.dirtGen = new WorldGenMinable(Blocks.dirt.getDefaultState(), this.chunkProviderSettings.dirtSize); + this.gravelGen = new WorldGenMinable(Blocks.gravel.getDefaultState(), + this.chunkProviderSettings.gravelSize); + this.graniteGen = new WorldGenMinable( + Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), + this.chunkProviderSettings.graniteSize); + this.dioriteGen = new WorldGenMinable( + Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), + this.chunkProviderSettings.dioriteSize); + this.andesiteGen = new WorldGenMinable( + Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), + this.chunkProviderSettings.andesiteSize); + this.coalGen = new WorldGenMinable(Blocks.coal_ore.getDefaultState(), this.chunkProviderSettings.coalSize); + this.ironGen = new WorldGenMinable(Blocks.iron_ore.getDefaultState(), this.chunkProviderSettings.ironSize); + this.goldGen = new WorldGenMinable(Blocks.gold_ore.getDefaultState(), this.chunkProviderSettings.goldSize); + this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore.getDefaultState(), + this.chunkProviderSettings.redstoneSize); + this.diamondGen = new WorldGenMinable(Blocks.diamond_ore.getDefaultState(), + this.chunkProviderSettings.diamondSize); + this.lapisGen = new WorldGenMinable(Blocks.lapis_ore.getDefaultState(), + this.chunkProviderSettings.lapisSize); + this.genDecorations(parBiomeGenBase); + this.currentWorld = null; + this.randomGenerator = null; + } + } + + protected void genDecorations(BiomeGenBase biomeGenBaseIn) { + this.generateOres(); + + for (int i = 0; i < this.sandPerChunk2; ++i) { + int j = this.randomGenerator.nextInt(16) + 8; + int k = this.randomGenerator.nextInt(16) + 8; + this.sandGen.generate(this.currentWorld, this.randomGenerator, + this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(j, 0, k))); + } + + for (int i1 = 0; i1 < this.clayPerChunk; ++i1) { + int l1 = this.randomGenerator.nextInt(16) + 8; + int i6 = this.randomGenerator.nextInt(16) + 8; + this.clayGen.generate(this.currentWorld, this.randomGenerator, + this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(l1, 0, i6))); + } + + for (int j1 = 0; j1 < this.sandPerChunk; ++j1) { + int i2 = this.randomGenerator.nextInt(16) + 8; + int j6 = this.randomGenerator.nextInt(16) + 8; + this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, + this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i2, 0, j6))); + } + + int k1 = this.treesPerChunk; + if (this.randomGenerator.nextInt(10) == 0) { + ++k1; + } + + for (int j2 = 0; j2 < k1; ++j2) { + int k6 = this.randomGenerator.nextInt(16) + 8; + int l = this.randomGenerator.nextInt(16) + 8; + WorldGenAbstractTree worldgenabstracttree = biomeGenBaseIn.genBigTreeChance(this.randomGenerator); + worldgenabstracttree.func_175904_e(); + BlockPos blockpos = this.currentWorld.getHeight(this.field_180294_c.add(k6, 0, l)); + if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, blockpos)) { + worldgenabstracttree.func_180711_a(this.currentWorld, this.randomGenerator, blockpos); + } + } + + for (int k2 = 0; k2 < this.bigMushroomsPerChunk; ++k2) { + int l6 = this.randomGenerator.nextInt(16) + 8; + int k10 = this.randomGenerator.nextInt(16) + 8; + this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, + this.currentWorld.getHeight(this.field_180294_c.add(l6, 0, k10))); + } + + for (int l2 = 0; l2 < this.flowersPerChunk; ++l2) { + int i7 = this.randomGenerator.nextInt(16) + 8; + int l10 = this.randomGenerator.nextInt(16) + 8; + int j14 = this.currentWorld.getHeight(this.field_180294_c.add(i7, 0, l10)).getY() + 32; + if (j14 > 0) { + int k17 = this.randomGenerator.nextInt(j14); + BlockPos blockpos1 = this.field_180294_c.add(i7, k17, l10); + BlockFlower.EnumFlowerType blockflower$enumflowertype = biomeGenBaseIn + .pickRandomFlower(this.randomGenerator, blockpos1); + BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock(); + if (blockflower.getMaterial() != Material.air) { + this.yellowFlowerGen.setGeneratedBlock(blockflower, blockflower$enumflowertype); + this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, blockpos1); + } + } + } + + for (int i3 = 0; i3 < this.grassPerChunk; ++i3) { + int j7 = this.randomGenerator.nextInt(16) + 8; + int i11 = this.randomGenerator.nextInt(16) + 8; + int k14 = this.currentWorld.getHeight(this.field_180294_c.add(j7, 0, i11)).getY() * 2; + if (k14 > 0) { + int l17 = this.randomGenerator.nextInt(k14); + biomeGenBaseIn.getRandomWorldGenForGrass(this.randomGenerator).generate(this.currentWorld, + this.randomGenerator, this.field_180294_c.add(j7, l17, i11)); + } + } + + for (int j3 = 0; j3 < this.deadBushPerChunk; ++j3) { + int k7 = this.randomGenerator.nextInt(16) + 8; + int j11 = this.randomGenerator.nextInt(16) + 8; + int l14 = this.currentWorld.getHeight(this.field_180294_c.add(k7, 0, j11)).getY() * 2; + if (l14 > 0) { + int i18 = this.randomGenerator.nextInt(l14); + (new WorldGenDeadBush()).generate(this.currentWorld, this.randomGenerator, + this.field_180294_c.add(k7, i18, j11)); + } + } + + for (int k3 = 0; k3 < this.waterlilyPerChunk; ++k3) { + int l7 = this.randomGenerator.nextInt(16) + 8; + int k11 = this.randomGenerator.nextInt(16) + 8; + int i15 = this.currentWorld.getHeight(this.field_180294_c.add(l7, 0, k11)).getY() * 2; + if (i15 > 0) { + int j18 = this.randomGenerator.nextInt(i15); + + BlockPos blockpos4; + BlockPos blockpos7; + for (blockpos4 = this.field_180294_c.add(l7, j18, k11); blockpos4.getY() > 0; blockpos4 = blockpos7) { + blockpos7 = blockpos4.down(); + if (!this.currentWorld.isAirBlock(blockpos7)) { + break; + } + } + + this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, blockpos4); + } + } + + for (int l3 = 0; l3 < this.mushroomsPerChunk; ++l3) { + if (this.randomGenerator.nextInt(4) == 0) { + int i8 = this.randomGenerator.nextInt(16) + 8; + int l11 = this.randomGenerator.nextInt(16) + 8; + BlockPos blockpos2 = this.currentWorld.getHeight(this.field_180294_c.add(i8, 0, l11)); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, blockpos2); + } + + if (this.randomGenerator.nextInt(8) == 0) { + int j8 = this.randomGenerator.nextInt(16) + 8; + int i12 = this.randomGenerator.nextInt(16) + 8; + int j15 = this.currentWorld.getHeight(this.field_180294_c.add(j8, 0, i12)).getY() * 2; + if (j15 > 0) { + int k18 = this.randomGenerator.nextInt(j15); + BlockPos blockpos5 = this.field_180294_c.add(j8, k18, i12); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, blockpos5); + } + } + } + + if (this.randomGenerator.nextInt(4) == 0) { + int i4 = this.randomGenerator.nextInt(16) + 8; + int k8 = this.randomGenerator.nextInt(16) + 8; + int j12 = this.currentWorld.getHeight(this.field_180294_c.add(i4, 0, k8)).getY() * 2; + if (j12 > 0) { + int k15 = this.randomGenerator.nextInt(j12); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, + this.field_180294_c.add(i4, k15, k8)); + } + } + + if (this.randomGenerator.nextInt(8) == 0) { + int j4 = this.randomGenerator.nextInt(16) + 8; + int l8 = this.randomGenerator.nextInt(16) + 8; + int k12 = this.currentWorld.getHeight(this.field_180294_c.add(j4, 0, l8)).getY() * 2; + if (k12 > 0) { + int l15 = this.randomGenerator.nextInt(k12); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, + this.field_180294_c.add(j4, l15, l8)); + } + } + + for (int k4 = 0; k4 < this.reedsPerChunk; ++k4) { + int i9 = this.randomGenerator.nextInt(16) + 8; + int l12 = this.randomGenerator.nextInt(16) + 8; + int i16 = this.currentWorld.getHeight(this.field_180294_c.add(i9, 0, l12)).getY() * 2; + if (i16 > 0) { + int l18 = this.randomGenerator.nextInt(i16); + this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(i9, l18, l12)); + } + } + + for (int l4 = 0; l4 < 10; ++l4) { + int j9 = this.randomGenerator.nextInt(16) + 8; + int i13 = this.randomGenerator.nextInt(16) + 8; + int j16 = this.currentWorld.getHeight(this.field_180294_c.add(j9, 0, i13)).getY() * 2; + if (j16 > 0) { + int i19 = this.randomGenerator.nextInt(j16); + this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j9, i19, i13)); + } + } + + if (this.randomGenerator.nextInt(32) == 0) { + int i5 = this.randomGenerator.nextInt(16) + 8; + int k9 = this.randomGenerator.nextInt(16) + 8; + int j13 = this.currentWorld.getHeight(this.field_180294_c.add(i5, 0, k9)).getY() * 2; + if (j13 > 0) { + int k16 = this.randomGenerator.nextInt(j13); + (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, + this.field_180294_c.add(i5, k16, k9)); + } + } + + for (int j5 = 0; j5 < this.cactiPerChunk; ++j5) { + int l9 = this.randomGenerator.nextInt(16) + 8; + int k13 = this.randomGenerator.nextInt(16) + 8; + int l16 = this.currentWorld.getHeight(this.field_180294_c.add(l9, 0, k13)).getY() * 2; + if (l16 > 0) { + int j19 = this.randomGenerator.nextInt(l16); + this.cactusGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(l9, j19, k13)); + } + } + + if (this.generateLakes) { + for (int k5 = 0; k5 < 50; ++k5) { + int i10 = this.randomGenerator.nextInt(16) + 8; + int l13 = this.randomGenerator.nextInt(16) + 8; + int i17 = this.randomGenerator.nextInt(248) + 8; + if (i17 > 0) { + int k19 = this.randomGenerator.nextInt(i17); + BlockPos blockpos6 = this.field_180294_c.add(i10, k19, l13); + (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, + blockpos6); + } + } + + for (int l5 = 0; l5 < 20; ++l5) { + int j10 = this.randomGenerator.nextInt(16) + 8; + int i14 = this.randomGenerator.nextInt(16) + 8; + int j17 = this.randomGenerator + .nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); + BlockPos blockpos3 = this.field_180294_c.add(j10, j17, i14); + (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, blockpos3); + } + } + + } + + /**+ + * Standard ore generation helper. Generates most ores. + */ + protected void genStandardOre1(int blockCount, WorldGenerator generator, int minHeight, int maxHeight) { + if (maxHeight < minHeight) { + int i = minHeight; + minHeight = maxHeight; + maxHeight = i; + } else if (maxHeight == minHeight) { + if (minHeight < 255) { + ++maxHeight; + } else { + --minHeight; + } + } + + for (int j = 0; j < blockCount; ++j) { + BlockPos blockpos = this.field_180294_c.add(this.randomGenerator.nextInt(16), + this.randomGenerator.nextInt(maxHeight - minHeight) + minHeight, this.randomGenerator.nextInt(16)); + generator.generate(this.currentWorld, this.randomGenerator, blockpos); + } + + } + + /**+ + * Standard ore generation helper. Generates Lapis Lazuli. + */ + protected void genStandardOre2(int blockCount, WorldGenerator generator, int centerHeight, int spread) { + for (int i = 0; i < blockCount; ++i) { + BlockPos blockpos = this.field_180294_c.add(this.randomGenerator.nextInt(16), + this.randomGenerator.nextInt(spread) + this.randomGenerator.nextInt(spread) + centerHeight - spread, + this.randomGenerator.nextInt(16)); + generator.generate(this.currentWorld, this.randomGenerator, blockpos); + } + + } + + /**+ + * Generates ores in the current chunk + */ + protected void generateOres() { + this.genStandardOre1(this.chunkProviderSettings.dirtCount, this.dirtGen, + this.chunkProviderSettings.dirtMinHeight, this.chunkProviderSettings.dirtMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.gravelCount, this.gravelGen, + this.chunkProviderSettings.gravelMinHeight, this.chunkProviderSettings.gravelMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.dioriteCount, this.dioriteGen, + this.chunkProviderSettings.dioriteMinHeight, this.chunkProviderSettings.dioriteMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.graniteCount, this.graniteGen, + this.chunkProviderSettings.graniteMinHeight, this.chunkProviderSettings.graniteMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.andesiteCount, this.andesiteGen, + this.chunkProviderSettings.andesiteMinHeight, this.chunkProviderSettings.andesiteMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.coalCount, this.coalGen, + this.chunkProviderSettings.coalMinHeight, this.chunkProviderSettings.coalMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.ironCount, this.ironGen, + this.chunkProviderSettings.ironMinHeight, this.chunkProviderSettings.ironMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.goldCount, this.goldGen, + this.chunkProviderSettings.goldMinHeight, this.chunkProviderSettings.goldMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.redstoneCount, this.redstoneGen, + this.chunkProviderSettings.redstoneMinHeight, this.chunkProviderSettings.redstoneMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.diamondCount, this.diamondGen, + this.chunkProviderSettings.diamondMinHeight, this.chunkProviderSettings.diamondMaxHeight); + this.genStandardOre2(this.chunkProviderSettings.lapisCount, this.lapisGen, + this.chunkProviderSettings.lapisCenterHeight, this.chunkProviderSettings.lapisSpread); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeEndDecorator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeEndDecorator.java new file mode 100644 index 0000000..88af0db --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeEndDecorator.java @@ -0,0 +1,56 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.boss.EntityDragon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeDecorator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenSpikes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeEndDecorator extends BiomeDecorator { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeEndDecorator"); + } + + protected WorldGenerator spikeGen = new WorldGenSpikes(Blocks.end_stone); + + protected void genDecorations(BiomeGenBase var1) { + this.generateOres(); + if (this.randomGenerator.nextInt(5) == 0) { + int i = this.randomGenerator.nextInt(16) + 8; + int j = this.randomGenerator.nextInt(16) + 8; + this.spikeGen.generate(this.currentWorld, this.randomGenerator, + this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i, 0, j))); + } + + if (this.field_180294_c.getX() == 0 && this.field_180294_c.getZ() == 0) { + EntityDragon entitydragon = new EntityDragon(this.currentWorld); + entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F); + this.currentWorld.spawnEntityInWorld(entitydragon); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBase.java new file mode 100644 index 0000000..487571e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBase.java @@ -0,0 +1,700 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityLiving; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityCreeper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEnderman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySlime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySpider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityWitch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityBat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityCow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityPig; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityRabbit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySheep; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntitySquid; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerFoliage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ColorizerGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeDecorator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBeach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenDesert; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenEnd; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenForest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenHell; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenHills; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenJungle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenMesa; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenMushroomIsland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenMutated; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenOcean; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenPlains; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenRiver; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenSavanna; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenStoneBeach; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenSwamp; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenTaiga; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenBigTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenSwamp; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTrees; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenBase"); + } + + private static final Logger logger = LogManager.getLogger(); + protected static final BiomeGenBase.Height height_Default = new BiomeGenBase.Height(0.1F, 0.2F); + protected static final BiomeGenBase.Height height_ShallowWaters = new BiomeGenBase.Height(-0.5F, 0.0F); + protected static final BiomeGenBase.Height height_Oceans = new BiomeGenBase.Height(-1.0F, 0.1F); + protected static final BiomeGenBase.Height height_DeepOceans = new BiomeGenBase.Height(-1.8F, 0.1F); + protected static final BiomeGenBase.Height height_LowPlains = new BiomeGenBase.Height(0.125F, 0.05F); + protected static final BiomeGenBase.Height height_MidPlains = new BiomeGenBase.Height(0.2F, 0.2F); + protected static final BiomeGenBase.Height height_LowHills = new BiomeGenBase.Height(0.45F, 0.3F); + protected static final BiomeGenBase.Height height_HighPlateaus = new BiomeGenBase.Height(1.5F, 0.025F); + protected static final BiomeGenBase.Height height_MidHills = new BiomeGenBase.Height(1.0F, 0.5F); + protected static final BiomeGenBase.Height height_Shores = new BiomeGenBase.Height(0.0F, 0.025F); + protected static final BiomeGenBase.Height height_RockyWaters = new BiomeGenBase.Height(0.1F, 0.8F); + protected static final BiomeGenBase.Height height_LowIslands = new BiomeGenBase.Height(0.2F, 0.3F); + protected static final BiomeGenBase.Height height_PartiallySubmerged = new BiomeGenBase.Height(-0.2F, 0.1F); + /**+ + * An array of all the biomes, indexed by biome id. + */ + private static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; + public static final Set explorationBiomesList = Sets.newHashSet(); + public static final Map BIOME_ID_MAP = Maps.newHashMap(); + public static BiomeGenBase ocean; + public static BiomeGenBase plains; + public static BiomeGenBase desert; + public static BiomeGenBase extremeHills; + public static BiomeGenBase forest; + public static BiomeGenBase taiga; + public static BiomeGenBase swampland; + public static BiomeGenBase river; + public static BiomeGenBase hell; + public static BiomeGenBase sky; + public static BiomeGenBase frozenOcean; + public static BiomeGenBase frozenRiver; + public static BiomeGenBase icePlains; + public static BiomeGenBase iceMountains; + public static BiomeGenBase mushroomIsland; + public static BiomeGenBase mushroomIslandShore; + public static BiomeGenBase beach; + public static BiomeGenBase desertHills; + public static BiomeGenBase forestHills; + public static BiomeGenBase taigaHills; + public static BiomeGenBase extremeHillsEdge; + public static BiomeGenBase jungle; + public static BiomeGenBase jungleHills; + public static BiomeGenBase jungleEdge; + public static BiomeGenBase deepOcean; + public static BiomeGenBase stoneBeach; + public static BiomeGenBase coldBeach; + public static BiomeGenBase birchForest; + public static BiomeGenBase birchForestHills; + public static BiomeGenBase roofedForest; + public static BiomeGenBase coldTaiga; + public static BiomeGenBase coldTaigaHills; + public static BiomeGenBase megaTaiga; + public static BiomeGenBase megaTaigaHills; + public static BiomeGenBase extremeHillsPlus; + public static BiomeGenBase savanna; + public static BiomeGenBase savannaPlateau; + public static BiomeGenBase mesa; + public static BiomeGenBase mesaPlateau_F; + public static BiomeGenBase mesaPlateau; + public static BiomeGenBase field_180279_ad; + protected static NoiseGeneratorPerlin temperatureNoise; + protected static NoiseGeneratorPerlin GRASS_COLOR_NOISE; + protected static WorldGenDoublePlant DOUBLE_PLANT_GENERATOR; + public String biomeName; + public int color; + public int field_150609_ah; + /**+ + * The block expected to be on the top of this biome + */ + public IBlockState topBlock = Blocks.grass.getDefaultState(); + /**+ + * The block to fill spots in when not on the top + */ + public IBlockState fillerBlock = Blocks.dirt.getDefaultState(); + public int fillerBlockMetadata = 5169201; + public float minHeight; + public float maxHeight; + public float temperature; + public float rainfall; + public int waterColorMultiplier; + public BiomeDecorator theBiomeDecorator; + protected List spawnableMonsterList; + protected List spawnableCreatureList; + protected List spawnableWaterCreatureList; + protected List spawnableCaveCreatureList; + protected boolean enableSnow; + protected boolean enableRain; + public final int biomeID; + protected WorldGenTrees worldGeneratorTrees; + protected WorldGenBigTree worldGeneratorBigTree; + protected WorldGenSwamp worldGeneratorSwamp; + + protected BiomeGenBase(int id) { + this.minHeight = height_Default.rootHeight; + this.maxHeight = height_Default.variation; + this.temperature = 0.5F; + this.rainfall = 0.5F; + this.waterColorMultiplier = 16777215; + this.spawnableMonsterList = Lists.newArrayList(); + this.spawnableCreatureList = Lists.newArrayList(); + this.spawnableWaterCreatureList = Lists.newArrayList(); + this.spawnableCaveCreatureList = Lists.newArrayList(); + this.enableRain = true; + this.worldGeneratorTrees = new WorldGenTrees(false); + this.worldGeneratorBigTree = new WorldGenBigTree(false); + this.worldGeneratorSwamp = new WorldGenSwamp(); + this.biomeID = id; + biomeList[id] = this; + this.theBiomeDecorator = this.createBiomeDecorator(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + } + + /**+ + * Allocate a new BiomeDecorator for this BiomeGenBase + */ + protected BiomeDecorator createBiomeDecorator() { + return new BiomeDecorator(); + } + + /**+ + * Sets the temperature and rainfall of this biome. + */ + protected BiomeGenBase setTemperatureRainfall(float temperatureIn, float rainfallIn) { + if (temperatureIn > 0.1F && temperatureIn < 0.2F) { + throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); + } else { + this.temperature = temperatureIn; + this.rainfall = rainfallIn; + return this; + } + } + + protected final BiomeGenBase setHeight(BiomeGenBase.Height heights) { + this.minHeight = heights.rootHeight; + this.maxHeight = heights.variation; + return this; + } + + /**+ + * Disable the rain for the biome. + */ + protected BiomeGenBase setDisableRain() { + this.enableRain = false; + return this; + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom rand) { + return (WorldGenAbstractTree) (rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); + } + + /**+ + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(EaglercraftRandom rand) { + return new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); + } + + public BlockFlower.EnumFlowerType pickRandomFlower(EaglercraftRandom rand, BlockPos pos) { + return rand.nextInt(3) > 0 ? BlockFlower.EnumFlowerType.DANDELION : BlockFlower.EnumFlowerType.POPPY; + } + + /**+ + * sets enableSnow to true during biome initialization. returns + * BiomeGenBase. + */ + protected BiomeGenBase setEnableSnow() { + this.enableSnow = true; + return this; + } + + protected BiomeGenBase setBiomeName(String name) { + this.biomeName = name; + return this; + } + + protected BiomeGenBase setFillerBlockMetadata(int meta) { + this.fillerBlockMetadata = meta; + return this; + } + + protected BiomeGenBase setColor(int colorIn) { + this.func_150557_a(colorIn, false); + return this; + } + + protected BiomeGenBase func_150563_c(int parInt1) { + this.field_150609_ah = parInt1; + return this; + } + + protected BiomeGenBase func_150557_a(int parInt1, boolean parFlag) { + this.color = parInt1; + if (parFlag) { + this.field_150609_ah = (parInt1 & 16711422) >> 1; + } else { + this.field_150609_ah = parInt1; + } + + return this; + } + + /**+ + * takes temperature, returns color + */ + public int getSkyColorByTemp(float parFloat1) { + parFloat1 = parFloat1 / 3.0F; + parFloat1 = MathHelper.clamp_float(parFloat1, -1.0F, 1.0F); + return MathHelper.func_181758_c(0.62222224F - parFloat1 * 0.05F, 0.5F + parFloat1 * 0.1F, 1.0F); + } + + /**+ + * Returns the correspondent list of the EnumCreatureType + * informed. + */ + public List getSpawnableList(EnumCreatureType creatureType) { + switch (creatureType) { + case MONSTER: + return this.spawnableMonsterList; + case CREATURE: + return this.spawnableCreatureList; + case WATER_CREATURE: + return this.spawnableWaterCreatureList; + case AMBIENT: + return this.spawnableCaveCreatureList; + default: + return Collections.emptyList(); + } + } + + /**+ + * Returns true if the biome have snowfall instead a normal + * rain. + */ + public boolean getEnableSnow() { + return this.isSnowyBiome(); + } + + /**+ + * Return true if the biome supports lightning bolt spawn, + * either by have the bolts enabled and have rain enabled. + */ + public boolean canSpawnLightningBolt() { + return this.isSnowyBiome() ? false : this.enableRain; + } + + /**+ + * Checks to see if the rainfall level of the biome is extremely + * high + */ + public boolean isHighHumidity() { + return this.rainfall > 0.85F; + } + + /**+ + * returns the chance a creature has to spawn. + */ + public float getSpawningChance() { + return 0.1F; + } + + /**+ + * Gets an integer representation of this biome's rainfall + */ + public final int getIntRainfall() { + return (int) (this.rainfall * 65536.0F); + } + + /**+ + * Gets a floating point representation of this biome's rainfall + */ + public final float getFloatRainfall() { + return this.rainfall; + } + + /**+ + * Gets a floating point representation of this biome's + * temperature + */ + public final float getFloatTemperature(BlockPos pos) { + if (pos.getY() > 64) { + float f = (float) (temperatureNoise.func_151601_a((double) pos.getX() * 1.0D / 8.0D, + (double) pos.getZ() * 1.0D / 8.0D) * 4.0D); + return this.temperature - (f + (float) pos.getY() - 64.0F) * 0.05F / 30.0F; + } else { + return this.temperature; + } + } + + public void decorate(World worldIn, EaglercraftRandom rand, BlockPos pos) { + this.theBiomeDecorator.decorate(worldIn, rand, this, pos); + } + + public int getGrassColorAtPos(BlockPos pos) { + double d0 = (double) MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F); + double d1 = (double) MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerGrass.getGrassColor(d0, d1); + } + + public int getFoliageColorAtPos(BlockPos pos) { + double d0 = (double) MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F); + double d1 = (double) MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerFoliage.getFoliageColor(d0, d1); + } + + public boolean isSnowyBiome() { + return this.enableSnow; + } + + public void genTerrainBlocks(World worldIn, EaglercraftRandom rand, ChunkPrimer chunkPrimerIn, int parInt1, + int parInt2, double parDouble1) { + this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, parInt1, parInt2, parDouble1); + } + + public final void generateBiomeTerrain(World worldIn, EaglercraftRandom rand, ChunkPrimer chunkPrimerIn, + int parInt1, int parInt2, double parDouble1) { + int i = worldIn.func_181545_F(); + IBlockState iblockstate = this.topBlock; + IBlockState iblockstate1 = this.fillerBlock; + int j = -1; + int k = (int) (parDouble1 / 3.0D + 3.0D + rand.nextDouble() * 0.25D); + int l = parInt1 & 15; + int i1 = parInt2 & 15; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j1 = 255; j1 >= 0; --j1) { + if (j1 <= rand.nextInt(5)) { + chunkPrimerIn.setBlockState(i1, j1, l, Blocks.bedrock.getDefaultState()); + } else { + IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l); + if (iblockstate2.getBlock().getMaterial() == Material.air) { + j = -1; + } else if (iblockstate2.getBlock() == Blocks.stone) { + if (j == -1) { + if (k <= 0) { + iblockstate = null; + iblockstate1 = Blocks.stone.getDefaultState(); + } else if (j1 >= i - 4 && j1 <= i + 1) { + iblockstate = this.topBlock; + iblockstate1 = this.fillerBlock; + } + + if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) { + if (this.getFloatTemperature( + blockpos$mutableblockpos.func_181079_c(parInt1, j1, parInt2)) < 0.15F) { + iblockstate = Blocks.ice.getDefaultState(); + } else { + iblockstate = Blocks.water.getDefaultState(); + } + } + + j = k; + if (j1 >= i - 1) { + chunkPrimerIn.setBlockState(i1, j1, l, iblockstate); + } else if (j1 < i - 7 - k) { + iblockstate = null; + iblockstate1 = Blocks.stone.getDefaultState(); + chunkPrimerIn.setBlockState(i1, j1, l, Blocks.gravel.getDefaultState()); + } else { + chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); + } + } else if (j > 0) { + --j; + chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); + if (j == 0 && iblockstate1.getBlock() == Blocks.sand) { + j = rand.nextInt(4) + Math.max(0, j1 - 63); + iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND + ? Blocks.red_sandstone.getDefaultState() + : Blocks.sandstone.getDefaultState(); + } + } + } + } + } + + } + + /**+ + * Creates a mutated version of the biome and places it into the + * biomeList with an index equal to the original plus 128 + */ + protected BiomeGenBase createMutation() { + return this.createMutatedBiome(this.biomeID + 128); + } + + protected BiomeGenBase createMutatedBiome(int parInt1) { + return new BiomeGenMutated(parInt1, this); + } + + public Class getBiomeClass() { + return this.getClass(); + } + + /**+ + * returns true if the biome specified is equal to this biome + */ + public boolean isEqualTo(BiomeGenBase biome) { + return biome == this ? true : (biome == null ? false : this.getBiomeClass() == biome.getBiomeClass()); + } + + public BiomeGenBase.TempCategory getTempCategory() { + return (double) this.temperature < 0.2D ? BiomeGenBase.TempCategory.COLD + : ((double) this.temperature < 1.0D ? BiomeGenBase.TempCategory.MEDIUM + : BiomeGenBase.TempCategory.WARM); + } + + public static BiomeGenBase[] getBiomeGenArray() { + return biomeList; + } + + /**+ + * return the biome specified by biomeID, or 0 (ocean) if out of + * bounds + */ + public static BiomeGenBase getBiome(int id) { + return getBiomeFromBiomeList(id, (BiomeGenBase) null); + } + + public static BiomeGenBase getBiomeFromBiomeList(int biomeId, BiomeGenBase biome) { + if (biomeId >= 0 && biomeId <= biomeList.length) { + BiomeGenBase biomegenbase = biomeList[biomeId]; + return biomegenbase == null ? biome : biomegenbase; + } else { + logger.warn("Biome ID is out of bounds: " + biomeId + ", defaulting to 0 (Ocean)"); + return ocean; + } + } + + public static void doBootstrap() { + ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans); + plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains"); + desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain() + .setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowPlains); + extremeHills = (new BiomeGenHills(3, false)).setColor(6316128).setBiomeName("Extreme Hills") + .setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); + forest = (new BiomeGenForest(4, 0)).setColor(353825).setBiomeName("Forest"); + taiga = (new BiomeGenTaiga(5, 0)).setColor(747097).setBiomeName("Taiga").setFillerBlockMetadata(5159473) + .setTemperatureRainfall(0.25F, 0.8F).setHeight(height_MidPlains); + swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").setFillerBlockMetadata(9154376) + .setHeight(height_PartiallySubmerged).setTemperatureRainfall(0.8F, 0.9F); + river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setHeight(height_ShallowWaters); + hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain() + .setTemperatureRainfall(2.0F, 0.0F); + sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("The End").setDisableRain(); + frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow() + .setHeight(height_Oceans).setTemperatureRainfall(0.0F, 0.5F); + frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow() + .setHeight(height_ShallowWaters).setTemperatureRainfall(0.0F, 0.5F); + icePlains = (new BiomeGenSnow(12, false)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow() + .setTemperatureRainfall(0.0F, 0.5F).setHeight(height_LowPlains); + iceMountains = (new BiomeGenSnow(13, false)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow() + .setHeight(height_LowHills).setTemperatureRainfall(0.0F, 0.5F); + mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland") + .setTemperatureRainfall(0.9F, 1.0F).setHeight(height_LowIslands); + mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore") + .setTemperatureRainfall(0.9F, 1.0F).setHeight(height_Shores); + beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F) + .setHeight(height_Shores); + desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain() + .setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowHills); + forestHills = (new BiomeGenForest(18, 0)).setColor(2250012).setBiomeName("ForestHills") + .setHeight(height_LowHills); + taigaHills = (new BiomeGenTaiga(19, 0)).setColor(1456435).setBiomeName("TaigaHills") + .setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_LowHills); + extremeHillsEdge = (new BiomeGenHills(20, true)).setColor(7501978).setBiomeName("Extreme Hills Edge") + .setHeight(height_MidHills.attenuate()).setTemperatureRainfall(0.2F, 0.3F); + jungle = (new BiomeGenJungle(21, false)).setColor(5470985).setBiomeName("Jungle") + .setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F); + jungleHills = (new BiomeGenJungle(22, false)).setColor(2900485).setBiomeName("JungleHills") + .setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F).setHeight(height_LowHills); + jungleEdge = (new BiomeGenJungle(23, true)).setColor(6458135).setBiomeName("JungleEdge") + .setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.8F); + deepOcean = (new BiomeGenOcean(24)).setColor(48).setBiomeName("Deep Ocean").setHeight(height_DeepOceans); + stoneBeach = (new BiomeGenStoneBeach(25)).setColor(10658436).setBiomeName("Stone Beach") + .setTemperatureRainfall(0.2F, 0.3F).setHeight(height_RockyWaters); + coldBeach = (new BiomeGenBeach(26)).setColor(16445632).setBiomeName("Cold Beach") + .setTemperatureRainfall(0.05F, 0.3F).setHeight(height_Shores).setEnableSnow(); + birchForest = (new BiomeGenForest(27, 2)).setBiomeName("Birch Forest").setColor(3175492); + birchForestHills = (new BiomeGenForest(28, 2)).setBiomeName("Birch Forest Hills").setColor(2055986) + .setHeight(height_LowHills); + roofedForest = (new BiomeGenForest(29, 3)).setColor(4215066).setBiomeName("Roofed Forest"); + coldTaiga = (new BiomeGenTaiga(30, 0)).setColor(3233098).setBiomeName("Cold Taiga") + .setFillerBlockMetadata(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F) + .setHeight(height_MidPlains).func_150563_c(16777215); + coldTaigaHills = (new BiomeGenTaiga(31, 0)).setColor(2375478).setBiomeName("Cold Taiga Hills") + .setFillerBlockMetadata(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F) + .setHeight(height_LowHills).func_150563_c(16777215); + megaTaiga = (new BiomeGenTaiga(32, 1)).setColor(5858897).setBiomeName("Mega Taiga") + .setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_MidPlains); + megaTaigaHills = (new BiomeGenTaiga(33, 1)).setColor(4542270).setBiomeName("Mega Taiga Hills") + .setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_LowHills); + extremeHillsPlus = (new BiomeGenHills(34, true)).setColor(5271632).setBiomeName("Extreme Hills+") + .setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); + savanna = (new BiomeGenSavanna(35)).setColor(12431967).setBiomeName("Savanna") + .setTemperatureRainfall(1.2F, 0.0F).setDisableRain().setHeight(height_LowPlains); + savannaPlateau = (new BiomeGenSavanna(36)).setColor(10984804).setBiomeName("Savanna Plateau") + .setTemperatureRainfall(1.0F, 0.0F).setDisableRain().setHeight(height_HighPlateaus); + mesa = (new BiomeGenMesa(37, false, false)).setColor(14238997).setBiomeName("Mesa"); + mesaPlateau_F = (new BiomeGenMesa(38, false, true)).setColor(11573093).setBiomeName("Mesa Plateau F") + .setHeight(height_HighPlateaus); + mesaPlateau = (new BiomeGenMesa(39, false, false)).setColor(13274213).setBiomeName("Mesa Plateau") + .setHeight(height_HighPlateaus); + field_180279_ad = ocean; + + plains.createMutation(); + desert.createMutation(); + forest.createMutation(); + taiga.createMutation(); + swampland.createMutation(); + icePlains.createMutation(); + jungle.createMutation(); + jungleEdge.createMutation(); + coldTaiga.createMutation(); + savanna.createMutation(); + savannaPlateau.createMutation(); + mesa.createMutation(); + mesaPlateau_F.createMutation(); + mesaPlateau.createMutation(); + birchForest.createMutation(); + birchForestHills.createMutation(); + roofedForest.createMutation(); + megaTaiga.createMutation(); + extremeHills.createMutation(); + extremeHillsPlus.createMutation(); + megaTaiga.createMutatedBiome(megaTaigaHills.biomeID + 128).setBiomeName("Redwood Taiga Hills M"); + + explorationBiomesList.clear(); + + for (BiomeGenBase biomegenbase : biomeList) { + if (biomegenbase != null) { + if (BIOME_ID_MAP.containsKey(biomegenbase.biomeName)) { + throw new Error("Biome \"" + biomegenbase.biomeName + "\" is defined as both ID " + + ((BiomeGenBase) BIOME_ID_MAP.get(biomegenbase.biomeName)).biomeID + " and " + + biomegenbase.biomeID); + } + + BIOME_ID_MAP.put(biomegenbase.biomeName, biomegenbase); + if (biomegenbase.biomeID < 128) { + explorationBiomesList.add(biomegenbase); + } + } + } + + explorationBiomesList.remove(hell); + explorationBiomesList.remove(sky); + explorationBiomesList.remove(frozenOcean); + explorationBiomesList.remove(extremeHillsEdge); + temperatureNoise = new NoiseGeneratorPerlin(new EaglercraftRandom(1234L), 1); + GRASS_COLOR_NOISE = new NoiseGeneratorPerlin(new EaglercraftRandom(2345L), 1); + DOUBLE_PLANT_GENERATOR = new WorldGenDoublePlant(); + } + + public static class Height { + public float rootHeight; + public float variation; + + public Height(float rootHeightIn, float variationIn) { + this.rootHeight = rootHeightIn; + this.variation = variationIn; + } + + public BiomeGenBase.Height attenuate() { + return new BiomeGenBase.Height(this.rootHeight * 0.8F, this.variation * 0.6F); + } + } + + public static class SpawnListEntry extends WeightedRandom.Item { + public Class entityClass; + public int minGroupCount; + public int maxGroupCount; + + public SpawnListEntry(Class entityclassIn, int weight, int groupCountMin, + int groupCountMax) { + super(weight); + this.entityClass = entityclassIn; + this.minGroupCount = groupCountMin; + this.maxGroupCount = groupCountMax; + } + + public String toString() { + return this.entityClass.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + + this.itemWeight; + } + } + + public static enum TempCategory { + OCEAN, COLD, MEDIUM, WARM; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBeach.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBeach.java new file mode 100644 index 0000000..a264899 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBeach.java @@ -0,0 +1,44 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenBeach extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenBeach"); + } + + public BiomeGenBeach(int parInt1) { + super(parInt1); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand.getDefaultState(); + this.fillerBlock = Blocks.sand.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenDesert.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenDesert.java new file mode 100644 index 0000000..4bdb014 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenDesert.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenDesertWells; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenDesert extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenDesert"); + } + + public BiomeGenDesert(int parInt1) { + super(parInt1); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand.getDefaultState(); + this.fillerBlock = Blocks.sand.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 2; + this.theBiomeDecorator.reedsPerChunk = 50; + this.theBiomeDecorator.cactiPerChunk = 10; + this.spawnableCreatureList.clear(); + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + super.decorate(world, random, blockpos); + if (random.nextInt(1000) == 0) { + int i = random.nextInt(16) + 8; + int j = random.nextInt(16) + 8; + BlockPos blockpos1 = world.getHeight(blockpos.add(i, 0, j)).up(); + (new WorldGenDesertWells()).generate(world, random, blockpos1); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenEnd.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenEnd.java new file mode 100644 index 0000000..c8a0f09 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenEnd.java @@ -0,0 +1,54 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityEnderman; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeEndDecorator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenEnd extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenEnd"); + } + + public BiomeGenEnd(int parInt1) { + super(parInt1); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4)); + this.topBlock = Blocks.dirt.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + this.theBiomeDecorator = new BiomeEndDecorator(); + } + + /**+ + * takes temperature, returns color + */ + public int getSkyColorByTemp(float var1) { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenForest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenForest.java new file mode 100644 index 0000000..28655f8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenForest.java @@ -0,0 +1,190 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenMutated; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenForest; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenForest extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenForest"); + } + + private int field_150632_aF; + protected static final WorldGenForest field_150629_aC = new WorldGenForest(false, true); + protected static final WorldGenForest field_150630_aD = new WorldGenForest(false, false); + protected static final WorldGenCanopyTree field_150631_aE = new WorldGenCanopyTree(false); + + public BiomeGenForest(int parInt1, int parInt2) { + super(parInt1); + this.field_150632_aF = parInt2; + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 2; + if (this.field_150632_aF == 1) { + this.theBiomeDecorator.treesPerChunk = 6; + this.theBiomeDecorator.flowersPerChunk = 100; + this.theBiomeDecorator.grassPerChunk = 1; + } + + this.setFillerBlockMetadata(5159473); + this.setTemperatureRainfall(0.7F, 0.8F); + if (this.field_150632_aF == 2) { + this.field_150609_ah = 353825; + this.color = 3175492; + this.setTemperatureRainfall(0.6F, 0.6F); + } + + if (this.field_150632_aF == 0) { + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4)); + } + + if (this.field_150632_aF == 3) { + this.theBiomeDecorator.treesPerChunk = -999; + } + + } + + protected BiomeGenBase func_150557_a(int i, boolean flag) { + if (this.field_150632_aF == 2) { + this.field_150609_ah = 353825; + this.color = i; + if (flag) { + this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1; + } + + return this; + } else { + return super.func_150557_a(i, flag); + } + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return (WorldGenAbstractTree) (this.field_150632_aF == 3 && random.nextInt(3) > 0 ? field_150631_aE + : (this.field_150632_aF != 2 && random.nextInt(5) != 0 ? this.worldGeneratorTrees : field_150630_aD)); + } + + public BlockFlower.EnumFlowerType pickRandomFlower(EaglercraftRandom random, BlockPos blockpos) { + if (this.field_150632_aF == 1) { + double d0 = MathHelper.clamp_double((1.0D + GRASS_COLOR_NOISE + .func_151601_a((double) blockpos.getX() / 48.0D, (double) blockpos.getZ() / 48.0D)) / 2.0D, 0.0D, + 0.9999D); + BlockFlower.EnumFlowerType blockflower$enumflowertype = BlockFlower.EnumFlowerType + .values()[(int) (d0 * (double) BlockFlower.EnumFlowerType.values().length)]; + return blockflower$enumflowertype == BlockFlower.EnumFlowerType.BLUE_ORCHID + ? BlockFlower.EnumFlowerType.POPPY + : blockflower$enumflowertype; + } else { + return super.pickRandomFlower(random, blockpos); + } + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (this.field_150632_aF == 3) { + for (int i = 0; i < 4; ++i) { + for (int j = 0; j < 4; ++j) { + int k = i * 4 + 1 + 8 + random.nextInt(3); + int l = j * 4 + 1 + 8 + random.nextInt(3); + BlockPos blockpos1 = world.getHeight(blockpos.add(k, 0, l)); + if (random.nextInt(20) == 0) { + WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom(); + worldgenbigmushroom.generate(world, random, blockpos1); + } else { + WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(random); + worldgenabstracttree.func_175904_e(); + if (worldgenabstracttree.generate(world, random, blockpos1)) { + worldgenabstracttree.func_180711_a(world, random, blockpos1); + } + } + } + } + } + + int j1 = random.nextInt(5) - 3; + if (this.field_150632_aF == 1) { + j1 += 2; + } + + for (int k1 = 0; k1 < j1; ++k1) { + int l1 = random.nextInt(3); + if (l1 == 0) { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA); + } else if (l1 == 1) { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE); + } else if (l1 == 2) { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA); + } + + for (int i2 = 0; i2 < 5; ++i2) { + int j2 = random.nextInt(16) + 8; + int k2 = random.nextInt(16) + 8; + int i1 = random.nextInt(world.getHeight(blockpos.add(j2, 0, k2)).getY() + 32); + if (DOUBLE_PLANT_GENERATOR.generate(world, random, + new BlockPos(blockpos.getX() + j2, i1, blockpos.getZ() + k2))) { + break; + } + } + } + + super.decorate(world, random, blockpos); + } + + public int getGrassColorAtPos(BlockPos blockpos) { + int i = super.getGrassColorAtPos(blockpos); + return this.field_150632_aF == 3 ? (i & 16711422) + 2634762 >> 1 : i; + } + + protected BiomeGenBase createMutatedBiome(final int i) { + if (this.biomeID == BiomeGenBase.forest.biomeID) { + BiomeGenForest biomegenforest = new BiomeGenForest(i, 1); + biomegenforest.setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight + 0.2F)); + biomegenforest.setBiomeName("Flower Forest"); + biomegenforest.func_150557_a(6976549, true); + biomegenforest.setFillerBlockMetadata(8233509); + return biomegenforest; + } else { + return this.biomeID != BiomeGenBase.birchForest.biomeID + && this.biomeID != BiomeGenBase.birchForestHills.biomeID ? new BiomeGenMutated(i, this) { + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + this.baseBiome.decorate(world, random, blockpos); + } + } : new BiomeGenMutated(i, this) { + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return random.nextBoolean() ? BiomeGenForest.field_150629_aC + : BiomeGenForest.field_150630_aD; + } + }; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHell.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHell.java new file mode 100644 index 0000000..e787914 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHell.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGhast; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMagmaCube; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityPigZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenHell extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenHell"); + } + + public BiomeGenHell(int parInt1) { + super(parInt1); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 50, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHills.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHills.java new file mode 100644 index 0000000..96f0c37 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHills.java @@ -0,0 +1,119 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMinable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenHills extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenHills"); + } + + private WorldGenerator theWorldGenerator = new WorldGenMinable( + Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), + 9); + private WorldGenTaiga2 field_150634_aD = new WorldGenTaiga2(false); + private int field_150635_aE = 0; + private int field_150636_aF = 1; + private int field_150637_aG = 2; + private int field_150638_aH; + + protected BiomeGenHills(int parInt1, boolean parFlag) { + super(parInt1); + this.field_150638_aH = this.field_150635_aE; + if (parFlag) { + this.theBiomeDecorator.treesPerChunk = 3; + this.field_150638_aH = this.field_150636_aF; + } + + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return (WorldGenAbstractTree) (random.nextInt(3) > 0 ? this.field_150634_aD : super.genBigTreeChance(random)); + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + super.decorate(world, random, blockpos); + int i = 3 + random.nextInt(6); + + for (int j = 0; j < i; ++j) { + int k = random.nextInt(16); + int l = random.nextInt(28) + 4; + int i1 = random.nextInt(16); + BlockPos blockpos1 = blockpos.add(k, l, i1); + if (world.getBlockState(blockpos1).getBlock() == Blocks.stone) { + world.setBlockState(blockpos1, Blocks.emerald_ore.getDefaultState(), 2); + } + } + + for (i = 0; i < 7; ++i) { + int j1 = random.nextInt(16); + int k1 = random.nextInt(64); + int l1 = random.nextInt(16); + this.theWorldGenerator.generate(world, random, blockpos.add(j1, k1, l1)); + } + + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + if ((d0 < -1.0D || d0 > 2.0D) && this.field_150638_aH == this.field_150637_aG) { + this.topBlock = Blocks.gravel.getDefaultState(); + this.fillerBlock = Blocks.gravel.getDefaultState(); + } else if (d0 > 1.0D && this.field_150638_aH != this.field_150636_aF) { + this.topBlock = Blocks.stone.getDefaultState(); + this.fillerBlock = Blocks.stone.getDefaultState(); + } + + this.generateBiomeTerrain(world, random, chunkprimer, i, j, d0); + } + + /**+ + * this creates a mutation specific to Hills biomes + */ + private BiomeGenHills mutateHills(BiomeGenBase parBiomeGenBase) { + this.field_150638_aH = this.field_150637_aG; + this.func_150557_a(parBiomeGenBase.color, true); + this.setBiomeName(parBiomeGenBase.biomeName + " M"); + this.setHeight(new BiomeGenBase.Height(parBiomeGenBase.minHeight, parBiomeGenBase.maxHeight)); + this.setTemperatureRainfall(parBiomeGenBase.temperature, parBiomeGenBase.rainfall); + return this; + } + + protected BiomeGenBase createMutatedBiome(int i) { + return (new BiomeGenHills(i, false)).mutateHills(this); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenJungle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenJungle.java new file mode 100644 index 0000000..bf0995b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenJungle.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityChicken; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityOcelot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMelon; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenShrub; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTrees; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenVines; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenJungle extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenJungle"); + } + + private boolean field_150614_aC; + private static final IBlockState field_181620_aE = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.JUNGLE); + private static final IBlockState field_181621_aF = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + private static final IBlockState field_181622_aG = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public BiomeGenJungle(int parInt1, boolean parFlag) { + super(parInt1); + this.field_150614_aC = parFlag; + if (parFlag) { + this.theBiomeDecorator.treesPerChunk = 2; + } else { + this.theBiomeDecorator.treesPerChunk = 50; + } + + this.theBiomeDecorator.grassPerChunk = 25; + this.theBiomeDecorator.flowersPerChunk = 4; + if (!parFlag) { + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1)); + } + + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return (WorldGenAbstractTree) (random.nextInt(10) == 0 ? this.worldGeneratorBigTree + : (random.nextInt(2) == 0 ? new WorldGenShrub(field_181620_aE, field_181622_aG) + : (!this.field_150614_aC && random.nextInt(3) == 0 + ? new WorldGenMegaJungle(false, 10, 20, field_181620_aE, field_181621_aF) + : new WorldGenTrees(false, 4 + random.nextInt(7), field_181620_aE, field_181621_aF, + true)))); + } + + /**+ + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(EaglercraftRandom random) { + return random.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) + : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + super.decorate(world, random, blockpos); + int i = random.nextInt(16) + 8; + int j = random.nextInt(16) + 8; + int k = random.nextInt(world.getHeight(blockpos.add(i, 0, j)).getY() * 2); + (new WorldGenMelon()).generate(world, random, blockpos.add(i, k, j)); + WorldGenVines worldgenvines = new WorldGenVines(); + + for (j = 0; j < 50; ++j) { + k = random.nextInt(16) + 8; + boolean flag = true; + int l = random.nextInt(16) + 8; + worldgenvines.generate(world, random, blockpos.add(k, 128, l)); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMesa.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMesa.java new file mode 100644 index 0000000..5768778 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMesa.java @@ -0,0 +1,302 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import java.util.Arrays; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockColored; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenMesa extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenMesa"); + } + + private IBlockState[] field_150621_aC; + private long field_150622_aD; + private NoiseGeneratorPerlin field_150623_aE; + private NoiseGeneratorPerlin field_150624_aF; + private NoiseGeneratorPerlin field_150625_aG; + private boolean field_150626_aH; + private boolean field_150620_aI; + + public BiomeGenMesa(int parInt1, boolean parFlag, boolean parFlag2) { + super(parInt1); + this.field_150626_aH = parFlag; + this.field_150620_aI = parFlag2; + this.setDisableRain(); + this.setTemperatureRainfall(2.0F, 0.0F); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); + this.fillerBlock = Blocks.stained_hardened_clay.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 20; + this.theBiomeDecorator.reedsPerChunk = 3; + this.theBiomeDecorator.cactiPerChunk = 5; + this.theBiomeDecorator.flowersPerChunk = 0; + this.spawnableCreatureList.clear(); + if (parFlag2) { + this.theBiomeDecorator.treesPerChunk = 5; + } + + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom var1) { + return this.worldGeneratorTrees; + } + + public int getFoliageColorAtPos(BlockPos var1) { + return 10387789; + } + + public int getGrassColorAtPos(BlockPos var1) { + return 9470285; + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + super.decorate(world, random, blockpos); + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + if (this.field_150621_aC == null || this.field_150622_aD != world.getSeed()) { + this.func_150619_a(world.getSeed()); + } + + if (this.field_150623_aE == null || this.field_150624_aF == null || this.field_150622_aD != world.getSeed()) { + EaglercraftRandom random1 = new EaglercraftRandom(this.field_150622_aD); + this.field_150623_aE = new NoiseGeneratorPerlin(random1, 4); + this.field_150624_aF = new NoiseGeneratorPerlin(random1, 1); + } + + this.field_150622_aD = world.getSeed(); + double d5 = 0.0D; + if (this.field_150626_aH) { + int k = (i & -16) + (j & 15); + int l = (j & -16) + (i & 15); + double d1 = Math.min(Math.abs(d0), + this.field_150623_aE.func_151601_a((double) k * 0.25D, (double) l * 0.25D)); + if (d1 > 0.0D) { + double d2 = 0.001953125D; + double d3 = Math.abs(this.field_150624_aF.func_151601_a((double) k * d2, (double) l * d2)); + d5 = d1 * d1 * 2.5D; + double d4 = Math.ceil(d3 * 50.0D) + 14.0D; + if (d5 > d4) { + d5 = d4; + } + + d5 = d5 + 64.0D; + } + } + + int l1 = i & 15; + int i2 = j & 15; + int j2 = world.func_181545_F(); + IBlockState iblockstate = Blocks.stained_hardened_clay.getDefaultState(); + IBlockState iblockstate3 = this.fillerBlock; + int i1 = (int) (d0 / 3.0D + 3.0D + random.nextDouble() * 0.25D); + boolean flag = Math.cos(d0 / 3.0D * 3.141592653589793D) > 0.0D; + int j1 = -1; + boolean flag1 = false; + + for (int k1 = 255; k1 >= 0; --k1) { + if (chunkprimer.getBlockState(i2, k1, l1).getBlock().getMaterial() == Material.air && k1 < (int) d5) { + chunkprimer.setBlockState(i2, k1, l1, Blocks.stone.getDefaultState()); + } + + if (k1 <= random.nextInt(5)) { + chunkprimer.setBlockState(i2, k1, l1, Blocks.bedrock.getDefaultState()); + } else { + IBlockState iblockstate1 = chunkprimer.getBlockState(i2, k1, l1); + if (iblockstate1.getBlock().getMaterial() == Material.air) { + j1 = -1; + } else if (iblockstate1.getBlock() == Blocks.stone) { + if (j1 == -1) { + flag1 = false; + if (i1 <= 0) { + iblockstate = null; + iblockstate3 = Blocks.stone.getDefaultState(); + } else if (k1 >= j2 - 4 && k1 <= j2 + 1) { + iblockstate = Blocks.stained_hardened_clay.getDefaultState(); + iblockstate3 = this.fillerBlock; + } + + if (k1 < j2 && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) { + iblockstate = Blocks.water.getDefaultState(); + } + + j1 = i1 + Math.max(0, k1 - j2); + if (k1 < j2 - 1) { + chunkprimer.setBlockState(i2, k1, l1, iblockstate3); + if (iblockstate3.getBlock() == Blocks.stained_hardened_clay) { + chunkprimer.setBlockState(i2, k1, l1, iblockstate3.getBlock().getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE)); + } + } else if (this.field_150620_aI && k1 > 86 + i1 * 2) { + if (flag) { + chunkprimer.setBlockState(i2, k1, l1, Blocks.dirt.getDefaultState() + .withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT)); + } else { + chunkprimer.setBlockState(i2, k1, l1, Blocks.grass.getDefaultState()); + } + } else if (k1 <= j2 + 3 + i1) { + chunkprimer.setBlockState(i2, k1, l1, this.topBlock); + flag1 = true; + } else { + IBlockState iblockstate4; + if (k1 >= 64 && k1 <= 127) { + if (flag) { + iblockstate4 = Blocks.hardened_clay.getDefaultState(); + } else { + iblockstate4 = this.func_180629_a(i, k1, j); + } + } else { + iblockstate4 = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE); + } + + chunkprimer.setBlockState(i2, k1, l1, iblockstate4); + } + } else if (j1 > 0) { + --j1; + if (flag1) { + chunkprimer.setBlockState(i2, k1, l1, Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE)); + } else { + IBlockState iblockstate2 = this.func_180629_a(i, k1, j); + chunkprimer.setBlockState(i2, k1, l1, iblockstate2); + } + } + } + } + } + + } + + private void func_150619_a(long parLong1) { + this.field_150621_aC = new IBlockState[64]; + Arrays.fill(this.field_150621_aC, Blocks.hardened_clay.getDefaultState()); + EaglercraftRandom random = new EaglercraftRandom(parLong1); + this.field_150625_aG = new NoiseGeneratorPerlin(random, 1); + + for (int l1 = 0; l1 < 64; ++l1) { + l1 += random.nextInt(5) + 1; + if (l1 < 64) { + this.field_150621_aC[l1] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE); + } + } + + int i2 = random.nextInt(4) + 2; + + for (int i = 0; i < i2; ++i) { + int j = random.nextInt(3) + 1; + int k = random.nextInt(64); + + for (int l = 0; k + l < 64 && l < j; ++l) { + this.field_150621_aC[k + l] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.YELLOW); + } + } + + int j2 = random.nextInt(4) + 2; + + for (int k2 = 0; k2 < j2; ++k2) { + int i3 = random.nextInt(3) + 2; + int l3 = random.nextInt(64); + + for (int i1 = 0; l3 + i1 < 64 && i1 < i3; ++i1) { + this.field_150621_aC[l3 + i1] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.BROWN); + } + } + + int l2 = random.nextInt(4) + 2; + + for (int j3 = 0; j3 < l2; ++j3) { + int i4 = random.nextInt(3) + 1; + int k4 = random.nextInt(64); + + for (int j1 = 0; k4 + j1 < 64 && j1 < i4; ++j1) { + this.field_150621_aC[k4 + j1] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.RED); + } + } + + int k3 = random.nextInt(3) + 3; + int j4 = 0; + + for (int l4 = 0; l4 < k3; ++l4) { + byte b0 = 1; + j4 += random.nextInt(16) + 4; + + for (int k1 = 0; j4 + k1 < 64 && k1 < b0; ++k1) { + this.field_150621_aC[j4 + k1] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.WHITE); + if (j4 + k1 > 1 && random.nextBoolean()) { + this.field_150621_aC[j4 + k1 - 1] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.SILVER); + } + + if (j4 + k1 < 63 && random.nextBoolean()) { + this.field_150621_aC[j4 + k1 + 1] = Blocks.stained_hardened_clay.getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.SILVER); + } + } + } + + } + + private IBlockState func_180629_a(int parInt1, int parInt2, int parInt3) { + int i = (int) Math.round( + this.field_150625_aG.func_151601_a((double) parInt1 * 1.0D / 512.0D, (double) parInt1 * 1.0D / 512.0D) + * 2.0D); + return this.field_150621_aC[(parInt2 + i + 64) % 64]; + } + + protected BiomeGenBase createMutatedBiome(int i) { + boolean flag = this.biomeID == BiomeGenBase.mesa.biomeID; + BiomeGenMesa biomegenmesa = new BiomeGenMesa(i, flag, this.field_150620_aI); + if (!flag) { + biomegenmesa.setHeight(height_LowHills); + biomegenmesa.setBiomeName(this.biomeName + " M"); + } else { + biomegenmesa.setBiomeName(this.biomeName + " (Bryce)"); + } + + biomegenmesa.func_150557_a(this.color, true); + return biomegenmesa; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMushroomIsland.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMushroomIsland.java new file mode 100644 index 0000000..f28b6c2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMushroomIsland.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityMooshroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenMushroomIsland extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenMushroomIsland"); + } + + public BiomeGenMushroomIsland(int parInt1) { + super(parInt1); + this.theBiomeDecorator.treesPerChunk = -100; + this.theBiomeDecorator.flowersPerChunk = -100; + this.theBiomeDecorator.grassPerChunk = -100; + this.theBiomeDecorator.mushroomsPerChunk = 1; + this.theBiomeDecorator.bigMushroomsPerChunk = 1; + this.topBlock = Blocks.mycelium.getDefaultState(); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMutated.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMutated.java new file mode 100644 index 0000000..5db07cb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMutated.java @@ -0,0 +1,108 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenMutated extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenMutated"); + } + + protected BiomeGenBase baseBiome; + + public BiomeGenMutated(int id, BiomeGenBase biome) { + super(id); + this.baseBiome = biome; + this.func_150557_a(biome.color, true); + this.biomeName = biome.biomeName + " M"; + this.topBlock = biome.topBlock; + this.fillerBlock = biome.fillerBlock; + this.fillerBlockMetadata = biome.fillerBlockMetadata; + this.minHeight = biome.minHeight; + this.maxHeight = biome.maxHeight; + this.temperature = biome.temperature; + this.rainfall = biome.rainfall; + this.waterColorMultiplier = biome.waterColorMultiplier; + this.enableSnow = biome.enableSnow; + this.enableRain = biome.enableRain; + this.spawnableCreatureList = Lists.newArrayList(biome.spawnableCreatureList); + this.spawnableMonsterList = Lists.newArrayList(biome.spawnableMonsterList); + this.spawnableCaveCreatureList = Lists.newArrayList(biome.spawnableCaveCreatureList); + this.spawnableWaterCreatureList = Lists.newArrayList(biome.spawnableWaterCreatureList); + this.temperature = biome.temperature; + this.rainfall = biome.rainfall; + this.minHeight = biome.minHeight + 0.1F; + this.maxHeight = biome.maxHeight + 0.2F; + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + this.baseBiome.theBiomeDecorator.decorate(world, random, this, blockpos); + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + this.baseBiome.genTerrainBlocks(world, random, chunkprimer, i, j, d0); + } + + /**+ + * returns the chance a creature has to spawn. + */ + public float getSpawningChance() { + return this.baseBiome.getSpawningChance(); + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return this.baseBiome.genBigTreeChance(random); + } + + public int getFoliageColorAtPos(BlockPos blockpos) { + return this.baseBiome.getFoliageColorAtPos(blockpos); + } + + public int getGrassColorAtPos(BlockPos blockpos) { + return this.baseBiome.getGrassColorAtPos(blockpos); + } + + public Class getBiomeClass() { + return this.baseBiome.getBiomeClass(); + } + + /**+ + * returns true if the biome specified is equal to this biome + */ + public boolean isEqualTo(BiomeGenBase biomegenbase) { + return this.baseBiome.isEqualTo(biomegenbase); + } + + public BiomeGenBase.TempCategory getTempCategory() { + return this.baseBiome.getTempCategory(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenOcean.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenOcean.java new file mode 100644 index 0000000..82a7e75 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenOcean.java @@ -0,0 +1,49 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenOcean extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenOcean"); + } + + public BiomeGenOcean(int parInt1) { + super(parInt1); + this.spawnableCreatureList.clear(); + } + + public BiomeGenBase.TempCategory getTempCategory() { + return BiomeGenBase.TempCategory.OCEAN; + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + super.genTerrainBlocks(world, random, chunkprimer, i, j, d0); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenPlains.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenPlains.java new file mode 100644 index 0000000..0956a77 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenPlains.java @@ -0,0 +1,117 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenPlains extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenPlains"); + } + + protected boolean field_150628_aC; + + protected BiomeGenPlains(int parInt1) { + super(parInt1); + this.setTemperatureRainfall(0.8F, 0.4F); + this.setHeight(height_LowPlains); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6)); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + } + + public BlockFlower.EnumFlowerType pickRandomFlower(EaglercraftRandom random, BlockPos blockpos) { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double) blockpos.getX() / 200.0D, + (double) blockpos.getZ() / 200.0D); + if (d0 < -0.8D) { + int j = random.nextInt(4); + switch (j) { + case 0: + return BlockFlower.EnumFlowerType.ORANGE_TULIP; + case 1: + return BlockFlower.EnumFlowerType.RED_TULIP; + case 2: + return BlockFlower.EnumFlowerType.PINK_TULIP; + case 3: + default: + return BlockFlower.EnumFlowerType.WHITE_TULIP; + } + } else if (random.nextInt(3) > 0) { + int i = random.nextInt(3); + return i == 0 ? BlockFlower.EnumFlowerType.POPPY + : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); + } else { + return BlockFlower.EnumFlowerType.DANDELION; + } + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double) (blockpos.getX() + 8) / 200.0D, + (double) (blockpos.getZ() + 8) / 200.0D); + if (d0 < -0.8D) { + this.theBiomeDecorator.flowersPerChunk = 15; + this.theBiomeDecorator.grassPerChunk = 5; + } else { + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); + + for (int i = 0; i < 7; ++i) { + int j = random.nextInt(16) + 8; + int k = random.nextInt(16) + 8; + int l = random.nextInt(world.getHeight(blockpos.add(j, 0, k)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(world, random, blockpos.add(j, l, k)); + } + } + + if (this.field_150628_aC) { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER); + + for (int i1 = 0; i1 < 10; ++i1) { + int j1 = random.nextInt(16) + 8; + int k1 = random.nextInt(16) + 8; + int l1 = random.nextInt(world.getHeight(blockpos.add(j1, 0, k1)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(world, random, blockpos.add(j1, l1, k1)); + } + } + + super.decorate(world, random, blockpos); + } + + protected BiomeGenBase createMutatedBiome(int i) { + BiomeGenPlains biomegenplains = new BiomeGenPlains(i); + biomegenplains.setBiomeName("Sunflower Plains"); + biomegenplains.field_150628_aC = true; + biomegenplains.setColor(9286496); + biomegenplains.field_150609_ah = 14273354; + return biomegenplains; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenRiver.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenRiver.java new file mode 100644 index 0000000..8704976 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenRiver.java @@ -0,0 +1,37 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenRiver extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenRiver"); + } + + public BiomeGenRiver(int parInt1) { + super(parInt1); + this.spawnableCreatureList.clear(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSavanna.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSavanna.java new file mode 100644 index 0000000..a1f6689 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSavanna.java @@ -0,0 +1,106 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityHorse; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenMutated; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenSavannaTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenSavanna extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenSavanna"); + } + + private static final WorldGenSavannaTree field_150627_aC = new WorldGenSavannaTree(false); + + protected BiomeGenSavanna(int parInt1) { + super(parInt1); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 1, 2, 6)); + this.theBiomeDecorator.treesPerChunk = 1; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 20; + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return (WorldGenAbstractTree) (random.nextInt(5) > 0 ? field_150627_aC : this.worldGeneratorTrees); + } + + protected BiomeGenBase createMutatedBiome(int i) { + BiomeGenSavanna.Mutated biomegensavanna$mutated = new BiomeGenSavanna.Mutated(i, this); + biomegensavanna$mutated.temperature = (this.temperature + 1.0F) * 0.5F; + biomegensavanna$mutated.minHeight = this.minHeight * 0.5F + 0.3F; + biomegensavanna$mutated.maxHeight = this.maxHeight * 0.5F + 1.2F; + return biomegensavanna$mutated; + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); + + for (int i = 0; i < 7; ++i) { + int j = random.nextInt(16) + 8; + int k = random.nextInt(16) + 8; + int l = random.nextInt(world.getHeight(blockpos.add(j, 0, k)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(world, random, blockpos.add(j, l, k)); + } + + super.decorate(world, random, blockpos); + } + + public static class Mutated extends BiomeGenMutated { + public Mutated(int parInt1, BiomeGenBase parBiomeGenBase) { + super(parInt1, parBiomeGenBase); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 2; + this.theBiomeDecorator.grassPerChunk = 5; + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + if (d0 > 1.75D) { + this.topBlock = Blocks.stone.getDefaultState(); + this.fillerBlock = Blocks.stone.getDefaultState(); + } else if (d0 > -0.5D) { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, + BlockDirt.DirtType.COARSE_DIRT); + } + + this.generateBiomeTerrain(world, random, chunkprimer, i, j, d0); + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + this.theBiomeDecorator.decorate(world, random, this, blockpos); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSnow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSnow.java new file mode 100644 index 0000000..23dc8ae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSnow.java @@ -0,0 +1,85 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenIcePath; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenIceSpike; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTaiga2; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenSnow extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenSnow"); + } + + private boolean field_150615_aC; + private WorldGenIceSpike field_150616_aD = new WorldGenIceSpike(); + private WorldGenIcePath field_150617_aE = new WorldGenIcePath(4); + + public BiomeGenSnow(int parInt1, boolean parFlag) { + super(parInt1); + this.field_150615_aC = parFlag; + if (parFlag) { + this.topBlock = Blocks.snow.getDefaultState(); + } + + this.spawnableCreatureList.clear(); + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (this.field_150615_aC) { + for (int i = 0; i < 3; ++i) { + int j = random.nextInt(16) + 8; + int k = random.nextInt(16) + 8; + this.field_150616_aD.generate(world, random, world.getHeight(blockpos.add(j, 0, k))); + } + + for (int l = 0; l < 2; ++l) { + int i1 = random.nextInt(16) + 8; + int j1 = random.nextInt(16) + 8; + this.field_150617_aE.generate(world, random, world.getHeight(blockpos.add(i1, 0, j1))); + } + } + + super.decorate(world, random, blockpos); + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom var1) { + return new WorldGenTaiga2(false); + } + + protected BiomeGenBase createMutatedBiome(int i) { + BiomeGenBase biomegenbase = (new BiomeGenSnow(i, true)).func_150557_a(13828095, true) + .setBiomeName(this.biomeName + " Spikes").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F) + .setHeight(new BiomeGenBase.Height(this.minHeight + 0.1F, this.maxHeight + 0.1F)); + biomegenbase.minHeight = this.minHeight + 0.3F; + biomegenbase.maxHeight = this.maxHeight + 0.4F; + return biomegenbase; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenStoneBeach.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenStoneBeach.java new file mode 100644 index 0000000..7441608 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenStoneBeach.java @@ -0,0 +1,44 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenStoneBeach extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenStoneBeach"); + } + + public BiomeGenStoneBeach(int parInt1) { + super(parInt1); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.stone.getDefaultState(); + this.fillerBlock = Blocks.stone.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSwamp.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSwamp.java new file mode 100644 index 0000000..51fae96 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSwamp.java @@ -0,0 +1,98 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySlime; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenSwamp extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenSwamp"); + } + + protected BiomeGenSwamp(int parInt1) { + super(parInt1); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 1; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 8; + this.theBiomeDecorator.reedsPerChunk = 10; + this.theBiomeDecorator.clayPerChunk = 1; + this.theBiomeDecorator.waterlilyPerChunk = 4; + this.theBiomeDecorator.sandPerChunk2 = 0; + this.theBiomeDecorator.sandPerChunk = 0; + this.theBiomeDecorator.grassPerChunk = 5; + this.waterColorMultiplier = 14745518; + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom var1) { + return this.worldGeneratorSwamp; + } + + public int getGrassColorAtPos(BlockPos blockpos) { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double) blockpos.getX() * 0.0225D, + (double) blockpos.getZ() * 0.0225D); + return d0 < -0.1D ? 5011004 : 6975545; + } + + public int getFoliageColorAtPos(BlockPos var1) { + return 6975545; + } + + public BlockFlower.EnumFlowerType pickRandomFlower(EaglercraftRandom var1, BlockPos var2) { + return BlockFlower.EnumFlowerType.BLUE_ORCHID; + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + double d1 = GRASS_COLOR_NOISE.func_151601_a((double) i * 0.25D, (double) j * 0.25D); + if (d1 > 0.0D) { + int k = i & 15; + int l = j & 15; + + for (int i1 = 255; i1 >= 0; --i1) { + if (chunkprimer.getBlockState(l, i1, k).getBlock().getMaterial() != Material.air) { + if (i1 == 62 && chunkprimer.getBlockState(l, i1, k).getBlock() != Blocks.water) { + chunkprimer.setBlockState(l, i1, k, Blocks.water.getDefaultState()); + if (d1 < 0.12D) { + chunkprimer.setBlockState(l, i1 + 1, k, Blocks.waterlily.getDefaultState()); + } + } + break; + } + } + } + + this.generateBiomeTerrain(world, random, chunkprimer, i, j, d0); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenTaiga.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenTaiga.java new file mode 100644 index 0000000..eb9038b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenTaiga.java @@ -0,0 +1,133 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityWolf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenBlockBlob; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTaiga1; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 BiomeGenTaiga extends BiomeGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/BiomeGenTaiga"); + } + + private static final WorldGenTaiga1 field_150639_aC = new WorldGenTaiga1(); + private static final WorldGenTaiga2 field_150640_aD = new WorldGenTaiga2(false); + private static final WorldGenMegaPineTree field_150641_aE = new WorldGenMegaPineTree(false, false); + private static final WorldGenMegaPineTree field_150642_aF = new WorldGenMegaPineTree(false, true); + private static final WorldGenBlockBlob field_150643_aG = new WorldGenBlockBlob(Blocks.mossy_cobblestone, 0); + private int field_150644_aH; + + public BiomeGenTaiga(int parInt1, int parInt2) { + super(parInt1); + this.field_150644_aH = parInt2; + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4)); + this.theBiomeDecorator.treesPerChunk = 10; + if (parInt2 != 1 && parInt2 != 2) { + this.theBiomeDecorator.grassPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 1; + } else { + this.theBiomeDecorator.grassPerChunk = 7; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 3; + } + + } + + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return (WorldGenAbstractTree) ((this.field_150644_aH == 1 || this.field_150644_aH == 2) + && random.nextInt(3) == 0 + ? (this.field_150644_aH != 2 && random.nextInt(13) != 0 ? field_150641_aE : field_150642_aF) + : (random.nextInt(3) == 0 ? field_150639_aC : field_150640_aD)); + } + + /**+ + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(EaglercraftRandom random) { + return random.nextInt(5) > 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) + : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); + } + + public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) { + int i = random.nextInt(3); + + for (int j = 0; j < i; ++j) { + int k = random.nextInt(16) + 8; + int l = random.nextInt(16) + 8; + BlockPos blockpos1 = world.getHeight(blockpos.add(k, 0, l)); + field_150643_aG.generate(world, random, blockpos1); + } + } + + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN); + + for (int i1 = 0; i1 < 7; ++i1) { + int j1 = random.nextInt(16) + 8; + int k1 = random.nextInt(16) + 8; + int l1 = random.nextInt(world.getHeight(blockpos.add(j1, 0, k1)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(world, random, blockpos.add(j1, l1, k1)); + } + + super.decorate(world, random, blockpos); + } + + public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j, + double d0) { + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + if (d0 > 1.75D) { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, + BlockDirt.DirtType.COARSE_DIRT); + } else if (d0 > -0.95D) { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, + BlockDirt.DirtType.PODZOL); + } + } + + this.generateBiomeTerrain(world, random, chunkprimer, i, j, d0); + } + + protected BiomeGenBase createMutatedBiome(int i) { + return this.biomeID == BiomeGenBase.megaTaiga.biomeID ? (new BiomeGenTaiga(i, 2)).func_150557_a(5858897, true) + .setBiomeName("Mega Spruce Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F) + .setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight)) : super.createMutatedBiome(i); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManager.java new file mode 100644 index 0000000..9bbaf52 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManager.java @@ -0,0 +1,272 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeCache; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldChunkManager { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/WorldChunkManager"); + } + + private GenLayer genBiomes; + private GenLayer biomeIndexLayer; + private BiomeCache biomeCache; + private List biomesToSpawnIn; + private String field_180301_f; + + protected WorldChunkManager() { + this.biomeCache = new BiomeCache(this); + this.field_180301_f = ""; + this.biomesToSpawnIn = Lists.newArrayList(); + this.biomesToSpawnIn.add(BiomeGenBase.forest); + this.biomesToSpawnIn.add(BiomeGenBase.plains); + this.biomesToSpawnIn.add(BiomeGenBase.taiga); + this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); + this.biomesToSpawnIn.add(BiomeGenBase.forestHills); + this.biomesToSpawnIn.add(BiomeGenBase.jungle); + this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); + } + + public WorldChunkManager(long seed, WorldType parWorldType, String parString1) { + this(); + this.field_180301_f = parString1; + GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, parWorldType, parString1); + this.genBiomes = agenlayer[0]; + this.biomeIndexLayer = agenlayer[1]; + } + + public WorldChunkManager(World worldIn) { + this(worldIn.getSeed(), worldIn.getWorldInfo().getTerrainType(), worldIn.getWorldInfo().getGeneratorOptions()); + } + + /**+ + * Gets the list of valid biomes for the player to spawn in. + */ + public List getBiomesToSpawnIn() { + return this.biomesToSpawnIn; + } + + /**+ + * Returns the biome generator + */ + public BiomeGenBase getBiomeGenerator(BlockPos pos) { + return this.getBiomeGenerator(pos, (BiomeGenBase) null); + } + + /**+ + * Returns the biome generator + */ + public BiomeGenBase getBiomeGenerator(BlockPos pos, BiomeGenBase biomeGenBaseIn) { + return this.biomeCache.func_180284_a(pos.getX(), pos.getZ(), biomeGenBaseIn); + } + + /**+ + * Returns a list of rainfall values for the specified blocks. + * Args: listToReuse, x, z, width, length. + */ + public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) { + IntCache.resetIntCache(); + if (listToReuse == null || listToReuse.length < width * length) { + listToReuse = new float[width * length]; + } + + int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); + + for (int i = 0; i < width * length; ++i) { + try { + float f = (float) BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad) + .getIntRainfall() / 65536.0F; + if (f > 1.0F) { + f = 1.0F; + } + + listToReuse[i] = f; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock"); + crashreportcategory.addCrashSection("biome id", Integer.valueOf(i)); + crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length)); + crashreportcategory.addCrashSection("x", Integer.valueOf(x)); + crashreportcategory.addCrashSection("z", Integer.valueOf(z)); + crashreportcategory.addCrashSection("w", Integer.valueOf(width)); + crashreportcategory.addCrashSection("h", Integer.valueOf(length)); + throw new ReportedException(crashreport); + } + } + + return listToReuse; + } + + /**+ + * Return an adjusted version of a given temperature based on + * the y height + */ + public float getTemperatureAtHeight(float parFloat1, int parInt1) { + return parFloat1; + } + + /**+ + * Returns an array of biomes for the location input. + */ + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int x, int z, int width, int height) { + IntCache.resetIntCache(); + if (biomes == null || biomes.length < width * height) { + biomes = new BiomeGenBase[width * height]; + } + + int[] aint = this.genBiomes.getInts(x, z, width, height); + + try { + for (int i = 0; i < width * height; ++i) { + biomes[i] = BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad); + } + + return biomes; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock"); + crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(biomes.length)); + crashreportcategory.addCrashSection("x", Integer.valueOf(x)); + crashreportcategory.addCrashSection("z", Integer.valueOf(z)); + crashreportcategory.addCrashSection("w", Integer.valueOf(width)); + crashreportcategory.addCrashSection("h", Integer.valueOf(height)); + throw new ReportedException(crashreport); + } + } + + /**+ + * Returns biomes to use for the blocks and loads the other data + * like temperature and humidity onto the WorldChunkManager + * Args: oldBiomeList, x, z, width, depth + */ + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) { + return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true); + } + + /**+ + * Return a list of biomes for the specified blocks. Args: + * listToReuse, x, y, width, length, cacheFlag (if false, don't + * check biomeCache to avoid infinite loop in BiomeCacheBlock) + */ + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int z, int width, int length, + boolean cacheFlag) { + IntCache.resetIntCache(); + if (listToReuse == null || listToReuse.length < width * length) { + listToReuse = new BiomeGenBase[width * length]; + } + + if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (z & 15) == 0) { + BiomeGenBase[] abiomegenbase = this.biomeCache.getCachedBiomes(x, z); + System.arraycopy(abiomegenbase, 0, listToReuse, 0, width * length); + return listToReuse; + } else { + int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); + + for (int i = 0; i < width * length; ++i) { + listToReuse[i] = BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad); + } + + return listToReuse; + } + } + + /**+ + * checks given Chunk's Biomes against List of allowed ones + */ + public boolean areBiomesViable(int parInt1, int parInt2, int parInt3, List parList) { + IntCache.resetIntCache(); + int i = parInt1 - parInt3 >> 2; + int j = parInt2 - parInt3 >> 2; + int k = parInt1 + parInt3 >> 2; + int l = parInt2 + parInt3 >> 2; + int i1 = k - i + 1; + int j1 = l - j + 1; + int[] aint = this.genBiomes.getInts(i, j, i1, j1); + + try { + for (int k1 = 0; k1 < i1 * j1; ++k1) { + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k1]); + if (!parList.contains(biomegenbase)) { + return false; + } + } + + return true; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer"); + crashreportcategory.addCrashSection("Layer", this.genBiomes.toString()); + crashreportcategory.addCrashSection("x", Integer.valueOf(parInt1)); + crashreportcategory.addCrashSection("z", Integer.valueOf(parInt2)); + crashreportcategory.addCrashSection("radius", Integer.valueOf(parInt3)); + crashreportcategory.addCrashSection("allowed", parList); + throw new ReportedException(crashreport); + } + } + + public BlockPos findBiomePosition(int x, int z, int range, List biomes, EaglercraftRandom random) { + IntCache.resetIntCache(); + int i = x - range >> 2; + int j = z - range >> 2; + int k = x + range >> 2; + int l = z + range >> 2; + int i1 = k - i + 1; + int j1 = l - j + 1; + int[] aint = this.genBiomes.getInts(i, j, i1, j1); + BlockPos blockpos = null; + int k1 = 0; + + for (int l1 = 0; l1 < i1 * j1; ++l1) { + int i2 = i + l1 % i1 << 2; + int j2 = j + l1 / i1 << 2; + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[l1]); + if (biomes.contains(biomegenbase) && (blockpos == null || random.nextInt(k1 + 1) == 0)) { + blockpos = new BlockPos(i2, 0, j2); + ++k1; + } + } + + return blockpos; + } + + /**+ + * Calls the WorldChunkManager's biomeCache.cleanupCache() + */ + public void cleanupCache() { + this.biomeCache.cleanupCache(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManagerHell.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManagerHell.java new file mode 100644 index 0000000..efc00ae --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManagerHell.java @@ -0,0 +1,113 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; + +import java.util.Arrays; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldChunkManagerHell extends WorldChunkManager { + + static { + __checkIntegratedContextValid("net/minecraft/world/biome/WorldChunkManagerHell"); + } + + private BiomeGenBase biomeGenerator; + private float rainfall; + + public WorldChunkManagerHell(BiomeGenBase parBiomeGenBase, float parFloat1) { + this.biomeGenerator = parBiomeGenBase; + this.rainfall = parFloat1; + } + + /**+ + * Returns the biome generator + */ + public BiomeGenBase getBiomeGenerator(BlockPos var1) { + return this.biomeGenerator; + } + + /**+ + * Returns an array of biomes for the location input. + */ + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] abiomegenbase, int var2, int var3, int i, int j) { + if (abiomegenbase == null || abiomegenbase.length < i * j) { + abiomegenbase = new BiomeGenBase[i * j]; + } + + Arrays.fill(abiomegenbase, 0, i * j, this.biomeGenerator); + return abiomegenbase; + } + + /**+ + * Returns a list of rainfall values for the specified blocks. + * Args: listToReuse, x, z, width, length. + */ + public float[] getRainfall(float[] afloat, int var2, int var3, int i, int j) { + if (afloat == null || afloat.length < i * j) { + afloat = new float[i * j]; + } + + Arrays.fill(afloat, 0, i * j, this.rainfall); + return afloat; + } + + /**+ + * Returns biomes to use for the blocks and loads the other data + * like temperature and humidity onto the WorldChunkManager + * Args: oldBiomeList, x, z, width, depth + */ + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] abiomegenbase, int var2, int var3, int i, int j) { + if (abiomegenbase == null || abiomegenbase.length < i * j) { + abiomegenbase = new BiomeGenBase[i * j]; + } + + Arrays.fill(abiomegenbase, 0, i * j, this.biomeGenerator); + return abiomegenbase; + } + + /**+ + * Return a list of biomes for the specified blocks. Args: + * listToReuse, x, y, width, length, cacheFlag (if false, don't + * check biomeCache to avoid infinite loop in BiomeCacheBlock) + */ + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] abiomegenbase, int i, int j, int k, int l, boolean var6) { + return this.loadBlockGeneratorData(abiomegenbase, i, j, k, l); + } + + public BlockPos findBiomePosition(int i, int j, int k, List list, EaglercraftRandom random) { + return list.contains(this.biomeGenerator) + ? new BlockPos(i - k + random.nextInt(k * 2 + 1), 0, j - k + random.nextInt(k * 2 + 1)) + : null; + } + + /**+ + * checks given Chunk's Biomes against List of allowed ones + */ + public boolean areBiomesViable(int var1, int var2, int var3, List list) { + return list.contains(this.biomeGenerator); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/EnumBorderStatus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/EnumBorderStatus.java new file mode 100644 index 0000000..abff6ad --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/EnumBorderStatus.java @@ -0,0 +1,46 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 enum EnumBorderStatus { + GROWING(4259712), SHRINKING(16724016), STATIONARY(2138367); + + static { + __checkIntegratedContextValid("net/minecraft/world/border/EnumBorderStatus"); + } + + private final int id; + + private EnumBorderStatus(int id) { + this.id = id; + } + + /**+ + * Returns an integer that represents the state of the world + * border. Growing, Shrinking and Stationary all have unique + * values. + */ + public int getID() { + return this.id; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/IBorderListener.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/IBorderListener.java new file mode 100644 index 0000000..6b77318 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/IBorderListener.java @@ -0,0 +1,39 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.WorldBorder; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IBorderListener { + void onSizeChanged(WorldBorder var1, double var2); + + void onTransitionStarted(WorldBorder var1, double var2, double var4, long var6); + + void onCenterChanged(WorldBorder var1, double var2, double var4); + + void onWarningTimeChanged(WorldBorder var1, int var2); + + void onWarningDistanceChanged(WorldBorder var1, int var2); + + void onDamageAmountChanged(WorldBorder var1, double var2); + + void onDamageBufferChanged(WorldBorder var1, double var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/WorldBorder.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/WorldBorder.java new file mode 100644 index 0000000..4fee856 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/WorldBorder.java @@ -0,0 +1,267 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.EnumBorderStatus; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.border.IBorderListener; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldBorder { + + static { + __checkIntegratedContextValid("net/minecraft/world/border/WorldBorder"); + } + + private final List listeners = Lists.newArrayList(); + private double centerX = 0.0D; + private double centerZ = 0.0D; + private double startDiameter = 6.0E7D; + private double endDiameter; + private long endTime; + private long startTime; + private int worldSize; + private double damageAmount; + private double damageBuffer; + private int warningTime; + private int warningDistance; + + public WorldBorder() { + this.endDiameter = this.startDiameter; + this.worldSize = 29999984; + this.damageAmount = 0.2D; + this.damageBuffer = 5.0D; + this.warningTime = 15; + this.warningDistance = 5; + } + + public boolean contains(BlockPos pos) { + return (double) (pos.getX() + 1) > this.minX() && (double) pos.getX() < this.maxX() + && (double) (pos.getZ() + 1) > this.minZ() && (double) pos.getZ() < this.maxZ(); + } + + public boolean contains(ChunkCoordIntPair range) { + return (double) range.getXEnd() > this.minX() && (double) range.getXStart() < this.maxX() + && (double) range.getZEnd() > this.minZ() && (double) range.getZStart() < this.maxZ(); + } + + public boolean contains(AxisAlignedBB bb) { + return bb.maxX > this.minX() && bb.minX < this.maxX() && bb.maxZ > this.minZ() && bb.minZ < this.maxZ(); + } + + public double getClosestDistance(Entity entityIn) { + return this.getClosestDistance(entityIn.posX, entityIn.posZ); + } + + public double getClosestDistance(double x, double z) { + double d0 = z - this.minZ(); + double d1 = this.maxZ() - z; + double d2 = x - this.minX(); + double d3 = this.maxX() - x; + double d4 = Math.min(d2, d3); + d4 = Math.min(d4, d0); + return Math.min(d4, d1); + } + + public EnumBorderStatus getStatus() { + return this.endDiameter < this.startDiameter ? EnumBorderStatus.SHRINKING + : (this.endDiameter > this.startDiameter ? EnumBorderStatus.GROWING : EnumBorderStatus.STATIONARY); + } + + public double minX() { + double d0 = this.getCenterX() - this.getDiameter() / 2.0D; + if (d0 < (double) (-this.worldSize)) { + d0 = (double) (-this.worldSize); + } + + return d0; + } + + public double minZ() { + double d0 = this.getCenterZ() - this.getDiameter() / 2.0D; + if (d0 < (double) (-this.worldSize)) { + d0 = (double) (-this.worldSize); + } + + return d0; + } + + public double maxX() { + double d0 = this.getCenterX() + this.getDiameter() / 2.0D; + if (d0 > (double) this.worldSize) { + d0 = (double) this.worldSize; + } + + return d0; + } + + public double maxZ() { + double d0 = this.getCenterZ() + this.getDiameter() / 2.0D; + if (d0 > (double) this.worldSize) { + d0 = (double) this.worldSize; + } + + return d0; + } + + public double getCenterX() { + return this.centerX; + } + + public double getCenterZ() { + return this.centerZ; + } + + public void setCenter(double x, double z) { + this.centerX = x; + this.centerZ = z; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onCenterChanged(this, x, z); + } + + } + + public double getDiameter() { + if (this.getStatus() != EnumBorderStatus.STATIONARY) { + double d0 = (double) ((float) (System.currentTimeMillis() - this.startTime) + / (float) (this.endTime - this.startTime)); + if (d0 < 1.0D) { + return this.startDiameter + (this.endDiameter - this.startDiameter) * d0; + } + + this.setTransition(this.endDiameter); + } + + return this.startDiameter; + } + + public long getTimeUntilTarget() { + return this.getStatus() != EnumBorderStatus.STATIONARY ? this.endTime - System.currentTimeMillis() : 0L; + } + + public double getTargetSize() { + return this.endDiameter; + } + + public void setTransition(double newSize) { + this.startDiameter = newSize; + this.endDiameter = newSize; + this.endTime = System.currentTimeMillis(); + this.startTime = this.endTime; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onSizeChanged(this, newSize); + } + + } + + public void setTransition(double oldSize, double newSize, long time) { + this.startDiameter = oldSize; + this.endDiameter = newSize; + this.startTime = System.currentTimeMillis(); + this.endTime = this.startTime + time; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onTransitionStarted(this, oldSize, newSize, time); + } + + } + + protected List getListeners() { + return Lists.newArrayList(this.listeners); + } + + public void addListener(IBorderListener listener) { + this.listeners.add(listener); + } + + public void setSize(int size) { + this.worldSize = size; + } + + public int getSize() { + return this.worldSize; + } + + public double getDamageBuffer() { + return this.damageBuffer; + } + + public void setDamageBuffer(double bufferSize) { + this.damageBuffer = bufferSize; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onDamageBufferChanged(this, bufferSize); + } + + } + + public double getDamageAmount() { + return this.damageAmount; + } + + public void setDamageAmount(double newAmount) { + this.damageAmount = newAmount; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onDamageAmountChanged(this, newAmount); + } + + } + + public double getResizeSpeed() { + return this.endTime == this.startTime ? 0.0D + : Math.abs(this.startDiameter - this.endDiameter) / (double) (this.endTime - this.startTime); + } + + public int getWarningTime() { + return this.warningTime; + } + + public void setWarningTime(int warningTime) { + this.warningTime = warningTime; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onWarningTimeChanged(this, warningTime); + } + + } + + public int getWarningDistance() { + return this.warningDistance; + } + + public void setWarningDistance(int warningDistance) { + this.warningDistance = warningDistance; + + for (IBorderListener iborderlistener : this.getListeners()) { + iborderlistener.onWarningDistanceChanged(this, warningDistance); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/Chunk.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/Chunk.java new file mode 100644 index 0000000..ba279ce --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/Chunk.java @@ -0,0 +1,1380 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk; + +import com.google.common.base.Predicate; +import com.google.common.collect.Maps; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; + +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentLinkedQueue; + +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.ITileEntityProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ClassInheritanceMultiMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +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.chunk.NibbleArray; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderDebug; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 Chunk { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/Chunk"); + } + + private static final Logger logger = LogManager.getLogger(); + private final ExtendedBlockStorage[] storageArrays; + private final byte[] blockBiomeArray; + private final int[] precipitationHeightMap; + private final boolean[] updateSkylightColumns; + private boolean isChunkLoaded; + private final World worldObj; + private final int[] heightMap; + public final int xPosition; + public final int zPosition; + private boolean isGapLightingUpdated; + private final Map chunkTileEntityMap; + private final ClassInheritanceMultiMap[] entityLists; + private boolean isTerrainPopulated; + private boolean isLightPopulated; + private boolean field_150815_m; + private boolean isModified; + private boolean hasEntities; + private long lastSaveTime; + private int heightMapMinimum; + private long inhabitedTime; + private int queuedLightChecks; + private List tileEntityPosQueue; + + public Chunk(World worldIn, int x, int z) { + this.storageArrays = new ExtendedBlockStorage[16]; + this.blockBiomeArray = new byte[256]; + this.precipitationHeightMap = new int[256]; + this.updateSkylightColumns = new boolean[256]; + this.chunkTileEntityMap = Maps.newHashMap(); + this.queuedLightChecks = 4096; + this.tileEntityPosQueue = new LinkedList(); + this.entityLists = (ClassInheritanceMultiMap[]) (new ClassInheritanceMultiMap[16]); + this.worldObj = worldIn; + this.xPosition = x; + this.zPosition = z; + this.heightMap = new int[256]; + + for (int i = 0; i < this.entityLists.length; ++i) { + this.entityLists[i] = new ClassInheritanceMultiMap(Entity.class); + } + + Arrays.fill(this.precipitationHeightMap, -999); + Arrays.fill(this.blockBiomeArray, (byte) -1); + } + + public Chunk(World worldIn, ChunkPrimer primer, int x, int z) { + this(worldIn, x, z); + short short1 = 256; + boolean flag = !worldIn.provider.getHasNoSky(); + + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + for (int k = 0; k < short1; ++k) { + int l = i * short1 * 16 | j * short1 | k; + IBlockState iblockstate = primer.getBlockState(l); + if (iblockstate.getBlock().getMaterial() != Material.air) { + int i1 = k >> 4; + if (this.storageArrays[i1] == null) { + this.storageArrays[i1] = new ExtendedBlockStorage(i1 << 4, flag); + } + + this.storageArrays[i1].set(i, k & 15, j, iblockstate); + } + } + } + } + + } + + /**+ + * Checks whether the chunk is at the X/Z location specified + */ + public boolean isAtLocation(int i, int j) { + return i == this.xPosition && j == this.zPosition; + } + + public int getHeight(BlockPos pos) { + return this.getHeightValue(pos.getX() & 15, pos.getZ() & 15); + } + + /**+ + * Returns the value in the height map at this x, z coordinate + * in the chunk + */ + public int getHeightValue(int i, int j) { + return this.heightMap[j << 4 | i]; + } + + /**+ + * Returns the topmost ExtendedBlockStorage instance for this + * Chunk that actually contains a block. + */ + public int getTopFilledSegment() { + for (int i = this.storageArrays.length - 1; i >= 0; --i) { + if (this.storageArrays[i] != null) { + return this.storageArrays[i].getYLocation(); + } + } + + return 0; + } + + /**+ + * Returns the ExtendedBlockStorage array for this Chunk. + */ + public ExtendedBlockStorage[] getBlockStorageArray() { + return this.storageArrays; + } + + /**+ + * Generates the height map for a chunk from scratch + */ + protected void generateHeightMap() { + int i = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int j = 0; j < 16; ++j) { + for (int k = 0; k < 16; ++k) { + this.precipitationHeightMap[j + (k << 4)] = -999; + + for (int l = i + 16; l > 0; --l) { + Block block = this.getBlock0(j, l - 1, k); + if (block.getLightOpacity() != 0) { + this.heightMap[k << 4 | j] = l; + if (l < this.heightMapMinimum) { + this.heightMapMinimum = l; + } + break; + } + } + } + } + + this.isModified = true; + } + + /**+ + * Generates the initial skylight map for the chunk upon + * generation or load. + */ + public void generateSkylightMap() { + int i = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int j = 0; j < 16; ++j) { + for (int k = 0; k < 16; ++k) { + this.precipitationHeightMap[j + (k << 4)] = -999; + + for (int l = i + 16; l > 0; --l) { + if (this.getBlockLightOpacity(j, l - 1, k) != 0) { + this.heightMap[k << 4 | j] = l; + if (l < this.heightMapMinimum) { + this.heightMapMinimum = l; + } + break; + } + } + + if (!this.worldObj.provider.getHasNoSky()) { + int k1 = 15; + int i1 = i + 16 - 1; + + while (true) { + int j1 = this.getBlockLightOpacity(j, i1, k); + if (j1 == 0 && k1 != 15) { + j1 = 1; + } + + k1 -= j1; + if (k1 > 0) { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[i1 >> 4]; + if (extendedblockstorage != null) { + extendedblockstorage.setExtSkylightValue(j, i1 & 15, k, k1); + this.worldObj.notifyLightSet( + new BlockPos((this.xPosition << 4) + j, i1, (this.zPosition << 4) + k)); + } + } + + --i1; + if (i1 <= 0 || k1 <= 0) { + break; + } + } + } + } + } + + ++EaglerMinecraftServer.counterLightUpdate; + this.isModified = true; + } + + /**+ + * Propagates a given sky-visible block's light value downward + * and upward to neighboring blocks as necessary. + */ + private void propagateSkylightOcclusion(int x, int z) { + this.updateSkylightColumns[x + z * 16] = true; + this.isGapLightingUpdated = true; + } + + private void recheckGaps(boolean parFlag) { + this.worldObj.theProfiler.startSection("recheckGaps"); + if (this.worldObj.isAreaLoaded(new BlockPos(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8), 16)) { + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + if (this.updateSkylightColumns[i + j * 16]) { + this.updateSkylightColumns[i + j * 16] = false; + int k = this.getHeightValue(i, j); + int l = this.xPosition * 16 + i; + int i1 = this.zPosition * 16 + j; + int j1 = Integer.MAX_VALUE; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + j1 = Math.min(j1, this.worldObj.getChunksLowestHorizon(l + enumfacing.getFrontOffsetX(), + i1 + enumfacing.getFrontOffsetZ())); + } + + this.checkSkylightNeighborHeight(l, i1, j1); + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) { + this.checkSkylightNeighborHeight(l + enumfacing1.getFrontOffsetX(), + i1 + enumfacing1.getFrontOffsetZ(), k); + } + + if (parFlag) { + this.worldObj.theProfiler.endSection(); + return; + } + } + } + } + + this.isGapLightingUpdated = false; + } + + this.worldObj.theProfiler.endSection(); + } + + /**+ + * Checks the height of a block next to a sky-visible block and + * schedules a lighting update as necessary. + */ + private void checkSkylightNeighborHeight(int x, int z, int maxValue) { + int i = this.worldObj.getHeight(new BlockPos(x, 0, z)).getY(); + if (i > maxValue) { + this.updateSkylightNeighborHeight(x, z, maxValue, i + 1); + } else if (i < maxValue) { + this.updateSkylightNeighborHeight(x, z, i, maxValue + 1); + } + + } + + private void updateSkylightNeighborHeight(int x, int z, int startY, int endY) { + if (endY > startY && this.worldObj.isAreaLoaded(new BlockPos(x, 0, z), 16)) { + for (int i = startY; i < endY; ++i) { + this.worldObj.checkLightFor(EnumSkyBlock.SKY, new BlockPos(x, i, z)); + } + + this.isModified = true; + } + + } + + /**+ + * Initiates the recalculation of both the block-light and + * sky-light for a given block inside a chunk. + */ + private void relightBlock(int x, int y, int z) { + int i = this.heightMap[z << 4 | x] & 255; + int j = i; + if (y > i) { + j = y; + } + + while (j > 0 && this.getBlockLightOpacity(x, j - 1, z) == 0) { + --j; + } + + if (j != i) { + this.worldObj.markBlocksDirtyVertical(x + this.xPosition * 16, z + this.zPosition * 16, j, i); + this.heightMap[z << 4 | x] = j; + int k = this.xPosition * 16 + x; + int l = this.zPosition * 16 + z; + if (!this.worldObj.provider.getHasNoSky()) { + if (j < i) { + for (int j1 = j; j1 < i; ++j1) { + ExtendedBlockStorage extendedblockstorage2 = this.storageArrays[j1 >> 4]; + if (extendedblockstorage2 != null) { + extendedblockstorage2.setExtSkylightValue(x, j1 & 15, z, 15); + this.worldObj.notifyLightSet( + new BlockPos((this.xPosition << 4) + x, j1, (this.zPosition << 4) + z)); + } + } + } else { + for (int i1 = i; i1 < j; ++i1) { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[i1 >> 4]; + if (extendedblockstorage != null) { + extendedblockstorage.setExtSkylightValue(x, i1 & 15, z, 0); + this.worldObj.notifyLightSet( + new BlockPos((this.xPosition << 4) + x, i1, (this.zPosition << 4) + z)); + } + } + } + + int k1 = 15; + + while (j > 0 && k1 > 0) { + --j; + int i2 = this.getBlockLightOpacity(x, j, z); + if (i2 == 0) { + i2 = 1; + } + + k1 -= i2; + if (k1 < 0) { + k1 = 0; + } + + ExtendedBlockStorage extendedblockstorage1 = this.storageArrays[j >> 4]; + if (extendedblockstorage1 != null) { + extendedblockstorage1.setExtSkylightValue(x, j & 15, z, k1); + } + } + } + + int l1 = this.heightMap[z << 4 | x]; + int j2 = i; + int k2 = l1; + if (l1 < i) { + j2 = l1; + k2 = i; + } + + if (l1 < this.heightMapMinimum) { + this.heightMapMinimum = l1; + } + + if (!this.worldObj.provider.getHasNoSky()) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + this.updateSkylightNeighborHeight(k + enumfacing.getFrontOffsetX(), + l + enumfacing.getFrontOffsetZ(), j2, k2); + } + + this.updateSkylightNeighborHeight(k, l, j2, k2); + } + + ++EaglerMinecraftServer.counterLightUpdate; + this.isModified = true; + } + } + + public int getBlockLightOpacity(BlockPos blockpos) { + return this.getBlock(blockpos).getLightOpacity(); + } + + private int getBlockLightOpacity(int x, int y, int z) { + return this.getBlock0(x, y, z).getLightOpacity(); + } + + /**+ + * Returns the block corresponding to the given coordinates + * inside a chunk. + */ + private Block getBlock0(int x, int y, int z) { + Block block = Blocks.air; + if (y >= 0 && y >> 4 < this.storageArrays.length) { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4]; + if (extendedblockstorage != null) { + try { + block = extendedblockstorage.getBlockByExtId(x, y & 15, z); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block"); + throw new ReportedException(crashreport); + } + } + } + + return block; + } + + public Block getBlock(final int x, final int y, final int z) { + try { + return this.getBlock0(x & 15, y, z & 15); + } catch (ReportedException reportedexception) { + CrashReportCategory crashreportcategory = reportedexception.getCrashReport() + .makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() { + public String call() throws Exception { + return CrashReportCategory.getCoordinateInfo(new net.minecraft.util.BlockPos( + Chunk.this.xPosition * 16 + x, y, Chunk.this.zPosition * 16 + z)); + } + }); + throw reportedexception; + } + } + + public Block getBlock(final BlockPos blockpos) { + try { + return this.getBlock0(blockpos.getX() & 15, blockpos.getY(), blockpos.getZ() & 15); + } catch (ReportedException reportedexception) { + CrashReportCategory crashreportcategory = reportedexception.getCrashReport() + .makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() { + public String call() throws Exception { + return CrashReportCategory.getCoordinateInfo( + new net.minecraft.util.BlockPos(blockpos.getX(), blockpos.getY(), blockpos.getZ())); + } + }); + throw reportedexception; + } + } + + public IBlockState getBlockState(final BlockPos pos) { + if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD) { + IBlockState iblockstate = null; + if (pos.getY() == 60) { + iblockstate = Blocks.barrier.getDefaultState(); + } + + if (pos.getY() == 70) { + iblockstate = ChunkProviderDebug.func_177461_b(pos.getX(), pos.getZ()); + } + + return iblockstate == null ? Blocks.air.getDefaultState() : iblockstate; + } else { + try { + if (pos.getY() >= 0 && pos.getY() >> 4 < this.storageArrays.length) { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[pos.getY() >> 4]; + if (extendedblockstorage != null) { + int j = pos.getX() & 15; + int k = pos.getY() & 15; + int i = pos.getZ() & 15; + return extendedblockstorage.get(j, k, i); + } + } + + return Blocks.air.getDefaultState(); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() { + public String call() throws Exception { + return CrashReportCategory + .getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ())); + } + }); + throw new ReportedException(crashreport); + } + } + } + + /**+ + * Return the metadata corresponding to the given coordinates + * inside a chunk. + */ + private int getBlockMetadata(int x, int y, int z) { + if (y >> 4 >= this.storageArrays.length) { + return 0; + } else { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4]; + return extendedblockstorage != null ? extendedblockstorage.getExtBlockMetadata(x, y & 15, z) : 0; + } + } + + /**+ + * Return the metadata corresponding to the given coordinates + * inside a chunk. + */ + public int getBlockMetadata(BlockPos blockpos) { + return this.getBlockMetadata(blockpos.getX() & 15, blockpos.getY(), blockpos.getZ() & 15); + } + + public IBlockState setBlockState(BlockPos pos, IBlockState state) { + int i = pos.getX() & 15; + int j = pos.getY(); + int k = pos.getZ() & 15; + int l = k << 4 | i; + if (j >= this.precipitationHeightMap[l] - 1) { + this.precipitationHeightMap[l] = -999; + } + + int i1 = this.heightMap[l]; + IBlockState iblockstate = this.getBlockState(pos); + if (iblockstate == state) { + return null; + } else { + Block block = state.getBlock(); + Block block1 = iblockstate.getBlock(); + ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; + boolean flag = false; + if (extendedblockstorage == null) { + if (block == Blocks.air) { + return null; + } + + extendedblockstorage = this.storageArrays[j >> 4] = new ExtendedBlockStorage(j >> 4 << 4, + !this.worldObj.provider.getHasNoSky()); + flag = j >= i1; + } + + extendedblockstorage.set(i, j & 15, k, state); + if (block1 != block) { + block1.breakBlock(this.worldObj, pos, iblockstate); + } + + if (extendedblockstorage.getBlockByExtId(i, j & 15, k) != block) { + return null; + } else { + if (flag) { + this.generateSkylightMap(); + } else { + int j1 = block.getLightOpacity(); + int k1 = block1.getLightOpacity(); + if (j1 > 0) { + if (j >= i1) { + this.relightBlock(i, j + 1, k); + } + } else if (j == i1 - 1) { + this.relightBlock(i, j, k); + } + + if (j1 != k1 && (j1 < k1 || this.getLightFor(EnumSkyBlock.SKY, pos) > 0 + || this.getLightFor(EnumSkyBlock.BLOCK, pos) > 0)) { + this.propagateSkylightOcclusion(i, k); + } + } + + if (block1 instanceof ITileEntityProvider) { + TileEntity tileentity = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); + if (tileentity != null) { + tileentity.updateContainingBlockInfo(); + } + } + + if (block1 != block) { + block.onBlockAdded(this.worldObj, pos, state); + } + + if (block instanceof ITileEntityProvider) { + TileEntity tileentity1 = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); + if (tileentity1 == null) { + tileentity1 = ((ITileEntityProvider) block).createNewTileEntity(this.worldObj, + block.getMetaFromState(state)); + this.worldObj.setTileEntity(pos, tileentity1); + } + + if (tileentity1 != null) { + tileentity1.updateContainingBlockInfo(); + } + } + + this.isModified = true; + return iblockstate; + } + } + } + + public int getLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos) { + int i = blockpos.getX() & 15; + int j = blockpos.getY(); + int k = blockpos.getZ() & 15; + ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; + return extendedblockstorage == null ? (this.canSeeSky(blockpos) ? enumskyblock.defaultLightValue : 0) + : (enumskyblock == EnumSkyBlock.SKY + ? (this.worldObj.provider.getHasNoSky() ? 0 + : extendedblockstorage.getExtSkylightValue(i, j & 15, k)) + : (enumskyblock == EnumSkyBlock.BLOCK ? extendedblockstorage.getExtBlocklightValue(i, j & 15, k) + : enumskyblock.defaultLightValue)); + } + + public void setLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos, int i) { + int j = blockpos.getX() & 15; + int k = blockpos.getY(); + int l = blockpos.getZ() & 15; + ExtendedBlockStorage extendedblockstorage = this.storageArrays[k >> 4]; + if (extendedblockstorage == null) { + extendedblockstorage = this.storageArrays[k >> 4] = new ExtendedBlockStorage(k >> 4 << 4, + !this.worldObj.provider.getHasNoSky()); + this.generateSkylightMap(); + } + + this.isModified = true; + if (enumskyblock == EnumSkyBlock.SKY) { + if (!this.worldObj.provider.getHasNoSky()) { + extendedblockstorage.setExtSkylightValue(j, k & 15, l, i); + } + } else if (enumskyblock == EnumSkyBlock.BLOCK) { + extendedblockstorage.setExtBlocklightValue(j, k & 15, l, i); + } + + } + + public int getLightSubtracted(BlockPos blockpos, int i) { + int j = blockpos.getX() & 15; + int k = blockpos.getY(); + int l = blockpos.getZ() & 15; + ExtendedBlockStorage extendedblockstorage = this.storageArrays[k >> 4]; + if (extendedblockstorage == null) { + return !this.worldObj.provider.getHasNoSky() && i < EnumSkyBlock.SKY.defaultLightValue + ? EnumSkyBlock.SKY.defaultLightValue - i + : 0; + } else { + int i1 = this.worldObj.provider.getHasNoSky() ? 0 : extendedblockstorage.getExtSkylightValue(j, k & 15, l); + i1 = i1 - i; + int j1 = extendedblockstorage.getExtBlocklightValue(j, k & 15, l); + if (j1 > i1) { + i1 = j1; + } + + return i1; + } + } + + /**+ + * Adds an entity to the chunk. Args: entity + */ + public void addEntity(Entity entity) { + this.hasEntities = true; + int i = MathHelper.floor_double(entity.posX / 16.0D); + int j = MathHelper.floor_double(entity.posZ / 16.0D); + if (i != this.xPosition || j != this.zPosition) { + logger.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.xPosition + ", " + this.zPosition + + "), " + entity, new Object[] { entity }); + entity.setDead(); + } + + int k = MathHelper.floor_double(entity.posY / 16.0D); + if (k < 0) { + k = 0; + } + + if (k >= this.entityLists.length) { + k = this.entityLists.length - 1; + } + + entity.addedToChunk = true; + entity.chunkCoordX = this.xPosition; + entity.chunkCoordY = k; + entity.chunkCoordZ = this.zPosition; + this.entityLists[k].add(entity); + } + + /**+ + * removes entity using its y chunk coordinate as its index + */ + public void removeEntity(Entity entity) { + this.removeEntityAtIndex(entity, entity.chunkCoordY); + } + + /**+ + * Removes entity at the specified index from the entity array. + */ + public void removeEntityAtIndex(Entity entity, int i) { + if (i < 0) { + i = 0; + } + + if (i >= this.entityLists.length) { + i = this.entityLists.length - 1; + } + + this.entityLists[i].remove(entity); + } + + public boolean canSeeSky(BlockPos blockpos) { + int i = blockpos.getX() & 15; + int j = blockpos.getY(); + int k = blockpos.getZ() & 15; + return j >= this.heightMap[k << 4 | i]; + } + + private TileEntity createNewTileEntity(BlockPos pos) { + Block block = this.getBlock(pos); + return !block.hasTileEntity() ? null + : ((ITileEntityProvider) block).createNewTileEntity(this.worldObj, this.getBlockMetadata(pos)); + } + + public TileEntity getTileEntity(BlockPos blockpos, Chunk.EnumCreateEntityType chunk$enumcreateentitytype) { + TileEntity tileentity = (TileEntity) this.chunkTileEntityMap.get(blockpos); + if (tileentity == null) { + if (chunk$enumcreateentitytype == Chunk.EnumCreateEntityType.IMMEDIATE) { + tileentity = this.createNewTileEntity(blockpos); + this.worldObj.setTileEntity(blockpos, tileentity); + } else if (chunk$enumcreateentitytype == Chunk.EnumCreateEntityType.QUEUED) { + this.tileEntityPosQueue.add(blockpos); + } + } else if (tileentity.isInvalid()) { + this.chunkTileEntityMap.remove(blockpos); + return null; + } + + return tileentity; + } + + public void addTileEntity(TileEntity tileentity) { + this.addTileEntity(tileentity.getPos(), tileentity); + if (this.isChunkLoaded) { + this.worldObj.addTileEntity(tileentity); + } + + } + + public void addTileEntity(BlockPos blockpos, TileEntity tileentity) { + tileentity.setWorldObj(this.worldObj); + tileentity.setPos(blockpos); + if (this.getBlock(blockpos) instanceof ITileEntityProvider) { + if (this.chunkTileEntityMap.containsKey(blockpos)) { + ((TileEntity) this.chunkTileEntityMap.get(blockpos)).invalidate(); + } + + tileentity.validate(); + this.chunkTileEntityMap.put(blockpos, tileentity); + } + } + + public void removeTileEntity(BlockPos blockpos) { + if (this.isChunkLoaded) { + TileEntity tileentity = (TileEntity) this.chunkTileEntityMap.remove(blockpos); + if (tileentity != null) { + tileentity.invalidate(); + } + } + + } + + /**+ + * Called when this Chunk is loaded by the ChunkProvider + */ + public void onChunkLoad() { + this.isChunkLoaded = true; + this.worldObj.addTileEntities(this.chunkTileEntityMap.values()); + + for (int i = 0; i < this.entityLists.length; ++i) { + for (Entity entity : this.entityLists[i]) { + entity.onChunkLoad(); + } + + this.worldObj.loadEntities(this.entityLists[i]); + } + + } + + /**+ + * Called when this Chunk is unloaded by the ChunkProvider + */ + public void onChunkUnload() { + this.isChunkLoaded = false; + + for (TileEntity tileentity : this.chunkTileEntityMap.values()) { + this.worldObj.markTileEntityForRemoval(tileentity); + } + + for (int i = 0; i < this.entityLists.length; ++i) { + this.worldObj.unloadEntities(this.entityLists[i]); + } + + } + + /**+ + * Sets the isModified flag for this Chunk + */ + public void setChunkModified() { + this.isModified = true; + } + + /**+ + * Fills the given list of all entities that intersect within + * the given bounding box that aren't the passed entity. + */ + public void getEntitiesWithinAABBForEntity(Entity entity, AxisAlignedBB axisalignedbb, List list, + Predicate predicate) { + int i = MathHelper.floor_double((axisalignedbb.minY - 2.0D) / 16.0D); + int j = MathHelper.floor_double((axisalignedbb.maxY + 2.0D) / 16.0D); + i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); + j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + + for (int k = i; k <= j; ++k) { + if (!this.entityLists[k].isEmpty()) { + for (Entity entity1 : this.entityLists[k]) { + if (entity1.getEntityBoundingBox().intersectsWith(axisalignedbb) && entity1 != entity) { + if (predicate == null || predicate.apply(entity1)) { + list.add(entity1); + } + + Entity[] aentity = entity1.getParts(); + if (aentity != null) { + for (int l = 0; l < aentity.length; ++l) { + entity1 = aentity[l]; + if (entity1 != entity && entity1.getEntityBoundingBox().intersectsWith(axisalignedbb) + && (predicate == null || predicate.apply(entity1))) { + list.add(entity1); + } + } + } + } + } + } + } + + } + + public void getEntitiesOfTypeWithinAAAB(Class oclass, AxisAlignedBB axisalignedbb, + List list, Predicate predicate) { + int i = MathHelper.floor_double((axisalignedbb.minY - 2.0D) / 16.0D); + int j = MathHelper.floor_double((axisalignedbb.maxY + 2.0D) / 16.0D); + i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); + j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + + for (int k = i; k <= j; ++k) { + for (Entity entity : this.entityLists[k].getByClass(oclass)) { + if (entity.getEntityBoundingBox().intersectsWith(axisalignedbb) + && (predicate == null || predicate.apply((T) entity))) { + list.add((T) entity); + } + } + } + + } + + /**+ + * Returns true if this Chunk needs to be saved + */ + public boolean needsSaving(boolean flag) { + if (flag) { + if (this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) { + return true; + } + } else if (this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) { + return true; + } + + return this.isModified; + } + + public EaglercraftRandom getRandomWithSeed(long i) { + return new EaglercraftRandom(this.worldObj.getSeed() + (long) (this.xPosition * this.xPosition * 4987142) + + (long) (this.xPosition * 5947611) + (long) (this.zPosition * this.zPosition) * 4392871L + + (long) (this.zPosition * 389711) ^ i); + } + + public boolean isEmpty() { + return false; + } + + public void populateChunk(IChunkProvider parIChunkProvider, IChunkProvider parIChunkProvider2, int parInt1, + int parInt2) { + boolean flag = parIChunkProvider.chunkExists(parInt1, parInt2 - 1); + boolean flag1 = parIChunkProvider.chunkExists(parInt1 + 1, parInt2); + boolean flag2 = parIChunkProvider.chunkExists(parInt1, parInt2 + 1); + boolean flag3 = parIChunkProvider.chunkExists(parInt1 - 1, parInt2); + boolean flag4 = parIChunkProvider.chunkExists(parInt1 - 1, parInt2 - 1); + boolean flag5 = parIChunkProvider.chunkExists(parInt1 + 1, parInt2 + 1); + boolean flag6 = parIChunkProvider.chunkExists(parInt1 - 1, parInt2 + 1); + boolean flag7 = parIChunkProvider.chunkExists(parInt1 + 1, parInt2 - 1); + if (flag1 && flag2 && flag5) { + if (!this.isTerrainPopulated) { + parIChunkProvider.populate(parIChunkProvider2, parInt1, parInt2); + } else { + parIChunkProvider.func_177460_a(parIChunkProvider2, this, parInt1, parInt2); + } + } + + if (flag3 && flag2 && flag6) { + Chunk chunk = parIChunkProvider.provideChunk(parInt1 - 1, parInt2); + if (!chunk.isTerrainPopulated) { + parIChunkProvider.populate(parIChunkProvider2, parInt1 - 1, parInt2); + } else { + parIChunkProvider.func_177460_a(parIChunkProvider2, chunk, parInt1 - 1, parInt2); + } + } + + if (flag && flag1 && flag7) { + Chunk chunk1 = parIChunkProvider.provideChunk(parInt1, parInt2 - 1); + if (!chunk1.isTerrainPopulated) { + parIChunkProvider.populate(parIChunkProvider2, parInt1, parInt2 - 1); + } else { + parIChunkProvider.func_177460_a(parIChunkProvider2, chunk1, parInt1, parInt2 - 1); + } + } + + if (flag4 && flag && flag3) { + Chunk chunk2 = parIChunkProvider.provideChunk(parInt1 - 1, parInt2 - 1); + if (!chunk2.isTerrainPopulated) { + parIChunkProvider.populate(parIChunkProvider2, parInt1 - 1, parInt2 - 1); + } else { + parIChunkProvider.func_177460_a(parIChunkProvider2, chunk2, parInt1 - 1, parInt2 - 1); + } + } + + } + + public BlockPos getPrecipitationHeight(BlockPos pos) { + int i = pos.getX() & 15; + int j = pos.getZ() & 15; + int k = i | j << 4; + BlockPos blockpos = new BlockPos(pos.getX(), this.precipitationHeightMap[k], pos.getZ()); + if (blockpos.getY() == -999) { + int l = this.getTopFilledSegment() + 15; + blockpos = new BlockPos(pos.getX(), l, pos.getZ()); + int i1 = -1; + + while (blockpos.getY() > 0 && i1 == -1) { + Block block = this.getBlock(blockpos); + Material material = block.getMaterial(); + if (!material.blocksMovement() && !material.isLiquid()) { + blockpos = blockpos.down(); + } else { + i1 = blockpos.getY() + 1; + } + } + + this.precipitationHeightMap[k] = i1; + } + + return new BlockPos(pos.getX(), this.precipitationHeightMap[k], pos.getZ()); + } + + public void func_150804_b(boolean parFlag) { + if (this.isGapLightingUpdated && !this.worldObj.provider.getHasNoSky() && !parFlag) { + this.recheckGaps(false); + } + + this.field_150815_m = true; + if (!this.isLightPopulated && this.isTerrainPopulated) { + this.func_150809_p(); + } + + while (!this.tileEntityPosQueue.isEmpty()) { + BlockPos blockpos = (BlockPos) this.tileEntityPosQueue.remove(0); + if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null + && this.getBlock(blockpos).hasTileEntity()) { + TileEntity tileentity = this.createNewTileEntity(blockpos); + this.worldObj.setTileEntity(blockpos, tileentity); + this.worldObj.markBlockRangeForRenderUpdate(blockpos, blockpos); + } + } + + } + + public boolean isPopulated() { + return this.field_150815_m && this.isTerrainPopulated && this.isLightPopulated; + } + + /**+ + * Gets a ChunkCoordIntPair representing the Chunk's position. + */ + public ChunkCoordIntPair getChunkCoordIntPair() { + return new ChunkCoordIntPair(this.xPosition, this.zPosition); + } + + /**+ + * Returns whether the ExtendedBlockStorages containing levels + * (in blocks) from arg 1 to arg 2 are fully empty (true) or not + * (false). + */ + public boolean getAreLevelsEmpty(int i, int j) { + if (i < 0) { + i = 0; + } + + if (j >= 256) { + j = 255; + } + + for (int k = i; k <= j; k += 16) { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[k >> 4]; + if (extendedblockstorage != null && !extendedblockstorage.isEmpty()) { + return false; + } + } + + return true; + } + + public void setStorageArrays(ExtendedBlockStorage[] newStorageArrays) { + if (this.storageArrays.length != newStorageArrays.length) { + logger.warn("Could not set level chunk sections, array length is " + newStorageArrays.length + + " instead of " + this.storageArrays.length); + } else { + for (int i = 0; i < this.storageArrays.length; ++i) { + this.storageArrays[i] = newStorageArrays[i]; + } + + } + } + + /**+ + * Initialize this chunk with new binary data. + */ + public void fillChunk(byte[] parArrayOfByte, int parInt1, boolean parFlag) { + int i = 0; + boolean flag = !this.worldObj.provider.getHasNoSky(); + + for (int j = 0; j < this.storageArrays.length; ++j) { + if ((parInt1 & 1 << j) != 0) { + if (this.storageArrays[j] == null) { + this.storageArrays[j] = new ExtendedBlockStorage(j << 4, flag); + } + + char[] achar = this.storageArrays[j].getData(); + + for (int k = 0; k < achar.length; ++k) { + achar[k] = (char) ((parArrayOfByte[i + 1] & 255) << 8 | parArrayOfByte[i] & 255); + i += 2; + } + } else if (parFlag && this.storageArrays[j] != null) { + this.storageArrays[j] = null; + } + } + + for (int l = 0; l < this.storageArrays.length; ++l) { + if ((parInt1 & 1 << l) != 0 && this.storageArrays[l] != null) { + NibbleArray nibblearray = this.storageArrays[l].getBlocklightArray(); + System.arraycopy(parArrayOfByte, i, nibblearray.getData(), 0, nibblearray.getData().length); + i += nibblearray.getData().length; + } + } + + if (flag) { + for (int i1 = 0; i1 < this.storageArrays.length; ++i1) { + if ((parInt1 & 1 << i1) != 0 && this.storageArrays[i1] != null) { + NibbleArray nibblearray1 = this.storageArrays[i1].getSkylightArray(); + System.arraycopy(parArrayOfByte, i, nibblearray1.getData(), 0, nibblearray1.getData().length); + i += nibblearray1.getData().length; + } + } + } + + if (parFlag) { + System.arraycopy(parArrayOfByte, i, this.blockBiomeArray, 0, this.blockBiomeArray.length); + int k1 = i + this.blockBiomeArray.length; + } + + for (int j1 = 0; j1 < this.storageArrays.length; ++j1) { + if (this.storageArrays[j1] != null && (parInt1 & 1 << j1) != 0) { + this.storageArrays[j1].removeInvalidBlocks(); + } + } + + this.isLightPopulated = true; + this.isTerrainPopulated = true; + this.generateHeightMap(); + + for (TileEntity tileentity : this.chunkTileEntityMap.values()) { + tileentity.updateContainingBlockInfo(); + } + + } + + public BiomeGenBase getBiome(BlockPos pos, WorldChunkManager chunkManager) { + int i = pos.getX() & 15; + int j = pos.getZ() & 15; + int k = this.blockBiomeArray[j << 4 | i] & 255; + if (k == 255) { + BiomeGenBase biomegenbase = chunkManager.getBiomeGenerator(pos, BiomeGenBase.plains); + k = biomegenbase.biomeID; + this.blockBiomeArray[j << 4 | i] = (byte) (k & 255); + } + + BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(k); + return biomegenbase1 == null ? BiomeGenBase.plains : biomegenbase1; + } + + /**+ + * Returns an array containing a 16x16 mapping on the X/Z of + * block positions in this Chunk to biome IDs. + */ + public byte[] getBiomeArray() { + return this.blockBiomeArray; + } + + /**+ + * Accepts a 256-entry array that contains a 16x16 mapping on + * the X/Z plane of block positions in this Chunk to biome IDs. + */ + public void setBiomeArray(byte[] biomeArray) { + if (this.blockBiomeArray.length != biomeArray.length) { + logger.warn("Could not set level chunk biomes, array length is " + biomeArray.length + " instead of " + + this.blockBiomeArray.length); + } else { + for (int i = 0; i < this.blockBiomeArray.length; ++i) { + this.blockBiomeArray[i] = biomeArray[i]; + } + + } + } + + /**+ + * Resets the relight check index to 0 for this Chunk. + */ + public void resetRelightChecks() { + this.queuedLightChecks = 0; + } + + /**+ + * Called once-per-chunk-per-tick, and advances the round-robin + * relight check index by up to 8 blocks at a time. In a + * worst-case scenario, can potentially take up to 25.6 seconds, + * calculated via (4096/8)/20, to re-check all blocks in a + * chunk, which may explain lagging light updates on initial + * world generation. + */ + public void enqueueRelightChecks() { + BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4); + + for (int i = 0; i < 8; ++i) { + if (this.queuedLightChecks >= 4096) { + return; + } + + int j = this.queuedLightChecks % 16; + int k = this.queuedLightChecks / 16 % 16; + int l = this.queuedLightChecks / 256; + ++this.queuedLightChecks; + + for (int i1 = 0; i1 < 16; ++i1) { + BlockPos blockpos1 = blockpos.add(k, (j << 4) + i1, l); + boolean flag = i1 == 0 || i1 == 15 || k == 0 || k == 15 || l == 0 || l == 15; + if (this.storageArrays[j] == null && flag || this.storageArrays[j] != null + && this.storageArrays[j].getBlockByExtId(k, i1, l).getMaterial() == Material.air) { + for (EnumFacing enumfacing : EnumFacing.values()) { + BlockPos blockpos2 = blockpos1.offset(enumfacing); + if (this.worldObj.getBlockState(blockpos2).getBlock().getLightValue() > 0) { + this.worldObj.checkLight(blockpos2); + } + } + + this.worldObj.checkLight(blockpos1); + } + } + } + + } + + public void func_150809_p() { + this.isTerrainPopulated = true; + this.isLightPopulated = true; + BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4); + if (!this.worldObj.provider.getHasNoSky()) { + if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), + blockpos.add(16, this.worldObj.func_181545_F(), 16))) { + label92: for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + if (!this.func_150811_f(i, j)) { + this.isLightPopulated = false; + break label92; + } + } + } + + if (this.isLightPopulated) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1; + this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)) + .func_180700_a(enumfacing.getOpposite()); + } + + this.func_177441_y(); + } + } else { + this.isLightPopulated = false; + } + } + + } + + private void func_177441_y() { + for (int i = 0; i < this.updateSkylightColumns.length; ++i) { + this.updateSkylightColumns[i] = true; + } + + this.recheckGaps(false); + } + + private void func_180700_a(EnumFacing parEnumFacing) { + if (this.isTerrainPopulated) { + if (parEnumFacing == EnumFacing.EAST) { + for (int i = 0; i < 16; ++i) { + this.func_150811_f(15, i); + } + } else if (parEnumFacing == EnumFacing.WEST) { + for (int j = 0; j < 16; ++j) { + this.func_150811_f(0, j); + } + } else if (parEnumFacing == EnumFacing.SOUTH) { + for (int k = 0; k < 16; ++k) { + this.func_150811_f(k, 15); + } + } else if (parEnumFacing == EnumFacing.NORTH) { + for (int l = 0; l < 16; ++l) { + this.func_150811_f(l, 0); + } + } + + } + } + + private boolean func_150811_f(int x, int z) { + int i = this.getTopFilledSegment(); + boolean flag = false; + boolean flag1 = false; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos((this.xPosition << 4) + x, 0, + (this.zPosition << 4) + z); + + for (int j = i + 16 - 1; j > this.worldObj.func_181545_F() || j > 0 && !flag1; --j) { + blockpos$mutableblockpos.func_181079_c(blockpos$mutableblockpos.getX(), j, blockpos$mutableblockpos.getZ()); + int k = this.getBlockLightOpacity(blockpos$mutableblockpos); + if (k == 255 && blockpos$mutableblockpos.getY() < this.worldObj.func_181545_F()) { + flag1 = true; + } + + if (!flag && k > 0) { + flag = true; + } else if (flag && k == 0 && !this.worldObj.checkLight(blockpos$mutableblockpos)) { + return false; + } + } + + for (int l = blockpos$mutableblockpos.getY(); l > 0; --l) { + blockpos$mutableblockpos.func_181079_c(blockpos$mutableblockpos.getX(), l, blockpos$mutableblockpos.getZ()); + if (this.getBlock(blockpos$mutableblockpos).getLightValue() > 0) { + this.worldObj.checkLight(blockpos$mutableblockpos); + } + } + + return true; + } + + public boolean isLoaded() { + return this.isChunkLoaded; + } + + public void setChunkLoaded(boolean loaded) { + this.isChunkLoaded = loaded; + } + + public World getWorld() { + return this.worldObj; + } + + public int[] getHeightMap() { + return this.heightMap; + } + + public void setHeightMap(int[] newHeightMap) { + if (this.heightMap.length != newHeightMap.length) { + logger.warn("Could not set level chunk heightmap, array length is " + newHeightMap.length + " instead of " + + this.heightMap.length); + } else { + for (int i = 0; i < this.heightMap.length; ++i) { + this.heightMap[i] = newHeightMap[i]; + } + + } + } + + public Map getTileEntityMap() { + return this.chunkTileEntityMap; + } + + public ClassInheritanceMultiMap[] getEntityLists() { + return this.entityLists; + } + + public boolean isTerrainPopulated() { + return this.isTerrainPopulated; + } + + public void setTerrainPopulated(boolean terrainPopulated) { + this.isTerrainPopulated = terrainPopulated; + } + + public boolean isLightPopulated() { + return this.isLightPopulated; + } + + public void setLightPopulated(boolean lightPopulated) { + this.isLightPopulated = lightPopulated; + } + + public void setModified(boolean modified) { + this.isModified = modified; + } + + public void setHasEntities(boolean hasEntitiesIn) { + this.hasEntities = hasEntitiesIn; + } + + public void setLastSaveTime(long saveTime) { + this.lastSaveTime = saveTime; + } + + public int getLowestHeight() { + return this.heightMapMinimum; + } + + public long getInhabitedTime() { + return this.inhabitedTime; + } + + public void setInhabitedTime(long newInhabitedTime) { + this.inhabitedTime = newInhabitedTime; + } + + public static enum EnumCreateEntityType { + IMMEDIATE, QUEUED, CHECK; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/ChunkPrimer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/ChunkPrimer.java new file mode 100644 index 0000000..7585f54 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/ChunkPrimer.java @@ -0,0 +1,67 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import java.util.HashMap; +import java.util.Map; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkPrimer { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/ChunkPrimer"); + } + + private final Map data = new HashMap(); + private final IBlockState defaultState = Blocks.air.getDefaultState(); + + public IBlockState getBlockState(int x, int y, int z) { + int i = x << 12 | z << 8 | y; + return this.getBlockState(i); + } + + public IBlockState getBlockState(int index) { + if (index >= 0 && index < this.data.size()) { + IBlockState iblockstate = (IBlockState) Block.BLOCK_STATE_IDS.getByValue(this.data.get(index)); + return iblockstate != null ? iblockstate : this.defaultState; + } else { + throw new IndexOutOfBoundsException("The coordinate is out of range"); + } + } + + public void setBlockState(int x, int y, int z, IBlockState state) { + int i = x << 12 | z << 8 | y; + this.setBlockState(i, state); + } + + public void setBlockState(int index, IBlockState state) { + if (index >= 0 && index < this.data.size()) { + this.data.put(index, (short) Block.BLOCK_STATE_IDS.get(state)); + } else { + throw new IndexOutOfBoundsException("The coordinate is out of range"); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/EmptyChunk.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/EmptyChunk.java new file mode 100644 index 0000000..5ea7f54 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/EmptyChunk.java @@ -0,0 +1,189 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk; + +import com.google.common.base.Predicate; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 EmptyChunk extends Chunk { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/EmptyChunk"); + } + + public EmptyChunk(World worldIn, int x, int z) { + super(worldIn, x, z); + } + + /**+ + * Checks whether the chunk is at the X/Z location specified + */ + public boolean isAtLocation(int x, int z) { + return x == this.xPosition && z == this.zPosition; + } + + /**+ + * Returns the value in the height map at this x, z coordinate + * in the chunk + */ + public int getHeightValue(int x, int z) { + return 0; + } + + /**+ + * Generates the height map for a chunk from scratch + */ + public void generateHeightMap() { + } + + /**+ + * Generates the initial skylight map for the chunk upon + * generation or load. + */ + public void generateSkylightMap() { + } + + public Block getBlock(BlockPos pos) { + return Blocks.air; + } + + public int getBlockLightOpacity(BlockPos pos) { + return 255; + } + + public int getBlockMetadata(BlockPos pos) { + return 0; + } + + public int getLightFor(EnumSkyBlock pos, BlockPos parBlockPos) { + return pos.defaultLightValue; + } + + public void setLightFor(EnumSkyBlock pos, BlockPos value, int parInt1) { + } + + public int getLightSubtracted(BlockPos pos, int amount) { + return 0; + } + + /**+ + * Adds an entity to the chunk. Args: entity + */ + public void addEntity(Entity entityIn) { + } + + /**+ + * removes entity using its y chunk coordinate as its index + */ + public void removeEntity(Entity entityIn) { + } + + /**+ + * Removes entity at the specified index from the entity array. + */ + public void removeEntityAtIndex(Entity entityIn, int parInt1) { + } + + public boolean canSeeSky(BlockPos pos) { + return false; + } + + public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType parEnumCreateEntityType) { + return null; + } + + public void addTileEntity(TileEntity tileEntityIn) { + } + + public void addTileEntity(BlockPos pos, TileEntity tileEntityIn) { + } + + public void removeTileEntity(BlockPos pos) { + } + + /**+ + * Called when this Chunk is loaded by the ChunkProvider + */ + public void onChunkLoad() { + } + + /**+ + * Called when this Chunk is unloaded by the ChunkProvider + */ + public void onChunkUnload() { + } + + /**+ + * Sets the isModified flag for this Chunk + */ + public void setChunkModified() { + } + + /**+ + * Fills the given list of all entities that intersect within + * the given bounding box that aren't the passed entity. + */ + public void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List listToFill, + Predicate parPredicate) { + } + + public void getEntitiesOfTypeWithinAAAB(Class entityClass, AxisAlignedBB aabb, + List listToFill, Predicate parPredicate) { + } + + /**+ + * Returns true if this Chunk needs to be saved + */ + public boolean needsSaving(boolean parFlag) { + return false; + } + + public EaglercraftRandom getRandomWithSeed(long seed) { + return new EaglercraftRandom(this.getWorld().getSeed() + (long) (this.xPosition * this.xPosition * 4987142) + + (long) (this.xPosition * 5947611) + (long) (this.zPosition * this.zPosition) * 4392871L + + (long) (this.zPosition * 389711) ^ seed); + } + + public boolean isEmpty() { + return true; + } + + /**+ + * Returns whether the ExtendedBlockStorages containing levels + * (in blocks) from arg 1 to arg 2 are fully empty (true) or not + * (false). + */ + public boolean getAreLevelsEmpty(int startY, int endY) { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/IChunkProvider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/IChunkProvider.java new file mode 100644 index 0000000..230f9d7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/IChunkProvider.java @@ -0,0 +1,95 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IChunkProvider { + /**+ + * Checks to see if a chunk exists at x, z + */ + boolean chunkExists(int var1, int var2); + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + Chunk provideChunk(int var1, int var2); + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + Chunk provideChunk(BlockPos var1); + + /**+ + * Populates chunk with ores etc etc + */ + void populate(IChunkProvider var1, int var2, int var3); + + boolean func_177460_a(IChunkProvider var1, Chunk var2, int var3, int var4); + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + boolean saveChunks(boolean var1, IProgressUpdate var2); + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + boolean unloadQueuedChunks(); + + /**+ + * Returns if the IChunkProvider supports saving. + */ + boolean canSave(); + + /**+ + * Converts the instance data to a readable string. + */ + String makeString(); + + List getPossibleCreatures(EnumCreatureType var1, BlockPos var2); + + BlockPos getStrongholdGen(World var1, String var2, BlockPos var3); + + int getLoadedChunkCount(); + + void recreateStructures(Chunk var1, int var2, int var3); + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + void saveExtraData(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/NibbleArray.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/NibbleArray.java new file mode 100644 index 0000000..f9f6603 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/NibbleArray.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NibbleArray { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/NibbleArray"); + } + + private final byte[] data; + + public NibbleArray() { + this.data = new byte[2048]; + } + + public NibbleArray(byte[] storageArray) { + this.data = storageArray; + if (storageArray.length != 2048) { + throw new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + storageArray.length); + } + } + + /**+ + * Returns the nibble of data corresponding to the passed in x, + * y, z. y is at most 6 bits, z is at most 4. + */ + public int get(int x, int y, int z) { + return this.getFromIndex(this.getCoordinateIndex(x, y, z)); + } + + /**+ + * Arguments are x, y, z, val. Sets the nibble of data at x << + * 11 | z << 7 | y to val. + */ + public void set(int x, int y, int z, int value) { + this.setIndex(this.getCoordinateIndex(x, y, z), value); + } + + private int getCoordinateIndex(int x, int y, int z) { + return y << 8 | z << 4 | x; + } + + public int getFromIndex(int index) { + int i = this.getNibbleIndex(index); + return this.isLowerNibble(index) ? this.data[i] & 15 : this.data[i] >> 4 & 15; + } + + public void setIndex(int index, int value) { + int i = this.getNibbleIndex(index); + if (this.isLowerNibble(index)) { + this.data[i] = (byte) (this.data[i] & 240 | value & 15); + } else { + this.data[i] = (byte) (this.data[i] & 15 | (value & 15) << 4); + } + + } + + private boolean isLowerNibble(int index) { + return (index & 1) == 0; + } + + private int getNibbleIndex(int index) { + return index >> 1; + } + + public byte[] getData() { + return this.data; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/AnvilChunkLoader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/AnvilChunkLoader.java new file mode 100644 index 0000000..3ffd6eb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -0,0 +1,309 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EntityList; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.NextTickListEntry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.NibbleArray; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.IChunkLoader; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class AnvilChunkLoader implements IChunkLoader { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/storage/AnvilChunkLoader"); + } + + private static final Logger logger = LogManager.getLogger("AnvilChunkLoader"); + + /**+ + * Wraps readChunkFromNBT. Checks the coordinates and several + * NBT tags. + */ + protected Chunk checkedReadChunkFromNBT(World worldIn, int x, int z, NBTTagCompound parNBTTagCompound) { + if (!parNBTTagCompound.hasKey("Level", 10)) { + logger.error("Chunk file at " + x + "," + z + " is missing level data, skipping"); + return null; + } else { + NBTTagCompound nbttagcompound = parNBTTagCompound.getCompoundTag("Level"); + if (!nbttagcompound.hasKey("Sections", 9)) { + logger.error("Chunk file at " + x + "," + z + " is missing block data, skipping"); + return null; + } else { + Chunk chunk = this.readChunkFromNBT(worldIn, nbttagcompound); + if (!chunk.isAtLocation(x, z)) { + logger.error("Chunk file at " + x + "," + z + " is in the wrong location; relocating. (Expected " + + x + ", " + z + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")"); + nbttagcompound.setInteger("xPos", x); + nbttagcompound.setInteger("zPos", z); + chunk = this.readChunkFromNBT(worldIn, nbttagcompound); + } + + return chunk; + } + } + } + + /**+ + * Writes the Chunk passed as an argument to the NBTTagCompound + * also passed, using the World argument to retrieve the Chunk's + * last update time. + */ + protected void writeChunkToNBT(Chunk chunkIn, World worldIn, NBTTagCompound parNBTTagCompound) { + parNBTTagCompound.setByte("V", (byte) 1); + parNBTTagCompound.setInteger("xPos", chunkIn.xPosition); + parNBTTagCompound.setInteger("zPos", chunkIn.zPosition); + parNBTTagCompound.setLong("LastUpdate", worldIn.getTotalWorldTime()); + parNBTTagCompound.setIntArray("HeightMap", chunkIn.getHeightMap()); + parNBTTagCompound.setBoolean("TerrainPopulated", chunkIn.isTerrainPopulated()); + parNBTTagCompound.setBoolean("LightPopulated", chunkIn.isLightPopulated()); + parNBTTagCompound.setLong("InhabitedTime", chunkIn.getInhabitedTime()); + ExtendedBlockStorage[] aextendedblockstorage = chunkIn.getBlockStorageArray(); + NBTTagList nbttaglist = new NBTTagList(); + boolean flag = !worldIn.provider.getHasNoSky(); + + for (ExtendedBlockStorage extendedblockstorage : aextendedblockstorage) { + if (extendedblockstorage != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Y", (byte) (extendedblockstorage.getYLocation() >> 4 & 255)); + byte[] abyte = new byte[extendedblockstorage.getData().length]; + NibbleArray nibblearray = new NibbleArray(); + NibbleArray nibblearray1 = null; + + for (int i = 0; i < extendedblockstorage.getData().length; ++i) { + char c0 = extendedblockstorage.getData()[i]; + int j = i & 15; + int k = i >> 8 & 15; + int l = i >> 4 & 15; + if (c0 >> 12 != 0) { + if (nibblearray1 == null) { + nibblearray1 = new NibbleArray(); + } + + nibblearray1.set(j, k, l, c0 >> 12); + } + + abyte[i] = (byte) (c0 >> 4 & 255); + nibblearray.set(j, k, l, c0 & 15); + } + + nbttagcompound.setByteArray("Blocks", abyte); + nbttagcompound.setByteArray("Data", nibblearray.getData()); + if (nibblearray1 != null) { + nbttagcompound.setByteArray("Add", nibblearray1.getData()); + } + + nbttagcompound.setByteArray("BlockLight", extendedblockstorage.getBlocklightArray().getData()); + if (flag) { + nbttagcompound.setByteArray("SkyLight", extendedblockstorage.getSkylightArray().getData()); + } else { + nbttagcompound.setByteArray("SkyLight", + new byte[extendedblockstorage.getBlocklightArray().getData().length]); + } + + nbttaglist.appendTag(nbttagcompound); + } + } + + parNBTTagCompound.setTag("Sections", nbttaglist); + parNBTTagCompound.setByteArray("Biomes", chunkIn.getBiomeArray()); + chunkIn.setHasEntities(false); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (int i1 = 0; i1 < chunkIn.getEntityLists().length; ++i1) { + for (Entity entity : chunkIn.getEntityLists()[i1]) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + if (entity.writeToNBTOptional(nbttagcompound1)) { + chunkIn.setHasEntities(true); + nbttaglist1.appendTag(nbttagcompound1); + } + } + } + + parNBTTagCompound.setTag("Entities", nbttaglist1); + NBTTagList nbttaglist2 = new NBTTagList(); + + for (TileEntity tileentity : chunkIn.getTileEntityMap().values()) { + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound2); + nbttaglist2.appendTag(nbttagcompound2); + } + + parNBTTagCompound.setTag("TileEntities", nbttaglist2); + List list = worldIn.getPendingBlockUpdates(chunkIn, false); + if (list != null) { + long j1 = worldIn.getTotalWorldTime(); + NBTTagList nbttaglist3 = new NBTTagList(); + + for (NextTickListEntry nextticklistentry : (List) list) { + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry + .getNameForObject(nextticklistentry.getBlock()); + nbttagcompound3.setString("i", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound3.setInteger("x", nextticklistentry.position.getX()); + nbttagcompound3.setInteger("y", nextticklistentry.position.getY()); + nbttagcompound3.setInteger("z", nextticklistentry.position.getZ()); + nbttagcompound3.setInteger("t", (int) (nextticklistentry.scheduledTime - j1)); + nbttagcompound3.setInteger("p", nextticklistentry.priority); + nbttaglist3.appendTag(nbttagcompound3); + } + + parNBTTagCompound.setTag("TileTicks", nbttaglist3); + } + + } + + /**+ + * Reads the data stored in the passed NBTTagCompound and + * creates a Chunk with that data in the passed World. Returns + * the created Chunk. + */ + protected Chunk readChunkFromNBT(World worldIn, NBTTagCompound parNBTTagCompound) { + int i = parNBTTagCompound.getInteger("xPos"); + int j = parNBTTagCompound.getInteger("zPos"); + Chunk chunk = new Chunk(worldIn, i, j); + chunk.setHeightMap(parNBTTagCompound.getIntArray("HeightMap")); + chunk.setTerrainPopulated(parNBTTagCompound.getBoolean("TerrainPopulated")); + chunk.setLightPopulated(parNBTTagCompound.getBoolean("LightPopulated")); + chunk.setInhabitedTime(parNBTTagCompound.getLong("InhabitedTime")); + NBTTagList nbttaglist = parNBTTagCompound.getTagList("Sections", 10); + byte b0 = 16; + ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[b0]; + boolean flag = !worldIn.provider.getHasNoSky(); + + for (int k = 0; k < nbttaglist.tagCount(); ++k) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(k); + byte b1 = nbttagcompound.getByte("Y"); + ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(b1 << 4, flag); + byte[] abyte = nbttagcompound.getByteArray("Blocks"); + NibbleArray nibblearray = new NibbleArray(nbttagcompound.getByteArray("Data")); + NibbleArray nibblearray1 = nbttagcompound.hasKey("Add", 7) + ? new NibbleArray(nbttagcompound.getByteArray("Add")) + : null; + char[] achar = new char[abyte.length]; + + for (int l = 0; l < achar.length; ++l) { + int i1 = l & 15; + int j1 = l >> 8 & 15; + int k1 = l >> 4 & 15; + int l1 = nibblearray1 != null ? nibblearray1.get(i1, j1, k1) : 0; + achar[l] = (char) (l1 << 12 | (abyte[l] & 255) << 4 | nibblearray.get(i1, j1, k1)); + } + + extendedblockstorage.setData(achar); + extendedblockstorage.setBlocklightArray(new NibbleArray(nbttagcompound.getByteArray("BlockLight"))); + if (flag) { + extendedblockstorage.setSkylightArray(new NibbleArray(nbttagcompound.getByteArray("SkyLight"))); + } + + extendedblockstorage.removeInvalidBlocks(); + aextendedblockstorage[b1] = extendedblockstorage; + } + + chunk.setStorageArrays(aextendedblockstorage); + if (parNBTTagCompound.hasKey("Biomes", 7)) { + chunk.setBiomeArray(parNBTTagCompound.getByteArray("Biomes")); + } + + NBTTagList nbttaglist1 = parNBTTagCompound.getTagList("Entities", 10); + if (nbttaglist1 != null) { + for (int i2 = 0; i2 < nbttaglist1.tagCount(); ++i2) { + NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(i2); + Entity entity = EntityList.createEntityFromNBT(nbttagcompound1, worldIn); + chunk.setHasEntities(true); + if (entity != null) { + chunk.addEntity(entity); + Entity entity1 = entity; + + for (NBTTagCompound nbttagcompound4 = nbttagcompound1; nbttagcompound4.hasKey("Riding", + 10); nbttagcompound4 = nbttagcompound4.getCompoundTag("Riding")) { + Entity entity2 = EntityList.createEntityFromNBT(nbttagcompound4.getCompoundTag("Riding"), + worldIn); + if (entity2 != null) { + chunk.addEntity(entity2); + entity1.mountEntity(entity2); + } + + entity1 = entity2; + } + } + } + } + + NBTTagList nbttaglist2 = parNBTTagCompound.getTagList("TileEntities", 10); + if (nbttaglist2 != null) { + for (int j2 = 0; j2 < nbttaglist2.tagCount(); ++j2) { + NBTTagCompound nbttagcompound2 = nbttaglist2.getCompoundTagAt(j2); + TileEntity tileentity = TileEntity.createAndLoadEntity(nbttagcompound2); + if (tileentity != null) { + chunk.addTileEntity(tileentity); + } + } + } + + if (parNBTTagCompound.hasKey("TileTicks", 9)) { + NBTTagList nbttaglist3 = parNBTTagCompound.getTagList("TileTicks", 10); + if (nbttaglist3 != null) { + for (int k2 = 0; k2 < nbttaglist3.tagCount(); ++k2) { + NBTTagCompound nbttagcompound3 = nbttaglist3.getCompoundTagAt(k2); + Block block; + if (nbttagcompound3.hasKey("i", 8)) { + block = Block.getBlockFromName(nbttagcompound3.getString("i")); + } else { + block = Block.getBlockById(nbttagcompound3.getInteger("i")); + } + + worldIn.scheduleBlockUpdate( + new BlockPos(nbttagcompound3.getInteger("x"), nbttagcompound3.getInteger("y"), + nbttagcompound3.getInteger("z")), + block, nbttagcompound3.getInteger("t"), nbttagcompound3.getInteger("p")); + } + } + } + + return chunk; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ChunkLoader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ChunkLoader.java new file mode 100644 index 0000000..df55a12 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ChunkLoader.java @@ -0,0 +1,163 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.NibbleArray; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.NibbleArrayReader; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkLoader { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/storage/ChunkLoader"); + } + + public static ChunkLoader.AnvilConverterData load(NBTTagCompound nbt) { + int i = nbt.getInteger("xPos"); + int j = nbt.getInteger("zPos"); + ChunkLoader.AnvilConverterData chunkloader$anvilconverterdata = new ChunkLoader.AnvilConverterData(i, j); + chunkloader$anvilconverterdata.blocks = nbt.getByteArray("Blocks"); + chunkloader$anvilconverterdata.data = new NibbleArrayReader(nbt.getByteArray("Data"), 7); + chunkloader$anvilconverterdata.skyLight = new NibbleArrayReader(nbt.getByteArray("SkyLight"), 7); + chunkloader$anvilconverterdata.blockLight = new NibbleArrayReader(nbt.getByteArray("BlockLight"), 7); + chunkloader$anvilconverterdata.heightmap = nbt.getByteArray("HeightMap"); + chunkloader$anvilconverterdata.terrainPopulated = nbt.getBoolean("TerrainPopulated"); + chunkloader$anvilconverterdata.entities = nbt.getTagList("Entities", 10); + chunkloader$anvilconverterdata.tileEntities = nbt.getTagList("TileEntities", 10); + chunkloader$anvilconverterdata.tileTicks = nbt.getTagList("TileTicks", 10); + + try { + chunkloader$anvilconverterdata.lastUpdated = nbt.getLong("LastUpdate"); + } catch (ClassCastException var5) { + chunkloader$anvilconverterdata.lastUpdated = (long) nbt.getInteger("LastUpdate"); + } + + return chunkloader$anvilconverterdata; + } + + public static void convertToAnvilFormat(ChunkLoader.AnvilConverterData parAnvilConverterData, + NBTTagCompound parNBTTagCompound, WorldChunkManager parWorldChunkManager) { + parNBTTagCompound.setInteger("xPos", parAnvilConverterData.x); + parNBTTagCompound.setInteger("zPos", parAnvilConverterData.z); + parNBTTagCompound.setLong("LastUpdate", parAnvilConverterData.lastUpdated); + int[] aint = new int[parAnvilConverterData.heightmap.length]; + + for (int i = 0; i < parAnvilConverterData.heightmap.length; ++i) { + aint[i] = parAnvilConverterData.heightmap[i]; + } + + parNBTTagCompound.setIntArray("HeightMap", aint); + parNBTTagCompound.setBoolean("TerrainPopulated", parAnvilConverterData.terrainPopulated); + NBTTagList nbttaglist = new NBTTagList(); + + for (int j = 0; j < 8; ++j) { + boolean flag = true; + + for (int k = 0; k < 16 && flag; ++k) { + for (int l = 0; l < 16 && flag; ++l) { + for (int i1 = 0; i1 < 16; ++i1) { + int j1 = k << 11 | i1 << 7 | l + (j << 4); + byte b0 = parAnvilConverterData.blocks[j1]; + if (b0 != 0) { + flag = false; + break; + } + } + } + } + + if (!flag) { + byte[] abyte1 = new byte[4096]; + NibbleArray nibblearray = new NibbleArray(); + NibbleArray nibblearray1 = new NibbleArray(); + NibbleArray nibblearray2 = new NibbleArray(); + + for (int l2 = 0; l2 < 16; ++l2) { + for (int k1 = 0; k1 < 16; ++k1) { + for (int l1 = 0; l1 < 16; ++l1) { + int i2 = l2 << 11 | l1 << 7 | k1 + (j << 4); + byte b1 = parAnvilConverterData.blocks[i2]; + abyte1[k1 << 8 | l1 << 4 | l2] = (byte) (b1 & 255); + nibblearray.set(l2, k1, l1, parAnvilConverterData.data.get(l2, k1 + (j << 4), l1)); + nibblearray1.set(l2, k1, l1, parAnvilConverterData.skyLight.get(l2, k1 + (j << 4), l1)); + nibblearray2.set(l2, k1, l1, parAnvilConverterData.blockLight.get(l2, k1 + (j << 4), l1)); + } + } + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Y", (byte) (j & 255)); + nbttagcompound.setByteArray("Blocks", abyte1); + nbttagcompound.setByteArray("Data", nibblearray.getData()); + nbttagcompound.setByteArray("SkyLight", nibblearray1.getData()); + nbttagcompound.setByteArray("BlockLight", nibblearray2.getData()); + nbttaglist.appendTag(nbttagcompound); + } + } + + parNBTTagCompound.setTag("Sections", nbttaglist); + byte[] abyte = new byte[256]; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j2 = 0; j2 < 16; ++j2) { + for (int k2 = 0; k2 < 16; ++k2) { + blockpos$mutableblockpos.func_181079_c(parAnvilConverterData.x << 4 | j2, 0, + parAnvilConverterData.z << 4 | k2); + abyte[k2 << 4 | j2] = (byte) (parWorldChunkManager.getBiomeGenerator(blockpos$mutableblockpos, + BiomeGenBase.field_180279_ad).biomeID & 255); + } + } + + parNBTTagCompound.setByteArray("Biomes", abyte); + parNBTTagCompound.setTag("Entities", parAnvilConverterData.entities); + parNBTTagCompound.setTag("TileEntities", parAnvilConverterData.tileEntities); + if (parAnvilConverterData.tileTicks != null) { + parNBTTagCompound.setTag("TileTicks", parAnvilConverterData.tileTicks); + } + + } + + public static class AnvilConverterData { + public long lastUpdated; + public boolean terrainPopulated; + public byte[] heightmap; + public NibbleArrayReader blockLight; + public NibbleArrayReader skyLight; + public NibbleArrayReader data; + public byte[] blocks; + public NBTTagList entities; + public NBTTagList tileEntities; + public NBTTagList tileTicks; + public final int x; + public final int z; + + public AnvilConverterData(int parInt1, int parInt2) { + this.x = parInt1; + this.z = parInt2; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java new file mode 100644 index 0000000..d9c00bc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java @@ -0,0 +1,211 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.NibbleArray; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ExtendedBlockStorage { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/storage/ExtendedBlockStorage"); + } + + private int yBase; + private int blockRefCount; + private int tickRefCount; + private char[] data; + private NibbleArray blocklightArray; + private NibbleArray skylightArray; + + public ExtendedBlockStorage(int y, boolean storeSkylight) { + this.yBase = y; + this.data = new char[4096]; + this.blocklightArray = new NibbleArray(); + if (storeSkylight) { + this.skylightArray = new NibbleArray(); + } + + } + + public IBlockState get(int x, int y, int z) { + IBlockState iblockstate = (IBlockState) Block.BLOCK_STATE_IDS.getByValue(this.data[y << 8 | z << 4 | x]); + return iblockstate != null ? iblockstate : Blocks.air.getDefaultState(); + } + + public void set(int x, int y, int z, IBlockState state) { + IBlockState iblockstate = this.get(x, y, z); + Block block = iblockstate.getBlock(); + Block block1 = state.getBlock(); + if (block != Blocks.air) { + --this.blockRefCount; + if (block.getTickRandomly()) { + --this.tickRefCount; + } + } + + if (block1 != Blocks.air) { + ++this.blockRefCount; + if (block1.getTickRandomly()) { + ++this.tickRefCount; + } + } + + this.data[y << 8 | z << 4 | x] = (char) Block.BLOCK_STATE_IDS.get(state); + } + + /**+ + * Returns the block for a location in a chunk, with the + * extended ID merged from a byte array and a NibbleArray to + * form a full 12-bit block ID. + */ + public Block getBlockByExtId(int x, int y, int z) { + return this.get(x, y, z).getBlock(); + } + + /**+ + * Returns the metadata associated with the block at the given + * coordinates in this ExtendedBlockStorage. + */ + public int getExtBlockMetadata(int x, int y, int z) { + IBlockState iblockstate = this.get(x, y, z); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + /**+ + * Returns whether or not this block storage's Chunk is fully + * empty, based on its internal reference count. + */ + public boolean isEmpty() { + return this.blockRefCount == 0; + } + + /**+ + * Returns whether or not this block storage's Chunk will + * require random ticking, used to avoid looping through random + * block ticks when there are no blocks that would randomly + * tick. + */ + public boolean getNeedsRandomTick() { + return this.tickRefCount > 0; + } + + /**+ + * Returns the Y location of this ExtendedBlockStorage. + */ + public int getYLocation() { + return this.yBase; + } + + /**+ + * Sets the saved Sky-light value in the extended block storage + * structure. + */ + public void setExtSkylightValue(int x, int y, int z, int value) { + this.skylightArray.set(x, y, z, value); + } + + /**+ + * Gets the saved Sky-light value in the extended block storage + * structure. + */ + public int getExtSkylightValue(int x, int y, int z) { + return this.skylightArray.get(x, y, z); + } + + /**+ + * Sets the saved Block-light value in the extended block + * storage structure. + */ + public void setExtBlocklightValue(int x, int y, int z, int value) { + this.blocklightArray.set(x, y, z, value); + } + + /**+ + * Gets the saved Block-light value in the extended block + * storage structure. + */ + public int getExtBlocklightValue(int x, int y, int z) { + return this.blocklightArray.get(x, y, z); + } + + public void removeInvalidBlocks() { + this.blockRefCount = 0; + this.tickRefCount = 0; + + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + for (int k = 0; k < 16; ++k) { + Block block = this.getBlockByExtId(i, j, k); + if (block != Blocks.air) { + ++this.blockRefCount; + if (block.getTickRandomly()) { + ++this.tickRefCount; + } + } + } + } + } + + } + + public char[] getData() { + return this.data; + } + + public void setData(char[] dataArray) { + this.data = dataArray; + } + + /**+ + * Returns the NibbleArray instance containing Block-light data. + */ + public NibbleArray getBlocklightArray() { + return this.blocklightArray; + } + + /**+ + * Returns the NibbleArray instance containing Sky-light data. + */ + public NibbleArray getSkylightArray() { + return this.skylightArray; + } + + /**+ + * Sets the NibbleArray instance used for Block-light values in + * this particular storage block. + */ + public void setBlocklightArray(NibbleArray newBlocklightArray) { + this.blocklightArray = newBlocklightArray; + } + + /**+ + * Sets the NibbleArray instance used for Sky-light values in + * this particular storage block. + */ + public void setSkylightArray(NibbleArray newSkylightArray) { + this.skylightArray = newSkylightArray; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/IChunkLoader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/IChunkLoader.java new file mode 100644 index 0000000..0c57404 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/IChunkLoader.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; + +import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IChunkLoader { + /**+ + * Loads the specified(XZ) chunk into the specified world. + */ + Chunk loadChunk(World var1, int var2, int var3) throws IOException; + + void saveChunk(World var1, Chunk var2) throws IOException, MinecraftException; + + /**+ + * Save extra data associated with this Chunk not normally saved + * during autosave, only during chunk unload. Currently unused. + */ + void saveExtraChunkData(World var1, Chunk var2) throws IOException; + + /**+ + * Called every World.tick() + */ + void chunkTick(); + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently unused. + */ + void saveExtraData(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/NibbleArrayReader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/NibbleArrayReader.java new file mode 100644 index 0000000..a1ef0d9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/NibbleArrayReader.java @@ -0,0 +1,47 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NibbleArrayReader { + + static { + __checkIntegratedContextValid("net/minecraft/world/chunk/storage/NibbleArrayReader"); + } + + public final byte[] data; + private final int depthBits; + private final int depthBitsPlusFour; + + public NibbleArrayReader(byte[] dataIn, int depthBitsIn) { + this.data = dataIn; + this.depthBits = depthBitsIn; + this.depthBitsPlusFour = depthBitsIn + 4; + } + + public int get(int parInt1, int parInt2, int parInt3) { + int i = parInt1 << this.depthBitsPlusFour | parInt3 << this.depthBits | parInt2; + int j = i >> 1; + int k = i & 1; + return k == 0 ? this.data[j] & 15 : this.data[j] >> 4 & 15; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/RegionFile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/RegionFile.java new file mode 100644 index 0000000..4bc3775 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/RegionFile.java @@ -0,0 +1,297 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.List; + +import com.google.common.collect.Lists; + +import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.sp.server.export.RandomAccessMemoryFile; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 RegionFile { + private static final byte[] emptySector = new byte[4096]; + private RandomAccessMemoryFile dataFile; + private final int[] offsets = new int[1024]; + private final int[] chunkTimestamps = new int[1024]; + private List sectorFree; + private int sizeDelta; + + public RegionFile(RandomAccessMemoryFile dataFile) { + this.sizeDelta = 0; + + try { + this.dataFile = dataFile; + if (this.dataFile.getLength() < 4096) { + for (int i = 0; i < 1024; ++i) { + this.dataFile.writeInt(0); + } + + for (int i1 = 0; i1 < 1024; ++i1) { + this.dataFile.writeInt(0); + } + + this.sizeDelta += 8192; + } + + if ((this.dataFile.getLength() & 4095L) != 0L) { + for (int j1 = 0; (long) j1 < (this.dataFile.getLength() & 4095L); ++j1) { + this.dataFile.write(0); + } + } + + int k1 = (int) this.dataFile.getLength() / 4096; + this.sectorFree = Lists.newArrayListWithCapacity(k1); + + for (int j = 0; j < k1; ++j) { + this.sectorFree.add(Boolean.valueOf(true)); + } + + this.sectorFree.set(0, Boolean.valueOf(false)); + this.sectorFree.set(1, Boolean.valueOf(false)); + this.dataFile.seek(0); + + for (int l1 = 0; l1 < 1024; ++l1) { + int k = this.dataFile.readInt(); + this.offsets[l1] = k; + if (k != 0 && (k >> 8) + (k & 255) <= this.sectorFree.size()) { + for (int l = 0; l < (k & 255); ++l) { + this.sectorFree.set((k >> 8) + l, Boolean.valueOf(false)); + } + } + } + + for (int i2 = 0; i2 < 1024; ++i2) { + int j2 = this.dataFile.readInt(); + this.chunkTimestamps[i2] = j2; + } + } catch (IOException ioexception) { + throw new RuntimeException("Could not initialize RegionFile!", ioexception); + } + + } + + /**+ + * Returns an uncompressed chunk stream from the region file. + */ + public synchronized DataInputStream getChunkDataInputStream(int x, int z) { + if (this.outOfBounds(x, z)) { + return null; + } else { + try { + int i = this.getOffset(x, z); + if (i == 0) { + return null; + } else { + int j = i >> 8; + int k = i & 255; + if (j + k > this.sectorFree.size()) { + return null; + } else { + this.dataFile.seek(j * 4096); + int l = this.dataFile.readInt(); + if (l > 4096 * k) { + return null; + } else if (l <= 0) { + return null; + } else { + byte b0 = this.dataFile.readByte(); + if (b0 == 1) { + byte[] abyte1 = new byte[l - 1]; + this.dataFile.read(abyte1); + return new DataInputStream(new BufferedInputStream( + EaglerZLIB.newGZIPInputStream(new ByteArrayInputStream(abyte1)))); + } else if (b0 == 2) { + byte[] abyte = new byte[l - 1]; + this.dataFile.read(abyte); + return new DataInputStream(new BufferedInputStream( + EaglerZLIB.newInflaterInputStream(new ByteArrayInputStream(abyte)))); + } else { + return null; + } + } + } + } + } catch (IOException var9) { + return null; + } + } + } + + /**+ + * Returns an output stream used to write chunk data. Data is on + * disk when the returned stream is closed. + */ + public DataOutputStream getChunkDataOutputStream(int x, int z) throws IOException { + return this.outOfBounds(x, z) ? null + : new DataOutputStream(EaglerZLIB.newDeflaterOutputStream(new RegionFile.ChunkBuffer(x, z))); + } + + /**+ + * args: x, z, data, length - write chunk data at (x, z) to disk + */ + protected synchronized void write(int x, int z, byte[] data, int length) { + try { + int i = this.getOffset(x, z); + int j = i >> 8; + int k = i & 255; + int l = (length + 5) / 4096 + 1; + if (l >= 256) { + return; + } + + if (j != 0 && k == l) { + this.write(j, data, length); + } else { + for (int i1 = 0; i1 < k; ++i1) { + this.sectorFree.set(j + i1, Boolean.valueOf(true)); + } + + int l1 = this.sectorFree.indexOf(Boolean.valueOf(true)); + int j1 = 0; + if (l1 != -1) { + for (int k1 = l1; k1 < this.sectorFree.size(); ++k1) { + if (j1 != 0) { + if (((Boolean) this.sectorFree.get(k1)).booleanValue()) { + ++j1; + } else { + j1 = 0; + } + } else if (((Boolean) this.sectorFree.get(k1)).booleanValue()) { + l1 = k1; + j1 = 1; + } + + if (j1 >= l) { + break; + } + } + } + + if (j1 >= l) { + j = l1; + this.setOffset(x, z, l1 << 8 | l); + + for (int j2 = 0; j2 < l; ++j2) { + this.sectorFree.set(j + j2, Boolean.valueOf(false)); + } + + this.write(j, data, length); + } else { + this.dataFile.seek(this.dataFile.getLength()); + j = this.sectorFree.size(); + + for (int i2 = 0; i2 < l; ++i2) { + this.dataFile.write(emptySector); + this.sectorFree.add(Boolean.valueOf(false)); + } + + this.sizeDelta += 4096 * l; + this.write(j, data, length); + this.setOffset(x, z, j << 8 | l); + } + } + + this.setChunkTimestamp(x, z, (int) (System.currentTimeMillis() / 1000L)); + } catch (IOException ioexception) { + throw new RuntimeException("Could not write chunk to RegionFile!", ioexception); + } + + } + + /**+ + * args: x, z, data, length - write chunk data at (x, z) to disk + */ + private void write(int sectorNumber, byte[] data, int length) throws IOException { + this.dataFile.seek(sectorNumber * 4096); + this.dataFile.writeInt(length + 1); + this.dataFile.writeByte(2); + this.dataFile.write(data, 0, length); + } + + /**+ + * args: x, z - check region bounds + */ + private boolean outOfBounds(int x, int z) { + return x < 0 || x >= 32 || z < 0 || z >= 32; + } + + /**+ + * args: x, z - get chunk's offset in region file + */ + private int getOffset(int x, int z) { + return this.offsets[x + z * 32]; + } + + /**+ + * args: x, z, - true if chunk has been saved / converted + */ + public boolean isChunkSaved(int x, int z) { + return this.getOffset(x, z) != 0; + } + + /**+ + * args: x, z, offset - sets the chunk's offset in the region + * file + */ + private void setOffset(int x, int z, int offset) throws IOException { + this.offsets[x + z * 32] = offset; + this.dataFile.seek((x + z * 32) * 4); + this.dataFile.writeInt(offset); + } + + /**+ + * args: x, z, timestamp - sets the chunk's write timestamp + */ + private void setChunkTimestamp(int x, int z, int timestamp) throws IOException { + this.chunkTimestamps[x + z * 32] = timestamp; + this.dataFile.seek(4096 + (x + z * 32) * 4); + this.dataFile.writeInt(timestamp); + } + + public RandomAccessMemoryFile getFile() { + return dataFile; + } + + class ChunkBuffer extends ByteArrayOutputStream { + private int chunkX; + private int chunkZ; + + public ChunkBuffer(int x, int z) { + super(8096); + this.chunkX = x; + this.chunkZ = z; + } + + /**+ + * close this RegionFile and prevent further writes + */ + public void close() throws IOException { + RegionFile.this.write(this.chunkX, this.chunkZ, this.buf, this.count); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldManager.java new file mode 100644 index 0000000..2c52f39 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldManager.java @@ -0,0 +1,145 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.demo; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management.ItemInWorldManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DemoWorldManager extends ItemInWorldManager { + + static { + __checkIntegratedContextValid("net/minecraft/world/demo/DemoWorldManager"); + } + + private boolean field_73105_c; + private boolean demoTimeExpired; + private int field_73104_e; + private int field_73102_f; + + public DemoWorldManager(World worldIn) { + super(worldIn); + } + + public void updateBlockRemoving() { + super.updateBlockRemoving(); + ++this.field_73102_f; + long i = this.theWorld.getTotalWorldTime(); + long j = i / 24000L + 1L; + if (!this.field_73105_c && this.field_73102_f > 20) { + this.field_73105_c = true; + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 0.0F)); + } + + this.demoTimeExpired = i > 120500L; + if (this.demoTimeExpired) { + ++this.field_73104_e; + } + + if (i % 24000L == 500L) { + if (j <= 6L) { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day." + j, new Object[0])); + } + } else if (j == 1L) { + if (i == 100L) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 101.0F)); + } else if (i == 175L) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 102.0F)); + } else if (i == 250L) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 103.0F)); + } + } else if (j == 5L && i % 24000L == 22000L) { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day.warning", new Object[0])); + } + + } + + /**+ + * Sends a message to the player reminding them that this is the + * demo version + */ + private void sendDemoReminder() { + if (this.field_73104_e > 100) { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.reminder", new Object[0])); + this.field_73104_e = 0; + } + + } + + /**+ + * If not creative, it calls sendBlockBreakProgress until the + * block is broken first. tryHarvestBlock can also be the result + * of this call. + */ + public void onBlockClicked(BlockPos pos, EnumFacing side) { + if (this.demoTimeExpired) { + this.sendDemoReminder(); + } else { + super.onBlockClicked(pos, side); + } + } + + public void blockRemoving(BlockPos pos) { + if (!this.demoTimeExpired) { + super.blockRemoving(pos); + } + } + + /**+ + * Attempts to harvest a block + */ + public boolean tryHarvestBlock(BlockPos pos) { + return this.demoTimeExpired ? false : super.tryHarvestBlock(pos); + } + + /**+ + * Attempts to right-click use an item by the given EntityPlayer + * in the given World + */ + public boolean tryUseItem(EntityPlayer player, World worldIn, ItemStack stack) { + if (this.demoTimeExpired) { + this.sendDemoReminder(); + return false; + } else { + return super.tryUseItem(player, worldIn, stack); + } + } + + /**+ + * Activate the clicked on block, otherwise use the held item. + */ + public boolean activateBlockOrUseItem(EntityPlayer player, World worldIn, ItemStack stack, BlockPos pos, + EnumFacing side, float offsetX, float offsetY, float offsetZ) { + if (this.demoTimeExpired) { + this.sendDemoReminder(); + return false; + } else { + return super.activateBlockOrUseItem(player, worldIn, stack, pos, side, offsetX, offsetY, offsetZ); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldServer.java new file mode 100644 index 0000000..a76576f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldServer.java @@ -0,0 +1,50 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.demo; + +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.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +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 static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DemoWorldServer extends WorldServer { + + static { + __checkIntegratedContextValid("net/minecraft/world/demo/DemoWorldServer"); + } + + private static final long demoWorldSeed = EaglercraftVersion.demoWorldSeed; + public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, + WorldSettings.GameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); + + public DemoWorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo worldInfoIn, int dimensionId, + Profiler profilerIn) { + super(server, saveHandlerIn, worldInfoIn, dimensionId, profilerIn); + this.worldInfo.populateFromWorldSettings(demoWorldSettings); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderDebug.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderDebug.java new file mode 100644 index 0000000..9fdceb5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderDebug.java @@ -0,0 +1,195 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.IChunkProvider; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderDebug implements IChunkProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderDebug"); + } + + private static final List field_177464_a = Lists.newArrayList(); + private static final int field_177462_b; + private static final int field_181039_c; + private final World world; + + public ChunkProviderDebug(World worldIn) { + this.world = worldIn; + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int i, int j) { + ChunkPrimer chunkprimer = new ChunkPrimer(); + + for (int k = 0; k < 16; ++k) { + for (int l = 0; l < 16; ++l) { + int i1 = i * 16 + k; + int j1 = j * 16 + l; + chunkprimer.setBlockState(k, 60, l, Blocks.barrier.getDefaultState()); + IBlockState iblockstate = func_177461_b(i1, j1); + if (iblockstate != null) { + chunkprimer.setBlockState(k, 70, l, iblockstate); + } + } + } + + Chunk chunk = new Chunk(this.world, chunkprimer, i, j); + chunk.generateSkylightMap(); + BiomeGenBase[] abiomegenbase = this.world.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[]) null, + i * 16, j * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (int k1 = 0; k1 < abyte.length; ++k1) { + abyte[k1] = (byte) abiomegenbase[k1].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + public static IBlockState func_177461_b(int parInt1, int parInt2) { + IBlockState iblockstate = null; + if (parInt1 > 0 && parInt2 > 0 && parInt1 % 2 != 0 && parInt2 % 2 != 0) { + parInt1 = parInt1 / 2; + parInt2 = parInt2 / 2; + if (parInt1 <= field_177462_b && parInt2 <= field_181039_c) { + int i = MathHelper.abs_int(parInt1 * field_177462_b + parInt2); + if (i < field_177464_a.size()) { + iblockstate = (IBlockState) field_177464_a.get(i); + } + } + } + + return iblockstate; + } + + /**+ + * Checks to see if a chunk exists at x, z + */ + public boolean chunkExists(int var1, int var2) { + return true; + } + + /**+ + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider var1, int var2, int var3) { + } + + public boolean func_177460_a(IChunkProvider var1, Chunk var2, int var3, int var4) { + return false; + } + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + public boolean saveChunks(boolean var1, IProgressUpdate var2) { + return true; + } + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + } + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /**+ + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /**+ + * Converts the instance data to a readable string. + */ + public String makeString() { + return "DebugLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType enumcreaturetype, + BlockPos blockpos) { + BiomeGenBase biomegenbase = this.world.getBiomeGenForCoords(blockpos); + return biomegenbase.getSpawnableList(enumcreaturetype); + } + + public BlockPos getStrongholdGen(World var1, String var2, BlockPos var3) { + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(Chunk var1, int var2, int var3) { + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(BlockPos blockpos) { + return this.provideChunk(blockpos.getX() >> 4, blockpos.getZ() >> 4); + } + + static { + for (Block block : Block.blockRegistry) { + field_177464_a.addAll(block.getBlockState().getValidStates()); + } + + field_177462_b = MathHelper.ceiling_float_int(MathHelper.sqrt_float((float) field_177464_a.size())); + field_181039_c = MathHelper.ceiling_float_int((float) field_177464_a.size() / (float) field_177462_b); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderEnd.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderEnd.java new file mode 100644 index 0000000..8f64e75 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderEnd.java @@ -0,0 +1,353 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +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.gen.NoiseGeneratorOctaves; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderEnd implements IChunkProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderEnd"); + } + + private EaglercraftRandom endRNG; + private NoiseGeneratorOctaves noiseGen1; + private NoiseGeneratorOctaves noiseGen2; + private NoiseGeneratorOctaves noiseGen3; + public NoiseGeneratorOctaves noiseGen4; + public NoiseGeneratorOctaves noiseGen5; + private World endWorld; + private double[] densities; + private BiomeGenBase[] biomesForGeneration; + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + + public ChunkProviderEnd(World worldIn, long parLong1) { + this.endWorld = worldIn; + this.endRNG = new EaglercraftRandom(parLong1); + this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); + this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); + this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + } + + public void func_180520_a(int parInt1, int parInt2, ChunkPrimer parChunkPrimer) { + byte b0 = 2; + int i = b0 + 1; + byte b1 = 33; + int j = b0 + 1; + this.densities = this.initializeNoiseField(this.densities, parInt1 * b0, 0, parInt2 * b0, i, b1, j); + + for (int k = 0; k < b0; ++k) { + for (int l = 0; l < b0; ++l) { + for (int i1 = 0; i1 < 32; ++i1) { + double d0 = 0.25D; + double d1 = this.densities[((k + 0) * j + l + 0) * b1 + i1 + 0]; + double d2 = this.densities[((k + 0) * j + l + 1) * b1 + i1 + 0]; + double d3 = this.densities[((k + 1) * j + l + 0) * b1 + i1 + 0]; + double d4 = this.densities[((k + 1) * j + l + 1) * b1 + i1 + 0]; + double d5 = (this.densities[((k + 0) * j + l + 0) * b1 + i1 + 1] - d1) * d0; + double d6 = (this.densities[((k + 0) * j + l + 1) * b1 + i1 + 1] - d2) * d0; + double d7 = (this.densities[((k + 1) * j + l + 0) * b1 + i1 + 1] - d3) * d0; + double d8 = (this.densities[((k + 1) * j + l + 1) * b1 + i1 + 1] - d4) * d0; + + for (int j1 = 0; j1 < 4; ++j1) { + double d9 = 0.125D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int k1 = 0; k1 < 8; ++k1) { + double d14 = 0.125D; + double d15 = d10; + double d16 = (d11 - d10) * d14; + + for (int l1 = 0; l1 < 8; ++l1) { + IBlockState iblockstate = null; + if (d15 > 0.0D) { + iblockstate = Blocks.end_stone.getDefaultState(); + } + + int i2 = k1 + k * 8; + int j2 = j1 + i1 * 4; + int k2 = l1 + l * 8; + parChunkPrimer.setBlockState(i2, j2, k2, iblockstate); + d15 += d16; + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + + } + + public void func_180519_a(ChunkPrimer parChunkPrimer) { + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + byte b0 = 1; + int k = -1; + IBlockState iblockstate = Blocks.end_stone.getDefaultState(); + IBlockState iblockstate1 = Blocks.end_stone.getDefaultState(); + + for (int l = 127; l >= 0; --l) { + IBlockState iblockstate2 = parChunkPrimer.getBlockState(i, l, j); + if (iblockstate2.getBlock().getMaterial() == Material.air) { + k = -1; + } else if (iblockstate2.getBlock() == Blocks.stone) { + if (k == -1) { + if (b0 <= 0) { + iblockstate = Blocks.air.getDefaultState(); + iblockstate1 = Blocks.end_stone.getDefaultState(); + } + + k = b0; + if (l >= 0) { + parChunkPrimer.setBlockState(i, l, j, iblockstate); + } else { + parChunkPrimer.setBlockState(i, l, j, iblockstate1); + } + } else if (k > 0) { + --k; + parChunkPrimer.setBlockState(i, l, j, iblockstate1); + } + } + } + } + } + + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int i, int j) { + this.endRNG.setSeed((long) i * 341873128712L + (long) j * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, + i * 16, j * 16, 16, 16); + this.func_180520_a(i, j, chunkprimer); + this.func_180519_a(chunkprimer); + Chunk chunk = new Chunk(this.endWorld, chunkprimer, i, j); + byte[] abyte = chunk.getBiomeArray(); + + for (int k = 0; k < abyte.length; ++k) { + abyte[k] = (byte) this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + /**+ + * generates a subset of the level's terrain data. Takes 7 + * arguments: the [empty] noise array, the position, and the + * size. + */ + private double[] initializeNoiseField(double[] parArrayOfDouble, int parInt1, int parInt2, int parInt3, int parInt4, + int parInt5, int parInt6) { + if (parArrayOfDouble == null) { + parArrayOfDouble = new double[parInt4 * parInt5 * parInt6]; + } + + double d0 = 684.412D; + double d1 = 684.412D; + this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, parInt1, parInt3, parInt4, parInt6, + 1.121D, 1.121D, 0.5D); + this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, parInt1, parInt3, parInt4, parInt6, + 200.0D, 200.0D, 0.5D); + d0 = d0 * 2.0D; + this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, parInt1, parInt2, parInt3, parInt4, + parInt5, parInt6, d0 / 80.0D, d1 / 160.0D, d0 / 80.0D); + this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, parInt1, parInt2, parInt3, parInt4, + parInt5, parInt6, d0, d1, d0); + this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, parInt1, parInt2, parInt3, parInt4, + parInt5, parInt6, d0, d1, d0); + int i = 0; + + for (int j = 0; j < parInt4; ++j) { + for (int k = 0; k < parInt6; ++k) { + float f = (float) (j + parInt1) / 1.0F; + float f1 = (float) (k + parInt3) / 1.0F; + float f2 = 100.0F - MathHelper.sqrt_float(f * f + f1 * f1) * 8.0F; + if (f2 > 80.0F) { + f2 = 80.0F; + } + + if (f2 < -100.0F) { + f2 = -100.0F; + } + + for (int l = 0; l < parInt5; ++l) { + double d2 = 0.0D; + double d3 = this.noiseData2[i] / 512.0D; + double d4 = this.noiseData3[i] / 512.0D; + double d5 = (this.noiseData1[i] / 10.0D + 1.0D) / 2.0D; + if (d5 < 0.0D) { + d2 = d3; + } else if (d5 > 1.0D) { + d2 = d4; + } else { + d2 = d3 + (d4 - d3) * d5; + } + + d2 = d2 - 8.0D; + d2 = d2 + (double) f2; + byte b0 = 2; + if (l > parInt5 / 2 - b0) { + double d6 = (double) ((float) (l - (parInt5 / 2 - b0)) / 64.0F); + d6 = MathHelper.clamp_double(d6, 0.0D, 1.0D); + d2 = d2 * (1.0D - d6) + -3000.0D * d6; + } + + b0 = 8; + if (l < b0) { + double d7 = (double) ((float) (b0 - l) / ((float) b0 - 1.0F)); + d2 = d2 * (1.0D - d7) + -30.0D * d7; + } + + parArrayOfDouble[i] = d2; + ++i; + } + } + } + + return parArrayOfDouble; + } + + /**+ + * Checks to see if a chunk exists at x, z + */ + public boolean chunkExists(int var1, int var2) { + return true; + } + + /**+ + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider var1, int i, int j) { + BlockFalling.fallInstantly = true; + BlockPos blockpos = new BlockPos(i * 16, 0, j * 16); + this.endWorld.getBiomeGenForCoords(blockpos.add(16, 0, 16)).decorate(this.endWorld, this.endWorld.rand, + blockpos); + BlockFalling.fallInstantly = false; + } + + public boolean func_177460_a(IChunkProvider var1, Chunk var2, int var3, int var4) { + return false; + } + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + public boolean saveChunks(boolean var1, IProgressUpdate var2) { + return true; + } + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + } + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /**+ + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /**+ + * Converts the instance data to a readable string. + */ + public String makeString() { + return "RandomLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType enumcreaturetype, + BlockPos blockpos) { + return this.endWorld.getBiomeGenForCoords(blockpos).getSpawnableList(enumcreaturetype); + } + + public BlockPos getStrongholdGen(World var1, String var2, BlockPos var3) { + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(Chunk var1, int var2, int var3) { + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(BlockPos blockpos) { + return this.provideChunk(blockpos.getX() >> 4, blockpos.getZ() >> 4); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderFlat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderFlat.java new file mode 100644 index 0000000..0a62cc7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderFlat.java @@ -0,0 +1,305 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +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.gen.FlatGeneratorInfo; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.FlatLayerInfo; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenDungeons; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenLakes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenMineshaft; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStronghold; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureOceanMonument; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderFlat implements IChunkProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderFlat"); + } + + private World worldObj; + private EaglercraftRandom random; + private final IBlockState[] cachedBlockIDs = new IBlockState[256]; + private final FlatGeneratorInfo flatWorldGenInfo; + private final List structureGenerators = Lists.newArrayList(); + private final boolean hasDecoration; + private final boolean hasDungeons; + private WorldGenLakes waterLakeGenerator; + private WorldGenLakes lavaLakeGenerator; + + public ChunkProviderFlat(World worldIn, long seed, boolean generateStructures, String flatGeneratorSettings) { + this.worldObj = worldIn; + this.random = new EaglercraftRandom(seed); + this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(flatGeneratorSettings); + if (generateStructures) { + Map map = this.flatWorldGenInfo.getWorldFeatures(); + if (map.containsKey("village")) { + Map map1 = (Map) map.get("village"); + if (!map1.containsKey("size")) { + map1.put("size", "1"); + } + + this.structureGenerators.add(new MapGenVillage(map1)); + } + + if (map.containsKey("biome_1")) { + this.structureGenerators.add(new MapGenScatteredFeature((Map) map.get("biome_1"))); + } + + if (map.containsKey("mineshaft")) { + this.structureGenerators.add(new MapGenMineshaft((Map) map.get("mineshaft"))); + } + + if (map.containsKey("stronghold")) { + this.structureGenerators.add(new MapGenStronghold((Map) map.get("stronghold"))); + } + + if (map.containsKey("oceanmonument")) { + this.structureGenerators.add(new StructureOceanMonument((Map) map.get("oceanmonument"))); + } + } + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) { + this.waterLakeGenerator = new WorldGenLakes(Blocks.water); + } + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) { + this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava); + } + + this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon"); + int j = 0; + int k = 0; + boolean flag = true; + + for (FlatLayerInfo flatlayerinfo : this.flatWorldGenInfo.getFlatLayers()) { + for (int i = flatlayerinfo.getMinY(); i < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++i) { + IBlockState iblockstate = flatlayerinfo.func_175900_c(); + if (iblockstate.getBlock() != Blocks.air) { + flag = false; + this.cachedBlockIDs[i] = iblockstate; + } + } + + if (flatlayerinfo.func_175900_c().getBlock() == Blocks.air) { + k += flatlayerinfo.getLayerCount(); + } else { + j += flatlayerinfo.getLayerCount() + k; + k = 0; + } + } + + worldIn.func_181544_b(j); + this.hasDecoration = flag ? false : this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration"); + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int i, int j) { + ChunkPrimer chunkprimer = new ChunkPrimer(); + + for (int k = 0; k < this.cachedBlockIDs.length; ++k) { + IBlockState iblockstate = this.cachedBlockIDs[k]; + if (iblockstate != null) { + for (int l = 0; l < 16; ++l) { + for (int i1 = 0; i1 < 16; ++i1) { + chunkprimer.setBlockState(l, k, i1, iblockstate); + } + } + } + } + + for (MapGenBase mapgenbase : this.structureGenerators) { + mapgenbase.generate(this, this.worldObj, i, j, chunkprimer); + } + + Chunk chunk = new Chunk(this.worldObj, chunkprimer, i, j); + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager() + .loadBlockGeneratorData((BiomeGenBase[]) null, i * 16, j * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (int j1 = 0; j1 < abyte.length; ++j1) { + abyte[j1] = (byte) abiomegenbase[j1].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + /**+ + * Checks to see if a chunk exists at x, z + */ + public boolean chunkExists(int var1, int var2) { + return true; + } + + /**+ + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider var1, int i, int j) { + int k = i * 16; + int l = j * 16; + BlockPos blockpos = new BlockPos(k, 0, l); + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16)); + boolean flag = false; + this.random.setSeed(this.worldObj.getSeed()); + long i1 = this.random.nextLong() / 2L * 2L + 1L; + long j1 = this.random.nextLong() / 2L * 2L + 1L; + this.random.setSeed((long) i * i1 + (long) j * j1 ^ this.worldObj.getSeed()); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + + for (MapGenStructure mapgenstructure : this.structureGenerators) { + boolean flag1 = mapgenstructure.generateStructure(this.worldObj, this.random, chunkcoordintpair); + if (mapgenstructure instanceof MapGenVillage) { + flag |= flag1; + } + } + + if (this.waterLakeGenerator != null && !flag && this.random.nextInt(4) == 0) { + this.waterLakeGenerator.generate(this.worldObj, this.random, + blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8)); + } + + if (this.lavaLakeGenerator != null && !flag && this.random.nextInt(8) == 0) { + BlockPos blockpos1 = blockpos.add(this.random.nextInt(16) + 8, + this.random.nextInt(this.random.nextInt(248) + 8), this.random.nextInt(16) + 8); + if (blockpos1.getY() < this.worldObj.func_181545_F() || this.random.nextInt(10) == 0) { + this.lavaLakeGenerator.generate(this.worldObj, this.random, blockpos1); + } + } + + if (this.hasDungeons) { + for (int k1 = 0; k1 < 8; ++k1) { + (new WorldGenDungeons()).generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, + this.random.nextInt(256), this.random.nextInt(16) + 8)); + } + } + + if (this.hasDecoration) { + biomegenbase.decorate(this.worldObj, this.random, blockpos); + } + + } + + public boolean func_177460_a(IChunkProvider var1, Chunk var2, int var3, int var4) { + return false; + } + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + public boolean saveChunks(boolean var1, IProgressUpdate var2) { + return true; + } + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + } + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /**+ + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /**+ + * Converts the instance data to a readable string. + */ + public String makeString() { + return "FlatLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType enumcreaturetype, + BlockPos blockpos) { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos); + return biomegenbase.getSpawnableList(enumcreaturetype); + } + + public BlockPos getStrongholdGen(World world, String s, BlockPos blockpos) { + if ("Stronghold".equals(s)) { + for (MapGenStructure mapgenstructure : this.structureGenerators) { + if (mapgenstructure instanceof MapGenStronghold) { + return mapgenstructure.getClosestStrongholdPos(world, blockpos); + } + } + } + + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(Chunk var1, int i, int j) { + for (MapGenStructure mapgenstructure : this.structureGenerators) { + mapgenstructure.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(BlockPos blockpos) { + return this.provideChunk(blockpos.getX() >> 4, blockpos.getZ() >> 4); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderGenerate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderGenerate.java new file mode 100644 index 0000000..6ad6e75 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -0,0 +1,565 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.SpawnerAnimals; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +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.gen.ChunkProviderSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenCaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenRavine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorOctaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenDungeons; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenLakes; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenMineshaft; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStronghold; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureOceanMonument; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderGenerate implements IChunkProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderGenerate"); + } + + private EaglercraftRandom rand; + private NoiseGeneratorOctaves field_147431_j; + private NoiseGeneratorOctaves field_147432_k; + private NoiseGeneratorOctaves field_147429_l; + private NoiseGeneratorPerlin field_147430_m; + public NoiseGeneratorOctaves noiseGen5; + public NoiseGeneratorOctaves noiseGen6; + public NoiseGeneratorOctaves mobSpawnerNoise; + private World worldObj; + private final boolean mapFeaturesEnabled; + private WorldType field_177475_o; + private final double[] field_147434_q; + private final float[] parabolicField; + private ChunkProviderSettings settings; + private Block field_177476_s = Blocks.water; + private double[] stoneNoise = new double[256]; + private MapGenBase caveGenerator = new MapGenCaves(); + /**+ + * Holds Stronghold Generator + */ + private MapGenStronghold strongholdGenerator = new MapGenStronghold(); + /**+ + * Holds Village Generator + */ + private MapGenVillage villageGenerator = new MapGenVillage(); + /**+ + * Holds Mineshaft Generator + */ + private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); + private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); + /**+ + * Holds ravine generator + */ + private MapGenBase ravineGenerator = new MapGenRavine(); + private StructureOceanMonument oceanMonumentGenerator = new StructureOceanMonument(); + private BiomeGenBase[] biomesForGeneration; + double[] field_147427_d; + double[] field_147428_e; + double[] field_147425_f; + double[] field_147426_g; + + public ChunkProviderGenerate(World worldIn, long parLong1, boolean parFlag, String parString1) { + this.worldObj = worldIn; + this.mapFeaturesEnabled = parFlag; + this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); + this.rand = new EaglercraftRandom(parLong1); + this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); + this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); + this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); + this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147434_q = new double[825]; + this.parabolicField = new float[25]; + + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + float f = 10.0F / MathHelper.sqrt_float((float) (i * i + j * j) + 0.2F); + this.parabolicField[i + 2 + (j + 2) * 5] = f; + } + } + + if (parString1 != null) { + this.settings = ChunkProviderSettings.Factory.jsonToFactory(parString1).func_177864_b(); + this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; + worldIn.func_181544_b(this.settings.seaLevel); + } + + } + + public void setBlocksInChunk(int parInt1, int parInt2, ChunkPrimer parChunkPrimer) { + this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, + parInt1 * 4 - 2, parInt2 * 4 - 2, 10, 10); + this.func_147423_a(parInt1 * 4, 0, parInt2 * 4); + + for (int i = 0; i < 4; ++i) { + int j = i * 5; + int k = (i + 1) * 5; + + for (int l = 0; l < 4; ++l) { + int i1 = (j + l) * 33; + int j1 = (j + l + 1) * 33; + int k1 = (k + l) * 33; + int l1 = (k + l + 1) * 33; + + for (int i2 = 0; i2 < 32; ++i2) { + double d0 = 0.125D; + double d1 = this.field_147434_q[i1 + i2]; + double d2 = this.field_147434_q[j1 + i2]; + double d3 = this.field_147434_q[k1 + i2]; + double d4 = this.field_147434_q[l1 + i2]; + double d5 = (this.field_147434_q[i1 + i2 + 1] - d1) * d0; + double d6 = (this.field_147434_q[j1 + i2 + 1] - d2) * d0; + double d7 = (this.field_147434_q[k1 + i2 + 1] - d3) * d0; + double d8 = (this.field_147434_q[l1 + i2 + 1] - d4) * d0; + + for (int j2 = 0; j2 < 8; ++j2) { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int k2 = 0; k2 < 4; ++k2) { + double d14 = 0.25D; + double d16 = (d11 - d10) * d14; + double d15 = d10 - d16; + + for (int l2 = 0; l2 < 4; ++l2) { + if ((d15 += d16) > 0.0D) { + parChunkPrimer.setBlockState(i * 4 + k2, i2 * 8 + j2, l * 4 + l2, + Blocks.stone.getDefaultState()); + } else if (i2 * 8 + j2 < this.settings.seaLevel) { + parChunkPrimer.setBlockState(i * 4 + k2, i2 * 8 + j2, l * 4 + l2, + this.field_177476_s.getDefaultState()); + } + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + + } + + public void replaceBlocksForBiome(int parInt1, int parInt2, ChunkPrimer parChunkPrimer, + BiomeGenBase[] parArrayOfBiomeGenBase) { + double d0 = 0.03125D; + this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double) (parInt1 * 16), + (double) (parInt2 * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 16; ++j) { + BiomeGenBase biomegenbase = parArrayOfBiomeGenBase[j + i * 16]; + biomegenbase.genTerrainBlocks(this.worldObj, this.rand, parChunkPrimer, parInt1 * 16 + i, + parInt2 * 16 + j, this.stoneNoise[j + i * 16]); + } + } + + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int i, int j) { + this.rand.setSeed((long) i * 341873128712L + (long) j * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.setBlocksInChunk(i, j, chunkprimer); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, + i * 16, j * 16, 16, 16); + this.replaceBlocksForBiome(i, j, chunkprimer, this.biomesForGeneration); + if (this.settings.useCaves) { + this.caveGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + if (this.settings.useRavines) { + this.ravineGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + if (this.settings.useMineShafts && this.mapFeaturesEnabled) { + this.mineshaftGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + if (this.settings.useVillages && this.mapFeaturesEnabled) { + this.villageGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + if (this.settings.useStrongholds && this.mapFeaturesEnabled) { + this.strongholdGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + if (this.settings.useTemples && this.mapFeaturesEnabled) { + this.scatteredFeatureGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + if (this.settings.useMonuments && this.mapFeaturesEnabled) { + this.oceanMonumentGenerator.generate(this, this.worldObj, i, j, chunkprimer); + } + + Chunk chunk = new Chunk(this.worldObj, chunkprimer, i, j); + byte[] abyte = chunk.getBiomeArray(); + + for (int k = 0; k < abyte.length; ++k) { + abyte[k] = (byte) this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + private void func_147423_a(int parInt1, int parInt2, int parInt3) { + this.field_147426_g = this.noiseGen6.generateNoiseOctaves(this.field_147426_g, parInt1, parInt3, 5, 5, + (double) this.settings.depthNoiseScaleX, (double) this.settings.depthNoiseScaleZ, + (double) this.settings.depthNoiseScaleExponent); + float f = this.settings.coordinateScale; + float f1 = this.settings.heightScale; + this.field_147427_d = this.field_147429_l.generateNoiseOctaves(this.field_147427_d, parInt1, parInt2, parInt3, + 5, 33, 5, (double) (f / this.settings.mainNoiseScaleX), (double) (f1 / this.settings.mainNoiseScaleY), + (double) (f / this.settings.mainNoiseScaleZ)); + this.field_147428_e = this.field_147431_j.generateNoiseOctaves(this.field_147428_e, parInt1, parInt2, parInt3, + 5, 33, 5, (double) f, (double) f1, (double) f); + this.field_147425_f = this.field_147432_k.generateNoiseOctaves(this.field_147425_f, parInt1, parInt2, parInt3, + 5, 33, 5, (double) f, (double) f1, (double) f); + parInt3 = 0; + parInt1 = 0; + int i = 0; + int j = 0; + + for (int k = 0; k < 5; ++k) { + for (int l = 0; l < 5; ++l) { + float f2 = 0.0F; + float f3 = 0.0F; + float f4 = 0.0F; + byte b0 = 2; + BiomeGenBase biomegenbase = this.biomesForGeneration[k + 2 + (l + 2) * 10]; + + for (int i1 = -b0; i1 <= b0; ++i1) { + for (int j1 = -b0; j1 <= b0; ++j1) { + BiomeGenBase biomegenbase1 = this.biomesForGeneration[k + i1 + 2 + (l + j1 + 2) * 10]; + float f5 = this.settings.biomeDepthOffSet + + biomegenbase1.minHeight * this.settings.biomeDepthWeight; + float f6 = this.settings.biomeScaleOffset + + biomegenbase1.maxHeight * this.settings.biomeScaleWeight; + if (this.field_177475_o == WorldType.AMPLIFIED && f5 > 0.0F) { + f5 = 1.0F + f5 * 2.0F; + f6 = 1.0F + f6 * 4.0F; + } + + float f7 = this.parabolicField[i1 + 2 + (j1 + 2) * 5] / (f5 + 2.0F); + if (biomegenbase1.minHeight > biomegenbase.minHeight) { + f7 /= 2.0F; + } + + f2 += f6 * f7; + f3 += f5 * f7; + f4 += f7; + } + } + + f2 = f2 / f4; + f3 = f3 / f4; + f2 = f2 * 0.9F + 0.1F; + f3 = (f3 * 4.0F - 1.0F) / 8.0F; + double d7 = this.field_147426_g[j] / 8000.0D; + if (d7 < 0.0D) { + d7 = -d7 * 0.3D; + } + + d7 = d7 * 3.0D - 2.0D; + if (d7 < 0.0D) { + d7 = d7 / 2.0D; + if (d7 < -1.0D) { + d7 = -1.0D; + } + + d7 = d7 / 1.4D; + d7 = d7 / 2.0D; + } else { + if (d7 > 1.0D) { + d7 = 1.0D; + } + + d7 = d7 / 8.0D; + } + + ++j; + double d8 = (double) f3; + double d9 = (double) f2; + d8 = d8 + d7 * 0.2D; + d8 = d8 * (double) this.settings.baseSize / 8.0D; + double d0 = (double) this.settings.baseSize + d8 * 4.0D; + + for (int k1 = 0; k1 < 33; ++k1) { + double d1 = ((double) k1 - d0) * (double) this.settings.stretchY * 128.0D / 256.0D / d9; + if (d1 < 0.0D) { + d1 *= 4.0D; + } + + double d2 = this.field_147428_e[i] / (double) this.settings.lowerLimitScale; + double d3 = this.field_147425_f[i] / (double) this.settings.upperLimitScale; + double d4 = (this.field_147427_d[i] / 10.0D + 1.0D) / 2.0D; + double d5 = MathHelper.denormalizeClamp(d2, d3, d4) - d1; + if (k1 > 29) { + double d6 = (double) ((float) (k1 - 29) / 3.0F); + d5 = d5 * (1.0D - d6) + -10.0D * d6; + } + + this.field_147434_q[i] = d5; + ++i; + } + } + } + + } + + /**+ + * Checks to see if a chunk exists at x, z + */ + public boolean chunkExists(int var1, int var2) { + return true; + } + + /**+ + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider var1, int i, int j) { + BlockFalling.fallInstantly = true; + int k = i * 16; + int l = j * 16; + BlockPos blockpos = new BlockPos(k, 0, l); + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos.add(16, 0, 16)); + this.rand.setSeed(this.worldObj.getSeed()); + long i1 = this.rand.nextLong() / 2L * 2L + 1L; + long j1 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long) i * i1 + (long) j * j1 ^ this.worldObj.getSeed()); + boolean flag = false; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + if (this.settings.useMineShafts && this.mapFeaturesEnabled) { + this.mineshaftGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useVillages && this.mapFeaturesEnabled) { + flag = this.villageGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useStrongholds && this.mapFeaturesEnabled) { + this.strongholdGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useTemples && this.mapFeaturesEnabled) { + this.scatteredFeatureGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useMonuments && this.mapFeaturesEnabled) { + this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills + && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0) { + int k1 = this.rand.nextInt(16) + 8; + int l1 = this.rand.nextInt(256); + int i2 = this.rand.nextInt(16) + 8; + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, blockpos.add(k1, l1, i2)); + } + + if (!flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes) { + int k2 = this.rand.nextInt(16) + 8; + int j3 = this.rand.nextInt(this.rand.nextInt(248) + 8); + int i4 = this.rand.nextInt(16) + 8; + if (j3 < this.worldObj.func_181545_F() || this.rand.nextInt(this.settings.lavaLakeChance / 8) == 0) { + (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, blockpos.add(k2, j3, i4)); + } + } + + if (this.settings.useDungeons) { + for (int l2 = 0; l2 < this.settings.dungeonChance; ++l2) { + int k3 = this.rand.nextInt(16) + 8; + int j4 = this.rand.nextInt(256); + int j2 = this.rand.nextInt(16) + 8; + (new WorldGenDungeons()).generate(this.worldObj, this.rand, blockpos.add(k3, j4, j2)); + } + } + + biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l)); + SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); + blockpos = blockpos.add(8, 0, 8); + + for (int i3 = 0; i3 < 16; ++i3) { + for (int l3 = 0; l3 < 16; ++l3) { + BlockPos blockpos1 = this.worldObj.getPrecipitationHeight(blockpos.add(i3, 0, l3)); + BlockPos blockpos2 = blockpos1.down(); + if (this.worldObj.canBlockFreezeWater(blockpos2)) { + this.worldObj.setBlockState(blockpos2, Blocks.ice.getDefaultState(), 2); + } + + if (this.worldObj.canSnowAt(blockpos1, true)) { + this.worldObj.setBlockState(blockpos1, Blocks.snow_layer.getDefaultState(), 2); + } + } + } + + BlockFalling.fallInstantly = false; + } + + public boolean func_177460_a(IChunkProvider var1, Chunk chunk, int i, int j) { + boolean flag = false; + if (this.settings.useMonuments && this.mapFeaturesEnabled && chunk.getInhabitedTime() < 3600L) { + flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, + new ChunkCoordIntPair(i, j)); + } + + return flag; + } + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + public boolean saveChunks(boolean var1, IProgressUpdate var2) { + return true; + } + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + } + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /**+ + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /**+ + * Converts the instance data to a readable string. + */ + public String makeString() { + return "RandomLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType enumcreaturetype, + BlockPos blockpos) { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos); + if (this.mapFeaturesEnabled) { + if (enumcreaturetype == EnumCreatureType.MONSTER + && this.scatteredFeatureGenerator.func_175798_a(blockpos)) { + return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList(); + } + + if (enumcreaturetype == EnumCreatureType.MONSTER && this.settings.useMonuments + && this.oceanMonumentGenerator.func_175796_a(this.worldObj, blockpos)) { + return this.oceanMonumentGenerator.func_175799_b(); + } + } + + return biomegenbase.getSpawnableList(enumcreaturetype); + } + + public BlockPos getStrongholdGen(World world, String s, BlockPos blockpos) { + return "Stronghold".equals(s) && this.strongholdGenerator != null + ? this.strongholdGenerator.getClosestStrongholdPos(world, blockpos) + : null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(Chunk var1, int i, int j) { + if (this.settings.useMineShafts && this.mapFeaturesEnabled) { + this.mineshaftGenerator.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + if (this.settings.useVillages && this.mapFeaturesEnabled) { + this.villageGenerator.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + if (this.settings.useStrongholds && this.mapFeaturesEnabled) { + this.strongholdGenerator.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + if (this.settings.useTemples && this.mapFeaturesEnabled) { + this.scatteredFeatureGenerator.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + if (this.settings.useMonuments && this.mapFeaturesEnabled) { + this.oceanMonumentGenerator.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(BlockPos blockpos) { + return this.provideChunk(blockpos.getX() >> 4, blockpos.getZ() >> 4); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderHell.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderHell.java new file mode 100644 index 0000000..dc607a4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderHell.java @@ -0,0 +1,495 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFalling; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +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.gen.GeneratorBushFeature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenCavesHell; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorOctaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenFire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenGlowStone1; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenGlowStone2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenHellLava; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenMinable; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenNetherBridge; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderHell implements IChunkProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderHell"); + } + + private final World worldObj; + private final boolean field_177466_i; + private final EaglercraftRandom hellRNG; + /**+ + * Holds the noise used to determine whether slowsand can be + * generated at a location + */ + private double[] slowsandNoise = new double[256]; + private double[] gravelNoise = new double[256]; + /**+ + * Holds the noise used to determine whether something other + * than netherrack can be generated at a location + */ + private double[] netherrackExclusivityNoise = new double[256]; + private double[] noiseField; + private final NoiseGeneratorOctaves netherNoiseGen1; + private final NoiseGeneratorOctaves netherNoiseGen2; + private final NoiseGeneratorOctaves netherNoiseGen3; + private final NoiseGeneratorOctaves slowsandGravelNoiseGen; + private final NoiseGeneratorOctaves netherrackExculsivityNoiseGen; + public final NoiseGeneratorOctaves netherNoiseGen6; + public final NoiseGeneratorOctaves netherNoiseGen7; + private final WorldGenFire field_177470_t = new WorldGenFire(); + private final WorldGenGlowStone1 field_177469_u = new WorldGenGlowStone1(); + private final WorldGenGlowStone2 field_177468_v = new WorldGenGlowStone2(); + private final WorldGenerator field_177467_w = new WorldGenMinable(Blocks.quartz_ore.getDefaultState(), 14, + BlockHelper.forBlock(Blocks.netherrack)); + private final WorldGenHellLava field_177473_x = new WorldGenHellLava(Blocks.flowing_lava, true); + private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.flowing_lava, false); + private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.brown_mushroom); + private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.red_mushroom); + private final MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); + private final MapGenBase netherCaveGenerator = new MapGenCavesHell(); + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + + public ChunkProviderHell(World worldIn, boolean parFlag, long parLong1) { + this.worldObj = worldIn; + this.field_177466_i = parFlag; + this.hellRNG = new EaglercraftRandom(parLong1); + this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); + this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); + this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + worldIn.func_181544_b(63); + } + + public void func_180515_a(int parInt1, int parInt2, ChunkPrimer parChunkPrimer) { + byte b0 = 4; + int i = this.worldObj.func_181545_F() / 2 + 1; + int j = b0 + 1; + byte b1 = 17; + int k = b0 + 1; + this.noiseField = this.initializeNoiseField(this.noiseField, parInt1 * b0, 0, parInt2 * b0, j, b1, k); + + for (int l = 0; l < b0; ++l) { + for (int i1 = 0; i1 < b0; ++i1) { + for (int j1 = 0; j1 < 16; ++j1) { + double d0 = 0.125D; + double d1 = this.noiseField[((l + 0) * k + i1 + 0) * b1 + j1 + 0]; + double d2 = this.noiseField[((l + 0) * k + i1 + 1) * b1 + j1 + 0]; + double d3 = this.noiseField[((l + 1) * k + i1 + 0) * b1 + j1 + 0]; + double d4 = this.noiseField[((l + 1) * k + i1 + 1) * b1 + j1 + 0]; + double d5 = (this.noiseField[((l + 0) * k + i1 + 0) * b1 + j1 + 1] - d1) * d0; + double d6 = (this.noiseField[((l + 0) * k + i1 + 1) * b1 + j1 + 1] - d2) * d0; + double d7 = (this.noiseField[((l + 1) * k + i1 + 0) * b1 + j1 + 1] - d3) * d0; + double d8 = (this.noiseField[((l + 1) * k + i1 + 1) * b1 + j1 + 1] - d4) * d0; + + for (int k1 = 0; k1 < 8; ++k1) { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int l1 = 0; l1 < 4; ++l1) { + double d14 = 0.25D; + double d15 = d10; + double d16 = (d11 - d10) * d14; + + for (int i2 = 0; i2 < 4; ++i2) { + IBlockState iblockstate = null; + if (j1 * 8 + k1 < i) { + iblockstate = Blocks.lava.getDefaultState(); + } + + if (d15 > 0.0D) { + iblockstate = Blocks.netherrack.getDefaultState(); + } + + int j2 = l1 + l * 4; + int k2 = k1 + j1 * 8; + int l2 = i2 + i1 * 4; + parChunkPrimer.setBlockState(j2, k2, l2, iblockstate); + d15 += d16; + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + + } + + public void func_180516_b(int parInt1, int parInt2, ChunkPrimer parChunkPrimer) { + int i = this.worldObj.func_181545_F() + 1; + double d0 = 0.03125D; + this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, parInt1 * 16, + parInt2 * 16, 0, 16, 16, 1, d0, d0, 1.0D); + this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, parInt1 * 16, 109, + parInt2 * 16, 16, 1, 16, d0, 1.0D, d0); + this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves( + this.netherrackExclusivityNoise, parInt1 * 16, parInt2 * 16, 0, 16, 16, 1, d0 * 2.0D, d0 * 2.0D, + d0 * 2.0D); + + for (int j = 0; j < 16; ++j) { + for (int k = 0; k < 16; ++k) { + boolean flag = this.slowsandNoise[j + k * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + boolean flag1 = this.gravelNoise[j + k * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + int l = (int) (this.netherrackExclusivityNoise[j + k * 16] / 3.0D + 3.0D + + this.hellRNG.nextDouble() * 0.25D); + int i1 = -1; + IBlockState iblockstate = Blocks.netherrack.getDefaultState(); + IBlockState iblockstate1 = Blocks.netherrack.getDefaultState(); + + for (int j1 = 127; j1 >= 0; --j1) { + if (j1 < 127 - this.hellRNG.nextInt(5) && j1 > this.hellRNG.nextInt(5)) { + IBlockState iblockstate2 = parChunkPrimer.getBlockState(k, j1, j); + if (iblockstate2.getBlock() != null && iblockstate2.getBlock().getMaterial() != Material.air) { + if (iblockstate2.getBlock() == Blocks.netherrack) { + if (i1 == -1) { + if (l <= 0) { + iblockstate = null; + iblockstate1 = Blocks.netherrack.getDefaultState(); + } else if (j1 >= i - 4 && j1 <= i + 1) { + iblockstate = Blocks.netherrack.getDefaultState(); + iblockstate1 = Blocks.netherrack.getDefaultState(); + if (flag1) { + iblockstate = Blocks.gravel.getDefaultState(); + iblockstate1 = Blocks.netherrack.getDefaultState(); + } + + if (flag) { + iblockstate = Blocks.soul_sand.getDefaultState(); + iblockstate1 = Blocks.soul_sand.getDefaultState(); + } + } + + if (j1 < i && (iblockstate == null + || iblockstate.getBlock().getMaterial() == Material.air)) { + iblockstate = Blocks.lava.getDefaultState(); + } + + i1 = l; + if (j1 >= i - 1) { + parChunkPrimer.setBlockState(k, j1, j, iblockstate); + } else { + parChunkPrimer.setBlockState(k, j1, j, iblockstate1); + } + } else if (i1 > 0) { + --i1; + parChunkPrimer.setBlockState(k, j1, j, iblockstate1); + } + } + } else { + i1 = -1; + } + } else { + parChunkPrimer.setBlockState(k, j1, j, Blocks.bedrock.getDefaultState()); + } + } + } + } + + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int i, int j) { + this.hellRNG.setSeed((long) i * 341873128712L + (long) j * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.func_180515_a(i, j, chunkprimer); + this.func_180516_b(i, j, chunkprimer); + this.netherCaveGenerator.generate(this, this.worldObj, i, j, chunkprimer); + if (this.field_177466_i) { + this.genNetherBridge.generate(this, this.worldObj, i, j, chunkprimer); + } + + Chunk chunk = new Chunk(this.worldObj, chunkprimer, i, j); + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager() + .loadBlockGeneratorData((BiomeGenBase[]) null, i * 16, j * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (int k = 0; k < abyte.length; ++k) { + abyte[k] = (byte) abiomegenbase[k].biomeID; + } + + chunk.resetRelightChecks(); + return chunk; + } + + /**+ + * generates a subset of the level's terrain data. Takes 7 + * arguments: the [empty] noise array, the position, and the + * size. + */ + private double[] initializeNoiseField(double[] parArrayOfDouble, int parInt1, int parInt2, int parInt3, int parInt4, + int parInt5, int parInt6) { + if (parArrayOfDouble == null) { + parArrayOfDouble = new double[parInt4 * parInt5 * parInt6]; + } + + double d0 = 684.412D; + double d1 = 2053.236D; + this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, parInt1, parInt2, parInt3, parInt4, + 1, parInt6, 1.0D, 0.0D, 1.0D); + this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, parInt1, parInt2, parInt3, parInt4, + 1, parInt6, 100.0D, 0.0D, 100.0D); + this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, parInt1, parInt2, parInt3, parInt4, + parInt5, parInt6, d0 / 80.0D, d1 / 60.0D, d0 / 80.0D); + this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, parInt1, parInt2, parInt3, parInt4, + parInt5, parInt6, d0, d1, d0); + this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, parInt1, parInt2, parInt3, parInt4, + parInt5, parInt6, d0, d1, d0); + int i = 0; + double[] adouble = new double[parInt5]; + + for (int j = 0; j < parInt5; ++j) { + adouble[j] = Math.cos((double) j * 3.141592653589793D * 6.0D / (double) parInt5) * 2.0D; + double d2 = (double) j; + if (j > parInt5 / 2) { + d2 = (double) (parInt5 - 1 - j); + } + + if (d2 < 4.0D) { + d2 = 4.0D - d2; + adouble[j] -= d2 * d2 * d2 * 10.0D; + } + } + + for (int l = 0; l < parInt4; ++l) { + for (int i1 = 0; i1 < parInt6; ++i1) { + double d3 = 0.0D; + + for (int k = 0; k < parInt5; ++k) { + double d4 = 0.0D; + double d5 = adouble[k]; + double d6 = this.noiseData2[i] / 512.0D; + double d7 = this.noiseData3[i] / 512.0D; + double d8 = (this.noiseData1[i] / 10.0D + 1.0D) / 2.0D; + if (d8 < 0.0D) { + d4 = d6; + } else if (d8 > 1.0D) { + d4 = d7; + } else { + d4 = d6 + (d7 - d6) * d8; + } + + d4 = d4 - d5; + if (k > parInt5 - 4) { + double d9 = (double) ((float) (k - (parInt5 - 4)) / 3.0F); + d4 = d4 * (1.0D - d9) + -10.0D * d9; + } + + if ((double) k < d3) { + double d10 = (d3 - (double) k) / 4.0D; + d10 = MathHelper.clamp_double(d10, 0.0D, 1.0D); + d4 = d4 * (1.0D - d10) + -10.0D * d10; + } + + parArrayOfDouble[i] = d4; + ++i; + } + } + } + + return parArrayOfDouble; + } + + /**+ + * Checks to see if a chunk exists at x, z + */ + public boolean chunkExists(int var1, int var2) { + return true; + } + + /**+ + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider var1, int i, int j) { + BlockFalling.fallInstantly = true; + BlockPos blockpos = new BlockPos(i * 16, 0, j * 16); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + this.genNetherBridge.generateStructure(this.worldObj, this.hellRNG, chunkcoordintpair); + + for (int k = 0; k < 8; ++k) { + this.field_177472_y.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, + this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + } + + for (int l = 0; l < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++l) { + this.field_177470_t.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, + this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + } + + for (int i1 = 0; i1 < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++i1) { + this.field_177469_u.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, + this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + } + + for (int j1 = 0; j1 < 10; ++j1) { + this.field_177468_v.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, + this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + } + + if (this.hellRNG.nextBoolean()) { + this.field_177471_z.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, + this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + } + + if (this.hellRNG.nextBoolean()) { + this.field_177465_A.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, + this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + } + + for (int k1 = 0; k1 < 16; ++k1) { + this.field_177467_w.generate(this.worldObj, this.hellRNG, + blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); + } + + for (int l1 = 0; l1 < 16; ++l1) { + this.field_177473_x.generate(this.worldObj, this.hellRNG, + blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); + } + + BlockFalling.fallInstantly = false; + } + + public boolean func_177460_a(IChunkProvider var1, Chunk var2, int var3, int var4) { + return false; + } + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + public boolean saveChunks(boolean var1, IProgressUpdate var2) { + return true; + } + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + } + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /**+ + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /**+ + * Converts the instance data to a readable string. + */ + public String makeString() { + return "HellRandomLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType enumcreaturetype, + BlockPos blockpos) { + if (enumcreaturetype == EnumCreatureType.MONSTER) { + if (this.genNetherBridge.func_175795_b(blockpos)) { + return this.genNetherBridge.getSpawnList(); + } + + if (this.genNetherBridge.func_175796_a(this.worldObj, blockpos) + && this.worldObj.getBlockState(blockpos.down()).getBlock() == Blocks.nether_brick) { + return this.genNetherBridge.getSpawnList(); + } + } + + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos); + return biomegenbase.getSpawnableList(enumcreaturetype); + } + + public BlockPos getStrongholdGen(World var1, String var2, BlockPos var3) { + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(Chunk var1, int i, int j) { + this.genNetherBridge.generate(this, this.worldObj, i, j, (ChunkPrimer) null); + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(BlockPos blockpos) { + return this.provideChunk(blockpos.getX() >> 4, blockpos.getZ() >> 4); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderServer.java new file mode 100644 index 0000000..c478a3c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderServer.java @@ -0,0 +1,348 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.EnumCreatureType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.LongHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +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.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.EmptyChunk; +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.chunk.storage.IChunkLoader; +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderServer implements IChunkProvider { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderServer"); + } + + private static final Logger logger = LogManager.getLogger(); + private Set droppedChunksSet = Collections.newSetFromMap(new ConcurrentHashMap()); + private Chunk dummyChunk; + private IChunkProvider serverChunkGenerator; + private IChunkLoader chunkLoader; + /**+ + * if set, this flag forces a request to load a chunk to load + * the chunk rather than defaulting to the dummy if possible + */ + public boolean chunkLoadOverride = true; + /**+ + * map of chunk Id's to Chunk instances + */ + private LongHashMap id2ChunkMap = new LongHashMap(); + private List loadedChunks = Lists.newArrayList(); + private WorldServer worldObj; + + public ChunkProviderServer(WorldServer parWorldServer, IChunkLoader parIChunkLoader, + IChunkProvider parIChunkProvider) { + this.dummyChunk = new EmptyChunk(parWorldServer, 0, 0); + this.worldObj = parWorldServer; + this.chunkLoader = parIChunkLoader; + this.serverChunkGenerator = parIChunkProvider; + } + + /**+ + * Checks to see if a chunk exists at x, z + */ + public boolean chunkExists(int i, int j) { + return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(i, j)); + } + + public List func_152380_a() { + return this.loadedChunks; + } + + public void dropChunk(int parInt1, int parInt2) { + if (this.worldObj.provider.canRespawnHere()) { + if (!this.worldObj.isSpawnChunk(parInt1, parInt2)) { + this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(parInt1, parInt2))); + } + } else { + this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(parInt1, parInt2))); + } + + } + + /**+ + * marks all chunks for unload, ignoring those near the spawn + */ + public void unloadAllChunks() { + for (Chunk chunk : this.loadedChunks) { + this.dropChunk(chunk.xPosition, chunk.zPosition); + } + + } + + /**+ + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int i, int j) { + long k = ChunkCoordIntPair.chunkXZ2Int(i, j); + this.droppedChunksSet.remove(Long.valueOf(k)); + Chunk chunk = (Chunk) this.id2ChunkMap.getValueByKey(k); + if (chunk == null) { + chunk = this.loadChunkFromFile(i, j); + if (chunk == null) { + if (this.serverChunkGenerator == null) { + chunk = this.dummyChunk; + } else { + try { + chunk = this.serverChunkGenerator.provideChunk(i, j); + ++EaglerMinecraftServer.counterChunkGenerate; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, + "Exception generating new chunk"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated"); + crashreportcategory.addCrashSection("Location", + HString.format("%d,%d", new Object[] { Integer.valueOf(i), Integer.valueOf(j) })); + crashreportcategory.addCrashSection("Position hash", Long.valueOf(k)); + crashreportcategory.addCrashSection("Generator", this.serverChunkGenerator.makeString()); + throw new ReportedException(crashreport); + } + } + } else { + ++EaglerMinecraftServer.counterChunkRead; + } + + this.id2ChunkMap.add(k, chunk); + this.loadedChunks.add(chunk); + chunk.onChunkLoad(); + chunk.populateChunk(this, this, i, j); + } + + return chunk; + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int i, int j) { + Chunk chunk = (Chunk) this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(i, j)); + return chunk == null ? (!this.worldObj.isFindingSpawnPoint() && !this.chunkLoadOverride ? this.dummyChunk + : this.loadChunk(i, j)) : chunk; + } + + private Chunk loadChunkFromFile(int x, int z) { + if (this.chunkLoader == null) { + return null; + } else { + try { + Chunk chunk = this.chunkLoader.loadChunk(this.worldObj, x, z); + if (chunk != null) { + chunk.setLastSaveTime(this.worldObj.getTotalWorldTime()); + if (this.serverChunkGenerator != null) { + this.serverChunkGenerator.recreateStructures(chunk, x, z); + } + } + + return chunk; + } catch (Exception exception) { + logger.error("Couldn\'t load chunk", exception); + return null; + } + } + } + + private void saveChunkExtraData(Chunk parChunk) { + if (this.chunkLoader != null) { + try { + this.chunkLoader.saveExtraChunkData(this.worldObj, parChunk); + } catch (Exception exception) { + logger.error("Couldn\'t save entities", exception); + } + + } + } + + private void saveChunkData(Chunk parChunk) { + if (this.chunkLoader != null) { + try { + parChunk.setLastSaveTime(this.worldObj.getTotalWorldTime()); + this.chunkLoader.saveChunk(this.worldObj, parChunk); + ++EaglerMinecraftServer.counterChunkWrite; + } catch (IOException ioexception) { + logger.error("Couldn\'t save chunk", ioexception); + } catch (MinecraftException minecraftexception) { + logger.error("Couldn\'t save chunk; already in use by another instance of Minecraft?", + minecraftexception); + } + + } + } + + /**+ + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider ichunkprovider, int i, int j) { + Chunk chunk = this.provideChunk(i, j); + if (!chunk.isTerrainPopulated()) { + chunk.func_150809_p(); + if (this.serverChunkGenerator != null) { + this.serverChunkGenerator.populate(ichunkprovider, i, j); + chunk.setChunkModified(); + } + } + + } + + public boolean func_177460_a(IChunkProvider ichunkprovider, Chunk chunk, int i, int j) { + if (this.serverChunkGenerator != null && this.serverChunkGenerator.func_177460_a(ichunkprovider, chunk, i, j)) { + Chunk chunk1 = this.provideChunk(i, j); + chunk1.setChunkModified(); + return true; + } else { + return false; + } + } + + /**+ + * Two modes of operation: if passed true, save all Chunks in + * one go. If passed false, save up to two chunks. Return true + * if all chunks have been saved. + */ + public boolean saveChunks(boolean flag, IProgressUpdate var2) { + int i = 0; + ArrayList arraylist = Lists.newArrayList(this.loadedChunks); + + for (int j = 0; j < arraylist.size(); ++j) { + Chunk chunk = (Chunk) arraylist.get(j); + if (flag) { + this.saveChunkExtraData(chunk); + } + + if (chunk.needsSaving(flag)) { + this.saveChunkData(chunk); + chunk.setModified(false); + ++i; + if (i == 24 && !flag) { + return false; + } + } + } + + return true; + } + + /**+ + * Save extra data not associated with any Chunk. Not saved + * during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + if (this.chunkLoader != null) { + this.chunkLoader.saveExtraData(); + } + + } + + /**+ + * Unloads chunks that are marked to be unloaded. This is not + * guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + if (!this.worldObj.disableLevelSaving) { + for (int i = 0; i < 100; ++i) { + if (!this.droppedChunksSet.isEmpty()) { + Long olong = (Long) this.droppedChunksSet.iterator().next(); + Chunk chunk = (Chunk) this.id2ChunkMap.getValueByKey(olong.longValue()); + if (chunk != null) { + chunk.onChunkUnload(); + this.saveChunkData(chunk); + this.saveChunkExtraData(chunk); + this.id2ChunkMap.remove(olong.longValue()); + this.loadedChunks.remove(chunk); + } + + this.droppedChunksSet.remove(olong); + } + } + + if (this.chunkLoader != null) { + this.chunkLoader.chunkTick(); + } + } + + return this.serverChunkGenerator.unloadQueuedChunks(); + } + + /**+ + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return !this.worldObj.disableLevelSaving; + } + + /**+ + * Converts the instance data to a readable string. + */ + public String makeString() { + return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.droppedChunksSet.size(); + } + + public List getPossibleCreatures(EnumCreatureType enumcreaturetype, + BlockPos blockpos) { + return this.serverChunkGenerator.getPossibleCreatures(enumcreaturetype, blockpos); + } + + public BlockPos getStrongholdGen(World world, String s, BlockPos blockpos) { + return this.serverChunkGenerator.getStrongholdGen(world, s, blockpos); + } + + public int getLoadedChunkCount() { + return this.id2ChunkMap.getNumHashElements(); + } + + public void recreateStructures(Chunk var1, int var2, int var3) { + } + + /**+ + * Will return back a chunk, if it doesn't exist and its not a + * MP client it will generates all the blocks for the specified + * chunk from the map seed and chunk seed + */ + public Chunk provideChunk(BlockPos blockpos) { + return this.provideChunk(blockpos.getX() >> 4, blockpos.getZ() >> 4); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderSettings.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderSettings.java new file mode 100644 index 0000000..8359087 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderSettings.java @@ -0,0 +1,918 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import java.lang.reflect.Type; + +import org.json.JSONException; +import org.json.JSONObject; + +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeCodec; +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderSettings { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderSettings"); + } + + public final float coordinateScale; + public final float heightScale; + public final float upperLimitScale; + public final float lowerLimitScale; + public final float depthNoiseScaleX; + public final float depthNoiseScaleZ; + public final float depthNoiseScaleExponent; + public final float mainNoiseScaleX; + public final float mainNoiseScaleY; + public final float mainNoiseScaleZ; + public final float baseSize; + public final float stretchY; + public final float biomeDepthWeight; + public final float biomeDepthOffSet; + public final float biomeScaleWeight; + public final float biomeScaleOffset; + public final int seaLevel; + public final boolean useCaves; + public final boolean useDungeons; + public final int dungeonChance; + public final boolean useStrongholds; + public final boolean useVillages; + public final boolean useMineShafts; + public final boolean useTemples; + public final boolean useMonuments; + public final boolean useRavines; + public final boolean useWaterLakes; + public final int waterLakeChance; + public final boolean useLavaLakes; + public final int lavaLakeChance; + public final boolean useLavaOceans; + public final int fixedBiome; + public final int biomeSize; + public final int riverSize; + public final int dirtSize; + public final int dirtCount; + public final int dirtMinHeight; + public final int dirtMaxHeight; + public final int gravelSize; + public final int gravelCount; + public final int gravelMinHeight; + public final int gravelMaxHeight; + public final int graniteSize; + public final int graniteCount; + public final int graniteMinHeight; + public final int graniteMaxHeight; + public final int dioriteSize; + public final int dioriteCount; + public final int dioriteMinHeight; + public final int dioriteMaxHeight; + public final int andesiteSize; + public final int andesiteCount; + public final int andesiteMinHeight; + public final int andesiteMaxHeight; + public final int coalSize; + public final int coalCount; + public final int coalMinHeight; + public final int coalMaxHeight; + public final int ironSize; + public final int ironCount; + public final int ironMinHeight; + public final int ironMaxHeight; + public final int goldSize; + public final int goldCount; + public final int goldMinHeight; + public final int goldMaxHeight; + public final int redstoneSize; + public final int redstoneCount; + public final int redstoneMinHeight; + public final int redstoneMaxHeight; + public final int diamondSize; + public final int diamondCount; + public final int diamondMinHeight; + public final int diamondMaxHeight; + public final int lapisSize; + public final int lapisCount; + public final int lapisCenterHeight; + public final int lapisSpread; + + private ChunkProviderSettings(ChunkProviderSettings.Factory settingsFactory) { + this.coordinateScale = settingsFactory.coordinateScale; + this.heightScale = settingsFactory.heightScale; + this.upperLimitScale = settingsFactory.upperLimitScale; + this.lowerLimitScale = settingsFactory.lowerLimitScale; + this.depthNoiseScaleX = settingsFactory.depthNoiseScaleX; + this.depthNoiseScaleZ = settingsFactory.depthNoiseScaleZ; + this.depthNoiseScaleExponent = settingsFactory.depthNoiseScaleExponent; + this.mainNoiseScaleX = settingsFactory.mainNoiseScaleX; + this.mainNoiseScaleY = settingsFactory.mainNoiseScaleY; + this.mainNoiseScaleZ = settingsFactory.mainNoiseScaleZ; + this.baseSize = settingsFactory.baseSize; + this.stretchY = settingsFactory.stretchY; + this.biomeDepthWeight = settingsFactory.biomeDepthWeight; + this.biomeDepthOffSet = settingsFactory.biomeDepthOffset; + this.biomeScaleWeight = settingsFactory.biomeScaleWeight; + this.biomeScaleOffset = settingsFactory.biomeScaleOffset; + this.seaLevel = settingsFactory.seaLevel; + this.useCaves = settingsFactory.useCaves; + this.useDungeons = settingsFactory.useDungeons; + this.dungeonChance = settingsFactory.dungeonChance; + this.useStrongholds = settingsFactory.useStrongholds; + this.useVillages = settingsFactory.useVillages; + this.useMineShafts = settingsFactory.useMineShafts; + this.useTemples = settingsFactory.useTemples; + this.useMonuments = settingsFactory.useMonuments; + this.useRavines = settingsFactory.useRavines; + this.useWaterLakes = settingsFactory.useWaterLakes; + this.waterLakeChance = settingsFactory.waterLakeChance; + this.useLavaLakes = settingsFactory.useLavaLakes; + this.lavaLakeChance = settingsFactory.lavaLakeChance; + this.useLavaOceans = settingsFactory.useLavaOceans; + this.fixedBiome = settingsFactory.fixedBiome; + this.biomeSize = settingsFactory.biomeSize; + this.riverSize = settingsFactory.riverSize; + this.dirtSize = settingsFactory.dirtSize; + this.dirtCount = settingsFactory.dirtCount; + this.dirtMinHeight = settingsFactory.dirtMinHeight; + this.dirtMaxHeight = settingsFactory.dirtMaxHeight; + this.gravelSize = settingsFactory.gravelSize; + this.gravelCount = settingsFactory.gravelCount; + this.gravelMinHeight = settingsFactory.gravelMinHeight; + this.gravelMaxHeight = settingsFactory.gravelMaxHeight; + this.graniteSize = settingsFactory.graniteSize; + this.graniteCount = settingsFactory.graniteCount; + this.graniteMinHeight = settingsFactory.graniteMinHeight; + this.graniteMaxHeight = settingsFactory.graniteMaxHeight; + this.dioriteSize = settingsFactory.dioriteSize; + this.dioriteCount = settingsFactory.dioriteCount; + this.dioriteMinHeight = settingsFactory.dioriteMinHeight; + this.dioriteMaxHeight = settingsFactory.dioriteMaxHeight; + this.andesiteSize = settingsFactory.andesiteSize; + this.andesiteCount = settingsFactory.andesiteCount; + this.andesiteMinHeight = settingsFactory.andesiteMinHeight; + this.andesiteMaxHeight = settingsFactory.andesiteMaxHeight; + this.coalSize = settingsFactory.coalSize; + this.coalCount = settingsFactory.coalCount; + this.coalMinHeight = settingsFactory.coalMinHeight; + this.coalMaxHeight = settingsFactory.coalMaxHeight; + this.ironSize = settingsFactory.ironSize; + this.ironCount = settingsFactory.ironCount; + this.ironMinHeight = settingsFactory.ironMinHeight; + this.ironMaxHeight = settingsFactory.ironMaxHeight; + this.goldSize = settingsFactory.goldSize; + this.goldCount = settingsFactory.goldCount; + this.goldMinHeight = settingsFactory.goldMinHeight; + this.goldMaxHeight = settingsFactory.goldMaxHeight; + this.redstoneSize = settingsFactory.redstoneSize; + this.redstoneCount = settingsFactory.redstoneCount; + this.redstoneMinHeight = settingsFactory.redstoneMinHeight; + this.redstoneMaxHeight = settingsFactory.redstoneMaxHeight; + this.diamondSize = settingsFactory.diamondSize; + this.diamondCount = settingsFactory.diamondCount; + this.diamondMinHeight = settingsFactory.diamondMinHeight; + this.diamondMaxHeight = settingsFactory.diamondMaxHeight; + this.lapisSize = settingsFactory.lapisSize; + this.lapisCount = settingsFactory.lapisCount; + this.lapisCenterHeight = settingsFactory.lapisCenterHeight; + this.lapisSpread = settingsFactory.lapisSpread; + } + + public static class Factory { + public float coordinateScale = 684.412F; + public float heightScale = 684.412F; + public float upperLimitScale = 512.0F; + public float lowerLimitScale = 512.0F; + public float depthNoiseScaleX = 200.0F; + public float depthNoiseScaleZ = 200.0F; + public float depthNoiseScaleExponent = 0.5F; + public float mainNoiseScaleX = 80.0F; + public float mainNoiseScaleY = 160.0F; + public float mainNoiseScaleZ = 80.0F; + public float baseSize = 8.5F; + public float stretchY = 12.0F; + public float biomeDepthWeight = 1.0F; + public float biomeDepthOffset = 0.0F; + public float biomeScaleWeight = 1.0F; + public float biomeScaleOffset = 0.0F; + public int seaLevel = 63; + public boolean useCaves = true; + public boolean useDungeons = true; + public int dungeonChance = 8; + public boolean useStrongholds = true; + public boolean useVillages = true; + public boolean useMineShafts = true; + public boolean useTemples = true; + public boolean useMonuments = true; + public boolean useRavines = true; + public boolean useWaterLakes = true; + public int waterLakeChance = 4; + public boolean useLavaLakes = true; + public int lavaLakeChance = 80; + public boolean useLavaOceans = false; + public int fixedBiome = -1; + public int biomeSize = 4; + public int riverSize = 4; + public int dirtSize = 33; + public int dirtCount = 10; + public int dirtMinHeight = 0; + public int dirtMaxHeight = 256; + public int gravelSize = 33; + public int gravelCount = 8; + public int gravelMinHeight = 0; + public int gravelMaxHeight = 256; + public int graniteSize = 33; + public int graniteCount = 10; + public int graniteMinHeight = 0; + public int graniteMaxHeight = 80; + public int dioriteSize = 33; + public int dioriteCount = 10; + public int dioriteMinHeight = 0; + public int dioriteMaxHeight = 80; + public int andesiteSize = 33; + public int andesiteCount = 10; + public int andesiteMinHeight = 0; + public int andesiteMaxHeight = 80; + public int coalSize = 17; + public int coalCount = 20; + public int coalMinHeight = 0; + public int coalMaxHeight = 128; + public int ironSize = 9; + public int ironCount = 20; + public int ironMinHeight = 0; + public int ironMaxHeight = 64; + public int goldSize = 9; + public int goldCount = 2; + public int goldMinHeight = 0; + public int goldMaxHeight = 32; + public int redstoneSize = 8; + public int redstoneCount = 8; + public int redstoneMinHeight = 0; + public int redstoneMaxHeight = 16; + public int diamondSize = 8; + public int diamondCount = 1; + public int diamondMinHeight = 0; + public int diamondMaxHeight = 16; + public int lapisSize = 7; + public int lapisCount = 1; + public int lapisCenterHeight = 16; + public int lapisSpread = 16; + + public static ChunkProviderSettings.Factory jsonToFactory(String parString1) { + if (parString1.length() == 0) { + return new ChunkProviderSettings.Factory(); + } else { + try { + return JSONTypeProvider.deserialize(parString1, ChunkProviderSettings.Factory.class); + } catch (Exception var2) { + return new ChunkProviderSettings.Factory(); + } + } + } + + public String toString() { + return JSONTypeProvider.serialize(this).toString(); + } + + public Factory() { + this.func_177863_a(); + } + + public void func_177863_a() { + this.coordinateScale = 684.412F; + this.heightScale = 684.412F; + this.upperLimitScale = 512.0F; + this.lowerLimitScale = 512.0F; + this.depthNoiseScaleX = 200.0F; + this.depthNoiseScaleZ = 200.0F; + this.depthNoiseScaleExponent = 0.5F; + this.mainNoiseScaleX = 80.0F; + this.mainNoiseScaleY = 160.0F; + this.mainNoiseScaleZ = 80.0F; + this.baseSize = 8.5F; + this.stretchY = 12.0F; + this.biomeDepthWeight = 1.0F; + this.biomeDepthOffset = 0.0F; + this.biomeScaleWeight = 1.0F; + this.biomeScaleOffset = 0.0F; + this.seaLevel = 63; + this.useCaves = true; + this.useDungeons = true; + this.dungeonChance = 8; + this.useStrongholds = true; + this.useVillages = true; + this.useMineShafts = true; + this.useTemples = true; + this.useMonuments = true; + this.useRavines = true; + this.useWaterLakes = true; + this.waterLakeChance = 4; + this.useLavaLakes = true; + this.lavaLakeChance = 80; + this.useLavaOceans = false; + this.fixedBiome = -1; + this.biomeSize = 4; + this.riverSize = 4; + this.dirtSize = 33; + this.dirtCount = 10; + this.dirtMinHeight = 0; + this.dirtMaxHeight = 256; + this.gravelSize = 33; + this.gravelCount = 8; + this.gravelMinHeight = 0; + this.gravelMaxHeight = 256; + this.graniteSize = 33; + this.graniteCount = 10; + this.graniteMinHeight = 0; + this.graniteMaxHeight = 80; + this.dioriteSize = 33; + this.dioriteCount = 10; + this.dioriteMinHeight = 0; + this.dioriteMaxHeight = 80; + this.andesiteSize = 33; + this.andesiteCount = 10; + this.andesiteMinHeight = 0; + this.andesiteMaxHeight = 80; + this.coalSize = 17; + this.coalCount = 20; + this.coalMinHeight = 0; + this.coalMaxHeight = 128; + this.ironSize = 9; + this.ironCount = 20; + this.ironMinHeight = 0; + this.ironMaxHeight = 64; + this.goldSize = 9; + this.goldCount = 2; + this.goldMinHeight = 0; + this.goldMaxHeight = 32; + this.redstoneSize = 8; + this.redstoneCount = 8; + this.redstoneMinHeight = 0; + this.redstoneMaxHeight = 16; + this.diamondSize = 8; + this.diamondCount = 1; + this.diamondMinHeight = 0; + this.diamondMaxHeight = 16; + this.lapisSize = 7; + this.lapisCount = 1; + this.lapisCenterHeight = 16; + this.lapisSpread = 16; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + ChunkProviderSettings.Factory chunkprovidersettings$factory = (ChunkProviderSettings.Factory) object; + return this.andesiteCount != chunkprovidersettings$factory.andesiteCount ? false + : (this.andesiteMaxHeight != chunkprovidersettings$factory.andesiteMaxHeight ? false + : (this.andesiteMinHeight != chunkprovidersettings$factory.andesiteMinHeight ? false + : (this.andesiteSize != chunkprovidersettings$factory.andesiteSize ? false + : (Float.compare(chunkprovidersettings$factory.baseSize, + this.baseSize) != 0 ? false + : (Float.compare( + chunkprovidersettings$factory.biomeDepthOffset, + this.biomeDepthOffset) != 0 ? false + : (Float.compare( + chunkprovidersettings$factory.biomeDepthWeight, + this.biomeDepthWeight) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.biomeScaleOffset, + this.biomeScaleOffset) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.biomeScaleWeight, + this.biomeScaleWeight) != 0 + ? false + : (this.biomeSize != chunkprovidersettings$factory.biomeSize + ? false + : (this.coalCount != chunkprovidersettings$factory.coalCount + ? false + : (this.coalMaxHeight != chunkprovidersettings$factory.coalMaxHeight + ? false + : (this.coalMinHeight != chunkprovidersettings$factory.coalMinHeight + ? false + : (this.coalSize != chunkprovidersettings$factory.coalSize + ? false + : (Float.compare( + chunkprovidersettings$factory.coordinateScale, + this.coordinateScale) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.depthNoiseScaleExponent, + this.depthNoiseScaleExponent) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.depthNoiseScaleX, + this.depthNoiseScaleX) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.depthNoiseScaleZ, + this.depthNoiseScaleZ) != 0 + ? false + : (this.diamondCount != chunkprovidersettings$factory.diamondCount + ? false + : (this.diamondMaxHeight != chunkprovidersettings$factory.diamondMaxHeight + ? false + : (this.diamondMinHeight != chunkprovidersettings$factory.diamondMinHeight + ? false + : (this.diamondSize != chunkprovidersettings$factory.diamondSize + ? false + : (this.dioriteCount != chunkprovidersettings$factory.dioriteCount + ? false + : (this.dioriteMaxHeight != chunkprovidersettings$factory.dioriteMaxHeight + ? false + : (this.dioriteMinHeight != chunkprovidersettings$factory.dioriteMinHeight + ? false + : (this.dioriteSize != chunkprovidersettings$factory.dioriteSize + ? false + : (this.dirtCount != chunkprovidersettings$factory.dirtCount + ? false + : (this.dirtMaxHeight != chunkprovidersettings$factory.dirtMaxHeight + ? false + : (this.dirtMinHeight != chunkprovidersettings$factory.dirtMinHeight + ? false + : (this.dirtSize != chunkprovidersettings$factory.dirtSize + ? false + : (this.dungeonChance != chunkprovidersettings$factory.dungeonChance + ? false + : (this.fixedBiome != chunkprovidersettings$factory.fixedBiome + ? false + : (this.goldCount != chunkprovidersettings$factory.goldCount + ? false + : (this.goldMaxHeight != chunkprovidersettings$factory.goldMaxHeight + ? false + : (this.goldMinHeight != chunkprovidersettings$factory.goldMinHeight + ? false + : (this.goldSize != chunkprovidersettings$factory.goldSize + ? false + : (this.graniteCount != chunkprovidersettings$factory.graniteCount + ? false + : (this.graniteMaxHeight != chunkprovidersettings$factory.graniteMaxHeight + ? false + : (this.graniteMinHeight != chunkprovidersettings$factory.graniteMinHeight + ? false + : (this.graniteSize != chunkprovidersettings$factory.graniteSize + ? false + : (this.gravelCount != chunkprovidersettings$factory.gravelCount + ? false + : (this.gravelMaxHeight != chunkprovidersettings$factory.gravelMaxHeight + ? false + : (this.gravelMinHeight != chunkprovidersettings$factory.gravelMinHeight + ? false + : (this.gravelSize != chunkprovidersettings$factory.gravelSize + ? false + : (Float.compare( + chunkprovidersettings$factory.heightScale, + this.heightScale) != 0 + ? false + : (this.ironCount != chunkprovidersettings$factory.ironCount + ? false + : (this.ironMaxHeight != chunkprovidersettings$factory.ironMaxHeight + ? false + : (this.ironMinHeight != chunkprovidersettings$factory.ironMinHeight + ? false + : (this.ironSize != chunkprovidersettings$factory.ironSize + ? false + : (this.lapisCenterHeight != chunkprovidersettings$factory.lapisCenterHeight + ? false + : (this.lapisCount != chunkprovidersettings$factory.lapisCount + ? false + : (this.lapisSize != chunkprovidersettings$factory.lapisSize + ? false + : (this.lapisSpread != chunkprovidersettings$factory.lapisSpread + ? false + : (this.lavaLakeChance != chunkprovidersettings$factory.lavaLakeChance + ? false + : (Float.compare( + chunkprovidersettings$factory.lowerLimitScale, + this.lowerLimitScale) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.mainNoiseScaleX, + this.mainNoiseScaleX) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.mainNoiseScaleY, + this.mainNoiseScaleY) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.mainNoiseScaleZ, + this.mainNoiseScaleZ) != 0 + ? false + : (this.redstoneCount != chunkprovidersettings$factory.redstoneCount + ? false + : (this.redstoneMaxHeight != chunkprovidersettings$factory.redstoneMaxHeight + ? false + : (this.redstoneMinHeight != chunkprovidersettings$factory.redstoneMinHeight + ? false + : (this.redstoneSize != chunkprovidersettings$factory.redstoneSize + ? false + : (this.riverSize != chunkprovidersettings$factory.riverSize + ? false + : (this.seaLevel != chunkprovidersettings$factory.seaLevel + ? false + : (Float.compare( + chunkprovidersettings$factory.stretchY, + this.stretchY) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.upperLimitScale, + this.upperLimitScale) != 0 + ? false + : (this.useCaves != chunkprovidersettings$factory.useCaves + ? false + : (this.useDungeons != chunkprovidersettings$factory.useDungeons + ? false + : (this.useLavaLakes != chunkprovidersettings$factory.useLavaLakes + ? false + : (this.useLavaOceans != chunkprovidersettings$factory.useLavaOceans + ? false + : (this.useMineShafts != chunkprovidersettings$factory.useMineShafts + ? false + : (this.useRavines != chunkprovidersettings$factory.useRavines + ? false + : (this.useStrongholds != chunkprovidersettings$factory.useStrongholds + ? false + : (this.useTemples != chunkprovidersettings$factory.useTemples + ? false + : (this.useMonuments != chunkprovidersettings$factory.useMonuments + ? false + : (this.useVillages != chunkprovidersettings$factory.useVillages + ? false + : (this.useWaterLakes != chunkprovidersettings$factory.useWaterLakes + ? false + : this.waterLakeChance == chunkprovidersettings$factory.waterLakeChance)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); + } else { + return false; + } + } + + public int hashCode() { + int i = this.coordinateScale != 0.0F ? Float.floatToIntBits(this.coordinateScale) : 0; + i = 31 * i + (this.heightScale != 0.0F ? Float.floatToIntBits(this.heightScale) : 0); + i = 31 * i + (this.upperLimitScale != 0.0F ? Float.floatToIntBits(this.upperLimitScale) : 0); + i = 31 * i + (this.lowerLimitScale != 0.0F ? Float.floatToIntBits(this.lowerLimitScale) : 0); + i = 31 * i + (this.depthNoiseScaleX != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleX) : 0); + i = 31 * i + (this.depthNoiseScaleZ != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleZ) : 0); + i = 31 * i + + (this.depthNoiseScaleExponent != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleExponent) : 0); + i = 31 * i + (this.mainNoiseScaleX != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleX) : 0); + i = 31 * i + (this.mainNoiseScaleY != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleY) : 0); + i = 31 * i + (this.mainNoiseScaleZ != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleZ) : 0); + i = 31 * i + (this.baseSize != 0.0F ? Float.floatToIntBits(this.baseSize) : 0); + i = 31 * i + (this.stretchY != 0.0F ? Float.floatToIntBits(this.stretchY) : 0); + i = 31 * i + (this.biomeDepthWeight != 0.0F ? Float.floatToIntBits(this.biomeDepthWeight) : 0); + i = 31 * i + (this.biomeDepthOffset != 0.0F ? Float.floatToIntBits(this.biomeDepthOffset) : 0); + i = 31 * i + (this.biomeScaleWeight != 0.0F ? Float.floatToIntBits(this.biomeScaleWeight) : 0); + i = 31 * i + (this.biomeScaleOffset != 0.0F ? Float.floatToIntBits(this.biomeScaleOffset) : 0); + i = 31 * i + this.seaLevel; + i = 31 * i + (this.useCaves ? 1 : 0); + i = 31 * i + (this.useDungeons ? 1 : 0); + i = 31 * i + this.dungeonChance; + i = 31 * i + (this.useStrongholds ? 1 : 0); + i = 31 * i + (this.useVillages ? 1 : 0); + i = 31 * i + (this.useMineShafts ? 1 : 0); + i = 31 * i + (this.useTemples ? 1 : 0); + i = 31 * i + (this.useMonuments ? 1 : 0); + i = 31 * i + (this.useRavines ? 1 : 0); + i = 31 * i + (this.useWaterLakes ? 1 : 0); + i = 31 * i + this.waterLakeChance; + i = 31 * i + (this.useLavaLakes ? 1 : 0); + i = 31 * i + this.lavaLakeChance; + i = 31 * i + (this.useLavaOceans ? 1 : 0); + i = 31 * i + this.fixedBiome; + i = 31 * i + this.biomeSize; + i = 31 * i + this.riverSize; + i = 31 * i + this.dirtSize; + i = 31 * i + this.dirtCount; + i = 31 * i + this.dirtMinHeight; + i = 31 * i + this.dirtMaxHeight; + i = 31 * i + this.gravelSize; + i = 31 * i + this.gravelCount; + i = 31 * i + this.gravelMinHeight; + i = 31 * i + this.gravelMaxHeight; + i = 31 * i + this.graniteSize; + i = 31 * i + this.graniteCount; + i = 31 * i + this.graniteMinHeight; + i = 31 * i + this.graniteMaxHeight; + i = 31 * i + this.dioriteSize; + i = 31 * i + this.dioriteCount; + i = 31 * i + this.dioriteMinHeight; + i = 31 * i + this.dioriteMaxHeight; + i = 31 * i + this.andesiteSize; + i = 31 * i + this.andesiteCount; + i = 31 * i + this.andesiteMinHeight; + i = 31 * i + this.andesiteMaxHeight; + i = 31 * i + this.coalSize; + i = 31 * i + this.coalCount; + i = 31 * i + this.coalMinHeight; + i = 31 * i + this.coalMaxHeight; + i = 31 * i + this.ironSize; + i = 31 * i + this.ironCount; + i = 31 * i + this.ironMinHeight; + i = 31 * i + this.ironMaxHeight; + i = 31 * i + this.goldSize; + i = 31 * i + this.goldCount; + i = 31 * i + this.goldMinHeight; + i = 31 * i + this.goldMaxHeight; + i = 31 * i + this.redstoneSize; + i = 31 * i + this.redstoneCount; + i = 31 * i + this.redstoneMinHeight; + i = 31 * i + this.redstoneMaxHeight; + i = 31 * i + this.diamondSize; + i = 31 * i + this.diamondCount; + i = 31 * i + this.diamondMinHeight; + i = 31 * i + this.diamondMaxHeight; + i = 31 * i + this.lapisSize; + i = 31 * i + this.lapisCount; + i = 31 * i + this.lapisCenterHeight; + i = 31 * i + this.lapisSpread; + return i; + } + + public ChunkProviderSettings func_177864_b() { + return new ChunkProviderSettings(this); + } + } + + public static class Serializer implements JSONTypeCodec { + public ChunkProviderSettings.Factory deserialize(JSONObject jsonobject) throws JSONException { + ChunkProviderSettings.Factory chunkprovidersettings$factory = new ChunkProviderSettings.Factory(); + + try { + chunkprovidersettings$factory.coordinateScale = jsonobject.optFloat("coordinateScale", + chunkprovidersettings$factory.coordinateScale); + chunkprovidersettings$factory.heightScale = jsonobject.optFloat("heightScale", + chunkprovidersettings$factory.heightScale); + chunkprovidersettings$factory.lowerLimitScale = jsonobject.optFloat("lowerLimitScale", + chunkprovidersettings$factory.lowerLimitScale); + chunkprovidersettings$factory.upperLimitScale = jsonobject.optFloat("upperLimitScale", + chunkprovidersettings$factory.upperLimitScale); + chunkprovidersettings$factory.depthNoiseScaleX = jsonobject.optFloat("depthNoiseScaleX", + chunkprovidersettings$factory.depthNoiseScaleX); + chunkprovidersettings$factory.depthNoiseScaleZ = jsonobject.optFloat("depthNoiseScaleZ", + chunkprovidersettings$factory.depthNoiseScaleZ); + chunkprovidersettings$factory.depthNoiseScaleExponent = jsonobject.optFloat("depthNoiseScaleExponent", + chunkprovidersettings$factory.depthNoiseScaleExponent); + chunkprovidersettings$factory.mainNoiseScaleX = jsonobject.optFloat("mainNoiseScaleX", + chunkprovidersettings$factory.mainNoiseScaleX); + chunkprovidersettings$factory.mainNoiseScaleY = jsonobject.optFloat("mainNoiseScaleY", + chunkprovidersettings$factory.mainNoiseScaleY); + chunkprovidersettings$factory.mainNoiseScaleZ = jsonobject.optFloat("mainNoiseScaleZ", + chunkprovidersettings$factory.mainNoiseScaleZ); + chunkprovidersettings$factory.baseSize = jsonobject.optFloat("baseSize", + chunkprovidersettings$factory.baseSize); + chunkprovidersettings$factory.stretchY = jsonobject.optFloat("stretchY", + chunkprovidersettings$factory.stretchY); + chunkprovidersettings$factory.biomeDepthWeight = jsonobject.optFloat("biomeDepthWeight", + chunkprovidersettings$factory.biomeDepthWeight); + chunkprovidersettings$factory.biomeDepthOffset = jsonobject.optFloat("biomeDepthOffset", + chunkprovidersettings$factory.biomeDepthOffset); + chunkprovidersettings$factory.biomeScaleWeight = jsonobject.optFloat("biomeScaleWeight", + chunkprovidersettings$factory.biomeScaleWeight); + chunkprovidersettings$factory.biomeScaleOffset = jsonobject.optFloat("biomeScaleOffset", + chunkprovidersettings$factory.biomeScaleOffset); + chunkprovidersettings$factory.seaLevel = jsonobject.optInt("seaLevel", + chunkprovidersettings$factory.seaLevel); + chunkprovidersettings$factory.useCaves = jsonobject.optBoolean("useCaves", + chunkprovidersettings$factory.useCaves); + chunkprovidersettings$factory.useDungeons = jsonobject.optBoolean("useDungeons", + chunkprovidersettings$factory.useDungeons); + chunkprovidersettings$factory.dungeonChance = jsonobject.optInt("dungeonChance", + chunkprovidersettings$factory.dungeonChance); + chunkprovidersettings$factory.useStrongholds = jsonobject.optBoolean("useStrongholds", + chunkprovidersettings$factory.useStrongholds); + chunkprovidersettings$factory.useVillages = jsonobject.optBoolean("useVillages", + chunkprovidersettings$factory.useVillages); + chunkprovidersettings$factory.useMineShafts = jsonobject.optBoolean("useMineShafts", + chunkprovidersettings$factory.useMineShafts); + chunkprovidersettings$factory.useTemples = jsonobject.optBoolean("useTemples", + chunkprovidersettings$factory.useTemples); + chunkprovidersettings$factory.useMonuments = jsonobject.optBoolean("useMonuments", + chunkprovidersettings$factory.useMonuments); + chunkprovidersettings$factory.useRavines = jsonobject.optBoolean("useRavines", + chunkprovidersettings$factory.useRavines); + chunkprovidersettings$factory.useWaterLakes = jsonobject.optBoolean("useWaterLakes", + chunkprovidersettings$factory.useWaterLakes); + chunkprovidersettings$factory.waterLakeChance = jsonobject.optInt("waterLakeChance", + chunkprovidersettings$factory.waterLakeChance); + chunkprovidersettings$factory.useLavaLakes = jsonobject.optBoolean("useLavaLakes", + chunkprovidersettings$factory.useLavaLakes); + chunkprovidersettings$factory.lavaLakeChance = jsonobject.optInt("lavaLakeChance", + chunkprovidersettings$factory.lavaLakeChance); + chunkprovidersettings$factory.useLavaOceans = jsonobject.optBoolean("useLavaOceans", + chunkprovidersettings$factory.useLavaOceans); + chunkprovidersettings$factory.fixedBiome = jsonobject.optInt("fixedBiome", + chunkprovidersettings$factory.fixedBiome); + if (chunkprovidersettings$factory.fixedBiome < 38 && chunkprovidersettings$factory.fixedBiome >= -1) { + if (chunkprovidersettings$factory.fixedBiome >= BiomeGenBase.hell.biomeID) { + chunkprovidersettings$factory.fixedBiome += 2; + } + } else { + chunkprovidersettings$factory.fixedBiome = -1; + } + + chunkprovidersettings$factory.biomeSize = jsonobject.optInt("biomeSize", + chunkprovidersettings$factory.biomeSize); + chunkprovidersettings$factory.riverSize = jsonobject.optInt("riverSize", + chunkprovidersettings$factory.riverSize); + chunkprovidersettings$factory.dirtSize = jsonobject.optInt("dirtSize", + chunkprovidersettings$factory.dirtSize); + chunkprovidersettings$factory.dirtCount = jsonobject.optInt("dirtCount", + chunkprovidersettings$factory.dirtCount); + chunkprovidersettings$factory.dirtMinHeight = jsonobject.optInt("dirtMinHeight", + chunkprovidersettings$factory.dirtMinHeight); + chunkprovidersettings$factory.dirtMaxHeight = jsonobject.optInt("dirtMaxHeight", + chunkprovidersettings$factory.dirtMaxHeight); + chunkprovidersettings$factory.gravelSize = jsonobject.optInt("gravelSize", + chunkprovidersettings$factory.gravelSize); + chunkprovidersettings$factory.gravelCount = jsonobject.optInt("gravelCount", + chunkprovidersettings$factory.gravelCount); + chunkprovidersettings$factory.gravelMinHeight = jsonobject.optInt("gravelMinHeight", + chunkprovidersettings$factory.gravelMinHeight); + chunkprovidersettings$factory.gravelMaxHeight = jsonobject.optInt("gravelMaxHeight", + chunkprovidersettings$factory.gravelMaxHeight); + chunkprovidersettings$factory.graniteSize = jsonobject.optInt("graniteSize", + chunkprovidersettings$factory.graniteSize); + chunkprovidersettings$factory.graniteCount = jsonobject.optInt("graniteCount", + chunkprovidersettings$factory.graniteCount); + chunkprovidersettings$factory.graniteMinHeight = jsonobject.optInt("graniteMinHeight", + chunkprovidersettings$factory.graniteMinHeight); + chunkprovidersettings$factory.graniteMaxHeight = jsonobject.optInt("graniteMaxHeight", + chunkprovidersettings$factory.graniteMaxHeight); + chunkprovidersettings$factory.dioriteSize = jsonobject.optInt("dioriteSize", + chunkprovidersettings$factory.dioriteSize); + chunkprovidersettings$factory.dioriteCount = jsonobject.optInt("dioriteCount", + chunkprovidersettings$factory.dioriteCount); + chunkprovidersettings$factory.dioriteMinHeight = jsonobject.optInt("dioriteMinHeight", + chunkprovidersettings$factory.dioriteMinHeight); + chunkprovidersettings$factory.dioriteMaxHeight = jsonobject.optInt("dioriteMaxHeight", + chunkprovidersettings$factory.dioriteMaxHeight); + chunkprovidersettings$factory.andesiteSize = jsonobject.optInt("andesiteSize", + chunkprovidersettings$factory.andesiteSize); + chunkprovidersettings$factory.andesiteCount = jsonobject.optInt("andesiteCount", + chunkprovidersettings$factory.andesiteCount); + chunkprovidersettings$factory.andesiteMinHeight = jsonobject.optInt("andesiteMinHeight", + chunkprovidersettings$factory.andesiteMinHeight); + chunkprovidersettings$factory.andesiteMaxHeight = jsonobject.optInt("andesiteMaxHeight", + chunkprovidersettings$factory.andesiteMaxHeight); + chunkprovidersettings$factory.coalSize = jsonobject.optInt("coalSize", + chunkprovidersettings$factory.coalSize); + chunkprovidersettings$factory.coalCount = jsonobject.optInt("coalCount", + chunkprovidersettings$factory.coalCount); + chunkprovidersettings$factory.coalMinHeight = jsonobject.optInt("coalMinHeight", + chunkprovidersettings$factory.coalMinHeight); + chunkprovidersettings$factory.coalMaxHeight = jsonobject.optInt("coalMaxHeight", + chunkprovidersettings$factory.coalMaxHeight); + chunkprovidersettings$factory.ironSize = jsonobject.optInt("ironSize", + chunkprovidersettings$factory.ironSize); + chunkprovidersettings$factory.ironCount = jsonobject.optInt("ironCount", + chunkprovidersettings$factory.ironCount); + chunkprovidersettings$factory.ironMinHeight = jsonobject.optInt("ironMinHeight", + chunkprovidersettings$factory.ironMinHeight); + chunkprovidersettings$factory.ironMaxHeight = jsonobject.optInt("ironMaxHeight", + chunkprovidersettings$factory.ironMaxHeight); + chunkprovidersettings$factory.goldSize = jsonobject.optInt("goldSize", + chunkprovidersettings$factory.goldSize); + chunkprovidersettings$factory.goldCount = jsonobject.optInt("goldCount", + chunkprovidersettings$factory.goldCount); + chunkprovidersettings$factory.goldMinHeight = jsonobject.optInt("goldMinHeight", + chunkprovidersettings$factory.goldMinHeight); + chunkprovidersettings$factory.goldMaxHeight = jsonobject.optInt("goldMaxHeight", + chunkprovidersettings$factory.goldMaxHeight); + chunkprovidersettings$factory.redstoneSize = jsonobject.optInt("redstoneSize", + chunkprovidersettings$factory.redstoneSize); + chunkprovidersettings$factory.redstoneCount = jsonobject.optInt("redstoneCount", + chunkprovidersettings$factory.redstoneCount); + chunkprovidersettings$factory.redstoneMinHeight = jsonobject.optInt("redstoneMinHeight", + chunkprovidersettings$factory.redstoneMinHeight); + chunkprovidersettings$factory.redstoneMaxHeight = jsonobject.optInt("redstoneMaxHeight", + chunkprovidersettings$factory.redstoneMaxHeight); + chunkprovidersettings$factory.diamondSize = jsonobject.optInt("diamondSize", + chunkprovidersettings$factory.diamondSize); + chunkprovidersettings$factory.diamondCount = jsonobject.optInt("diamondCount", + chunkprovidersettings$factory.diamondCount); + chunkprovidersettings$factory.diamondMinHeight = jsonobject.optInt("diamondMinHeight", + chunkprovidersettings$factory.diamondMinHeight); + chunkprovidersettings$factory.diamondMaxHeight = jsonobject.optInt("diamondMaxHeight", + chunkprovidersettings$factory.diamondMaxHeight); + chunkprovidersettings$factory.lapisSize = jsonobject.optInt("lapisSize", + chunkprovidersettings$factory.lapisSize); + chunkprovidersettings$factory.lapisCount = jsonobject.optInt("lapisCount", + chunkprovidersettings$factory.lapisCount); + chunkprovidersettings$factory.lapisCenterHeight = jsonobject.optInt("lapisCenterHeight", + chunkprovidersettings$factory.lapisCenterHeight); + chunkprovidersettings$factory.lapisSpread = jsonobject.optInt("lapisSpread", + chunkprovidersettings$factory.lapisSpread); + } catch (Exception var7) { + ; + } + + return chunkprovidersettings$factory; + } + + public JSONObject serialize(ChunkProviderSettings.Factory parFactory) throws JSONException { + JSONObject jsonobject = new JSONObject(); + jsonobject.put("coordinateScale", Float.valueOf(parFactory.coordinateScale)); + jsonobject.put("heightScale", Float.valueOf(parFactory.heightScale)); + jsonobject.put("lowerLimitScale", Float.valueOf(parFactory.lowerLimitScale)); + jsonobject.put("upperLimitScale", Float.valueOf(parFactory.upperLimitScale)); + jsonobject.put("depthNoiseScaleX", Float.valueOf(parFactory.depthNoiseScaleX)); + jsonobject.put("depthNoiseScaleZ", Float.valueOf(parFactory.depthNoiseScaleZ)); + jsonobject.put("depthNoiseScaleExponent", Float.valueOf(parFactory.depthNoiseScaleExponent)); + jsonobject.put("mainNoiseScaleX", Float.valueOf(parFactory.mainNoiseScaleX)); + jsonobject.put("mainNoiseScaleY", Float.valueOf(parFactory.mainNoiseScaleY)); + jsonobject.put("mainNoiseScaleZ", Float.valueOf(parFactory.mainNoiseScaleZ)); + jsonobject.put("baseSize", Float.valueOf(parFactory.baseSize)); + jsonobject.put("stretchY", Float.valueOf(parFactory.stretchY)); + jsonobject.put("biomeDepthWeight", Float.valueOf(parFactory.biomeDepthWeight)); + jsonobject.put("biomeDepthOffset", Float.valueOf(parFactory.biomeDepthOffset)); + jsonobject.put("biomeScaleWeight", Float.valueOf(parFactory.biomeScaleWeight)); + jsonobject.put("biomeScaleOffset", Float.valueOf(parFactory.biomeScaleOffset)); + jsonobject.put("seaLevel", Integer.valueOf(parFactory.seaLevel)); + jsonobject.put("useCaves", Boolean.valueOf(parFactory.useCaves)); + jsonobject.put("useDungeons", Boolean.valueOf(parFactory.useDungeons)); + jsonobject.put("dungeonChance", Integer.valueOf(parFactory.dungeonChance)); + jsonobject.put("useStrongholds", Boolean.valueOf(parFactory.useStrongholds)); + jsonobject.put("useVillages", Boolean.valueOf(parFactory.useVillages)); + jsonobject.put("useMineShafts", Boolean.valueOf(parFactory.useMineShafts)); + jsonobject.put("useTemples", Boolean.valueOf(parFactory.useTemples)); + jsonobject.put("useMonuments", Boolean.valueOf(parFactory.useMonuments)); + jsonobject.put("useRavines", Boolean.valueOf(parFactory.useRavines)); + jsonobject.put("useWaterLakes", Boolean.valueOf(parFactory.useWaterLakes)); + jsonobject.put("waterLakeChance", Integer.valueOf(parFactory.waterLakeChance)); + jsonobject.put("useLavaLakes", Boolean.valueOf(parFactory.useLavaLakes)); + jsonobject.put("lavaLakeChance", Integer.valueOf(parFactory.lavaLakeChance)); + jsonobject.put("useLavaOceans", Boolean.valueOf(parFactory.useLavaOceans)); + jsonobject.put("fixedBiome", Integer.valueOf(parFactory.fixedBiome)); + jsonobject.put("biomeSize", Integer.valueOf(parFactory.biomeSize)); + jsonobject.put("riverSize", Integer.valueOf(parFactory.riverSize)); + jsonobject.put("dirtSize", Integer.valueOf(parFactory.dirtSize)); + jsonobject.put("dirtCount", Integer.valueOf(parFactory.dirtCount)); + jsonobject.put("dirtMinHeight", Integer.valueOf(parFactory.dirtMinHeight)); + jsonobject.put("dirtMaxHeight", Integer.valueOf(parFactory.dirtMaxHeight)); + jsonobject.put("gravelSize", Integer.valueOf(parFactory.gravelSize)); + jsonobject.put("gravelCount", Integer.valueOf(parFactory.gravelCount)); + jsonobject.put("gravelMinHeight", Integer.valueOf(parFactory.gravelMinHeight)); + jsonobject.put("gravelMaxHeight", Integer.valueOf(parFactory.gravelMaxHeight)); + jsonobject.put("graniteSize", Integer.valueOf(parFactory.graniteSize)); + jsonobject.put("graniteCount", Integer.valueOf(parFactory.graniteCount)); + jsonobject.put("graniteMinHeight", Integer.valueOf(parFactory.graniteMinHeight)); + jsonobject.put("graniteMaxHeight", Integer.valueOf(parFactory.graniteMaxHeight)); + jsonobject.put("dioriteSize", Integer.valueOf(parFactory.dioriteSize)); + jsonobject.put("dioriteCount", Integer.valueOf(parFactory.dioriteCount)); + jsonobject.put("dioriteMinHeight", Integer.valueOf(parFactory.dioriteMinHeight)); + jsonobject.put("dioriteMaxHeight", Integer.valueOf(parFactory.dioriteMaxHeight)); + jsonobject.put("andesiteSize", Integer.valueOf(parFactory.andesiteSize)); + jsonobject.put("andesiteCount", Integer.valueOf(parFactory.andesiteCount)); + jsonobject.put("andesiteMinHeight", Integer.valueOf(parFactory.andesiteMinHeight)); + jsonobject.put("andesiteMaxHeight", Integer.valueOf(parFactory.andesiteMaxHeight)); + jsonobject.put("coalSize", Integer.valueOf(parFactory.coalSize)); + jsonobject.put("coalCount", Integer.valueOf(parFactory.coalCount)); + jsonobject.put("coalMinHeight", Integer.valueOf(parFactory.coalMinHeight)); + jsonobject.put("coalMaxHeight", Integer.valueOf(parFactory.coalMaxHeight)); + jsonobject.put("ironSize", Integer.valueOf(parFactory.ironSize)); + jsonobject.put("ironCount", Integer.valueOf(parFactory.ironCount)); + jsonobject.put("ironMinHeight", Integer.valueOf(parFactory.ironMinHeight)); + jsonobject.put("ironMaxHeight", Integer.valueOf(parFactory.ironMaxHeight)); + jsonobject.put("goldSize", Integer.valueOf(parFactory.goldSize)); + jsonobject.put("goldCount", Integer.valueOf(parFactory.goldCount)); + jsonobject.put("goldMinHeight", Integer.valueOf(parFactory.goldMinHeight)); + jsonobject.put("goldMaxHeight", Integer.valueOf(parFactory.goldMaxHeight)); + jsonobject.put("redstoneSize", Integer.valueOf(parFactory.redstoneSize)); + jsonobject.put("redstoneCount", Integer.valueOf(parFactory.redstoneCount)); + jsonobject.put("redstoneMinHeight", Integer.valueOf(parFactory.redstoneMinHeight)); + jsonobject.put("redstoneMaxHeight", Integer.valueOf(parFactory.redstoneMaxHeight)); + jsonobject.put("diamondSize", Integer.valueOf(parFactory.diamondSize)); + jsonobject.put("diamondCount", Integer.valueOf(parFactory.diamondCount)); + jsonobject.put("diamondMinHeight", Integer.valueOf(parFactory.diamondMinHeight)); + jsonobject.put("diamondMaxHeight", Integer.valueOf(parFactory.diamondMaxHeight)); + jsonobject.put("lapisSize", Integer.valueOf(parFactory.lapisSize)); + jsonobject.put("lapisCount", Integer.valueOf(parFactory.lapisCount)); + jsonobject.put("lapisCenterHeight", Integer.valueOf(parFactory.lapisCenterHeight)); + jsonobject.put("lapisSpread", Integer.valueOf(parFactory.lapisSpread)); + return jsonobject; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatGeneratorInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatGeneratorInfo.java new file mode 100644 index 0000000..b39c08b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatGeneratorInfo.java @@ -0,0 +1,285 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.FlatLayerInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 FlatGeneratorInfo { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/FlatGeneratorInfo"); + } + + /**+ + * List of layers on this preset. + */ + private final List flatLayers = Lists.newArrayList(); + private final Map> worldFeatures = Maps.newHashMap(); + private int biomeToUse; + + /**+ + * Return the biome used on this preset. + */ + public int getBiome() { + return this.biomeToUse; + } + + /**+ + * Set the biome used on this preset. + */ + public void setBiome(int parInt1) { + this.biomeToUse = parInt1; + } + + public Map> getWorldFeatures() { + return this.worldFeatures; + } + + /**+ + * Return the list of layers on this preset. + */ + public List getFlatLayers() { + return this.flatLayers; + } + + public void func_82645_d() { + int i = 0; + + for (FlatLayerInfo flatlayerinfo : this.flatLayers) { + flatlayerinfo.setMinY(i); + i += flatlayerinfo.getLayerCount(); + } + + } + + public String toString() { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append(3); + stringbuilder.append(";"); + + for (int i = 0; i < this.flatLayers.size(); ++i) { + if (i > 0) { + stringbuilder.append(","); + } + + stringbuilder.append(((FlatLayerInfo) this.flatLayers.get(i)).toString()); + } + + stringbuilder.append(";"); + stringbuilder.append(this.biomeToUse); + if (!this.worldFeatures.isEmpty()) { + stringbuilder.append(";"); + int k = 0; + + for (Entry entry : this.worldFeatures.entrySet()) { + if (k++ > 0) { + stringbuilder.append(","); + } + + stringbuilder.append(((String) entry.getKey()).toLowerCase()); + Map map = (Map) entry.getValue(); + if (!map.isEmpty()) { + stringbuilder.append("("); + int j = 0; + + for (Entry entry1 : (Set) map.entrySet()) { + if (j++ > 0) { + stringbuilder.append(" "); + } + + stringbuilder.append((String) entry1.getKey()); + stringbuilder.append("="); + stringbuilder.append((String) entry1.getValue()); + } + + stringbuilder.append(")"); + } + } + } else { + stringbuilder.append(";"); + } + + return stringbuilder.toString(); + } + + private static FlatLayerInfo func_180715_a(int parInt1, String parString1, int parInt2) { + String[] astring = parInt1 >= 3 ? parString1.split("\\*", 2) : parString1.split("x", 2); + int i = 1; + int j = 0; + if (astring.length == 2) { + try { + i = Integer.parseInt(astring[0]); + if (parInt2 + i >= 256) { + i = 256 - parInt2; + } + + if (i < 0) { + i = 0; + } + } catch (Throwable var8) { + return null; + } + } + + Block block = null; + + try { + String s = astring[astring.length - 1]; + if (parInt1 < 3) { + astring = s.split(":", 2); + if (astring.length > 1) { + j = Integer.parseInt(astring[1]); + } + + block = Block.getBlockById(Integer.parseInt(astring[0])); + } else { + astring = s.split(":", 3); + block = astring.length > 1 ? Block.getBlockFromName(astring[0] + ":" + astring[1]) : null; + if (block != null) { + j = astring.length > 2 ? Integer.parseInt(astring[2]) : 0; + } else { + block = Block.getBlockFromName(astring[0]); + if (block != null) { + j = astring.length > 1 ? Integer.parseInt(astring[1]) : 0; + } + } + + if (block == null) { + return null; + } + } + + if (block == Blocks.air) { + j = 0; + } + + if (j < 0 || j > 15) { + j = 0; + } + } catch (Throwable var9) { + return null; + } + + FlatLayerInfo flatlayerinfo = new FlatLayerInfo(parInt1, i, block, j); + flatlayerinfo.setMinY(parInt2); + return flatlayerinfo; + } + + private static List func_180716_a(int parInt1, String parString1) { + if (parString1 != null && parString1.length() >= 1) { + ArrayList arraylist = Lists.newArrayList(); + String[] astring = parString1.split(","); + int i = 0; + + for (String s : astring) { + FlatLayerInfo flatlayerinfo = func_180715_a(parInt1, s, i); + if (flatlayerinfo == null) { + return null; + } + + arraylist.add(flatlayerinfo); + i += flatlayerinfo.getLayerCount(); + } + + return arraylist; + } else { + return null; + } + } + + public static FlatGeneratorInfo createFlatGeneratorFromString(String parString1) { + if (parString1 == null) { + return getDefaultFlatGenerator(); + } else { + String[] astring = parString1.split(";", -1); + int i = astring.length == 1 ? 0 : MathHelper.parseIntWithDefault(astring[0], 0); + if (i >= 0 && i <= 3) { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + int j = astring.length == 1 ? 0 : 1; + List list = func_180716_a(i, astring[j++]); + if (list != null && !list.isEmpty()) { + flatgeneratorinfo.getFlatLayers().addAll(list); + flatgeneratorinfo.func_82645_d(); + int k = BiomeGenBase.plains.biomeID; + if (i > 0 && astring.length > j) { + k = MathHelper.parseIntWithDefault(astring[j++], k); + } + + flatgeneratorinfo.setBiome(k); + if (i > 0 && astring.length > j) { + String[] astring1 = astring[j++].toLowerCase().split(","); + + for (String s : astring1) { + String[] astring2 = s.split("\\(", 2); + HashMap hashmap = Maps.newHashMap(); + if (astring2[0].length() > 0) { + flatgeneratorinfo.getWorldFeatures().put(astring2[0], hashmap); + if (astring2.length > 1 && astring2[1].endsWith(")") && astring2[1].length() > 1) { + String[] astring3 = astring2[1].substring(0, astring2[1].length() - 1).split(" "); + + for (int l = 0; l < astring3.length; ++l) { + String[] astring4 = astring3[l].split("=", 2); + if (astring4.length == 2) { + hashmap.put(astring4[0], astring4[1]); + } + } + } + } + } + } else { + flatgeneratorinfo.getWorldFeatures().put("village", Maps.newHashMap()); + } + + return flatgeneratorinfo; + } else { + return getDefaultFlatGenerator(); + } + } else { + return getDefaultFlatGenerator(); + } + } + } + + public static FlatGeneratorInfo getDefaultFlatGenerator() { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + flatgeneratorinfo.setBiome(BiomeGenBase.plains.biomeID); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.bedrock)); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(2, Blocks.dirt)); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.grass)); + flatgeneratorinfo.func_82645_d(); + flatgeneratorinfo.getWorldFeatures().put("village", Maps.newHashMap()); + return flatgeneratorinfo; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatLayerInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatLayerInfo.java new file mode 100644 index 0000000..cca3bc9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatLayerInfo.java @@ -0,0 +1,116 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 FlatLayerInfo { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/FlatLayerInfo"); + } + + private final int field_175902_a; + private IBlockState field_175901_b; + private int layerCount; + private int layerMinimumY; + + public FlatLayerInfo(int parInt1, Block parBlock) { + this(3, parInt1, parBlock); + } + + public FlatLayerInfo(int parInt1, int parInt2, Block parBlock) { + this.layerCount = 1; + this.field_175902_a = parInt1; + this.layerCount = parInt2; + this.field_175901_b = parBlock.getDefaultState(); + } + + public FlatLayerInfo(int parInt1, int parInt2, Block parBlock, int parInt3) { + this(parInt1, parInt2, parBlock); + this.field_175901_b = parBlock.getStateFromMeta(parInt3); + } + + /**+ + * Return the amount of layers for this set of layers. + */ + public int getLayerCount() { + return this.layerCount; + } + + public IBlockState func_175900_c() { + return this.field_175901_b; + } + + private Block func_151536_b() { + return this.field_175901_b.getBlock(); + } + + /**+ + * Return the block metadata used on this set of layers. + */ + private int getFillBlockMeta() { + return this.field_175901_b.getBlock().getMetaFromState(this.field_175901_b); + } + + /**+ + * Return the minimum Y coordinate for this layer, set during + * generation. + */ + public int getMinY() { + return this.layerMinimumY; + } + + /**+ + * Set the minimum Y coordinate for this layer. + */ + public void setMinY(int parInt1) { + this.layerMinimumY = parInt1; + } + + public String toString() { + String s; + if (this.field_175902_a >= 3) { + ResourceLocation resourcelocation = (ResourceLocation) Block.blockRegistry + .getNameForObject(this.func_151536_b()); + s = resourcelocation == null ? "null" : resourcelocation.toString(); + if (this.layerCount > 1) { + s = this.layerCount + "*" + s; + } + } else { + s = Integer.toString(Block.getIdFromBlock(this.func_151536_b())); + if (this.layerCount > 1) { + s = this.layerCount + "x" + s; + } + } + + int i = this.getFillBlockMeta(); + if (i > 0) { + s = s + ":" + i; + } + + return s; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/GeneratorBushFeature.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/GeneratorBushFeature.java new file mode 100644 index 0000000..ca95961 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/GeneratorBushFeature.java @@ -0,0 +1,55 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockBush; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GeneratorBushFeature extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/GeneratorBushFeature"); + } + + private BlockBush field_175908_a; + + public GeneratorBushFeature(BlockBush parBlockBush) { + this.field_175908_a = parBlockBush; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 64; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) && (!world.provider.getHasNoSky() || blockpos1.getY() < 255) + && this.field_175908_a.canBlockStay(world, blockpos1, this.field_175908_a.getDefaultState())) { + world.setBlockState(blockpos1, this.field_175908_a.getDefaultState(), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenBase.java new file mode 100644 index 0000000..2a552f8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenBase.java @@ -0,0 +1,69 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.IChunkProvider; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/MapGenBase"); + } + + /**+ + * The number of Chunks to gen-check in any given direction. + */ + protected int range = 8; + /**+ + * The RNG used by the MapGen classes. + */ + protected EaglercraftRandom rand = new EaglercraftRandom(); + protected World worldObj; + + public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn) { + int i = this.range; + this.worldObj = worldIn; + this.rand.setSeed(worldIn.getSeed()); + long j = this.rand.nextLong(); + long k = this.rand.nextLong(); + + for (int l = x - i; l <= x + i; ++l) { + for (int i1 = z - i; i1 <= z + i; ++i1) { + long j1 = (long) l * j; + long k1 = (long) i1 * k; + this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed()); + this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn); + } + } + + } + + /**+ + * Recursively called by generate() + */ + protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, ChunkPrimer var6) { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCaves.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCaves.java new file mode 100644 index 0000000..615adaa --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCaves.java @@ -0,0 +1,279 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import com.google.common.base.Objects; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenCaves extends MapGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/MapGenCaves"); + } + + protected void func_180703_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1, + double parDouble2, double parDouble3) { + this.func_180702_a(parLong1, parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, parDouble3, + 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_180702_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1, + double parDouble2, double parDouble3, float parFloat1, float parFloat2, float parFloat3, int parInt3, + int parInt4, double parDouble4) { + double d0 = (double) (parInt1 * 16 + 8); + double d1 = (double) (parInt2 * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + EaglercraftRandom random = new EaglercraftRandom(parLong1); + if (parInt4 <= 0) { + int i = this.range * 16 - 16; + parInt4 = i - random.nextInt(i / 4); + } + + boolean flag2 = false; + if (parInt3 == -1) { + parInt3 = parInt4 / 2; + flag2 = true; + } + + int j = random.nextInt(parInt4 / 2) + parInt4 / 4; + + for (boolean flag = random.nextInt(6) == 0; parInt3 < parInt4; ++parInt3) { + double d2 = 1.5D + + (double) (MathHelper.sin((float) parInt3 * 3.1415927F / (float) parInt4) * parFloat1 * 1.0F); + double d3 = d2 * parDouble4; + float f2 = MathHelper.cos(parFloat3); + float f3 = MathHelper.sin(parFloat3); + parDouble1 += (double) (MathHelper.cos(parFloat2) * f2); + parDouble2 += (double) f3; + parDouble3 += (double) (MathHelper.sin(parFloat2) * f2); + if (flag) { + parFloat3 = parFloat3 * 0.92F; + } else { + parFloat3 = parFloat3 * 0.7F; + } + + parFloat3 = parFloat3 + f1 * 0.1F; + parFloat2 += f * 0.1F; + f1 = f1 * 0.9F; + f = f * 0.75F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + if (!flag2 && parInt3 == j && parFloat1 > 1.0F && parInt4 > 0) { + this.func_180702_a(random.nextLong(), parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, + parDouble3, random.nextFloat() * 0.5F + 0.5F, parFloat2 - 1.5707964F, parFloat3 / 3.0F, parInt3, + parInt4, 1.0D); + this.func_180702_a(random.nextLong(), parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, + parDouble3, random.nextFloat() * 0.5F + 0.5F, parFloat2 + 1.5707964F, parFloat3 / 3.0F, parInt3, + parInt4, 1.0D); + return; + } + + if (flag2 || random.nextInt(4) != 0) { + double d4 = parDouble1 - d0; + double d5 = parDouble3 - d1; + double d6 = (double) (parInt4 - parInt3); + double d7 = (double) (parFloat1 + 2.0F + 16.0F); + if (d4 * d4 + d5 * d5 - d6 * d6 > d7 * d7) { + return; + } + + if (parDouble1 >= d0 - 16.0D - d2 * 2.0D && parDouble3 >= d1 - 16.0D - d2 * 2.0D + && parDouble1 <= d0 + 16.0D + d2 * 2.0D && parDouble3 <= d1 + 16.0D + d2 * 2.0D) { + int k2 = MathHelper.floor_double(parDouble1 - d2) - parInt1 * 16 - 1; + int k = MathHelper.floor_double(parDouble1 + d2) - parInt1 * 16 + 1; + int l2 = MathHelper.floor_double(parDouble2 - d3) - 1; + int l = MathHelper.floor_double(parDouble2 + d3) + 1; + int i3 = MathHelper.floor_double(parDouble3 - d2) - parInt2 * 16 - 1; + int i1 = MathHelper.floor_double(parDouble3 + d2) - parInt2 * 16 + 1; + if (k2 < 0) { + k2 = 0; + } + + if (k > 16) { + k = 16; + } + + if (l2 < 1) { + l2 = 1; + } + + if (l > 248) { + l = 248; + } + + if (i3 < 0) { + i3 = 0; + } + + if (i1 > 16) { + i1 = 16; + } + + boolean flag3 = false; + + for (int j1 = k2; !flag3 && j1 < k; ++j1) { + for (int k1 = i3; !flag3 && k1 < i1; ++k1) { + for (int l1 = l + 1; !flag3 && l1 >= l2 - 1; --l1) { + if (l1 >= 0 && l1 < 256) { + IBlockState iblockstate = parChunkPrimer.getBlockState(j1, l1, k1); + if (iblockstate.getBlock() == Blocks.flowing_water + || iblockstate.getBlock() == Blocks.water) { + flag3 = true; + } + + if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1) { + l1 = l2; + } + } + } + } + } + + if (!flag3) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j3 = k2; j3 < k; ++j3) { + double d10 = ((double) (j3 + parInt1 * 16) + 0.5D - parDouble1) / d2; + + for (int i2 = i3; i2 < i1; ++i2) { + double d8 = ((double) (i2 + parInt2 * 16) + 0.5D - parDouble3) / d2; + boolean flag1 = false; + if (d10 * d10 + d8 * d8 < 1.0D) { + for (int j2 = l; j2 > l2; --j2) { + double d9 = ((double) (j2 - 1) + 0.5D - parDouble2) / d3; + if (d9 > -0.7D && d10 * d10 + d9 * d9 + d8 * d8 < 1.0D) { + IBlockState iblockstate1 = parChunkPrimer.getBlockState(j3, j2, i2); + IBlockState iblockstate2 = (IBlockState) Objects.firstNonNull( + parChunkPrimer.getBlockState(j3, j2 + 1, i2), + Blocks.air.getDefaultState()); + if (iblockstate1.getBlock() == Blocks.grass + || iblockstate1.getBlock() == Blocks.mycelium) { + flag1 = true; + } + + if (this.func_175793_a(iblockstate1, iblockstate2)) { + if (j2 - 1 < 10) { + parChunkPrimer.setBlockState(j3, j2, i2, + Blocks.lava.getDefaultState()); + } else { + parChunkPrimer.setBlockState(j3, j2, i2, + Blocks.air.getDefaultState()); + if (iblockstate2.getBlock() == Blocks.sand) { + parChunkPrimer.setBlockState(j3, j2 + 1, i2, + iblockstate2.getValue( + BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND + ? Blocks.red_sandstone.getDefaultState() + : Blocks.sandstone.getDefaultState()); + } + + if (flag1 && parChunkPrimer.getBlockState(j3, j2 - 1, i2) + .getBlock() == Blocks.dirt) { + blockpos$mutableblockpos.func_181079_c(j3 + parInt1 * 16, 0, + i2 + parInt2 * 16); + parChunkPrimer.setBlockState(j3, j2 - 1, i2, + this.worldObj.getBiomeGenForCoords( + blockpos$mutableblockpos).topBlock.getBlock() + .getDefaultState()); + } + } + } + } + } + } + } + } + + if (flag2) { + break; + } + } + } + } + } + + } + + protected boolean func_175793_a(IBlockState parIBlockState, IBlockState parIBlockState2) { + return parIBlockState.getBlock() == Blocks.stone ? true + : (parIBlockState.getBlock() == Blocks.dirt ? true + : (parIBlockState.getBlock() == Blocks.grass ? true + : (parIBlockState.getBlock() == Blocks.hardened_clay ? true + : (parIBlockState.getBlock() == Blocks.stained_hardened_clay ? true + : (parIBlockState.getBlock() == Blocks.sandstone ? true + : (parIBlockState.getBlock() == Blocks.red_sandstone ? true + : (parIBlockState.getBlock() == Blocks.mycelium ? true + : (parIBlockState + .getBlock() == Blocks.snow_layer + ? true + : (parIBlockState + .getBlock() == Blocks.sand + || parIBlockState + .getBlock() == Blocks.gravel) + && parIBlockState2 + .getBlock() + .getMaterial() != Material.water)))))))); + } + + /**+ + * Recursively called by generate() + */ + protected void recursiveGenerate(World var1, int i, int j, int k, int l, ChunkPrimer chunkprimer) { + int i1 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(15) + 1) + 1); + if (this.rand.nextInt(7) != 0) { + i1 = 0; + } + + for (int j1 = 0; j1 < i1; ++j1) { + double d0 = (double) (i * 16 + this.rand.nextInt(16)); + double d1 = (double) this.rand.nextInt(this.rand.nextInt(120) + 8); + double d2 = (double) (j * 16 + this.rand.nextInt(16)); + int k1 = 1; + if (this.rand.nextInt(4) == 0) { + this.func_180703_a(this.rand.nextLong(), k, l, chunkprimer, d0, d1, d2); + k1 += this.rand.nextInt(4); + } + + for (int l1 = 0; l1 < k1; ++l1) { + float f = this.rand.nextFloat() * 3.1415927F * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + if (this.rand.nextInt(10) == 0) { + f2 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; + } + + this.func_180702_a(this.rand.nextLong(), k, l, chunkprimer, d0, d1, d2, f2, f, f1, 0, 0, 1.0D); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCavesHell.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCavesHell.java new file mode 100644 index 0000000..b579a6d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCavesHell.java @@ -0,0 +1,217 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenCavesHell extends MapGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/MapGenCavesHell"); + } + + protected void func_180705_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1, + double parDouble2, double parDouble3) { + this.func_180704_a(parLong1, parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, parDouble3, + 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_180704_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1, + double parDouble2, double parDouble3, float parFloat1, float parFloat2, float parFloat3, int parInt3, + int parInt4, double parDouble4) { + double d0 = (double) (parInt1 * 16 + 8); + double d1 = (double) (parInt2 * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + EaglercraftRandom random = new EaglercraftRandom(parLong1); + if (parInt4 <= 0) { + int i = this.range * 16 - 16; + parInt4 = i - random.nextInt(i / 4); + } + + boolean flag1 = false; + if (parInt3 == -1) { + parInt3 = parInt4 / 2; + flag1 = true; + } + + int j = random.nextInt(parInt4 / 2) + parInt4 / 4; + + for (boolean flag = random.nextInt(6) == 0; parInt3 < parInt4; ++parInt3) { + double d2 = 1.5D + + (double) (MathHelper.sin((float) parInt3 * 3.1415927F / (float) parInt4) * parFloat1 * 1.0F); + double d3 = d2 * parDouble4; + float f2 = MathHelper.cos(parFloat3); + float f3 = MathHelper.sin(parFloat3); + parDouble1 += (double) (MathHelper.cos(parFloat2) * f2); + parDouble2 += (double) f3; + parDouble3 += (double) (MathHelper.sin(parFloat2) * f2); + if (flag) { + parFloat3 = parFloat3 * 0.92F; + } else { + parFloat3 = parFloat3 * 0.7F; + } + + parFloat3 = parFloat3 + f1 * 0.1F; + parFloat2 += f * 0.1F; + f1 = f1 * 0.9F; + f = f * 0.75F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + if (!flag1 && parInt3 == j && parFloat1 > 1.0F) { + this.func_180704_a(random.nextLong(), parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, + parDouble3, random.nextFloat() * 0.5F + 0.5F, parFloat2 - 1.5707964F, parFloat3 / 3.0F, parInt3, + parInt4, 1.0D); + this.func_180704_a(random.nextLong(), parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, + parDouble3, random.nextFloat() * 0.5F + 0.5F, parFloat2 + 1.5707964F, parFloat3 / 3.0F, parInt3, + parInt4, 1.0D); + return; + } + + if (flag1 || random.nextInt(4) != 0) { + double d4 = parDouble1 - d0; + double d5 = parDouble3 - d1; + double d6 = (double) (parInt4 - parInt3); + double d7 = (double) (parFloat1 + 2.0F + 16.0F); + if (d4 * d4 + d5 * d5 - d6 * d6 > d7 * d7) { + return; + } + + if (parDouble1 >= d0 - 16.0D - d2 * 2.0D && parDouble3 >= d1 - 16.0D - d2 * 2.0D + && parDouble1 <= d0 + 16.0D + d2 * 2.0D && parDouble3 <= d1 + 16.0D + d2 * 2.0D) { + int j2 = MathHelper.floor_double(parDouble1 - d2) - parInt1 * 16 - 1; + int k = MathHelper.floor_double(parDouble1 + d2) - parInt1 * 16 + 1; + int k2 = MathHelper.floor_double(parDouble2 - d3) - 1; + int l = MathHelper.floor_double(parDouble2 + d3) + 1; + int l2 = MathHelper.floor_double(parDouble3 - d2) - parInt2 * 16 - 1; + int i1 = MathHelper.floor_double(parDouble3 + d2) - parInt2 * 16 + 1; + if (j2 < 0) { + j2 = 0; + } + + if (k > 16) { + k = 16; + } + + if (k2 < 1) { + k2 = 1; + } + + if (l > 120) { + l = 120; + } + + if (l2 < 0) { + l2 = 0; + } + + if (i1 > 16) { + i1 = 16; + } + + boolean flag2 = false; + + for (int j1 = j2; !flag2 && j1 < k; ++j1) { + for (int k1 = l2; !flag2 && k1 < i1; ++k1) { + for (int l1 = l + 1; !flag2 && l1 >= k2 - 1; --l1) { + if (l1 >= 0 && l1 < 128) { + IBlockState iblockstate = parChunkPrimer.getBlockState(j1, l1, k1); + if (iblockstate.getBlock() == Blocks.flowing_lava + || iblockstate.getBlock() == Blocks.lava) { + flag2 = true; + } + + if (l1 != k2 - 1 && j1 != j2 && j1 != k - 1 && k1 != l2 && k1 != i1 - 1) { + l1 = k2; + } + } + } + } + } + + if (!flag2) { + for (int i3 = j2; i3 < k; ++i3) { + double d10 = ((double) (i3 + parInt1 * 16) + 0.5D - parDouble1) / d2; + + for (int j3 = l2; j3 < i1; ++j3) { + double d8 = ((double) (j3 + parInt2 * 16) + 0.5D - parDouble3) / d2; + + for (int i2 = l; i2 > k2; --i2) { + double d9 = ((double) (i2 - 1) + 0.5D - parDouble2) / d3; + if (d9 > -0.7D && d10 * d10 + d9 * d9 + d8 * d8 < 1.0D) { + IBlockState iblockstate1 = parChunkPrimer.getBlockState(i3, i2, j3); + if (iblockstate1.getBlock() == Blocks.netherrack + || iblockstate1.getBlock() == Blocks.dirt + || iblockstate1.getBlock() == Blocks.grass) { + parChunkPrimer.setBlockState(i3, i2, j3, Blocks.air.getDefaultState()); + } + } + } + } + } + + if (flag1) { + break; + } + } + } + } + } + + } + + /**+ + * Recursively called by generate() + */ + protected void recursiveGenerate(World var1, int i, int j, int k, int l, ChunkPrimer chunkprimer) { + int i1 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1); + if (this.rand.nextInt(5) != 0) { + i1 = 0; + } + + for (int j1 = 0; j1 < i1; ++j1) { + double d0 = (double) (i * 16 + this.rand.nextInt(16)); + double d1 = (double) this.rand.nextInt(128); + double d2 = (double) (j * 16 + this.rand.nextInt(16)); + int k1 = 1; + if (this.rand.nextInt(4) == 0) { + this.func_180705_a(this.rand.nextLong(), k, l, chunkprimer, d0, d1, d2); + k1 += this.rand.nextInt(4); + } + + for (int l1 = 0; l1 < k1; ++l1) { + float f = this.rand.nextFloat() * 3.1415927F * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + this.func_180704_a(this.rand.nextLong(), k, l, chunkprimer, d0, d1, d2, f2 * 2.0F, f, f1, 0, 0, 0.5D); + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenRavine.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenRavine.java new file mode 100644 index 0000000..68cf700 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenRavine.java @@ -0,0 +1,225 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenRavine extends MapGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/MapGenRavine"); + } + + private float[] field_75046_d = new float[1024]; + + protected void func_180707_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1, + double parDouble2, double parDouble3, float parFloat1, float parFloat2, float parFloat3, int parInt3, + int parInt4, double parDouble4) { + EaglercraftRandom random = new EaglercraftRandom(parLong1); + double d0 = (double) (parInt1 * 16 + 8); + double d1 = (double) (parInt2 * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + if (parInt4 <= 0) { + int i = this.range * 16 - 16; + parInt4 = i - random.nextInt(i / 4); + } + + boolean flag1 = false; + if (parInt3 == -1) { + parInt3 = parInt4 / 2; + flag1 = true; + } + + float f2 = 1.0F; + + for (int j = 0; j < 256; ++j) { + if (j == 0 || random.nextInt(3) == 0) { + f2 = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F; + } + + this.field_75046_d[j] = f2 * f2; + } + + for (; parInt3 < parInt4; ++parInt3) { + double d9 = 1.5D + + (double) (MathHelper.sin((float) parInt3 * 3.1415927F / (float) parInt4) * parFloat1 * 1.0F); + double d2 = d9 * parDouble4; + d9 = d9 * ((double) random.nextFloat() * 0.25D + 0.75D); + d2 = d2 * ((double) random.nextFloat() * 0.25D + 0.75D); + float f3 = MathHelper.cos(parFloat3); + float f4 = MathHelper.sin(parFloat3); + parDouble1 += (double) (MathHelper.cos(parFloat2) * f3); + parDouble2 += (double) f4; + parDouble3 += (double) (MathHelper.sin(parFloat2) * f3); + parFloat3 = parFloat3 * 0.7F; + parFloat3 = parFloat3 + f1 * 0.05F; + parFloat2 += f * 0.05F; + f1 = f1 * 0.8F; + f = f * 0.5F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + if (flag1 || random.nextInt(4) != 0) { + double d3 = parDouble1 - d0; + double d4 = parDouble3 - d1; + double d5 = (double) (parInt4 - parInt3); + double d6 = (double) (parFloat1 + 2.0F + 16.0F); + if (d3 * d3 + d4 * d4 - d5 * d5 > d6 * d6) { + return; + } + + if (parDouble1 >= d0 - 16.0D - d9 * 2.0D && parDouble3 >= d1 - 16.0D - d9 * 2.0D + && parDouble1 <= d0 + 16.0D + d9 * 2.0D && parDouble3 <= d1 + 16.0D + d9 * 2.0D) { + int k2 = MathHelper.floor_double(parDouble1 - d9) - parInt1 * 16 - 1; + int k = MathHelper.floor_double(parDouble1 + d9) - parInt1 * 16 + 1; + int l2 = MathHelper.floor_double(parDouble2 - d2) - 1; + int l = MathHelper.floor_double(parDouble2 + d2) + 1; + int i3 = MathHelper.floor_double(parDouble3 - d9) - parInt2 * 16 - 1; + int i1 = MathHelper.floor_double(parDouble3 + d9) - parInt2 * 16 + 1; + if (k2 < 0) { + k2 = 0; + } + + if (k > 16) { + k = 16; + } + + if (l2 < 1) { + l2 = 1; + } + + if (l > 248) { + l = 248; + } + + if (i3 < 0) { + i3 = 0; + } + + if (i1 > 16) { + i1 = 16; + } + + boolean flag2 = false; + + for (int j1 = k2; !flag2 && j1 < k; ++j1) { + for (int k1 = i3; !flag2 && k1 < i1; ++k1) { + for (int l1 = l + 1; !flag2 && l1 >= l2 - 1; --l1) { + if (l1 >= 0 && l1 < 256) { + IBlockState iblockstate = parChunkPrimer.getBlockState(j1, l1, k1); + if (iblockstate.getBlock() == Blocks.flowing_water + || iblockstate.getBlock() == Blocks.water) { + flag2 = true; + } + + if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1) { + l1 = l2; + } + } + } + } + } + + if (!flag2) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j3 = k2; j3 < k; ++j3) { + double d10 = ((double) (j3 + parInt1 * 16) + 0.5D - parDouble1) / d9; + + for (int i2 = i3; i2 < i1; ++i2) { + double d7 = ((double) (i2 + parInt2 * 16) + 0.5D - parDouble3) / d9; + boolean flag = false; + if (d10 * d10 + d7 * d7 < 1.0D) { + for (int j2 = l; j2 > l2; --j2) { + double d8 = ((double) (j2 - 1) + 0.5D - parDouble2) / d2; + if ((d10 * d10 + d7 * d7) * (double) this.field_75046_d[j2 - 1] + + d8 * d8 / 6.0D < 1.0D) { + IBlockState iblockstate1 = parChunkPrimer.getBlockState(j3, j2, i2); + if (iblockstate1.getBlock() == Blocks.grass) { + flag = true; + } + + if (iblockstate1.getBlock() == Blocks.stone + || iblockstate1.getBlock() == Blocks.dirt + || iblockstate1.getBlock() == Blocks.grass) { + if (j2 - 1 < 10) { + parChunkPrimer.setBlockState(j3, j2, i2, + Blocks.flowing_lava.getDefaultState()); + } else { + parChunkPrimer.setBlockState(j3, j2, i2, + Blocks.air.getDefaultState()); + if (flag && parChunkPrimer.getBlockState(j3, j2 - 1, i2) + .getBlock() == Blocks.dirt) { + blockpos$mutableblockpos.func_181079_c(j3 + parInt1 * 16, 0, + i2 + parInt2 * 16); + parChunkPrimer.setBlockState(j3, j2 - 1, i2, + this.worldObj.getBiomeGenForCoords( + blockpos$mutableblockpos).topBlock); + } + } + } + } + } + } + } + } + + if (flag1) { + break; + } + } + } + } + } + + } + + /**+ + * Recursively called by generate() + */ + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int chunkPrimerIn, int parInt4, + ChunkPrimer parChunkPrimer) { + if (this.rand.nextInt(50) == 0) { + double d0 = (double) (chunkX * 16 + this.rand.nextInt(16)); + double d1 = (double) (this.rand.nextInt(this.rand.nextInt(40) + 8) + 20); + double d2 = (double) (chunkZ * 16 + this.rand.nextInt(16)); + byte b0 = 1; + + for (int i = 0; i < b0; ++i) { + float f = this.rand.nextFloat() * 3.1415927F * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; + this.func_180707_a(this.rand.nextLong(), chunkPrimerIn, parInt4, parChunkPrimer, d0, d1, d2, f2, f, f1, + 0, 0, 3.0D); + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGenerator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGenerator.java new file mode 100644 index 0000000..6977089 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGenerator.java @@ -0,0 +1,31 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class NoiseGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/NoiseGenerator"); + } + +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorImproved.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorImproved.java new file mode 100644 index 0000000..7ebc7a1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorImproved.java @@ -0,0 +1,216 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NoiseGeneratorImproved extends NoiseGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/NoiseGeneratorImproved"); + } + + private int[] permutations; + public double xCoord; + public double yCoord; + public double zCoord; + private static final double[] field_152381_e = new double[] { 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, + 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D }; + private static final double[] field_152382_f = new double[] { 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, + 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D }; + private static final double[] field_152383_g = new double[] { 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, + 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D }; + private static final double[] field_152384_h = new double[] { 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, + 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D }; + private static final double[] field_152385_i = new double[] { 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, + 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D }; + + public NoiseGeneratorImproved() { + this(new EaglercraftRandom()); + } + + public NoiseGeneratorImproved(EaglercraftRandom parRandom) { + this.permutations = new int[512]; + this.xCoord = parRandom.nextDouble() * 256.0D; + this.yCoord = parRandom.nextDouble() * 256.0D; + this.zCoord = parRandom.nextDouble() * 256.0D; + + for (int i = 0; i < 256; this.permutations[i] = i++) { + ; + } + + for (int l = 0; l < 256; ++l) { + int j = parRandom.nextInt(256 - l) + l; + int k = this.permutations[l]; + this.permutations[l] = this.permutations[j]; + this.permutations[j] = k; + this.permutations[l + 256] = this.permutations[l]; + } + + } + + public final double lerp(double parDouble1, double parDouble2, double parDouble3) { + return parDouble2 + parDouble1 * (parDouble3 - parDouble2); + } + + public final double func_76309_a(int parInt1, double parDouble1, double parDouble2) { + int i = parInt1 & 15; + return field_152384_h[i] * parDouble1 + field_152385_i[i] * parDouble2; + } + + public final double grad(int parInt1, double parDouble1, double parDouble2, double parDouble3) { + int i = parInt1 & 15; + return field_152381_e[i] * parDouble1 + field_152382_f[i] * parDouble2 + field_152383_g[i] * parDouble3; + } + + /**+ + * pars: noiseArray , xOffset , yOffset , zOffset , xSize , + * ySize , zSize , xScale, yScale , zScale , noiseScale. + * noiseArray should be xSize*ySize*zSize in size + */ + public void populateNoiseArray(double[] parArrayOfDouble, double parDouble1, double parDouble2, double parDouble3, + int parInt1, int parInt2, int parInt3, double parDouble4, double parDouble5, double parDouble6, + double parDouble7) { + if (parInt2 == 1) { + int i5 = 0; + int j5 = 0; + int j = 0; + int k5 = 0; + double d14 = 0.0D; + double d15 = 0.0D; + int l5 = 0; + double d16 = 1.0D / parDouble7; + + for (int j2 = 0; j2 < parInt1; ++j2) { + double d17 = parDouble1 + (double) j2 * parDouble4 + this.xCoord; + int i6 = (int) d17; + if (d17 < (double) i6) { + --i6; + } + + int k2 = i6 & 255; + d17 = d17 - (double) i6; + double d18 = d17 * d17 * d17 * (d17 * (d17 * 6.0D - 15.0D) + 10.0D); + + for (int j6 = 0; j6 < parInt3; ++j6) { + double d19 = parDouble3 + (double) j6 * parDouble6 + this.zCoord; + int k6 = (int) d19; + if (d19 < (double) k6) { + --k6; + } + + int l6 = k6 & 255; + d19 = d19 - (double) k6; + double d20 = d19 * d19 * d19 * (d19 * (d19 * 6.0D - 15.0D) + 10.0D); + i5 = this.permutations[k2] + 0; + j5 = this.permutations[i5] + l6; + j = this.permutations[k2 + 1] + 0; + k5 = this.permutations[j] + l6; + d14 = this.lerp(d18, this.func_76309_a(this.permutations[j5], d17, d19), + this.grad(this.permutations[k5], d17 - 1.0D, 0.0D, d19)); + d15 = this.lerp(d18, this.grad(this.permutations[j5 + 1], d17, 0.0D, d19 - 1.0D), + this.grad(this.permutations[k5 + 1], d17 - 1.0D, 0.0D, d19 - 1.0D)); + double d21 = this.lerp(d20, d14, d15); + int i7 = l5++; + parArrayOfDouble[i7] += d21 * d16; + } + } + + } else { + int i = 0; + double d0 = 1.0D / parDouble7; + int k = -1; + int l = 0; + int i1 = 0; + int j1 = 0; + int k1 = 0; + int l1 = 0; + int i2 = 0; + double d1 = 0.0D; + double d2 = 0.0D; + double d3 = 0.0D; + double d4 = 0.0D; + + for (int l2 = 0; l2 < parInt1; ++l2) { + double d5 = parDouble1 + (double) l2 * parDouble4 + this.xCoord; + int i3 = (int) d5; + if (d5 < (double) i3) { + --i3; + } + + int j3 = i3 & 255; + d5 = d5 - (double) i3; + double d6 = d5 * d5 * d5 * (d5 * (d5 * 6.0D - 15.0D) + 10.0D); + + for (int k3 = 0; k3 < parInt3; ++k3) { + double d7 = parDouble3 + (double) k3 * parDouble6 + this.zCoord; + int l3 = (int) d7; + if (d7 < (double) l3) { + --l3; + } + + int i4 = l3 & 255; + d7 = d7 - (double) l3; + double d8 = d7 * d7 * d7 * (d7 * (d7 * 6.0D - 15.0D) + 10.0D); + + for (int j4 = 0; j4 < parInt2; ++j4) { + double d9 = parDouble2 + (double) j4 * parDouble5 + this.yCoord; + int k4 = (int) d9; + if (d9 < (double) k4) { + --k4; + } + + int l4 = k4 & 255; + d9 = d9 - (double) k4; + double d10 = d9 * d9 * d9 * (d9 * (d9 * 6.0D - 15.0D) + 10.0D); + if (j4 == 0 || l4 != k) { + k = l4; + l = this.permutations[j3] + l4; + i1 = this.permutations[l] + i4; + j1 = this.permutations[l + 1] + i4; + k1 = this.permutations[j3 + 1] + l4; + l1 = this.permutations[k1] + i4; + i2 = this.permutations[k1 + 1] + i4; + d1 = this.lerp(d6, this.grad(this.permutations[i1], d5, d9, d7), + this.grad(this.permutations[l1], d5 - 1.0D, d9, d7)); + d2 = this.lerp(d6, this.grad(this.permutations[j1], d5, d9 - 1.0D, d7), + this.grad(this.permutations[i2], d5 - 1.0D, d9 - 1.0D, d7)); + d3 = this.lerp(d6, this.grad(this.permutations[i1 + 1], d5, d9, d7 - 1.0D), + this.grad(this.permutations[l1 + 1], d5 - 1.0D, d9, d7 - 1.0D)); + d4 = this.lerp(d6, this.grad(this.permutations[j1 + 1], d5, d9 - 1.0D, d7 - 1.0D), + this.grad(this.permutations[i2 + 1], d5 - 1.0D, d9 - 1.0D, d7 - 1.0D)); + } + + double d11 = this.lerp(d10, d1, d2); + double d12 = this.lerp(d10, d3, d4); + double d13 = this.lerp(d8, d11, d12); + int j7 = i++; + parArrayOfDouble[j7] += d13 * d0; + } + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorOctaves.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorOctaves.java new file mode 100644 index 0000000..34c2938 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorOctaves.java @@ -0,0 +1,92 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorImproved; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NoiseGeneratorOctaves extends NoiseGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/NoiseGeneratorOctaves"); + } + + private NoiseGeneratorImproved[] generatorCollection; + private int octaves; + + public NoiseGeneratorOctaves(EaglercraftRandom parRandom, int parInt1) { + this.octaves = parInt1; + this.generatorCollection = new NoiseGeneratorImproved[parInt1]; + + for (int i = 0; i < parInt1; ++i) { + this.generatorCollection[i] = new NoiseGeneratorImproved(parRandom); + } + + } + + /**+ + * Bouncer function to the main one with some default arguments. + */ + public double[] generateNoiseOctaves(double[] parArrayOfDouble, int parInt1, int parInt2, int parInt3, int parInt4, + int parInt5, int parInt6, double parDouble1, double parDouble2, double parDouble3) { + if (parArrayOfDouble == null) { + parArrayOfDouble = new double[parInt4 * parInt5 * parInt6]; + } else { + for (int i = 0; i < parArrayOfDouble.length; ++i) { + parArrayOfDouble[i] = 0.0D; + } + } + + double d3 = 1.0D; + + for (int j = 0; j < this.octaves; ++j) { + double d0 = (double) parInt1 * d3 * parDouble1; + double d1 = (double) parInt2 * d3 * parDouble2; + double d2 = (double) parInt3 * d3 * parDouble3; + long k = MathHelper.floor_double_long(d0); + long l = MathHelper.floor_double_long(d2); + d0 = d0 - (double) k; + d2 = d2 - (double) l; + k = k % 16777216L; + l = l % 16777216L; + d0 = d0 + (double) k; + d2 = d2 + (double) l; + this.generatorCollection[j].populateNoiseArray(parArrayOfDouble, d0, d1, d2, parInt4, parInt5, parInt6, + parDouble1 * d3, parDouble2 * d3, parDouble3 * d3, d3); + d3 /= 2.0D; + } + + return parArrayOfDouble; + } + + /**+ + * Bouncer function to the main one with some default arguments. + */ + public double[] generateNoiseOctaves(double[] parArrayOfDouble, int parInt1, int parInt2, int parInt3, int parInt4, + double parDouble1, double parDouble2, double parDouble3) { + return this.generateNoiseOctaves(parArrayOfDouble, parInt1, 10, parInt2, parInt3, 1, parInt4, parDouble1, 1.0D, + parDouble2); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorPerlin.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorPerlin.java new file mode 100644 index 0000000..7328bec --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorPerlin.java @@ -0,0 +1,88 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGenerator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.NoiseGeneratorSimplex; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NoiseGeneratorPerlin extends NoiseGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/NoiseGeneratorPerlin"); + } + + private NoiseGeneratorSimplex[] field_151603_a; + private int field_151602_b; + + public NoiseGeneratorPerlin(EaglercraftRandom parRandom, int parInt1) { + this.field_151602_b = parInt1; + this.field_151603_a = new NoiseGeneratorSimplex[parInt1]; + + for (int i = 0; i < parInt1; ++i) { + this.field_151603_a[i] = new NoiseGeneratorSimplex(parRandom); + } + + } + + public double func_151601_a(double parDouble1, double parDouble2) { + double d0 = 0.0D; + double d1 = 1.0D; + + for (int i = 0; i < this.field_151602_b; ++i) { + d0 += this.field_151603_a[i].func_151605_a(parDouble1 * d1, parDouble2 * d1) / d1; + d1 /= 2.0D; + } + + return d0; + } + + public double[] func_151599_a(double[] parArrayOfDouble, double parDouble1, double parDouble2, int parInt1, + int parInt2, double parDouble3, double parDouble4, double parDouble5) { + return this.func_151600_a(parArrayOfDouble, parDouble1, parDouble2, parInt1, parInt2, parDouble3, parDouble4, + parDouble5, 0.5D); + } + + public double[] func_151600_a(double[] parArrayOfDouble, double parDouble1, double parDouble2, int parInt1, + int parInt2, double parDouble3, double parDouble4, double parDouble5, double parDouble6) { + if (parArrayOfDouble != null && parArrayOfDouble.length >= parInt1 * parInt2) { + for (int i = 0; i < parArrayOfDouble.length; ++i) { + parArrayOfDouble[i] = 0.0D; + } + } else { + parArrayOfDouble = new double[parInt1 * parInt2]; + } + + double d1 = 1.0D; + double d0 = 1.0D; + + for (int j = 0; j < this.field_151602_b; ++j) { + this.field_151603_a[j].func_151606_a(parArrayOfDouble, parDouble1, parDouble2, parInt1, parInt2, + parDouble3 * d0 * d1, parDouble4 * d0 * d1, 0.55D / d1); + d0 *= parDouble5; + d1 *= parDouble6; + } + + return parArrayOfDouble; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorSimplex.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorSimplex.java new file mode 100644 index 0000000..f2a8817 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorSimplex.java @@ -0,0 +1,205 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 NoiseGeneratorSimplex { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/NoiseGeneratorSimplex"); + } + + private static int[][] field_151611_e = new int[][] { { 1, 1, 0 }, { -1, 1, 0 }, { 1, -1, 0 }, { -1, -1, 0 }, + { 1, 0, 1 }, { -1, 0, 1 }, { 1, 0, -1 }, { -1, 0, -1 }, { 0, 1, 1 }, { 0, -1, 1 }, { 0, 1, -1 }, + { 0, -1, -1 } }; + public static final double field_151614_a = Math.sqrt(3.0D); + private int[] field_151608_f; + public double field_151612_b; + public double field_151613_c; + public double field_151610_d; + private static final double field_151609_g = 0.5D * (field_151614_a - 1.0D); + private static final double field_151615_h = (3.0D - field_151614_a) / 6.0D; + + public NoiseGeneratorSimplex() { + this(new EaglercraftRandom()); + } + + public NoiseGeneratorSimplex(EaglercraftRandom parRandom) { + this.field_151608_f = new int[512]; + this.field_151612_b = parRandom.nextDouble() * 256.0D; + this.field_151613_c = parRandom.nextDouble() * 256.0D; + this.field_151610_d = parRandom.nextDouble() * 256.0D; + + for (int i = 0; i < 256; this.field_151608_f[i] = i++) { + ; + } + + for (int l = 0; l < 256; ++l) { + int j = parRandom.nextInt(256 - l) + l; + int k = this.field_151608_f[l]; + this.field_151608_f[l] = this.field_151608_f[j]; + this.field_151608_f[j] = k; + this.field_151608_f[l + 256] = this.field_151608_f[l]; + } + + } + + private static int func_151607_a(double parDouble1) { + return parDouble1 > 0.0D ? (int) parDouble1 : (int) parDouble1 - 1; + } + + private static double func_151604_a(int[] parArrayOfInt, double parDouble1, double parDouble2) { + return (double) parArrayOfInt[0] * parDouble1 + (double) parArrayOfInt[1] * parDouble2; + } + + public double func_151605_a(double parDouble1, double parDouble2) { + double d3 = 0.5D * (field_151614_a - 1.0D); + double d4 = (parDouble1 + parDouble2) * d3; + int i = func_151607_a(parDouble1 + d4); + int j = func_151607_a(parDouble2 + d4); + double d5 = (3.0D - field_151614_a) / 6.0D; + double d6 = (double) (i + j) * d5; + double d7 = (double) i - d6; + double d8 = (double) j - d6; + double d9 = parDouble1 - d7; + double d10 = parDouble2 - d8; + byte b0; + byte b1; + if (d9 > d10) { + b0 = 1; + b1 = 0; + } else { + b0 = 0; + b1 = 1; + } + + double d11 = d9 - (double) b0 + d5; + double d12 = d10 - (double) b1 + d5; + double d13 = d9 - 1.0D + 2.0D * d5; + double d14 = d10 - 1.0D + 2.0D * d5; + int k = i & 255; + int l = j & 255; + int i1 = this.field_151608_f[k + this.field_151608_f[l]] % 12; + int j1 = this.field_151608_f[k + b0 + this.field_151608_f[l + b1]] % 12; + int k1 = this.field_151608_f[k + 1 + this.field_151608_f[l + 1]] % 12; + double d15 = 0.5D - d9 * d9 - d10 * d10; + double d0; + if (d15 < 0.0D) { + d0 = 0.0D; + } else { + d15 = d15 * d15; + d0 = d15 * d15 * func_151604_a(field_151611_e[i1], d9, d10); + } + + double d16 = 0.5D - d11 * d11 - d12 * d12; + double d1; + if (d16 < 0.0D) { + d1 = 0.0D; + } else { + d16 = d16 * d16; + d1 = d16 * d16 * func_151604_a(field_151611_e[j1], d11, d12); + } + + double d17 = 0.5D - d13 * d13 - d14 * d14; + double d2; + if (d17 < 0.0D) { + d2 = 0.0D; + } else { + d17 = d17 * d17; + d2 = d17 * d17 * func_151604_a(field_151611_e[k1], d13, d14); + } + + return 70.0D * (d0 + d1 + d2); + } + + public void func_151606_a(double[] parArrayOfDouble, double parDouble1, double parDouble2, int parInt1, int parInt2, + double parDouble3, double parDouble4, double parDouble5) { + int i = 0; + + for (int j = 0; j < parInt2; ++j) { + double d0 = (parDouble2 + (double) j) * parDouble4 + this.field_151613_c; + + for (int k = 0; k < parInt1; ++k) { + double d1 = (parDouble1 + (double) k) * parDouble3 + this.field_151612_b; + double d5 = (d1 + d0) * field_151609_g; + int l = func_151607_a(d1 + d5); + int i1 = func_151607_a(d0 + d5); + double d6 = (double) (l + i1) * field_151615_h; + double d7 = (double) l - d6; + double d8 = (double) i1 - d6; + double d9 = d1 - d7; + double d10 = d0 - d8; + byte b0; + byte b1; + if (d9 > d10) { + b0 = 1; + b1 = 0; + } else { + b0 = 0; + b1 = 1; + } + + double d11 = d9 - (double) b0 + field_151615_h; + double d12 = d10 - (double) b1 + field_151615_h; + double d13 = d9 - 1.0D + 2.0D * field_151615_h; + double d14 = d10 - 1.0D + 2.0D * field_151615_h; + int j1 = l & 255; + int k1 = i1 & 255; + int l1 = this.field_151608_f[j1 + this.field_151608_f[k1]] % 12; + int i2 = this.field_151608_f[j1 + b0 + this.field_151608_f[k1 + b1]] % 12; + int j2 = this.field_151608_f[j1 + 1 + this.field_151608_f[k1 + 1]] % 12; + double d15 = 0.5D - d9 * d9 - d10 * d10; + double d2; + if (d15 < 0.0D) { + d2 = 0.0D; + } else { + d15 = d15 * d15; + d2 = d15 * d15 * func_151604_a(field_151611_e[l1], d9, d10); + } + + double d16 = 0.5D - d11 * d11 - d12 * d12; + double d3; + if (d16 < 0.0D) { + d3 = 0.0D; + } else { + d16 = d16 * d16; + d3 = d16 * d16 * func_151604_a(field_151611_e[i2], d11, d12); + } + + double d17 = 0.5D - d13 * d13 - d14 * d14; + double d4; + if (d17 < 0.0D) { + d4 = 0.0D; + } else { + d17 = d17 * d17; + d4 = d17 * d17 * func_151604_a(field_151611_e[j2], d13, d14); + } + + int k2 = i++; + parArrayOfDouble[k2] += 70.0D * (d2 + d3 + d4) * parDouble5; + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenAbstractTree.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenAbstractTree.java new file mode 100644 index 0000000..c433bc6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenAbstractTree.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldGenAbstractTree extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenAbstractTree"); + } + + public WorldGenAbstractTree(boolean parFlag) { + super(parFlag); + } + + protected boolean func_150523_a(Block parBlock) { + Material material = parBlock.getMaterial(); + return material == Material.air || material == Material.leaves || parBlock == Blocks.grass + || parBlock == Blocks.dirt || parBlock == Blocks.log || parBlock == Blocks.log2 + || parBlock == Blocks.sapling || parBlock == Blocks.vine; + } + + public void func_180711_a(World worldIn, EaglercraftRandom parRandom, BlockPos parBlockPos) { + } + + protected void func_175921_a(World worldIn, BlockPos parBlockPos) { + if (worldIn.getBlockState(parBlockPos).getBlock() != Blocks.dirt) { + this.setBlockAndNotifyAdequately(worldIn, parBlockPos, Blocks.dirt.getDefaultState()); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigMushroom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigMushroom.java new file mode 100644 index 0000000..2ccf70b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -0,0 +1,197 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockHugeMushroom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenBigMushroom extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenBigMushroom"); + } + + private Block mushroomType; + + public WorldGenBigMushroom(Block parBlock) { + super(true); + this.mushroomType = parBlock; + } + + public WorldGenBigMushroom() { + super(false); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (this.mushroomType == null) { + this.mushroomType = random.nextBoolean() ? Blocks.brown_mushroom_block : Blocks.red_mushroom_block; + } + + int i = random.nextInt(3) + 4; + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 < 256) { + for (int j = blockpos.getY(); j <= blockpos.getY() + 1 + i; ++j) { + byte b0 = 3; + if (j <= blockpos.getY() + 3) { + b0 = 0; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) { + for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) { + if (j >= 0 && j < 256) { + Block block = world.getBlockState(blockpos$mutableblockpos.func_181079_c(k, j, l)) + .getBlock(); + if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) { + flag = false; + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + if (block1 != Blocks.dirt && block1 != Blocks.grass && block1 != Blocks.mycelium) { + return false; + } else { + int j2 = blockpos.getY() + i; + if (this.mushroomType == Blocks.red_mushroom_block) { + j2 = blockpos.getY() + i - 3; + } + + for (int k2 = j2; k2 <= blockpos.getY() + i; ++k2) { + int i3 = 1; + if (k2 < blockpos.getY() + i) { + ++i3; + } + + if (this.mushroomType == Blocks.brown_mushroom_block) { + i3 = 3; + } + + int j3 = blockpos.getX() - i3; + int k3 = blockpos.getX() + i3; + int i1 = blockpos.getZ() - i3; + int j1 = blockpos.getZ() + i3; + + for (int k1 = j3; k1 <= k3; ++k1) { + for (int l1 = i1; l1 <= j1; ++l1) { + int i2 = 5; + if (k1 == j3) { + --i2; + } else if (k1 == k3) { + ++i2; + } + + if (l1 == i1) { + i2 -= 3; + } else if (l1 == j1) { + i2 += 3; + } + + BlockHugeMushroom.EnumType blockhugemushroom$enumtype = BlockHugeMushroom.EnumType + .byMetadata(i2); + if (this.mushroomType == Blocks.brown_mushroom_block || k2 < blockpos.getY() + i) { + if ((k1 == j3 || k1 == k3) && (l1 == i1 || l1 == j1)) { + continue; + } + + if (k1 == blockpos.getX() - (i3 - 1) && l1 == i1) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_WEST; + } + + if (k1 == j3 && l1 == blockpos.getZ() - (i3 - 1)) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_WEST; + } + + if (k1 == blockpos.getX() + (i3 - 1) && l1 == i1) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_EAST; + } + + if (k1 == k3 && l1 == blockpos.getZ() - (i3 - 1)) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_EAST; + } + + if (k1 == blockpos.getX() - (i3 - 1) && l1 == j1) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_WEST; + } + + if (k1 == j3 && l1 == blockpos.getZ() + (i3 - 1)) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_WEST; + } + + if (k1 == blockpos.getX() + (i3 - 1) && l1 == j1) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_EAST; + } + + if (k1 == k3 && l1 == blockpos.getZ() + (i3 - 1)) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_EAST; + } + } + + if (blockhugemushroom$enumtype == BlockHugeMushroom.EnumType.CENTER + && k2 < blockpos.getY() + i) { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.ALL_INSIDE; + } + + if (blockpos.getY() >= blockpos.getY() + i - 1 + || blockhugemushroom$enumtype != BlockHugeMushroom.EnumType.ALL_INSIDE) { + BlockPos blockpos1 = new BlockPos(k1, k2, l1); + if (!world.getBlockState(blockpos1).getBlock().isFullBlock()) { + this.setBlockAndNotifyAdequately(world, blockpos1, + this.mushroomType.getDefaultState().withProperty( + BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype)); + } + } + } + } + } + + for (int l2 = 0; l2 < i; ++l2) { + Block block2 = world.getBlockState(blockpos.up(l2)).getBlock(); + if (!block2.isFullBlock()) { + this.setBlockAndNotifyAdequately(world, blockpos.up(l2), this.mushroomType.getDefaultState() + .withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM)); + } + } + + return true; + } + } + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigTree.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigTree.java new file mode 100644 index 0000000..e210c04 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigTree.java @@ -0,0 +1,347 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenBigTree extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenBigTree"); + } + + private EaglercraftRandom rand; + private World world; + private BlockPos basePos = BlockPos.ORIGIN; + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + int trunkSize = 1; + int heightLimitLimit = 12; + int leafDistanceLimit = 4; + List field_175948_j; + + public WorldGenBigTree(boolean parFlag) { + super(parFlag); + } + + /**+ + * Generates a list of leaf nodes for the tree, to be populated + * by generateLeaves. + */ + void generateLeafNodeList() { + this.height = (int) ((double) this.heightLimit * this.heightAttenuation); + if (this.height >= this.heightLimit) { + this.height = this.heightLimit - 1; + } + + int i = (int) (1.382D + Math.pow(this.leafDensity * (double) this.heightLimit / 13.0D, 2.0D)); + if (i < 1) { + i = 1; + } + + int j = this.basePos.getY() + this.height; + int k = this.heightLimit - this.leafDistanceLimit; + this.field_175948_j = Lists.newArrayList(); + this.field_175948_j.add(new WorldGenBigTree.FoliageCoordinates(this.basePos.up(k), j)); + + for (; k >= 0; --k) { + float f = this.layerSize(k); + if (f >= 0.0F) { + for (int l = 0; l < i; ++l) { + double d0 = this.scaleWidth * (double) f * ((double) rand.nextFloat() + 0.328D); + double d1 = (double) (rand.nextFloat() * 2.0F) * 3.141592653589793D; + double d2 = d0 * Math.sin(d1) + 0.5D; + double d3 = d0 * Math.cos(d1) + 0.5D; + BlockPos blockpos = this.basePos.add(d2, (double) (k - 1), d3); + BlockPos blockpos1 = blockpos.up(this.leafDistanceLimit); + if (this.checkBlockLine(blockpos, blockpos1) == -1) { + int i1 = this.basePos.getX() - blockpos.getX(); + int j1 = this.basePos.getZ() - blockpos.getZ(); + double d4 = (double) blockpos.getY() + - Math.sqrt((double) (i1 * i1 + j1 * j1)) * this.branchSlope; + int k1 = d4 > (double) j ? j : (int) d4; + BlockPos blockpos2 = new BlockPos(this.basePos.getX(), k1, this.basePos.getZ()); + if (this.checkBlockLine(blockpos2, blockpos) == -1) { + this.field_175948_j.add(new WorldGenBigTree.FoliageCoordinates(blockpos, blockpos2.getY())); + } + } + } + } + } + + } + + void func_181631_a(BlockPos parBlockPos, float parFloat1, IBlockState parIBlockState) { + int i = (int) ((double) parFloat1 + 0.618D); + + for (int j = -i; j <= i; ++j) { + for (int k = -i; k <= i; ++k) { + if (Math.pow((double) Math.abs(j) + 0.5D, 2.0D) + + Math.pow((double) Math.abs(k) + 0.5D, 2.0D) <= (double) (parFloat1 * parFloat1)) { + BlockPos blockpos = parBlockPos.add(j, 0, k); + Material material = this.world.getBlockState(blockpos).getBlock().getMaterial(); + if (material == Material.air || material == Material.leaves) { + this.setBlockAndNotifyAdequately(this.world, blockpos, parIBlockState); + } + } + } + } + + } + + /**+ + * Gets the rough size of a layer of the tree. + */ + float layerSize(int parInt1) { + if ((float) parInt1 < (float) this.heightLimit * 0.3F) { + return -1.0F; + } else { + float f = (float) this.heightLimit / 2.0F; + float f1 = f - (float) parInt1; + float f2 = MathHelper.sqrt_float(f * f - f1 * f1); + if (f1 == 0.0F) { + f2 = f; + } else if (Math.abs(f1) >= f) { + return 0.0F; + } + + return f2 * 0.5F; + } + } + + float leafSize(int parInt1) { + return parInt1 >= 0 && parInt1 < this.leafDistanceLimit + ? (parInt1 != 0 && parInt1 != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) + : -1.0F; + } + + /**+ + * Generates the leaves surrounding an individual entry in the + * leafNodes list. + */ + void generateLeafNode(BlockPos pos) { + for (int i = 0; i < this.leafDistanceLimit; ++i) { + this.func_181631_a(pos.up(i), this.leafSize(i), + Blocks.leaves.getDefaultState().withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false))); + } + + } + + void func_175937_a(BlockPos parBlockPos, BlockPos parBlockPos2, Block parBlock) { + BlockPos blockpos = parBlockPos2.add(-parBlockPos.getX(), -parBlockPos.getY(), -parBlockPos.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float) blockpos.getX() / (float) i; + float f1 = (float) blockpos.getY() / (float) i; + float f2 = (float) blockpos.getZ() / (float) i; + + for (int j = 0; j <= i; ++j) { + BlockPos blockpos1 = parBlockPos.add((double) (0.5F + (float) j * f), (double) (0.5F + (float) j * f1), + (double) (0.5F + (float) j * f2)); + BlockLog.EnumAxis blocklog$enumaxis = this.func_175938_b(parBlockPos, blockpos1); + this.setBlockAndNotifyAdequately(this.world, blockpos1, + parBlock.getDefaultState().withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis)); + } + + } + + /**+ + * Returns the absolute greatest distance in the BlockPos + * object. + */ + private int getGreatestDistance(BlockPos posIn) { + int i = MathHelper.abs_int(posIn.getX()); + int j = MathHelper.abs_int(posIn.getY()); + int k = MathHelper.abs_int(posIn.getZ()); + return k > i && k > j ? k : (j > i ? j : i); + } + + private BlockLog.EnumAxis func_175938_b(BlockPos parBlockPos, BlockPos parBlockPos2) { + BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y; + int i = Math.abs(parBlockPos2.getX() - parBlockPos.getX()); + int j = Math.abs(parBlockPos2.getZ() - parBlockPos.getZ()); + int k = Math.max(i, j); + if (k > 0) { + if (i == k) { + blocklog$enumaxis = BlockLog.EnumAxis.X; + } else if (j == k) { + blocklog$enumaxis = BlockLog.EnumAxis.Z; + } + } + + return blocklog$enumaxis; + } + + /**+ + * Generates the leaf portion of the tree as specified by the + * leafNodes list. + */ + void generateLeaves() { + for (WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j) { + this.generateLeafNode(worldgenbigtree$foliagecoordinates); + } + + } + + /**+ + * Indicates whether or not a leaf node requires additional wood + * to be added to preserve integrity. + */ + boolean leafNodeNeedsBase(int parInt1) { + return (double) parInt1 >= (double) this.heightLimit * 0.2D; + } + + /**+ + * Places the trunk for the big tree that is being generated. + * Able to generate double-sized trunks by changing a field that + * is always 1 to 2. + */ + void generateTrunk() { + BlockPos blockpos = this.basePos; + BlockPos blockpos1 = this.basePos.up(this.height); + Block block = Blocks.log; + this.func_175937_a(blockpos, blockpos1, block); + if (this.trunkSize == 2) { + this.func_175937_a(blockpos.east(), blockpos1.east(), block); + this.func_175937_a(blockpos.east().south(), blockpos1.east().south(), block); + this.func_175937_a(blockpos.south(), blockpos1.south(), block); + } + + } + + /**+ + * Generates additional wood blocks to fill out the bases of + * different leaf nodes that would otherwise degrade. + */ + void generateLeafNodeBases() { + for (WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j) { + int i = worldgenbigtree$foliagecoordinates.func_177999_q(); + BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ()); + if (!blockpos.equals(worldgenbigtree$foliagecoordinates) + && this.leafNodeNeedsBase(i - this.basePos.getY())) { + this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates, Blocks.log); + } + } + + } + + /**+ + * Checks a line of blocks in the world from the first + * coordinate to triplet to the second, returning the distance + * (in blocks) before a non-air, non-leaf block is encountered + * and/or the end is encountered. + */ + int checkBlockLine(BlockPos posOne, BlockPos posTwo) { + BlockPos blockpos = posTwo.add(-posOne.getX(), -posOne.getY(), -posOne.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float) blockpos.getX() / (float) i; + float f1 = (float) blockpos.getY() / (float) i; + float f2 = (float) blockpos.getZ() / (float) i; + if (i == 0) { + return -1; + } else { + for (int j = 0; j <= i; ++j) { + BlockPos blockpos1 = posOne.add((double) (0.5F + (float) j * f), (double) (0.5F + (float) j * f1), + (double) (0.5F + (float) j * f2)); + if (!this.func_150523_a(this.world.getBlockState(blockpos1).getBlock())) { + return j; + } + } + + return -1; + } + } + + public void func_175904_e() { + this.leafDistanceLimit = 5; + } + + public boolean generate(World worldIn, EaglercraftRandom rand, BlockPos position) { + this.world = worldIn; + this.basePos = position; + this.rand = new EaglercraftRandom(rand.nextLong()); + if (this.heightLimit == 0) { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) { + return false; + } else { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + return true; + } + } + + /**+ + * Returns a boolean indicating whether or not the current + * location for the tree, spanning basePos to to the height + * limit, is valid. + */ + private boolean validTreeLocation() { + Block block = this.world.getBlockState(this.basePos.down()).getBlock(); + if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland) { + return false; + } else { + int i = this.checkBlockLine(this.basePos, this.basePos.up(this.heightLimit - 1)); + if (i == -1) { + return true; + } else if (i < 6) { + return false; + } else { + this.heightLimit = i; + return true; + } + } + } + + static class FoliageCoordinates extends BlockPos { + private final int field_178000_b; + + public FoliageCoordinates(BlockPos parBlockPos, int parInt1) { + super(parBlockPos.getX(), parBlockPos.getY(), parBlockPos.getZ()); + this.field_178000_b = parInt1; + } + + public int func_177999_q() { + return this.field_178000_b; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBlockBlob.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBlockBlob.java new file mode 100644 index 0000000..e318c30 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBlockBlob.java @@ -0,0 +1,89 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenBlockBlob extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenBlockBlob"); + } + + private final Block field_150545_a; + private final int field_150544_b; + + public WorldGenBlockBlob(Block parBlock, int parInt1) { + super(false); + this.field_150545_a = parBlock; + this.field_150544_b = parInt1; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + while (true) { + label0: { + if (blockpos.getY() > 3) { + if (world.isAirBlock(blockpos.down())) { + break label0; + } + + Block block = world.getBlockState(blockpos.down()).getBlock(); + if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.stone) { + break label0; + } + } + + if (blockpos.getY() <= 3) { + return false; + } + + int i1 = this.field_150544_b; + + for (int i = 0; i1 >= 0 && i < 3; ++i) { + int j = i1 + random.nextInt(2); + int k = i1 + random.nextInt(2); + int l = i1 + random.nextInt(2); + float f = (float) (j + k + l) * 0.333F + 0.5F; + + for (BlockPos blockpos1 : BlockPos.getAllInBox(blockpos.add(-j, -k, -l), blockpos.add(j, k, l))) { + if (blockpos1.distanceSq(blockpos) <= (double) (f * f)) { + world.setBlockState(blockpos1, this.field_150545_a.getDefaultState(), 4); + } + } + + blockpos = blockpos.add(-(i1 + 1) + random.nextInt(2 + i1 * 2), 0 - random.nextInt(2), + -(i1 + 1) + random.nextInt(2 + i1 * 2)); + } + + return true; + } + + blockpos = blockpos.down(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCactus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCactus.java new file mode 100644 index 0000000..79880bf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCactus.java @@ -0,0 +1,54 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenCactus extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenCactus"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 10; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1)) { + int j = 1 + random.nextInt(random.nextInt(3) + 1); + + for (int k = 0; k < j; ++k) { + if (Blocks.cactus.canBlockStay(world, blockpos1)) { + world.setBlockState(blockpos1.up(k), Blocks.cactus.getDefaultState(), 2); + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCanopyTree.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCanopyTree.java new file mode 100644 index 0000000..8ec2742 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCanopyTree.java @@ -0,0 +1,207 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNewLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNewLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenCanopyTree extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenCanopyTree"); + } + + private static final IBlockState field_181640_a = Blocks.log2.getDefaultState().withProperty(BlockNewLog.VARIANT, + BlockPlanks.EnumType.DARK_OAK); + private static final IBlockState field_181641_b = Blocks.leaves2.getDefaultState() + .withProperty(BlockNewLeaf.VARIANT, BlockPlanks.EnumType.DARK_OAK) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenCanopyTree(boolean parFlag) { + super(parFlag); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = random.nextInt(3) + random.nextInt(2) + 6; + int j = blockpos.getX(); + int k = blockpos.getY(); + int l = blockpos.getZ(); + if (k >= 1 && k + i + 1 < 256) { + BlockPos blockpos1 = blockpos.down(); + Block block = world.getBlockState(blockpos1).getBlock(); + if (block != Blocks.grass && block != Blocks.dirt) { + return false; + } else if (!this.func_181638_a(world, blockpos, i)) { + return false; + } else { + this.func_175921_a(world, blockpos1); + this.func_175921_a(world, blockpos1.east()); + this.func_175921_a(world, blockpos1.south()); + this.func_175921_a(world, blockpos1.south().east()); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(random); + int i1 = i - random.nextInt(4); + int j1 = 2 - random.nextInt(3); + int k1 = j; + int l1 = l; + int i2 = k + i - 1; + + for (int j2 = 0; j2 < i; ++j2) { + if (j2 >= i1 && j1 > 0) { + k1 += enumfacing.getFrontOffsetX(); + l1 += enumfacing.getFrontOffsetZ(); + --j1; + } + + int k2 = k + j2; + BlockPos blockpos2 = new BlockPos(k1, k2, l1); + Material material = world.getBlockState(blockpos2).getBlock().getMaterial(); + if (material == Material.air || material == Material.leaves) { + this.func_181639_b(world, blockpos2); + this.func_181639_b(world, blockpos2.east()); + this.func_181639_b(world, blockpos2.south()); + this.func_181639_b(world, blockpos2.east().south()); + } + } + + for (int i3 = -2; i3 <= 0; ++i3) { + for (int l3 = -2; l3 <= 0; ++l3) { + byte b0 = -1; + this.func_150526_a(world, k1 + i3, i2 + b0, l1 + l3); + this.func_150526_a(world, 1 + k1 - i3, i2 + b0, l1 + l3); + this.func_150526_a(world, k1 + i3, i2 + b0, 1 + l1 - l3); + this.func_150526_a(world, 1 + k1 - i3, i2 + b0, 1 + l1 - l3); + if ((i3 > -2 || l3 > -1) && (i3 != -1 || l3 != -2)) { + b0 = 1; + this.func_150526_a(world, k1 + i3, i2 + b0, l1 + l3); + this.func_150526_a(world, 1 + k1 - i3, i2 + b0, l1 + l3); + this.func_150526_a(world, k1 + i3, i2 + b0, 1 + l1 - l3); + this.func_150526_a(world, 1 + k1 - i3, i2 + b0, 1 + l1 - l3); + } + } + } + + if (random.nextBoolean()) { + this.func_150526_a(world, k1, i2 + 2, l1); + this.func_150526_a(world, k1 + 1, i2 + 2, l1); + this.func_150526_a(world, k1 + 1, i2 + 2, l1 + 1); + this.func_150526_a(world, k1, i2 + 2, l1 + 1); + } + + for (int j3 = -3; j3 <= 4; ++j3) { + for (int i4 = -3; i4 <= 4; ++i4) { + if ((j3 != -3 || i4 != -3) && (j3 != -3 || i4 != 4) && (j3 != 4 || i4 != -3) + && (j3 != 4 || i4 != 4) && (Math.abs(j3) < 3 || Math.abs(i4) < 3)) { + this.func_150526_a(world, k1 + j3, i2, l1 + i4); + } + } + } + + for (int k3 = -1; k3 <= 2; ++k3) { + for (int j4 = -1; j4 <= 2; ++j4) { + if ((k3 < 0 || k3 > 1 || j4 < 0 || j4 > 1) && random.nextInt(3) <= 0) { + int k4 = random.nextInt(3) + 2; + + for (int l4 = 0; l4 < k4; ++l4) { + this.func_181639_b(world, new BlockPos(j + k3, i2 - l4 - 1, l + j4)); + } + + for (int i5 = -1; i5 <= 1; ++i5) { + for (int l2 = -1; l2 <= 1; ++l2) { + this.func_150526_a(world, k1 + k3 + i5, i2, l1 + j4 + l2); + } + } + + for (int j5 = -2; j5 <= 2; ++j5) { + for (int k5 = -2; k5 <= 2; ++k5) { + if (Math.abs(j5) != 2 || Math.abs(k5) != 2) { + this.func_150526_a(world, k1 + k3 + j5, i2 - 1, l1 + j4 + k5); + } + } + } + } + } + } + + return true; + } + } else { + return false; + } + } + + private boolean func_181638_a(World parWorld, BlockPos parBlockPos, int parInt1) { + int i = parBlockPos.getX(); + int j = parBlockPos.getY(); + int k = parBlockPos.getZ(); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = 0; l <= parInt1 + 1; ++l) { + byte b0 = 1; + if (l == 0) { + b0 = 0; + } + + if (l >= parInt1 - 1) { + b0 = 2; + } + + for (int i1 = -b0; i1 <= b0; ++i1) { + for (int j1 = -b0; j1 <= b0; ++j1) { + if (!this.func_150523_a(parWorld + .getBlockState(blockpos$mutableblockpos.func_181079_c(i + i1, j + l, k + j1)).getBlock())) { + return false; + } + } + } + } + + return true; + } + + private void func_181639_b(World parWorld, BlockPos parBlockPos) { + if (this.func_150523_a(parWorld.getBlockState(parBlockPos).getBlock())) { + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, field_181640_a); + } + + } + + private void func_150526_a(World worldIn, int parInt1, int parInt2, int parInt3) { + BlockPos blockpos = new BlockPos(parInt1, parInt2, parInt3); + Block block = worldIn.getBlockState(blockpos).getBlock(); + if (block.getMaterial() == Material.air) { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181641_b); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenClay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenClay.java new file mode 100644 index 0000000..92e39c9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenClay.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenClay extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenClay"); + } + + private Block field_150546_a = Blocks.clay; + private int numberOfBlocks; + + public WorldGenClay(int parInt1) { + this.numberOfBlocks = parInt1; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (world.getBlockState(blockpos).getBlock().getMaterial() != Material.water) { + return false; + } else { + int i = random.nextInt(this.numberOfBlocks - 2) + 2; + byte b0 = 1; + + for (int j = blockpos.getX() - i; j <= blockpos.getX() + i; ++j) { + for (int k = blockpos.getZ() - i; k <= blockpos.getZ() + i; ++k) { + int l = j - blockpos.getX(); + int i1 = k - blockpos.getZ(); + if (l * l + i1 * i1 <= i * i) { + for (int j1 = blockpos.getY() - b0; j1 <= blockpos.getY() + b0; ++j1) { + BlockPos blockpos1 = new BlockPos(j, j1, k); + Block block = world.getBlockState(blockpos1).getBlock(); + if (block == Blocks.dirt || block == Blocks.clay) { + world.setBlockState(blockpos1, this.field_150546_a.getDefaultState(), 2); + } + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDeadBush.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDeadBush.java new file mode 100644 index 0000000..f9d93e1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDeadBush.java @@ -0,0 +1,57 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenDeadBush extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenDeadBush"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + Block block; + while (((block = world.getBlockState(blockpos).getBlock()).getMaterial() == Material.air + || block.getMaterial() == Material.leaves) && blockpos.getY() > 0) { + blockpos = blockpos.down(); + } + + for (int i = 0; i < 4; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) + && Blocks.deadbush.canBlockStay(world, blockpos1, Blocks.deadbush.getDefaultState())) { + world.setBlockState(blockpos1, Blocks.deadbush.getDefaultState(), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDesertWells.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDesertWells.java new file mode 100644 index 0000000..c5ac835 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDesertWells.java @@ -0,0 +1,115 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import com.google.common.base.Predicates; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSand; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockStateHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenDesertWells extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenDesertWells"); + } + + private static final BlockStateHelper field_175913_a = BlockStateHelper.forBlock(Blocks.sand) + .where(BlockSand.VARIANT, Predicates.equalTo(BlockSand.EnumType.SAND)); + private final IBlockState field_175911_b = Blocks.stone_slab.getDefaultState() + .withProperty(BlockStoneSlab.VARIANT, BlockStoneSlab.EnumType.SAND) + .withProperty(BlockSlab.HALF, BlockSlab.EnumBlockHalf.BOTTOM); + private final IBlockState field_175912_c = Blocks.sandstone.getDefaultState(); + private final IBlockState field_175910_d = Blocks.flowing_water.getDefaultState(); + + public boolean generate(World world, EaglercraftRandom var2, BlockPos blockpos) { + while (world.isAirBlock(blockpos) && blockpos.getY() > 2) { + blockpos = blockpos.down(); + } + + if (!field_175913_a.apply(world.getBlockState(blockpos))) { + return false; + } else { + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + if (world.isAirBlock(blockpos.add(i, -1, j)) && world.isAirBlock(blockpos.add(i, -2, j))) { + return false; + } + } + } + + for (int l = -1; l <= 0; ++l) { + for (int l1 = -2; l1 <= 2; ++l1) { + for (int k = -2; k <= 2; ++k) { + world.setBlockState(blockpos.add(l1, l, k), this.field_175912_c, 2); + } + } + } + + world.setBlockState(blockpos, this.field_175910_d, 2); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + world.setBlockState(blockpos.offset(enumfacing), this.field_175910_d, 2); + } + + for (int i1 = -2; i1 <= 2; ++i1) { + for (int i2 = -2; i2 <= 2; ++i2) { + if (i1 == -2 || i1 == 2 || i2 == -2 || i2 == 2) { + world.setBlockState(blockpos.add(i1, 1, i2), this.field_175912_c, 2); + } + } + } + + world.setBlockState(blockpos.add(2, 1, 0), this.field_175911_b, 2); + world.setBlockState(blockpos.add(-2, 1, 0), this.field_175911_b, 2); + world.setBlockState(blockpos.add(0, 1, 2), this.field_175911_b, 2); + world.setBlockState(blockpos.add(0, 1, -2), this.field_175911_b, 2); + + for (int j1 = -1; j1 <= 1; ++j1) { + for (int j2 = -1; j2 <= 1; ++j2) { + if (j1 == 0 && j2 == 0) { + world.setBlockState(blockpos.add(j1, 4, j2), this.field_175912_c, 2); + } else { + world.setBlockState(blockpos.add(j1, 4, j2), this.field_175911_b, 2); + } + } + } + + for (int k1 = 1; k1 <= 3; ++k1) { + world.setBlockState(blockpos.add(-1, k1, -1), this.field_175912_c, 2); + world.setBlockState(blockpos.add(-1, k1, 1), this.field_175912_c, 2); + world.setBlockState(blockpos.add(1, k1, -1), this.field_175912_c, 2); + world.setBlockState(blockpos.add(1, k1, 1), this.field_175912_c, 2); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDoublePlant.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDoublePlant.java new file mode 100644 index 0000000..3cdf6dd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDoublePlant.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoublePlant; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenDoublePlant extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenDoublePlant"); + } + + private BlockDoublePlant.EnumPlantType field_150549_a; + + public void setPlantType(BlockDoublePlant.EnumPlantType parEnumPlantType) { + this.field_150549_a = parEnumPlantType; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + boolean flag = false; + + for (int i = 0; i < 64; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) && (!world.provider.getHasNoSky() || blockpos1.getY() < 254) + && Blocks.double_plant.canPlaceBlockAt(world, blockpos1)) { + Blocks.double_plant.placeAt(world, blockpos1, this.field_150549_a, 2); + flag = true; + } + } + + return flag; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDungeons.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDungeons.java new file mode 100644 index 0000000..eea625c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDungeons.java @@ -0,0 +1,177 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenDungeons extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenDungeons"); + } + + private static final Logger field_175918_a = LogManager.getLogger(); + private static final String[] SPAWNERTYPES = new String[] { "Skeleton", "Zombie", "Zombie", "Spider" }; + private static final List CHESTCONTENT = Lists + .newArrayList(new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 4, 10), + new WeightedRandomChestContent(Items.bread, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.wheat, 0, 1, 4, 10), + new WeightedRandomChestContent(Items.gunpowder, 0, 1, 4, 10), + new WeightedRandomChestContent(Items.string, 0, 1, 4, 10), + new WeightedRandomChestContent(Items.bucket, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.redstone, 0, 1, 4, 10), + new WeightedRandomChestContent(Items.record_13, 0, 1, 1, 4), + new WeightedRandomChestContent(Items.record_cat, 0, 1, 1, 4), + new WeightedRandomChestContent(Items.name_tag, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 2), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1) }); + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + boolean flag = true; + int i = random.nextInt(2) + 2; + int j = -i - 1; + int k = i + 1; + boolean flag1 = true; + boolean flag2 = true; + int l = random.nextInt(2) + 2; + int i1 = -l - 1; + int j1 = l + 1; + int k1 = 0; + + for (int l1 = j; l1 <= k; ++l1) { + for (int i2 = -1; i2 <= 4; ++i2) { + for (int j2 = i1; j2 <= j1; ++j2) { + BlockPos blockpos1 = blockpos.add(l1, i2, j2); + Material material = world.getBlockState(blockpos1).getBlock().getMaterial(); + boolean flag3 = material.isSolid(); + if (i2 == -1 && !flag3) { + return false; + } + + if (i2 == 4 && !flag3) { + return false; + } + + if ((l1 == j || l1 == k || j2 == i1 || j2 == j1) && i2 == 0 && world.isAirBlock(blockpos1) + && world.isAirBlock(blockpos1.up())) { + ++k1; + } + } + } + } + + if (k1 >= 1 && k1 <= 5) { + for (int l2 = j; l2 <= k; ++l2) { + for (int j3 = 3; j3 >= -1; --j3) { + for (int l3 = i1; l3 <= j1; ++l3) { + BlockPos blockpos2 = blockpos.add(l2, j3, l3); + if (l2 != j && j3 != -1 && l3 != i1 && l2 != k && j3 != 4 && l3 != j1) { + if (world.getBlockState(blockpos2).getBlock() != Blocks.chest) { + world.setBlockToAir(blockpos2); + } + } else if (blockpos2.getY() >= 0 + && !world.getBlockState(blockpos2.down()).getBlock().getMaterial().isSolid()) { + world.setBlockToAir(blockpos2); + } else if (world.getBlockState(blockpos2).getBlock().getMaterial().isSolid() + && world.getBlockState(blockpos2).getBlock() != Blocks.chest) { + if (j3 == -1 && random.nextInt(4) != 0) { + world.setBlockState(blockpos2, Blocks.mossy_cobblestone.getDefaultState(), 2); + } else { + world.setBlockState(blockpos2, Blocks.cobblestone.getDefaultState(), 2); + } + } + } + } + } + + for (int i3 = 0; i3 < 2; ++i3) { + for (int k3 = 0; k3 < 3; ++k3) { + int i4 = blockpos.getX() + random.nextInt(i * 2 + 1) - i; + int j4 = blockpos.getY(); + int k4 = blockpos.getZ() + random.nextInt(l * 2 + 1) - l; + BlockPos blockpos3 = new BlockPos(i4, j4, k4); + if (world.isAirBlock(blockpos3)) { + int k2 = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (world.getBlockState(blockpos3.offset(enumfacing)).getBlock().getMaterial().isSolid()) { + ++k2; + } + } + + if (k2 == 1) { + world.setBlockState(blockpos3, + Blocks.chest.correctFacing(world, blockpos3, Blocks.chest.getDefaultState()), 2); + List list = WeightedRandomChestContent.func_177629_a(CHESTCONTENT, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random) }); + TileEntity tileentity1 = world.getTileEntity(blockpos3); + if (tileentity1 instanceof TileEntityChest) { + WeightedRandomChestContent.generateChestContents(random, list, + (TileEntityChest) tileentity1, 8); + } + break; + } + } + } + } + + world.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityMobSpawner) { + ((TileEntityMobSpawner) tileentity).getSpawnerBaseLogic().setEntityName(this.pickMobSpawner(random)); + } else { + field_175918_a.error("Failed to fetch mob spawner entity at (" + blockpos.getX() + ", " + + blockpos.getY() + ", " + blockpos.getZ() + ")"); + } + + return true; + } else { + return false; + } + } + + /**+ + * Randomly decides which spawner to use in a dungeon + */ + private String pickMobSpawner(EaglercraftRandom parRandom) { + return SPAWNERTYPES[parRandom.nextInt(SPAWNERTYPES.length)]; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFire.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFire.java new file mode 100644 index 0000000..b9e905e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFire.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenFire extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenFire"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 64; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) && world.getBlockState(blockpos1.down()).getBlock() == Blocks.netherrack) { + world.setBlockState(blockpos1, Blocks.fire.getDefaultState(), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFlowers.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFlowers.java new file mode 100644 index 0000000..d8231ba --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFlowers.java @@ -0,0 +1,63 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlower; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenFlowers extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenFlowers"); + } + + private BlockFlower flower; + private IBlockState field_175915_b; + + public WorldGenFlowers(BlockFlower parBlockFlower, BlockFlower.EnumFlowerType parEnumFlowerType) { + this.setGeneratedBlock(parBlockFlower, parEnumFlowerType); + } + + public void setGeneratedBlock(BlockFlower parBlockFlower, BlockFlower.EnumFlowerType parEnumFlowerType) { + this.flower = parBlockFlower; + this.field_175915_b = parBlockFlower.getDefaultState().withProperty(parBlockFlower.getTypeProperty(), + parEnumFlowerType); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 64; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) && (!world.provider.getHasNoSky() || blockpos1.getY() < 255) + && this.flower.canBlockStay(world, blockpos1, this.field_175915_b)) { + world.setBlockState(blockpos1, this.field_175915_b, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenForest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenForest.java new file mode 100644 index 0000000..bb14a06 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenForest.java @@ -0,0 +1,133 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenForest extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenForest"); + } + + private static final IBlockState field_181629_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.BIRCH); + private static final IBlockState field_181630_b = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.BIRCH) + .withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false)); + private boolean useExtraRandomHeight; + + public WorldGenForest(boolean parFlag, boolean parFlag2) { + super(parFlag); + this.useExtraRandomHeight = parFlag2; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = random.nextInt(3) + 5; + if (this.useExtraRandomHeight) { + i += random.nextInt(7); + } + + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 <= 256) { + for (int j = blockpos.getY(); j <= blockpos.getY() + 1 + i; ++j) { + byte b0 = 1; + if (j == blockpos.getY()) { + b0 = 0; + } + + if (j >= blockpos.getY() + 1 + i - 2) { + b0 = 2; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) { + for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) { + if (j >= 0 && j < 256) { + if (!this.func_150523_a( + world.getBlockState(blockpos$mutableblockpos.func_181079_c(k, j, l)).getBlock())) { + flag = false; + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) + && blockpos.getY() < 256 - i - 1) { + this.func_175921_a(world, blockpos.down()); + + for (int l1 = blockpos.getY() - 3 + i; l1 <= blockpos.getY() + i; ++l1) { + int j2 = l1 - (blockpos.getY() + i); + int k2 = 1 - j2 / 2; + + for (int l2 = blockpos.getX() - k2; l2 <= blockpos.getX() + k2; ++l2) { + int i1 = l2 - blockpos.getX(); + + for (int j1 = blockpos.getZ() - k2; j1 <= blockpos.getZ() + k2; ++j1) { + int k1 = j1 - blockpos.getZ(); + if (Math.abs(i1) != k2 || Math.abs(k1) != k2 || random.nextInt(2) != 0 && j2 != 0) { + BlockPos blockpos1 = new BlockPos(l2, l1, j1); + Block block = world.getBlockState(blockpos1).getBlock(); + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos1, field_181630_b); + } + } + } + } + } + + for (int i2 = 0; i2 < i; ++i2) { + Block block2 = world.getBlockState(blockpos.up(i2)).getBlock(); + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.up(i2), field_181629_a); + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone1.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone1.java new file mode 100644 index 0000000..3ec2df9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone1.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenGlowStone1 extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenGlowStone1"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (!world.isAirBlock(blockpos)) { + return false; + } else if (world.getBlockState(blockpos.up()).getBlock() != Blocks.netherrack) { + return false; + } else { + world.setBlockState(blockpos, Blocks.glowstone.getDefaultState(), 2); + + for (int i = 0; i < 1500; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), -random.nextInt(12), + random.nextInt(8) - random.nextInt(8)); + if (world.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) { + int j = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) { + if (world.getBlockState(blockpos1.offset(enumfacing)).getBlock() == Blocks.glowstone) { + ++j; + } + + if (j > 1) { + break; + } + } + + if (j == 1) { + world.setBlockState(blockpos1, Blocks.glowstone.getDefaultState(), 2); + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone2.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone2.java new file mode 100644 index 0000000..694ccdf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone2.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenGlowStone2 extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenGlowStone2"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (!world.isAirBlock(blockpos)) { + return false; + } else if (world.getBlockState(blockpos.up()).getBlock() != Blocks.netherrack) { + return false; + } else { + world.setBlockState(blockpos, Blocks.glowstone.getDefaultState(), 2); + + for (int i = 0; i < 1500; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), -random.nextInt(12), + random.nextInt(8) - random.nextInt(8)); + if (world.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) { + int j = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) { + if (world.getBlockState(blockpos1.offset(enumfacing)).getBlock() == Blocks.glowstone) { + ++j; + } + + if (j > 1) { + break; + } + } + + if (j == 1) { + world.setBlockState(blockpos1, Blocks.glowstone.getDefaultState(), 2); + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHellLava.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHellLava.java new file mode 100644 index 0000000..78439fe --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHellLava.java @@ -0,0 +1,104 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenHellLava extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenHellLava"); + } + + private final Block field_150553_a; + private final boolean field_94524_b; + + public WorldGenHellLava(Block parBlock, boolean parFlag) { + this.field_150553_a = parBlock; + this.field_94524_b = parFlag; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (world.getBlockState(blockpos.up()).getBlock() != Blocks.netherrack) { + return false; + } else if (world.getBlockState(blockpos).getBlock().getMaterial() != Material.air + && world.getBlockState(blockpos).getBlock() != Blocks.netherrack) { + return false; + } else { + int i = 0; + if (world.getBlockState(blockpos.west()).getBlock() == Blocks.netherrack) { + ++i; + } + + if (world.getBlockState(blockpos.east()).getBlock() == Blocks.netherrack) { + ++i; + } + + if (world.getBlockState(blockpos.north()).getBlock() == Blocks.netherrack) { + ++i; + } + + if (world.getBlockState(blockpos.south()).getBlock() == Blocks.netherrack) { + ++i; + } + + if (world.getBlockState(blockpos.down()).getBlock() == Blocks.netherrack) { + ++i; + } + + int j = 0; + if (world.isAirBlock(blockpos.west())) { + ++j; + } + + if (world.isAirBlock(blockpos.east())) { + ++j; + } + + if (world.isAirBlock(blockpos.north())) { + ++j; + } + + if (world.isAirBlock(blockpos.south())) { + ++j; + } + + if (world.isAirBlock(blockpos.down())) { + ++j; + } + + if (!this.field_94524_b && i == 4 && j == 1 || i == 5) { + world.setBlockState(blockpos, this.field_150553_a.getDefaultState(), 2); + world.forceBlockUpdateTick(this.field_150553_a, blockpos, random); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHugeTrees.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHugeTrees.java new file mode 100644 index 0000000..0e3a140 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHugeTrees.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldGenHugeTrees extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenHugeTrees"); + } + + protected final int baseHeight; + protected final IBlockState woodMetadata; + protected final IBlockState leavesMetadata; + protected int extraRandomHeight; + + public WorldGenHugeTrees(boolean parFlag, int parInt1, int parInt2, IBlockState parIBlockState, + IBlockState parIBlockState2) { + super(parFlag); + this.baseHeight = parInt1; + this.extraRandomHeight = parInt2; + this.woodMetadata = parIBlockState; + this.leavesMetadata = parIBlockState2; + } + + protected int func_150533_a(EaglercraftRandom parRandom) { + int i = parRandom.nextInt(3) + this.baseHeight; + if (this.extraRandomHeight > 1) { + i += parRandom.nextInt(this.extraRandomHeight); + } + + return i; + } + + private boolean func_175926_c(World worldIn, BlockPos parBlockPos, int parInt1) { + boolean flag = true; + if (parBlockPos.getY() >= 1 && parBlockPos.getY() + parInt1 + 1 <= 256) { + for (int i = 0; i <= 1 + parInt1; ++i) { + byte b0 = 2; + if (i == 0) { + b0 = 1; + } else if (i >= 1 + parInt1 - 2) { + b0 = 2; + } + + for (int j = -b0; j <= b0 && flag; ++j) { + for (int k = -b0; k <= b0 && flag; ++k) { + if (parBlockPos.getY() + i < 0 || parBlockPos.getY() + i >= 256 + || !this.func_150523_a(worldIn.getBlockState(parBlockPos.add(j, i, k)).getBlock())) { + flag = false; + } + } + } + } + + return flag; + } else { + return false; + } + } + + private boolean func_175927_a(BlockPos worldIn, World parWorld) { + BlockPos blockpos = worldIn.down(); + Block block = parWorld.getBlockState(blockpos).getBlock(); + if ((block == Blocks.grass || block == Blocks.dirt) && worldIn.getY() >= 2) { + this.func_175921_a(parWorld, blockpos); + this.func_175921_a(parWorld, blockpos.east()); + this.func_175921_a(parWorld, blockpos.south()); + this.func_175921_a(parWorld, blockpos.south().east()); + return true; + } else { + return false; + } + } + + protected boolean func_175929_a(World worldIn, EaglercraftRandom parRandom, BlockPos parBlockPos, int parInt1) { + return this.func_175926_c(worldIn, parBlockPos, parInt1) && this.func_175927_a(parBlockPos, worldIn); + } + + protected void func_175925_a(World worldIn, BlockPos parBlockPos, int parInt1) { + int i = parInt1 * parInt1; + + for (int j = -parInt1; j <= parInt1 + 1; ++j) { + for (int k = -parInt1; k <= parInt1 + 1; ++k) { + int l = j - 1; + int i1 = k - 1; + if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i) { + BlockPos blockpos = parBlockPos.add(j, 0, k); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + if (material == Material.air || material == Material.leaves) { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } + } + } + } + + } + + protected void func_175928_b(World worldIn, BlockPos parBlockPos, int parInt1) { + int i = parInt1 * parInt1; + + for (int j = -parInt1; j <= parInt1; ++j) { + for (int k = -parInt1; k <= parInt1; ++k) { + if (j * j + k * k <= i) { + BlockPos blockpos = parBlockPos.add(j, 0, k); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + if (material == Material.air || material == Material.leaves) { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } + } + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIcePath.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIcePath.java new file mode 100644 index 0000000..f06f4ec --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIcePath.java @@ -0,0 +1,75 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenIcePath extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenIcePath"); + } + + private Block block = Blocks.packed_ice; + private int basePathWidth; + + public WorldGenIcePath(int parInt1) { + this.basePathWidth = parInt1; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + while (world.isAirBlock(blockpos) && blockpos.getY() > 2) { + blockpos = blockpos.down(); + } + + if (world.getBlockState(blockpos).getBlock() != Blocks.snow) { + return false; + } else { + int i = random.nextInt(this.basePathWidth - 2) + 2; + byte b0 = 1; + + for (int j = blockpos.getX() - i; j <= blockpos.getX() + i; ++j) { + for (int k = blockpos.getZ() - i; k <= blockpos.getZ() + i; ++k) { + int l = j - blockpos.getX(); + int i1 = k - blockpos.getZ(); + if (l * l + i1 * i1 <= i * i) { + for (int j1 = blockpos.getY() - b0; j1 <= blockpos.getY() + b0; ++j1) { + BlockPos blockpos1 = new BlockPos(j, j1, k); + Block blockx = world.getBlockState(blockpos1).getBlock(); + if (blockx == Blocks.dirt || blockx == Blocks.snow || blockx == Blocks.ice) { + world.setBlockState(blockpos1, this.block.getDefaultState(), 2); + } + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIceSpike.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIceSpike.java new file mode 100644 index 0000000..ad87d02 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIceSpike.java @@ -0,0 +1,122 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenIceSpike extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenIceSpike"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + while (world.isAirBlock(blockpos) && blockpos.getY() > 2) { + blockpos = blockpos.down(); + } + + if (world.getBlockState(blockpos).getBlock() != Blocks.snow) { + return false; + } else { + blockpos = blockpos.up(random.nextInt(4)); + int i = random.nextInt(4) + 7; + int j = i / 4 + random.nextInt(2); + if (j > 1 && random.nextInt(60) == 0) { + blockpos = blockpos.up(10 + random.nextInt(30)); + } + + for (int k = 0; k < i; ++k) { + float f = (1.0F - (float) k / (float) i) * (float) j; + int l = MathHelper.ceiling_float_int(f); + + for (int i1 = -l; i1 <= l; ++i1) { + float f1 = (float) MathHelper.abs_int(i1) - 0.25F; + + for (int j1 = -l; j1 <= l; ++j1) { + float f2 = (float) MathHelper.abs_int(j1) - 0.25F; + if ((i1 == 0 && j1 == 0 || f1 * f1 + f2 * f2 <= f * f) + && (i1 != -l && i1 != l && j1 != -l && j1 != l || random.nextFloat() <= 0.75F)) { + Block block = world.getBlockState(blockpos.add(i1, k, j1)).getBlock(); + if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow + || block == Blocks.ice) { + this.setBlockAndNotifyAdequately(world, blockpos.add(i1, k, j1), + Blocks.packed_ice.getDefaultState()); + } + + if (k != 0 && l > 1) { + block = world.getBlockState(blockpos.add(i1, -k, j1)).getBlock(); + if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow + || block == Blocks.ice) { + this.setBlockAndNotifyAdequately(world, blockpos.add(i1, -k, j1), + Blocks.packed_ice.getDefaultState()); + } + } + } + } + } + } + + int k1 = j - 1; + if (k1 < 0) { + k1 = 0; + } else if (k1 > 1) { + k1 = 1; + } + + for (int l1 = -k1; l1 <= k1; ++l1) { + for (int i2 = -k1; i2 <= k1; ++i2) { + BlockPos blockpos1 = blockpos.add(l1, -1, i2); + int j2 = 50; + if (Math.abs(l1) == 1 && Math.abs(i2) == 1) { + j2 = random.nextInt(5); + } + + while (blockpos1.getY() > 50) { + Block block1 = world.getBlockState(blockpos1).getBlock(); + if (block1.getMaterial() != Material.air && block1 != Blocks.dirt && block1 != Blocks.snow + && block1 != Blocks.ice && block1 != Blocks.packed_ice) { + break; + } + + this.setBlockAndNotifyAdequately(world, blockpos1, Blocks.packed_ice.getDefaultState()); + blockpos1 = blockpos1.down(); + --j2; + if (j2 <= 0) { + blockpos1 = blockpos1.down(random.nextInt(5) + 1); + j2 = random.nextInt(5); + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLakes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLakes.java new file mode 100644 index 0000000..6f74306 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLakes.java @@ -0,0 +1,172 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumSkyBlock; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenLakes extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenLakes"); + } + + private Block block; + + public WorldGenLakes(Block blockIn) { + this.block = blockIn; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (blockpos = blockpos.add(-8, 0, -8); blockpos.getY() > 5 + && world.isAirBlock(blockpos); blockpos = blockpos.down()) { + ; + } + + if (blockpos.getY() <= 4) { + return false; + } else { + blockpos = blockpos.down(4); + boolean[] aboolean = new boolean[2048]; + int i = random.nextInt(4) + 4; + + for (int j = 0; j < i; ++j) { + double d0 = random.nextDouble() * 6.0D + 3.0D; + double d1 = random.nextDouble() * 4.0D + 2.0D; + double d2 = random.nextDouble() * 6.0D + 3.0D; + double d3 = random.nextDouble() * (16.0D - d0 - 2.0D) + 1.0D + d0 / 2.0D; + double d4 = random.nextDouble() * (8.0D - d1 - 4.0D) + 2.0D + d1 / 2.0D; + double d5 = random.nextDouble() * (16.0D - d2 - 2.0D) + 1.0D + d2 / 2.0D; + + for (int l = 1; l < 15; ++l) { + for (int i1 = 1; i1 < 15; ++i1) { + for (int j1 = 1; j1 < 7; ++j1) { + double d6 = ((double) l - d3) / (d0 / 2.0D); + double d7 = ((double) j1 - d4) / (d1 / 2.0D); + double d8 = ((double) i1 - d5) / (d2 / 2.0D); + double d9 = d6 * d6 + d7 * d7 + d8 * d8; + if (d9 < 1.0D) { + aboolean[(l * 16 + i1) * 8 + j1] = true; + } + } + } + } + } + + for (int k1 = 0; k1 < 16; ++k1) { + for (int l2 = 0; l2 < 16; ++l2) { + for (int k = 0; k < 8; ++k) { + boolean flag = !aboolean[(k1 * 16 + l2) * 8 + k] + && (k1 < 15 && aboolean[((k1 + 1) * 16 + l2) * 8 + k] + || k1 > 0 && aboolean[((k1 - 1) * 16 + l2) * 8 + k] + || l2 < 15 && aboolean[(k1 * 16 + l2 + 1) * 8 + k] + || l2 > 0 && aboolean[(k1 * 16 + (l2 - 1)) * 8 + k] + || k < 7 && aboolean[(k1 * 16 + l2) * 8 + k + 1] + || k > 0 && aboolean[(k1 * 16 + l2) * 8 + (k - 1)]); + if (flag) { + Material material = world.getBlockState(blockpos.add(k1, k, l2)).getBlock().getMaterial(); + if (k >= 4 && material.isLiquid()) { + return false; + } + + if (k < 4 && !material.isSolid() + && world.getBlockState(blockpos.add(k1, k, l2)).getBlock() != this.block) { + return false; + } + } + } + } + } + + for (int l1 = 0; l1 < 16; ++l1) { + for (int i3 = 0; i3 < 16; ++i3) { + for (int i4 = 0; i4 < 8; ++i4) { + if (aboolean[(l1 * 16 + i3) * 8 + i4]) { + world.setBlockState(blockpos.add(l1, i4, i3), + i4 >= 4 ? Blocks.air.getDefaultState() : this.block.getDefaultState(), 2); + } + } + } + } + + for (int i2 = 0; i2 < 16; ++i2) { + for (int j3 = 0; j3 < 16; ++j3) { + for (int j4 = 4; j4 < 8; ++j4) { + if (aboolean[(i2 * 16 + j3) * 8 + j4]) { + BlockPos blockpos1 = blockpos.add(i2, j4 - 1, j3); + if (world.getBlockState(blockpos1).getBlock() == Blocks.dirt + && world.getLightFor(EnumSkyBlock.SKY, blockpos.add(i2, j4, j3)) > 0) { + BiomeGenBase biomegenbase = world.getBiomeGenForCoords(blockpos1); + if (biomegenbase.topBlock.getBlock() == Blocks.mycelium) { + world.setBlockState(blockpos1, Blocks.mycelium.getDefaultState(), 2); + } else { + world.setBlockState(blockpos1, Blocks.grass.getDefaultState(), 2); + } + } + } + } + } + } + + if (this.block.getMaterial() == Material.lava) { + for (int j2 = 0; j2 < 16; ++j2) { + for (int k3 = 0; k3 < 16; ++k3) { + for (int k4 = 0; k4 < 8; ++k4) { + boolean flag1 = !aboolean[(j2 * 16 + k3) * 8 + k4] + && (j2 < 15 && aboolean[((j2 + 1) * 16 + k3) * 8 + k4] + || j2 > 0 && aboolean[((j2 - 1) * 16 + k3) * 8 + k4] + || k3 < 15 && aboolean[(j2 * 16 + k3 + 1) * 8 + k4] + || k3 > 0 && aboolean[(j2 * 16 + (k3 - 1)) * 8 + k4] + || k4 < 7 && aboolean[(j2 * 16 + k3) * 8 + k4 + 1] + || k4 > 0 && aboolean[(j2 * 16 + k3) * 8 + (k4 - 1)]); + if (flag1 && (k4 < 4 || random.nextInt(2) != 0) && world + .getBlockState(blockpos.add(j2, k4, k3)).getBlock().getMaterial().isSolid()) { + world.setBlockState(blockpos.add(j2, k4, k3), Blocks.stone.getDefaultState(), 2); + } + } + } + } + } + + if (this.block.getMaterial() == Material.water) { + for (int k2 = 0; k2 < 16; ++k2) { + for (int l3 = 0; l3 < 16; ++l3) { + byte b0 = 4; + if (world.canBlockFreezeWater(blockpos.add(k2, b0, l3))) { + world.setBlockState(blockpos.add(k2, b0, l3), Blocks.ice.getDefaultState(), 2); + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLiquids.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLiquids.java new file mode 100644 index 0000000..757349d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLiquids.java @@ -0,0 +1,96 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenLiquids extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenLiquids"); + } + + private Block block; + + public WorldGenLiquids(Block parBlock) { + this.block = parBlock; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (world.getBlockState(blockpos.up()).getBlock() != Blocks.stone) { + return false; + } else if (world.getBlockState(blockpos.down()).getBlock() != Blocks.stone) { + return false; + } else if (world.getBlockState(blockpos).getBlock().getMaterial() != Material.air + && world.getBlockState(blockpos).getBlock() != Blocks.stone) { + return false; + } else { + int i = 0; + if (world.getBlockState(blockpos.west()).getBlock() == Blocks.stone) { + ++i; + } + + if (world.getBlockState(blockpos.east()).getBlock() == Blocks.stone) { + ++i; + } + + if (world.getBlockState(blockpos.north()).getBlock() == Blocks.stone) { + ++i; + } + + if (world.getBlockState(blockpos.south()).getBlock() == Blocks.stone) { + ++i; + } + + int j = 0; + if (world.isAirBlock(blockpos.west())) { + ++j; + } + + if (world.isAirBlock(blockpos.east())) { + ++j; + } + + if (world.isAirBlock(blockpos.north())) { + ++j; + } + + if (world.isAirBlock(blockpos.south())) { + ++j; + } + + if (i == 3 && j == 1) { + world.setBlockState(blockpos, this.block.getDefaultState(), 2); + world.forceBlockUpdateTick(this.block, blockpos, random); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaJungle.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaJungle.java new file mode 100644 index 0000000..293e379 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -0,0 +1,135 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockVine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenHugeTrees; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenMegaJungle extends WorldGenHugeTrees { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenMegaJungle"); + } + + public WorldGenMegaJungle(boolean parFlag, int parInt1, int parInt2, IBlockState parIBlockState, + IBlockState parIBlockState2) { + super(parFlag, parInt1, parInt2, parIBlockState, parIBlockState2); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = this.func_150533_a(random); + if (!this.func_175929_a(world, random, blockpos, i)) { + return false; + } else { + this.func_175930_c(world, blockpos.up(i), 2); + + for (int j = blockpos.getY() + i - 2 - random.nextInt(4); j > blockpos.getY() + i / 2; j -= 2 + + random.nextInt(4)) { + float f = random.nextFloat() * 3.1415927F * 2.0F; + int k = blockpos.getX() + (int) (0.5F + MathHelper.cos(f) * 4.0F); + int l = blockpos.getZ() + (int) (0.5F + MathHelper.sin(f) * 4.0F); + + for (int i1 = 0; i1 < 5; ++i1) { + k = blockpos.getX() + (int) (1.5F + MathHelper.cos(f) * (float) i1); + l = blockpos.getZ() + (int) (1.5F + MathHelper.sin(f) * (float) i1); + this.setBlockAndNotifyAdequately(world, new BlockPos(k, j - 3 + i1 / 2, l), this.woodMetadata); + } + + int j2 = 1 + random.nextInt(2); + int j1 = j; + + for (int k1 = j - j2; k1 <= j1; ++k1) { + int l1 = k1 - j1; + this.func_175928_b(world, new BlockPos(k, k1, l), 1 - l1); + } + } + + for (int i2 = 0; i2 < i; ++i2) { + BlockPos blockpos1 = blockpos.up(i2); + if (this.func_150523_a(world.getBlockState(blockpos1).getBlock())) { + this.setBlockAndNotifyAdequately(world, blockpos1, this.woodMetadata); + if (i2 > 0) { + this.func_181632_a(world, random, blockpos1.west(), BlockVine.EAST); + this.func_181632_a(world, random, blockpos1.north(), BlockVine.SOUTH); + } + } + + if (i2 < i - 1) { + BlockPos blockpos2 = blockpos1.east(); + if (this.func_150523_a(world.getBlockState(blockpos2).getBlock())) { + this.setBlockAndNotifyAdequately(world, blockpos2, this.woodMetadata); + if (i2 > 0) { + this.func_181632_a(world, random, blockpos2.east(), BlockVine.WEST); + this.func_181632_a(world, random, blockpos2.north(), BlockVine.SOUTH); + } + } + + BlockPos blockpos3 = blockpos1.south().east(); + if (this.func_150523_a(world.getBlockState(blockpos3).getBlock())) { + this.setBlockAndNotifyAdequately(world, blockpos3, this.woodMetadata); + if (i2 > 0) { + this.func_181632_a(world, random, blockpos3.east(), BlockVine.WEST); + this.func_181632_a(world, random, blockpos3.south(), BlockVine.NORTH); + } + } + + BlockPos blockpos4 = blockpos1.south(); + if (this.func_150523_a(world.getBlockState(blockpos4).getBlock())) { + this.setBlockAndNotifyAdequately(world, blockpos4, this.woodMetadata); + if (i2 > 0) { + this.func_181632_a(world, random, blockpos4.west(), BlockVine.EAST); + this.func_181632_a(world, random, blockpos4.south(), BlockVine.NORTH); + } + } + } + } + + return true; + } + } + + private void func_181632_a(World parWorld, EaglercraftRandom parRandom, BlockPos parBlockPos, + PropertyBool parPropertyBool) { + if (parRandom.nextInt(3) > 0 && parWorld.isAirBlock(parBlockPos)) { + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, + Blocks.vine.getDefaultState().withProperty(parPropertyBool, Boolean.valueOf(true))); + } + + } + + private void func_175930_c(World worldIn, BlockPos parBlockPos, int parInt1) { + byte b0 = 2; + + for (int i = -b0; i <= 0; ++i) { + this.func_175925_a(worldIn, parBlockPos.up(i), parInt1 + 1 - i); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java new file mode 100644 index 0000000..3090b96 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java @@ -0,0 +1,153 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirt; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenHugeTrees; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenMegaPineTree extends WorldGenHugeTrees { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenMegaPineTree"); + } + + private static final IBlockState field_181633_e = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.SPRUCE); + private static final IBlockState field_181634_f = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + private static final IBlockState field_181635_g = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, + BlockDirt.DirtType.PODZOL); + private boolean useBaseHeight; + + public WorldGenMegaPineTree(boolean parFlag, boolean parFlag2) { + super(parFlag, 13, 15, field_181633_e, field_181634_f); + this.useBaseHeight = parFlag2; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = this.func_150533_a(random); + if (!this.func_175929_a(world, random, blockpos, i)) { + return false; + } else { + this.func_150541_c(world, blockpos.getX(), blockpos.getZ(), blockpos.getY() + i, 0, random); + + for (int j = 0; j < i; ++j) { + Block block = world.getBlockState(blockpos.up(j)).getBlock(); + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.up(j), this.woodMetadata); + } + + if (j < i - 1) { + block = world.getBlockState(blockpos.add(1, j, 0)).getBlock(); + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.add(1, j, 0), this.woodMetadata); + } + + block = world.getBlockState(blockpos.add(1, j, 1)).getBlock(); + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.add(1, j, 1), this.woodMetadata); + } + + block = world.getBlockState(blockpos.add(0, j, 1)).getBlock(); + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.add(0, j, 1), this.woodMetadata); + } + } + } + + return true; + } + } + + private void func_150541_c(World worldIn, int parInt1, int parInt2, int parInt3, int parInt4, + EaglercraftRandom parRandom) { + int i = parRandom.nextInt(5) + (this.useBaseHeight ? this.baseHeight : 3); + int j = 0; + + for (int k = parInt3 - i; k <= parInt3; ++k) { + int l = parInt3 - k; + int i1 = parInt4 + MathHelper.floor_float((float) l / (float) i * 3.5F); + this.func_175925_a(worldIn, new BlockPos(parInt1, k, parInt2), + i1 + (l > 0 && i1 == j && (k & 1) == 0 ? 1 : 0)); + j = i1; + } + + } + + public void func_180711_a(World world, EaglercraftRandom random, BlockPos blockpos) { + this.func_175933_b(world, blockpos.west().north()); + this.func_175933_b(world, blockpos.east(2).north()); + this.func_175933_b(world, blockpos.west().south(2)); + this.func_175933_b(world, blockpos.east(2).south(2)); + + for (int i = 0; i < 5; ++i) { + int j = random.nextInt(64); + int k = j % 8; + int l = j / 8; + if (k == 0 || k == 7 || l == 0 || l == 7) { + this.func_175933_b(world, blockpos.add(-3 + k, 0, -3 + l)); + } + } + + } + + private void func_175933_b(World worldIn, BlockPos parBlockPos) { + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + if (Math.abs(i) != 2 || Math.abs(j) != 2) { + this.func_175934_c(worldIn, parBlockPos.add(i, 0, j)); + } + } + } + + } + + private void func_175934_c(World worldIn, BlockPos parBlockPos) { + for (int i = 2; i >= -3; --i) { + BlockPos blockpos = parBlockPos.up(i); + Block block = worldIn.getBlockState(blockpos).getBlock(); + if (block == Blocks.grass || block == Blocks.dirt) { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181635_g); + break; + } + + if (block.getMaterial() != Material.air && i < 0) { + break; + } + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMelon.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMelon.java new file mode 100644 index 0000000..528db38 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMelon.java @@ -0,0 +1,49 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenMelon extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenMelon"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 64; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (Blocks.melon_block.canPlaceBlockAt(world, blockpos1) + && world.getBlockState(blockpos1.down()).getBlock() == Blocks.grass) { + world.setBlockState(blockpos1, Blocks.melon_block.getDefaultState(), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMinable.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMinable.java new file mode 100644 index 0000000..9569086 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMinable.java @@ -0,0 +1,102 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.pattern.BlockHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenMinable extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenMinable"); + } + + private final IBlockState oreBlock; + private final int numberOfBlocks; + private final Predicate predicate; + + public WorldGenMinable(IBlockState state, int blockCount) { + this(state, blockCount, BlockHelper.forBlock(Blocks.stone)); + } + + public WorldGenMinable(IBlockState state, int blockCount, Predicate parPredicate) { + this.oreBlock = state; + this.numberOfBlocks = blockCount; + this.predicate = parPredicate; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + float f = random.nextFloat() * 3.1415927F; + double d0 = (double) ((float) (blockpos.getX() + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F); + double d1 = (double) ((float) (blockpos.getX() + 8) - MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F); + double d2 = (double) ((float) (blockpos.getZ() + 8) + MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F); + double d3 = (double) ((float) (blockpos.getZ() + 8) - MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F); + double d4 = (double) (blockpos.getY() + random.nextInt(3) - 2); + double d5 = (double) (blockpos.getY() + random.nextInt(3) - 2); + + for (int i = 0; i < this.numberOfBlocks; ++i) { + float f1 = (float) i / (float) this.numberOfBlocks; + double d6 = d0 + (d1 - d0) * (double) f1; + double d7 = d4 + (d5 - d4) * (double) f1; + double d8 = d2 + (d3 - d2) * (double) f1; + double d9 = random.nextDouble() * (double) this.numberOfBlocks / 16.0D; + double d10 = (double) (MathHelper.sin(3.1415927F * f1) + 1.0F) * d9 + 1.0D; + double d11 = (double) (MathHelper.sin(3.1415927F * f1) + 1.0F) * d9 + 1.0D; + int j = MathHelper.floor_double(d6 - d10 / 2.0D); + int k = MathHelper.floor_double(d7 - d11 / 2.0D); + int l = MathHelper.floor_double(d8 - d10 / 2.0D); + int i1 = MathHelper.floor_double(d6 + d10 / 2.0D); + int j1 = MathHelper.floor_double(d7 + d11 / 2.0D); + int k1 = MathHelper.floor_double(d8 + d10 / 2.0D); + + for (int l1 = j; l1 <= i1; ++l1) { + double d12 = ((double) l1 + 0.5D - d6) / (d10 / 2.0D); + if (d12 * d12 < 1.0D) { + for (int i2 = k; i2 <= j1; ++i2) { + double d13 = ((double) i2 + 0.5D - d7) / (d11 / 2.0D); + if (d12 * d12 + d13 * d13 < 1.0D) { + for (int j2 = l; j2 <= k1; ++j2) { + double d14 = ((double) j2 + 0.5D - d8) / (d10 / 2.0D); + if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D) { + BlockPos blockpos1 = new BlockPos(l1, i2, j2); + if (this.predicate.apply(world.getBlockState(blockpos1))) { + world.setBlockState(blockpos1, this.oreBlock, 2); + } + } + } + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenPumpkin.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenPumpkin.java new file mode 100644 index 0000000..358eedb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenPumpkin.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPumpkin; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenPumpkin extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenPumpkin"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 64; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) && world.getBlockState(blockpos1.down()).getBlock() == Blocks.grass + && Blocks.pumpkin.canPlaceBlockAt(world, blockpos1)) { + world.setBlockState(blockpos1, Blocks.pumpkin.getDefaultState().withProperty(BlockPumpkin.FACING, + EnumFacing.Plane.HORIZONTAL.random(random)), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenReed.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenReed.java new file mode 100644 index 0000000..5587f34 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenReed.java @@ -0,0 +1,61 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenReed extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenReed"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 20; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(4) - random.nextInt(4), 0, + random.nextInt(4) - random.nextInt(4)); + if (world.isAirBlock(blockpos1)) { + BlockPos blockpos2 = blockpos1.down(); + if (world.getBlockState(blockpos2.west()).getBlock().getMaterial() == Material.water + || world.getBlockState(blockpos2.east()).getBlock().getMaterial() == Material.water + || world.getBlockState(blockpos2.north()).getBlock().getMaterial() == Material.water + || world.getBlockState(blockpos2.south()).getBlock().getMaterial() == Material.water) { + int j = 2 + random.nextInt(random.nextInt(3) + 1); + + for (int k = 0; k < j; ++k) { + if (Blocks.reeds.canBlockStay(world, blockpos1)) { + world.setBlockState(blockpos1.up(k), Blocks.reeds.getDefaultState(), 2); + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSand.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSand.java new file mode 100644 index 0000000..1186ee4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSand.java @@ -0,0 +1,73 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenSand extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenSand"); + } + + private Block block; + private int radius; + + public WorldGenSand(Block parBlock, int parInt1) { + this.block = parBlock; + this.radius = parInt1; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (world.getBlockState(blockpos).getBlock().getMaterial() != Material.water) { + return false; + } else { + int i = random.nextInt(this.radius - 2) + 2; + byte b0 = 2; + + for (int j = blockpos.getX() - i; j <= blockpos.getX() + i; ++j) { + for (int k = blockpos.getZ() - i; k <= blockpos.getZ() + i; ++k) { + int l = j - blockpos.getX(); + int i1 = k - blockpos.getZ(); + if (l * l + i1 * i1 <= i * i) { + for (int j1 = blockpos.getY() - b0; j1 <= blockpos.getY() + b0; ++j1) { + BlockPos blockpos1 = new BlockPos(j, j1, k); + Block blockx = world.getBlockState(blockpos1).getBlock(); + if (blockx == Blocks.dirt || blockx == Blocks.grass) { + world.setBlockState(blockpos1, this.block.getDefaultState(), 2); + } + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSavannaTree.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSavannaTree.java new file mode 100644 index 0000000..fda84c9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSavannaTree.java @@ -0,0 +1,202 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNewLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockNewLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenSavannaTree extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenSavannaTree"); + } + + private static final IBlockState field_181643_a = Blocks.log2.getDefaultState().withProperty(BlockNewLog.VARIANT, + BlockPlanks.EnumType.ACACIA); + private static final IBlockState field_181644_b = Blocks.leaves2.getDefaultState() + .withProperty(BlockNewLeaf.VARIANT, BlockPlanks.EnumType.ACACIA) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenSavannaTree(boolean parFlag) { + super(parFlag); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = random.nextInt(3) + random.nextInt(3) + 5; + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 <= 256) { + for (int j = blockpos.getY(); j <= blockpos.getY() + 1 + i; ++j) { + byte b0 = 1; + if (j == blockpos.getY()) { + b0 = 0; + } + + if (j >= blockpos.getY() + 1 + i - 2) { + b0 = 2; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) { + for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) { + if (j >= 0 && j < 256) { + if (!this.func_150523_a( + world.getBlockState(blockpos$mutableblockpos.func_181079_c(k, j, l)).getBlock())) { + flag = false; + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block = world.getBlockState(blockpos.down()).getBlock(); + if ((block == Blocks.grass || block == Blocks.dirt) && blockpos.getY() < 256 - i - 1) { + this.func_175921_a(world, blockpos.down()); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(random); + int j2 = i - random.nextInt(4) - 1; + int k2 = 3 - random.nextInt(3); + int l2 = blockpos.getX(); + int i1 = blockpos.getZ(); + int j1 = 0; + + for (int k1 = 0; k1 < i; ++k1) { + int l1 = blockpos.getY() + k1; + if (k1 >= j2 && k2 > 0) { + l2 += enumfacing.getFrontOffsetX(); + i1 += enumfacing.getFrontOffsetZ(); + --k2; + } + + BlockPos blockpos1 = new BlockPos(l2, l1, i1); + Material material = world.getBlockState(blockpos1).getBlock().getMaterial(); + if (material == Material.air || material == Material.leaves) { + this.func_181642_b(world, blockpos1); + j1 = l1; + } + } + + BlockPos blockpos3 = new BlockPos(l2, j1, i1); + + for (int i3 = -3; i3 <= 3; ++i3) { + for (int l3 = -3; l3 <= 3; ++l3) { + if (Math.abs(i3) != 3 || Math.abs(l3) != 3) { + this.func_175924_b(world, blockpos3.add(i3, 0, l3)); + } + } + } + + blockpos3 = blockpos3.up(); + + for (int j3 = -1; j3 <= 1; ++j3) { + for (int i4 = -1; i4 <= 1; ++i4) { + this.func_175924_b(world, blockpos3.add(j3, 0, i4)); + } + } + + this.func_175924_b(world, blockpos3.east(2)); + this.func_175924_b(world, blockpos3.west(2)); + this.func_175924_b(world, blockpos3.south(2)); + this.func_175924_b(world, blockpos3.north(2)); + l2 = blockpos.getX(); + i1 = blockpos.getZ(); + EnumFacing enumfacing1 = EnumFacing.Plane.HORIZONTAL.random(random); + if (enumfacing1 != enumfacing) { + int k3 = j2 - random.nextInt(2) - 1; + int j4 = 1 + random.nextInt(3); + j1 = 0; + + for (int k4 = k3; k4 < i && j4 > 0; --j4) { + if (k4 >= 1) { + int i2 = blockpos.getY() + k4; + l2 += enumfacing1.getFrontOffsetX(); + i1 += enumfacing1.getFrontOffsetZ(); + BlockPos blockpos2 = new BlockPos(l2, i2, i1); + Material material1 = world.getBlockState(blockpos2).getBlock().getMaterial(); + if (material1 == Material.air || material1 == Material.leaves) { + this.func_181642_b(world, blockpos2); + j1 = i2; + } + } + + ++k4; + } + + if (j1 > 0) { + BlockPos blockpos4 = new BlockPos(l2, j1, i1); + + for (int l4 = -2; l4 <= 2; ++l4) { + for (int j5 = -2; j5 <= 2; ++j5) { + if (Math.abs(l4) != 2 || Math.abs(j5) != 2) { + this.func_175924_b(world, blockpos4.add(l4, 0, j5)); + } + } + } + + blockpos4 = blockpos4.up(); + + for (int i5 = -1; i5 <= 1; ++i5) { + for (int k5 = -1; k5 <= 1; ++k5) { + this.func_175924_b(world, blockpos4.add(i5, 0, k5)); + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + private void func_181642_b(World parWorld, BlockPos parBlockPos) { + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, field_181643_a); + } + + private void func_175924_b(World worldIn, BlockPos parBlockPos) { + Material material = worldIn.getBlockState(parBlockPos).getBlock().getMaterial(); + if (material == Material.air || material == Material.leaves) { + this.setBlockAndNotifyAdequately(worldIn, parBlockPos, field_181644_b); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenShrub.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenShrub.java new file mode 100644 index 0000000..6a03569 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenShrub.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenTrees; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenShrub extends WorldGenTrees { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenShrub"); + } + + private final IBlockState leavesMetadata; + private final IBlockState woodMetadata; + + public WorldGenShrub(IBlockState parIBlockState, IBlockState parIBlockState2) { + super(false); + this.woodMetadata = parIBlockState; + this.leavesMetadata = parIBlockState2; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + Block block; + while (((block = world.getBlockState(blockpos).getBlock()).getMaterial() == Material.air + || block.getMaterial() == Material.leaves) && blockpos.getY() > 0) { + blockpos = blockpos.down(); + } + + Block block1 = world.getBlockState(blockpos).getBlock(); + if (block1 == Blocks.dirt || block1 == Blocks.grass) { + blockpos = blockpos.up(); + this.setBlockAndNotifyAdequately(world, blockpos, this.woodMetadata); + + for (int i = blockpos.getY(); i <= blockpos.getY() + 2; ++i) { + int j = i - blockpos.getY(); + int k = 2 - j; + + for (int l = blockpos.getX() - k; l <= blockpos.getX() + k; ++l) { + int i1 = l - blockpos.getX(); + + for (int j1 = blockpos.getZ() - k; j1 <= blockpos.getZ() + k; ++j1) { + int k1 = j1 - blockpos.getZ(); + if (Math.abs(i1) != k || Math.abs(k1) != k || random.nextInt(2) != 0) { + BlockPos blockpos1 = new BlockPos(l, i, j1); + if (!world.getBlockState(blockpos1).getBlock().isFullBlock()) { + this.setBlockAndNotifyAdequately(world, blockpos1, this.leavesMetadata); + } + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSpikes.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSpikes.java new file mode 100644 index 0000000..d336d4a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSpikes.java @@ -0,0 +1,86 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityEnderCrystal; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenSpikes extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenSpikes"); + } + + private Block baseBlockRequired; + + public WorldGenSpikes(Block parBlock) { + this.baseBlockRequired = parBlock; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + if (world.isAirBlock(blockpos) && world.getBlockState(blockpos.down()).getBlock() == this.baseBlockRequired) { + int i = random.nextInt(32) + 6; + int j = random.nextInt(4) + 1; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = blockpos.getX() - j; k <= blockpos.getX() + j; ++k) { + for (int l = blockpos.getZ() - j; l <= blockpos.getZ() + j; ++l) { + int i1 = k - blockpos.getX(); + int j1 = l - blockpos.getZ(); + if (i1 * i1 + j1 * j1 <= j * j + 1 + && world.getBlockState(blockpos$mutableblockpos.func_181079_c(k, blockpos.getY() - 1, l)) + .getBlock() != this.baseBlockRequired) { + return false; + } + } + } + + for (int l1 = blockpos.getY(); l1 < blockpos.getY() + i && l1 < 256; ++l1) { + for (int i2 = blockpos.getX() - j; i2 <= blockpos.getX() + j; ++i2) { + for (int j2 = blockpos.getZ() - j; j2 <= blockpos.getZ() + j; ++j2) { + int k2 = i2 - blockpos.getX(); + int k1 = j2 - blockpos.getZ(); + if (k2 * k2 + k1 * k1 <= j * j + 1) { + world.setBlockState(new BlockPos(i2, l1, j2), Blocks.obsidian.getDefaultState(), 2); + } + } + } + } + + EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world); + entityendercrystal.setLocationAndAngles((double) ((float) blockpos.getX() + 0.5F), + (double) (blockpos.getY() + i), (double) ((float) blockpos.getZ() + 0.5F), + random.nextFloat() * 360.0F, 0.0F); + world.spawnEntityInWorld(entityendercrystal); + world.setBlockState(blockpos.up(i), Blocks.bedrock.getDefaultState(), 2); + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSwamp.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSwamp.java new file mode 100644 index 0000000..fa97579 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -0,0 +1,189 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockVine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenSwamp extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenSwamp"); + } + + private static final IBlockState field_181648_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.OAK); + private static final IBlockState field_181649_b = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK) + .withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenSwamp() { + super(false); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i; + for (i = random.nextInt(4) + 5; world.getBlockState(blockpos.down()).getBlock() + .getMaterial() == Material.water; blockpos = blockpos.down()) { + ; + } + + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 <= 256) { + for (int j = blockpos.getY(); j <= blockpos.getY() + 1 + i; ++j) { + byte b0 = 1; + if (j == blockpos.getY()) { + b0 = 0; + } + + if (j >= blockpos.getY() + 1 + i - 2) { + b0 = 3; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) { + for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) { + if (j >= 0 && j < 256) { + Block block = world.getBlockState(blockpos$mutableblockpos.func_181079_c(k, j, l)) + .getBlock(); + if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) { + if (block != Blocks.water && block != Blocks.flowing_water) { + flag = false; + } else if (j > blockpos.getY()) { + flag = false; + } + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + if ((block1 == Blocks.grass || block1 == Blocks.dirt) && blockpos.getY() < 256 - i - 1) { + this.func_175921_a(world, blockpos.down()); + + for (int k1 = blockpos.getY() - 3 + i; k1 <= blockpos.getY() + i; ++k1) { + int j2 = k1 - (blockpos.getY() + i); + int l2 = 2 - j2 / 2; + + for (int j3 = blockpos.getX() - l2; j3 <= blockpos.getX() + l2; ++j3) { + int k3 = j3 - blockpos.getX(); + + for (int i1 = blockpos.getZ() - l2; i1 <= blockpos.getZ() + l2; ++i1) { + int j1 = i1 - blockpos.getZ(); + if (Math.abs(k3) != l2 || Math.abs(j1) != l2 || random.nextInt(2) != 0 && j2 != 0) { + BlockPos blockpos1 = new BlockPos(j3, k1, i1); + if (!world.getBlockState(blockpos1).getBlock().isFullBlock()) { + this.setBlockAndNotifyAdequately(world, blockpos1, field_181649_b); + } + } + } + } + } + + for (int l1 = 0; l1 < i; ++l1) { + Block block2 = world.getBlockState(blockpos.up(l1)).getBlock(); + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves + || block2 == Blocks.flowing_water || block2 == Blocks.water) { + this.setBlockAndNotifyAdequately(world, blockpos.up(l1), field_181648_a); + } + } + + for (int i2 = blockpos.getY() - 3 + i; i2 <= blockpos.getY() + i; ++i2) { + int k2 = i2 - (blockpos.getY() + i); + int i3 = 2 - k2 / 2; + BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); + + for (int l3 = blockpos.getX() - i3; l3 <= blockpos.getX() + i3; ++l3) { + for (int i4 = blockpos.getZ() - i3; i4 <= blockpos.getZ() + i3; ++i4) { + blockpos$mutableblockpos1.func_181079_c(l3, i2, i4); + if (world.getBlockState(blockpos$mutableblockpos1).getBlock() + .getMaterial() == Material.leaves) { + BlockPos blockpos4 = blockpos$mutableblockpos1.west(); + BlockPos blockpos5 = blockpos$mutableblockpos1.east(); + BlockPos blockpos2 = blockpos$mutableblockpos1.north(); + BlockPos blockpos3 = blockpos$mutableblockpos1.south(); + if (random.nextInt(4) == 0 && world.getBlockState(blockpos4).getBlock() + .getMaterial() == Material.air) { + this.func_181647_a(world, blockpos4, BlockVine.EAST); + } + + if (random.nextInt(4) == 0 && world.getBlockState(blockpos5).getBlock() + .getMaterial() == Material.air) { + this.func_181647_a(world, blockpos5, BlockVine.WEST); + } + + if (random.nextInt(4) == 0 && world.getBlockState(blockpos2).getBlock() + .getMaterial() == Material.air) { + this.func_181647_a(world, blockpos2, BlockVine.SOUTH); + } + + if (random.nextInt(4) == 0 && world.getBlockState(blockpos3).getBlock() + .getMaterial() == Material.air) { + this.func_181647_a(world, blockpos3, BlockVine.NORTH); + } + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + private void func_181647_a(World parWorld, BlockPos parBlockPos, PropertyBool parPropertyBool) { + IBlockState iblockstate = Blocks.vine.getDefaultState().withProperty(parPropertyBool, Boolean.valueOf(true)); + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, iblockstate); + int i = 4; + + for (parBlockPos = parBlockPos + .down(); parWorld.getBlockState(parBlockPos).getBlock().getMaterial() == Material.air && i > 0; --i) { + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, iblockstate); + parBlockPos = parBlockPos.down(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga1.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga1.java new file mode 100644 index 0000000..36fea5b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga1.java @@ -0,0 +1,131 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenTaiga1 extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenTaiga1"); + } + + private static final IBlockState field_181636_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.SPRUCE); + private static final IBlockState field_181637_b = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenTaiga1() { + super(false); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = random.nextInt(5) + 7; + int j = i - random.nextInt(2) - 3; + int k = i - j; + int l = 1 + random.nextInt(k + 1); + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 <= 256) { + for (int i1 = blockpos.getY(); i1 <= blockpos.getY() + 1 + i && flag; ++i1) { + int j1 = 1; + if (i1 - blockpos.getY() < j) { + j1 = 0; + } else { + j1 = l; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = blockpos.getX() - j1; k1 <= blockpos.getX() + j1 && flag; ++k1) { + for (int l1 = blockpos.getZ() - j1; l1 <= blockpos.getZ() + j1 && flag; ++l1) { + if (i1 >= 0 && i1 < 256) { + if (!this.func_150523_a(world + .getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).getBlock())) { + flag = false; + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block = world.getBlockState(blockpos.down()).getBlock(); + if ((block == Blocks.grass || block == Blocks.dirt) && blockpos.getY() < 256 - i - 1) { + this.func_175921_a(world, blockpos.down()); + int k2 = 0; + + for (int l2 = blockpos.getY() + i; l2 >= blockpos.getY() + j; --l2) { + for (int j3 = blockpos.getX() - k2; j3 <= blockpos.getX() + k2; ++j3) { + int k3 = j3 - blockpos.getX(); + + for (int i2 = blockpos.getZ() - k2; i2 <= blockpos.getZ() + k2; ++i2) { + int j2 = i2 - blockpos.getZ(); + if (Math.abs(k3) != k2 || Math.abs(j2) != k2 || k2 <= 0) { + BlockPos blockpos1 = new BlockPos(j3, l2, i2); + if (!world.getBlockState(blockpos1).getBlock().isFullBlock()) { + this.setBlockAndNotifyAdequately(world, blockpos1, field_181637_b); + } + } + } + } + + if (k2 >= 1 && l2 == blockpos.getY() + j + 1) { + --k2; + } else if (k2 < l) { + ++k2; + } + } + + for (int i3 = 0; i3 < i - 1; ++i3) { + Block block1 = world.getBlockState(blockpos.up(i3)).getBlock(); + if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.up(i3), field_181636_a); + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga2.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga2.java new file mode 100644 index 0000000..87c4517 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -0,0 +1,144 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenTaiga2 extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenTaiga2"); + } + + private static final IBlockState field_181645_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.SPRUCE); + private static final IBlockState field_181646_b = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenTaiga2(boolean parFlag) { + super(parFlag); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = random.nextInt(4) + 6; + int j = 1 + random.nextInt(2); + int k = i - j; + int l = 2 + random.nextInt(2); + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 <= 256) { + for (int i1 = blockpos.getY(); i1 <= blockpos.getY() + 1 + i && flag; ++i1) { + int j1 = 1; + if (i1 - blockpos.getY() < j) { + j1 = 0; + } else { + j1 = l; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = blockpos.getX() - j1; k1 <= blockpos.getX() + j1 && flag; ++k1) { + for (int l1 = blockpos.getZ() - j1; l1 <= blockpos.getZ() + j1 && flag; ++l1) { + if (i1 >= 0 && i1 < 256) { + Block block = world.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)) + .getBlock(); + if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) { + flag = false; + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) + && blockpos.getY() < 256 - i - 1) { + this.func_175921_a(world, blockpos.down()); + int i3 = random.nextInt(2); + int j3 = 1; + byte b0 = 0; + + for (int k3 = 0; k3 <= k; ++k3) { + int i4 = blockpos.getY() + i - k3; + + for (int i2 = blockpos.getX() - i3; i2 <= blockpos.getX() + i3; ++i2) { + int j2 = i2 - blockpos.getX(); + + for (int k2 = blockpos.getZ() - i3; k2 <= blockpos.getZ() + i3; ++k2) { + int l2 = k2 - blockpos.getZ(); + if (Math.abs(j2) != i3 || Math.abs(l2) != i3 || i3 <= 0) { + BlockPos blockpos1 = new BlockPos(i2, i4, k2); + if (!world.getBlockState(blockpos1).getBlock().isFullBlock()) { + this.setBlockAndNotifyAdequately(world, blockpos1, field_181646_b); + } + } + } + } + + if (i3 >= j3) { + i3 = b0; + b0 = 1; + ++j3; + if (j3 > l) { + j3 = l; + } + } else { + ++i3; + } + } + + int l3 = random.nextInt(3); + + for (int j4 = 0; j4 < i - l3; ++j4) { + Block block2 = world.getBlockState(blockpos.up(j4)).getBlock(); + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) { + this.setBlockAndNotifyAdequately(world, blockpos.up(j4), field_181645_a); + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTallGrass.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTallGrass.java new file mode 100644 index 0000000..4d8c103 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTallGrass.java @@ -0,0 +1,64 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTallGrass; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenTallGrass extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenTallGrass"); + } + + private final IBlockState tallGrassState; + + public WorldGenTallGrass(BlockTallGrass.EnumType parEnumType) { + this.tallGrassState = Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, parEnumType); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + Block block; + while (((block = world.getBlockState(blockpos).getBlock()).getMaterial() == Material.air + || block.getMaterial() == Material.leaves) && blockpos.getY() > 0) { + blockpos = blockpos.down(); + } + + for (int i = 0; i < 128; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(8) - random.nextInt(8), + random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8)); + if (world.isAirBlock(blockpos1) && Blocks.tallgrass.canBlockStay(world, blockpos1, this.tallGrassState)) { + world.setBlockState(blockpos1, this.tallGrassState, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTrees.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTrees.java new file mode 100644 index 0000000..dc117c2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTrees.java @@ -0,0 +1,242 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockCocoa; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLeaves; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLeaf; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockOldLog; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockVine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.properties.PropertyBool; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenTrees extends WorldGenAbstractTree { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenTrees"); + } + + private static final IBlockState field_181653_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, + BlockPlanks.EnumType.OAK); + private static final IBlockState field_181654_b = Blocks.leaves.getDefaultState() + .withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK) + .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + private final int minTreeHeight; + private final boolean vinesGrow; + private final IBlockState metaWood; + private final IBlockState metaLeaves; + + public WorldGenTrees(boolean parFlag) { + this(parFlag, 4, field_181653_a, field_181654_b, false); + } + + public WorldGenTrees(boolean parFlag, int parInt1, IBlockState parIBlockState, IBlockState parIBlockState2, + boolean parFlag2) { + super(parFlag); + this.minTreeHeight = parInt1; + this.metaWood = parIBlockState; + this.metaLeaves = parIBlockState2; + this.vinesGrow = parFlag2; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + int i = random.nextInt(3) + this.minTreeHeight; + boolean flag = true; + if (blockpos.getY() >= 1 && blockpos.getY() + i + 1 <= 256) { + for (int j = blockpos.getY(); j <= blockpos.getY() + 1 + i; ++j) { + byte b0 = 1; + if (j == blockpos.getY()) { + b0 = 0; + } + + if (j >= blockpos.getY() + 1 + i - 2) { + b0 = 2; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = blockpos.getX() - b0; k <= blockpos.getX() + b0 && flag; ++k) { + for (int l = blockpos.getZ() - b0; l <= blockpos.getZ() + b0 && flag; ++l) { + if (j >= 0 && j < 256) { + if (!this.func_150523_a( + world.getBlockState(blockpos$mutableblockpos.func_181079_c(k, j, l)).getBlock())) { + flag = false; + } + } else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } else { + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) + && blockpos.getY() < 256 - i - 1) { + this.func_175921_a(world, blockpos.down()); + byte b1 = 3; + byte b2 = 0; + + for (int j2 = blockpos.getY() - b1 + i; j2 <= blockpos.getY() + i; ++j2) { + int j3 = j2 - (blockpos.getY() + i); + int i1 = b2 + 1 - j3 / 2; + + for (int j1 = blockpos.getX() - i1; j1 <= blockpos.getX() + i1; ++j1) { + int k1 = j1 - blockpos.getX(); + + for (int l1 = blockpos.getZ() - i1; l1 <= blockpos.getZ() + i1; ++l1) { + int i2 = l1 - blockpos.getZ(); + if (Math.abs(k1) != i1 || Math.abs(i2) != i1 || random.nextInt(2) != 0 && j3 != 0) { + BlockPos blockpos1 = new BlockPos(j1, j2, l1); + Block block = world.getBlockState(blockpos1).getBlock(); + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves + || block.getMaterial() == Material.vine) { + this.setBlockAndNotifyAdequately(world, blockpos1, this.metaLeaves); + } + } + } + } + } + + for (int k2 = 0; k2 < i; ++k2) { + Block block2 = world.getBlockState(blockpos.up(k2)).getBlock(); + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves + || block2.getMaterial() == Material.vine) { + this.setBlockAndNotifyAdequately(world, blockpos.up(k2), this.metaWood); + if (this.vinesGrow && k2 > 0) { + if (random.nextInt(3) > 0 && world.isAirBlock(blockpos.add(-1, k2, 0))) { + this.func_181651_a(world, blockpos.add(-1, k2, 0), BlockVine.EAST); + } + + if (random.nextInt(3) > 0 && world.isAirBlock(blockpos.add(1, k2, 0))) { + this.func_181651_a(world, blockpos.add(1, k2, 0), BlockVine.WEST); + } + + if (random.nextInt(3) > 0 && world.isAirBlock(blockpos.add(0, k2, -1))) { + this.func_181651_a(world, blockpos.add(0, k2, -1), BlockVine.SOUTH); + } + + if (random.nextInt(3) > 0 && world.isAirBlock(blockpos.add(0, k2, 1))) { + this.func_181651_a(world, blockpos.add(0, k2, 1), BlockVine.NORTH); + } + } + } + } + + if (this.vinesGrow) { + for (int l2 = blockpos.getY() - 3 + i; l2 <= blockpos.getY() + i; ++l2) { + int k3 = l2 - (blockpos.getY() + i); + int l3 = 2 - k3 / 2; + BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); + + for (int i4 = blockpos.getX() - l3; i4 <= blockpos.getX() + l3; ++i4) { + for (int j4 = blockpos.getZ() - l3; j4 <= blockpos.getZ() + l3; ++j4) { + blockpos$mutableblockpos1.func_181079_c(i4, l2, j4); + if (world.getBlockState(blockpos$mutableblockpos1).getBlock() + .getMaterial() == Material.leaves) { + BlockPos blockpos3 = blockpos$mutableblockpos1.west(); + BlockPos blockpos4 = blockpos$mutableblockpos1.east(); + BlockPos blockpos5 = blockpos$mutableblockpos1.north(); + BlockPos blockpos2 = blockpos$mutableblockpos1.south(); + if (random.nextInt(4) == 0 && world.getBlockState(blockpos3).getBlock() + .getMaterial() == Material.air) { + this.func_181650_b(world, blockpos3, BlockVine.EAST); + } + + if (random.nextInt(4) == 0 && world.getBlockState(blockpos4).getBlock() + .getMaterial() == Material.air) { + this.func_181650_b(world, blockpos4, BlockVine.WEST); + } + + if (random.nextInt(4) == 0 && world.getBlockState(blockpos5).getBlock() + .getMaterial() == Material.air) { + this.func_181650_b(world, blockpos5, BlockVine.SOUTH); + } + + if (random.nextInt(4) == 0 && world.getBlockState(blockpos2).getBlock() + .getMaterial() == Material.air) { + this.func_181650_b(world, blockpos2, BlockVine.NORTH); + } + } + } + } + } + + if (random.nextInt(5) == 0 && i > 5) { + for (int i3 = 0; i3 < 2; ++i3) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (random.nextInt(4 - i3) == 0) { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + this.func_181652_a(world, random.nextInt(3), + blockpos.add(enumfacing1.getFrontOffsetX(), i - 5 + i3, + enumfacing1.getFrontOffsetZ()), + enumfacing); + } + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + private void func_181652_a(World parWorld, int parInt1, BlockPos parBlockPos, EnumFacing parEnumFacing) { + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, Blocks.cocoa.getDefaultState() + .withProperty(BlockCocoa.AGE, Integer.valueOf(parInt1)).withProperty(BlockCocoa.FACING, parEnumFacing)); + } + + private void func_181651_a(World parWorld, BlockPos parBlockPos, PropertyBool parPropertyBool) { + this.setBlockAndNotifyAdequately(parWorld, parBlockPos, + Blocks.vine.getDefaultState().withProperty(parPropertyBool, Boolean.valueOf(true))); + } + + private void func_181650_b(World parWorld, BlockPos parBlockPos, PropertyBool parPropertyBool) { + this.func_181651_a(parWorld, parBlockPos, parPropertyBool); + int i = 4; + + for (parBlockPos = parBlockPos + .down(); parWorld.getBlockState(parBlockPos).getBlock().getMaterial() == Material.air && i > 0; --i) { + this.func_181651_a(parWorld, parBlockPos, parPropertyBool); + parBlockPos = parBlockPos.down(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenVines.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenVines.java new file mode 100644 index 0000000..aae30de --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenVines.java @@ -0,0 +1,62 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockVine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenVines extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenVines"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (; blockpos.getY() < 128; blockpos = blockpos.up()) { + if (world.isAirBlock(blockpos)) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL.facings()) { + if (Blocks.vine.canPlaceBlockOnSide(world, blockpos, enumfacing)) { + IBlockState iblockstate = Blocks.vine.getDefaultState() + .withProperty(BlockVine.NORTH, Boolean.valueOf(enumfacing == EnumFacing.NORTH)) + .withProperty(BlockVine.EAST, Boolean.valueOf(enumfacing == EnumFacing.EAST)) + .withProperty(BlockVine.SOUTH, Boolean.valueOf(enumfacing == EnumFacing.SOUTH)) + .withProperty(BlockVine.WEST, Boolean.valueOf(enumfacing == EnumFacing.WEST)); + world.setBlockState(blockpos, iblockstate, 2); + break; + } + } + } else { + blockpos = blockpos.add(random.nextInt(4) - random.nextInt(4), 0, + random.nextInt(4) - random.nextInt(4)); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenWaterlily.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenWaterlily.java new file mode 100644 index 0000000..5bc0637 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenWaterlily.java @@ -0,0 +1,50 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGenWaterlily extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenWaterlily"); + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + for (int i = 0; i < 10; ++i) { + int j = blockpos.getX() + random.nextInt(8) - random.nextInt(8); + int k = blockpos.getY() + random.nextInt(4) - random.nextInt(4); + int l = blockpos.getZ() + random.nextInt(8) - random.nextInt(8); + if (world.isAirBlock(new BlockPos(j, k, l)) + && Blocks.waterlily.canPlaceBlockAt(world, new BlockPos(j, k, l))) { + world.setBlockState(new BlockPos(j, k, l), Blocks.waterlily.getDefaultState(), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenerator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenerator.java new file mode 100644 index 0000000..5a8a904 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenerator.java @@ -0,0 +1,59 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenerator"); + } + + private final boolean doBlockNotify; + + public WorldGenerator() { + this(false); + } + + public WorldGenerator(boolean notify) { + this.doBlockNotify = notify; + } + + public abstract boolean generate(World var1, EaglercraftRandom var2, BlockPos var3); + + public void func_175904_e() { + } + + protected void setBlockAndNotifyAdequately(World worldIn, BlockPos pos, IBlockState state) { + if (this.doBlockNotify) { + worldIn.setBlockState(pos, state, 3); + } else { + worldIn.setBlockState(pos, state, 2); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java new file mode 100644 index 0000000..5f81245 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature.WorldGenerator; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldGeneratorBonusChest extends WorldGenerator { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGeneratorBonusChest"); + } + + private final List chestItems; + private final int itemsToGenerateInBonusChest; + + public WorldGeneratorBonusChest(List parList, int parInt1) { + this.chestItems = parList; + this.itemsToGenerateInBonusChest = parInt1; + } + + public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { + Block block; + while (((block = world.getBlockState(blockpos).getBlock()).getMaterial() == Material.air + || block.getMaterial() == Material.leaves) && blockpos.getY() > 1) { + blockpos = blockpos.down(); + } + + if (blockpos.getY() < 1) { + return false; + } else { + blockpos = blockpos.up(); + + for (int i = 0; i < 4; ++i) { + BlockPos blockpos1 = blockpos.add(random.nextInt(4) - random.nextInt(4), + random.nextInt(3) - random.nextInt(3), random.nextInt(4) - random.nextInt(4)); + if (world.isAirBlock(blockpos1) && World.doesBlockHaveSolidTopSurface(world, blockpos1.down())) { + world.setBlockState(blockpos1, Blocks.chest.getDefaultState(), 2); + TileEntity tileentity = world.getTileEntity(blockpos1); + if (tileentity instanceof TileEntityChest) { + WeightedRandomChestContent.generateChestContents(random, this.chestItems, + (TileEntityChest) tileentity, this.itemsToGenerateInBonusChest); + } + + BlockPos blockpos2 = blockpos1.east(); + BlockPos blockpos3 = blockpos1.west(); + BlockPos blockpos4 = blockpos1.north(); + BlockPos blockpos5 = blockpos1.south(); + if (world.isAirBlock(blockpos3) && World.doesBlockHaveSolidTopSurface(world, blockpos3.down())) { + world.setBlockState(blockpos3, Blocks.torch.getDefaultState(), 2); + } + + if (world.isAirBlock(blockpos2) && World.doesBlockHaveSolidTopSurface(world, blockpos2.down())) { + world.setBlockState(blockpos2, Blocks.torch.getDefaultState(), 2); + } + + if (world.isAirBlock(blockpos4) && World.doesBlockHaveSolidTopSurface(world, blockpos4.down())) { + world.setBlockState(blockpos4, Blocks.torch.getDefaultState(), 2); + } + + if (world.isAirBlock(blockpos5) && World.doesBlockHaveSolidTopSurface(world, blockpos5.down())) { + world.setBlockState(blockpos5, Blocks.torch.getDefaultState(), 2); + } + + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayer.java new file mode 100644 index 0000000..024d7a7 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayer.java @@ -0,0 +1,254 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerAddIsland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerAddMushroomIsland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerAddSnow; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerBiome; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerBiomeEdge; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerDeepOcean; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerEdge; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerFuzzyZoom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerHills; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerIsland; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerRareBiome; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerRemoveTooMuchOcean; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerRiver; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerRiverInit; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerRiverMix; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerShore; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerSmooth; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerVoronoiZoom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerZoom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayer"); + } + + private long worldGenSeed; + protected GenLayer parent; + private long chunkSeed; + protected long baseSeed; + + public static GenLayer[] initializeAllBiomeGenerators(long seed, WorldType parWorldType, String parString1) { + GenLayerIsland genlayerisland = new GenLayerIsland(1L); + GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland); + GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom); + GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland); + GenLayerAddIsland genlayeraddisland1 = new GenLayerAddIsland(2L, genlayerzoom); + genlayeraddisland1 = new GenLayerAddIsland(50L, genlayeraddisland1); + genlayeraddisland1 = new GenLayerAddIsland(70L, genlayeraddisland1); + GenLayerRemoveTooMuchOcean genlayerremovetoomuchocean = new GenLayerRemoveTooMuchOcean(2L, genlayeraddisland1); + GenLayerAddSnow genlayeraddsnow = new GenLayerAddSnow(2L, genlayerremovetoomuchocean); + GenLayerAddIsland genlayeraddisland2 = new GenLayerAddIsland(3L, genlayeraddsnow); + GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland2, GenLayerEdge.Mode.COOL_WARM); + genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE); + genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL); + GenLayerZoom genlayerzoom1 = new GenLayerZoom(2002L, genlayeredge); + genlayerzoom1 = new GenLayerZoom(2003L, genlayerzoom1); + GenLayerAddIsland genlayeraddisland3 = new GenLayerAddIsland(4L, genlayerzoom1); + GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland3); + GenLayerDeepOcean genlayerdeepocean = new GenLayerDeepOcean(4L, genlayeraddmushroomisland); + GenLayer genlayer2 = GenLayerZoom.magnify(1000L, genlayerdeepocean, 0); + ChunkProviderSettings chunkprovidersettings = null; + int i = 4; + int j = i; + if (parWorldType == WorldType.CUSTOMIZED && parString1.length() > 0) { + chunkprovidersettings = ChunkProviderSettings.Factory.jsonToFactory(parString1).func_177864_b(); + i = chunkprovidersettings.biomeSize; + j = chunkprovidersettings.riverSize; + } + + if (parWorldType == WorldType.LARGE_BIOMES) { + i = 6; + } + + GenLayer genlayer = GenLayerZoom.magnify(1000L, genlayer2, 0); + GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer); + GenLayerBiome genlayerbiome = new GenLayerBiome(200L, genlayer2, parWorldType, parString1); + GenLayer genlayer4 = GenLayerZoom.magnify(1000L, genlayerbiome, 2); + GenLayerBiomeEdge genlayerbiomeedge = new GenLayerBiomeEdge(1000L, genlayer4); + GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, genlayer1); + GenLayer genlayer3 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + genlayer3 = GenLayerZoom.magnify(1000L, genlayer3, j); + GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer3); + GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver); + genlayerhills = new GenLayerRareBiome(1001L, genlayerhills); + + for (int k = 0; k < i; ++k) { + genlayerhills = new GenLayerZoom((long) (1000 + k), genlayerhills); + if (k == 0) { + genlayerhills = new GenLayerAddIsland(3L, genlayerhills); + } + + if (k == 1 || i == 1) { + genlayerhills = new GenLayerShore(1000L, genlayerhills); + } + } + + GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, genlayerhills); + GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth); + GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, genlayerrivermix); + genlayerrivermix.initWorldGenSeed(seed); + genlayervoronoizoom.initWorldGenSeed(seed); + return new GenLayer[] { genlayerrivermix, genlayervoronoizoom, genlayerrivermix }; + } + + public GenLayer(long parLong1) { + this.baseSeed = parLong1; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += parLong1; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += parLong1; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += parLong1; + } + + /**+ + * Initialize layer's local worldGenSeed based on its own + * baseSeed and the world's global seed (passed in as an + * argument). + */ + public void initWorldGenSeed(long seed) { + this.worldGenSeed = seed; + if (this.parent != null) { + this.parent.initWorldGenSeed(seed); + } + + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + } + + /**+ + * Initialize layer's current chunkSeed based on the local + * worldGenSeed and the (x,z) chunk coordinates. + */ + public void initChunkSeed(long parLong1, long parLong2) { + this.chunkSeed = this.worldGenSeed; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += parLong1; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += parLong2; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += parLong1; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += parLong2; + } + + /**+ + * returns a LCG pseudo random number from [0, x). Args: int x + */ + protected int nextInt(int parInt1) { + int i = (int) ((this.chunkSeed >> 24) % (long) parInt1); + if (i < 0) { + i += parInt1; + } + + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += this.worldGenSeed; + return i; + } + + public abstract int[] getInts(int var1, int var2, int var3, int var4); + + protected static boolean biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB) { + if (biomeIDA == biomeIDB) { + return true; + } else if (biomeIDA != BiomeGenBase.mesaPlateau_F.biomeID && biomeIDA != BiomeGenBase.mesaPlateau.biomeID) { + final BiomeGenBase biomegenbase = BiomeGenBase.getBiome(biomeIDA); + final BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(biomeIDB); + + try { + return biomegenbase != null && biomegenbase1 != null ? biomegenbase.isEqualTo(biomegenbase1) : false; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Comparing biomes"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Biomes being compared"); + crashreportcategory.addCrashSection("Biome A ID", Integer.valueOf(biomeIDA)); + crashreportcategory.addCrashSection("Biome B ID", Integer.valueOf(biomeIDB)); + crashreportcategory.addCrashSectionCallable("Biome A", new Callable() { + public String call() throws Exception { + return String.valueOf(biomegenbase); + } + }); + crashreportcategory.addCrashSectionCallable("Biome B", new Callable() { + public String call() throws Exception { + return String.valueOf(biomegenbase1); + } + }); + throw new ReportedException(crashreport); + } + } else { + return biomeIDB == BiomeGenBase.mesaPlateau_F.biomeID || biomeIDB == BiomeGenBase.mesaPlateau.biomeID; + } + } + + /**+ + * returns true if the biomeId is one of the various ocean + * biomes. + */ + protected static boolean isBiomeOceanic(int parInt1) { + return parInt1 == BiomeGenBase.ocean.biomeID || parInt1 == BiomeGenBase.deepOcean.biomeID + || parInt1 == BiomeGenBase.frozenOcean.biomeID; + } + + /**+ + * selects a random integer from a set of provided integers + */ + protected int selectRandom(int... parArrayOfInt) { + return parArrayOfInt[this.nextInt(parArrayOfInt.length)]; + } + + /**+ + * returns the most frequently occurring number of the set, or a + * random number from those provided + */ + protected int selectModeOrRandom(int i, int j, int k, int l) { + return j == k && k == l ? j + : (i == j && i == k ? i + : (i == j && i == l ? i + : (i == k && i == l ? i + : (i == j && k != l ? i + : (i == k && j != l ? i + : (i == l && j != k ? i + : (j == k && i != l ? j + : (j == l && i != k ? j + : (k == l && i != j ? k + : this.selectRandom(new int[] { + i, j, k, l })))))))))); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddIsland.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddIsland.java new file mode 100644 index 0000000..3e1a195 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddIsland.java @@ -0,0 +1,107 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerAddIsland extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerAddIsland"); + } + + public GenLayerAddIsland(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i - 1; + int j1 = j - 1; + int k1 = k + 2; + int l1 = l + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i2 = 0; i2 < l; ++i2) { + for (int j2 = 0; j2 < k; ++j2) { + int k2 = aint[j2 + 0 + (i2 + 0) * k1]; + int l2 = aint[j2 + 2 + (i2 + 0) * k1]; + int i3 = aint[j2 + 0 + (i2 + 2) * k1]; + int j3 = aint[j2 + 2 + (i2 + 2) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + this.initChunkSeed((long) (j2 + i), (long) (i2 + j)); + if (k3 != 0 || k2 == 0 && l2 == 0 && i3 == 0 && j3 == 0) { + if (k3 > 0 && (k2 == 0 || l2 == 0 || i3 == 0 || j3 == 0)) { + if (this.nextInt(5) == 0) { + if (k3 == 4) { + aint1[j2 + i2 * k] = 4; + } else { + aint1[j2 + i2 * k] = 0; + } + } else { + aint1[j2 + i2 * k] = k3; + } + } else { + aint1[j2 + i2 * k] = k3; + } + } else { + int l3 = 1; + int i4 = 1; + if (k2 != 0 && this.nextInt(l3++) == 0) { + i4 = k2; + } + + if (l2 != 0 && this.nextInt(l3++) == 0) { + i4 = l2; + } + + if (i3 != 0 && this.nextInt(l3++) == 0) { + i4 = i3; + } + + if (j3 != 0 && this.nextInt(l3++) == 0) { + i4 = j3; + } + + if (this.nextInt(3) == 0) { + aint1[j2 + i2 * k] = i4; + } else if (i4 == 4) { + aint1[j2 + i2 * k] = 4; + } else { + aint1[j2 + i2 * k] = 0; + } + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java new file mode 100644 index 0000000..73bb84a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java @@ -0,0 +1,72 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerAddMushroomIsland extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerAddMushroomIsland"); + } + + public GenLayerAddMushroomIsland(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i - 1; + int j1 = j - 1; + int k1 = k + 2; + int l1 = l + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i2 = 0; i2 < l; ++i2) { + for (int j2 = 0; j2 < k; ++j2) { + int k2 = aint[j2 + 0 + (i2 + 0) * k1]; + int l2 = aint[j2 + 2 + (i2 + 0) * k1]; + int i3 = aint[j2 + 0 + (i2 + 2) * k1]; + int j3 = aint[j2 + 2 + (i2 + 2) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + this.initChunkSeed((long) (j2 + i), (long) (i2 + j)); + if (k3 == 0 && k2 == 0 && l2 == 0 && i3 == 0 && j3 == 0 && this.nextInt(100) == 0) { + aint1[j2 + i2 * k] = BiomeGenBase.mushroomIsland.biomeID; + } else { + aint1[j2 + i2 * k] = k3; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddSnow.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddSnow.java new file mode 100644 index 0000000..5b03c21 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddSnow.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerAddSnow extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerAddSnow"); + } + + public GenLayerAddSnow(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i - 1; + int j1 = j - 1; + int k1 = k + 2; + int l1 = l + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i2 = 0; i2 < l; ++i2) { + for (int j2 = 0; j2 < k; ++j2) { + int k2 = aint[j2 + 1 + (i2 + 1) * k1]; + this.initChunkSeed((long) (j2 + i), (long) (i2 + j)); + if (k2 == 0) { + aint1[j2 + i2 * k] = 0; + } else { + int l2 = this.nextInt(6); + if (l2 == 0) { + l2 = 4; + } else if (l2 <= 1) { + l2 = 3; + } else { + l2 = 1; + } + + aint1[j2 + i2 * k] = l2; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiome.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiome.java new file mode 100644 index 0000000..d1d5c4f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiome.java @@ -0,0 +1,116 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerBiome extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerBiome"); + } + + private BiomeGenBase[] field_151623_c = new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.desert, + BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains }; + private BiomeGenBase[] field_151621_d = new BiomeGenBase[] { BiomeGenBase.forest, BiomeGenBase.roofedForest, + BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland }; + private BiomeGenBase[] field_151622_e = new BiomeGenBase[] { BiomeGenBase.forest, BiomeGenBase.extremeHills, + BiomeGenBase.taiga, BiomeGenBase.plains }; + private BiomeGenBase[] field_151620_f = new BiomeGenBase[] { BiomeGenBase.icePlains, BiomeGenBase.icePlains, + BiomeGenBase.icePlains, BiomeGenBase.coldTaiga }; + private final ChunkProviderSettings field_175973_g; + + public GenLayerBiome(long parLong1, GenLayer parGenLayer, WorldType parWorldType, String parString1) { + super(parLong1); + this.parent = parGenLayer; + if (parWorldType == WorldType.DEFAULT_1_1) { + this.field_151623_c = new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.forest, + BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga }; + this.field_175973_g = null; + } else if (parWorldType == WorldType.CUSTOMIZED) { + this.field_175973_g = ChunkProviderSettings.Factory.jsonToFactory(parString1).func_177864_b(); + } else { + this.field_175973_g = null; + } + + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (j1 + i), (long) (i1 + j)); + int k1 = aint[j1 + i1 * k]; + int l1 = (k1 & 3840) >> 8; + k1 = k1 & -3841; + if (this.field_175973_g != null && this.field_175973_g.fixedBiome >= 0) { + aint1[j1 + i1 * k] = this.field_175973_g.fixedBiome; + } else if (isBiomeOceanic(k1)) { + aint1[j1 + i1 * k] = k1; + } else if (k1 == BiomeGenBase.mushroomIsland.biomeID) { + aint1[j1 + i1 * k] = k1; + } else if (k1 == 1) { + if (l1 > 0) { + if (this.nextInt(3) == 0) { + aint1[j1 + i1 * k] = BiomeGenBase.mesaPlateau.biomeID; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.mesaPlateau_F.biomeID; + } + } else { + aint1[j1 + i1 * k] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID; + } + } else if (k1 == 2) { + if (l1 > 0) { + aint1[j1 + i1 * k] = BiomeGenBase.jungle.biomeID; + } else { + aint1[j1 + i1 * k] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID; + } + } else if (k1 == 3) { + if (l1 > 0) { + aint1[j1 + i1 * k] = BiomeGenBase.megaTaiga.biomeID; + } else { + aint1[j1 + i1 * k] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID; + } + } else if (k1 == 4) { + aint1[j1 + i1 * k] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.mushroomIsland.biomeID; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java new file mode 100644 index 0000000..a9de211 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java @@ -0,0 +1,171 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerBiomeEdge extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerBiomeEdge"); + } + + public GenLayerBiomeEdge(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.parent.getInts(i - 1, j - 1, k + 2, l + 2); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (j1 + i), (long) (i1 + j)); + int k1 = aint[j1 + 1 + (i1 + 1) * (k + 2)]; + if (!this.replaceBiomeEdgeIfNecessary(aint, aint1, j1, i1, k, k1, BiomeGenBase.extremeHills.biomeID, + BiomeGenBase.extremeHillsEdge.biomeID) + && !this.replaceBiomeEdge(aint, aint1, j1, i1, k, k1, BiomeGenBase.mesaPlateau_F.biomeID, + BiomeGenBase.mesa.biomeID) + && !this.replaceBiomeEdge(aint, aint1, j1, i1, k, k1, BiomeGenBase.mesaPlateau.biomeID, + BiomeGenBase.mesa.biomeID) + && !this.replaceBiomeEdge(aint, aint1, j1, i1, k, k1, BiomeGenBase.megaTaiga.biomeID, + BiomeGenBase.taiga.biomeID)) { + if (k1 == BiomeGenBase.desert.biomeID) { + int l2 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int i3 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int j3 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int k3 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + if (l2 != BiomeGenBase.icePlains.biomeID && i3 != BiomeGenBase.icePlains.biomeID + && j3 != BiomeGenBase.icePlains.biomeID && k3 != BiomeGenBase.icePlains.biomeID) { + aint1[j1 + i1 * k] = k1; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.extremeHillsPlus.biomeID; + } + } else if (k1 == BiomeGenBase.swampland.biomeID) { + int l1 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int i2 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int j2 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int k2 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + if (l1 != BiomeGenBase.desert.biomeID && i2 != BiomeGenBase.desert.biomeID + && j2 != BiomeGenBase.desert.biomeID && k2 != BiomeGenBase.desert.biomeID + && l1 != BiomeGenBase.coldTaiga.biomeID && i2 != BiomeGenBase.coldTaiga.biomeID + && j2 != BiomeGenBase.coldTaiga.biomeID && k2 != BiomeGenBase.coldTaiga.biomeID + && l1 != BiomeGenBase.icePlains.biomeID && i2 != BiomeGenBase.icePlains.biomeID + && j2 != BiomeGenBase.icePlains.biomeID && k2 != BiomeGenBase.icePlains.biomeID) { + if (l1 != BiomeGenBase.jungle.biomeID && k2 != BiomeGenBase.jungle.biomeID + && i2 != BiomeGenBase.jungle.biomeID && j2 != BiomeGenBase.jungle.biomeID) { + aint1[j1 + i1 * k] = k1; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.jungleEdge.biomeID; + } + } else { + aint1[j1 + i1 * k] = BiomeGenBase.plains.biomeID; + } + } else { + aint1[j1 + i1 * k] = k1; + } + } + } + } + + return aint1; + } + + /**+ + * Creates a border around a biome if necessary, e.g. A + * transition from hot to cold climates would otherwise occur. + */ + private boolean replaceBiomeEdgeIfNecessary(int[] parArrayOfInt, int[] parArrayOfInt2, int parInt1, int parInt2, + int parInt3, int parInt4, int parInt5, int parInt6) { + if (!biomesEqualOrMesaPlateau(parInt4, parInt5)) { + return false; + } else { + int i = parArrayOfInt[parInt1 + 1 + (parInt2 + 1 - 1) * (parInt3 + 2)]; + int j = parArrayOfInt[parInt1 + 1 + 1 + (parInt2 + 1) * (parInt3 + 2)]; + int k = parArrayOfInt[parInt1 + 1 - 1 + (parInt2 + 1) * (parInt3 + 2)]; + int l = parArrayOfInt[parInt1 + 1 + (parInt2 + 1 + 1) * (parInt3 + 2)]; + if (this.canBiomesBeNeighbors(i, parInt5) && this.canBiomesBeNeighbors(j, parInt5) + && this.canBiomesBeNeighbors(k, parInt5) && this.canBiomesBeNeighbors(l, parInt5)) { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt4; + } else { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt6; + } + + return true; + } + } + + /**+ + * Creates a border around a biome. + */ + private boolean replaceBiomeEdge(int[] parArrayOfInt, int[] parArrayOfInt2, int parInt1, int parInt2, int parInt3, + int parInt4, int parInt5, int parInt6) { + if (parInt4 != parInt5) { + return false; + } else { + int i = parArrayOfInt[parInt1 + 1 + (parInt2 + 1 - 1) * (parInt3 + 2)]; + int j = parArrayOfInt[parInt1 + 1 + 1 + (parInt2 + 1) * (parInt3 + 2)]; + int k = parArrayOfInt[parInt1 + 1 - 1 + (parInt2 + 1) * (parInt3 + 2)]; + int l = parArrayOfInt[parInt1 + 1 + (parInt2 + 1 + 1) * (parInt3 + 2)]; + if (biomesEqualOrMesaPlateau(i, parInt5) && biomesEqualOrMesaPlateau(j, parInt5) + && biomesEqualOrMesaPlateau(k, parInt5) && biomesEqualOrMesaPlateau(l, parInt5)) { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt4; + } else { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt6; + } + + return true; + } + } + + /**+ + * Returns if two biomes can logically be neighbors. If one is + * hot and the other cold, for example, it returns false. + */ + private boolean canBiomesBeNeighbors(int parInt1, int parInt2) { + if (biomesEqualOrMesaPlateau(parInt1, parInt2)) { + return true; + } else { + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(parInt1); + BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(parInt2); + if (biomegenbase != null && biomegenbase1 != null) { + BiomeGenBase.TempCategory biomegenbase$tempcategory = biomegenbase.getTempCategory(); + BiomeGenBase.TempCategory biomegenbase$tempcategory1 = biomegenbase1.getTempCategory(); + return biomegenbase$tempcategory == biomegenbase$tempcategory1 + || biomegenbase$tempcategory == BiomeGenBase.TempCategory.MEDIUM + || biomegenbase$tempcategory1 == BiomeGenBase.TempCategory.MEDIUM; + } else { + return false; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerDeepOcean.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerDeepOcean.java new file mode 100644 index 0000000..abf2761 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerDeepOcean.java @@ -0,0 +1,88 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerDeepOcean extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerDeepOcean"); + } + + public GenLayerDeepOcean(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) { + for (int j1 = 0; j1 < areaWidth; ++j1) { + int k1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + int k2 = aint[j1 + 1 + (i1 + 1) * k]; + int l2 = 0; + if (k1 == 0) { + ++l2; + } + + if (l1 == 0) { + ++l2; + } + + if (i2 == 0) { + ++l2; + } + + if (j2 == 0) { + ++l2; + } + + if (k2 == 0 && l2 > 3) { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.deepOcean.biomeID; + } else { + aint1[j1 + i1 * areaWidth] = k2; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerEdge.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerEdge.java new file mode 100644 index 0000000..2ee336f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerEdge.java @@ -0,0 +1,143 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerEdge extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerEdge"); + } + + private final GenLayerEdge.Mode field_151627_c; + + public GenLayerEdge(long parLong1, GenLayer parGenLayer, GenLayerEdge.Mode parMode) { + super(parLong1); + this.parent = parGenLayer; + this.field_151627_c = parMode; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + switch (this.field_151627_c) { + case COOL_WARM: + default: + return this.getIntsCoolWarm(i, j, k, l); + case HEAT_ICE: + return this.getIntsHeatIce(i, j, k, l); + case SPECIAL: + return this.getIntsSpecial(i, j, k, l); + } + } + + private int[] getIntsCoolWarm(int parInt1, int parInt2, int parInt3, int parInt4) { + int i = parInt1 - 1; + int j = parInt2 - 1; + int k = 1 + parInt3 + 1; + int l = 1 + parInt4 + 1; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(parInt3 * parInt4); + + for (int i1 = 0; i1 < parInt4; ++i1) { + for (int j1 = 0; j1 < parInt3; ++j1) { + this.initChunkSeed((long) (j1 + parInt1), (long) (i1 + parInt2)); + int k1 = aint[j1 + 1 + (i1 + 1) * k]; + if (k1 == 1) { + int l1 = aint[j1 + 1 + (i1 + 1 - 1) * k]; + int i2 = aint[j1 + 1 + 1 + (i1 + 1) * k]; + int j2 = aint[j1 + 1 - 1 + (i1 + 1) * k]; + int k2 = aint[j1 + 1 + (i1 + 1 + 1) * k]; + boolean flag = l1 == 3 || i2 == 3 || j2 == 3 || k2 == 3; + boolean flag1 = l1 == 4 || i2 == 4 || j2 == 4 || k2 == 4; + if (flag || flag1) { + k1 = 2; + } + } + + aint1[j1 + i1 * parInt3] = k1; + } + } + + return aint1; + } + + private int[] getIntsHeatIce(int parInt1, int parInt2, int parInt3, int parInt4) { + int i = parInt1 - 1; + int j = parInt2 - 1; + int k = 1 + parInt3 + 1; + int l = 1 + parInt4 + 1; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(parInt3 * parInt4); + + for (int i1 = 0; i1 < parInt4; ++i1) { + for (int j1 = 0; j1 < parInt3; ++j1) { + int k1 = aint[j1 + 1 + (i1 + 1) * k]; + if (k1 == 4) { + int l1 = aint[j1 + 1 + (i1 + 1 - 1) * k]; + int i2 = aint[j1 + 1 + 1 + (i1 + 1) * k]; + int j2 = aint[j1 + 1 - 1 + (i1 + 1) * k]; + int k2 = aint[j1 + 1 + (i1 + 1 + 1) * k]; + boolean flag = l1 == 2 || i2 == 2 || j2 == 2 || k2 == 2; + boolean flag1 = l1 == 1 || i2 == 1 || j2 == 1 || k2 == 1; + if (flag1 || flag) { + k1 = 3; + } + } + + aint1[j1 + i1 * parInt3] = k1; + } + } + + return aint1; + } + + private int[] getIntsSpecial(int parInt1, int parInt2, int parInt3, int parInt4) { + int[] aint = this.parent.getInts(parInt1, parInt2, parInt3, parInt4); + int[] aint1 = IntCache.getIntCache(parInt3 * parInt4); + + for (int i = 0; i < parInt4; ++i) { + for (int j = 0; j < parInt3; ++j) { + this.initChunkSeed((long) (j + parInt1), (long) (i + parInt2)); + int k = aint[j + i * parInt3]; + if (k != 0 && this.nextInt(13) == 0) { + k |= 1 + this.nextInt(15) << 8 & 3840; + } + + aint1[j + i * parInt3] = k; + } + } + + return aint1; + } + + public static enum Mode { + COOL_WARM, HEAT_ICE, SPECIAL; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java new file mode 100644 index 0000000..96ba14b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java @@ -0,0 +1,45 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayerZoom; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerFuzzyZoom extends GenLayerZoom { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerFuzzyZoom"); + } + + public GenLayerFuzzyZoom(long parLong1, GenLayer parGenLayer) { + super(parLong1, parGenLayer); + } + + /**+ + * returns the most frequently occurring number of the set, or a + * random number from those provided + */ + protected int selectModeOrRandom(int parInt1, int parInt2, int parInt3, int parInt4) { + return this.selectRandom(new int[] { parInt1, parInt2, parInt3, parInt4 }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerHills.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerHills.java new file mode 100644 index 0000000..637e655 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerHills.java @@ -0,0 +1,162 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerHills extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerHills"); + } + + private static final Logger logger = LogManager.getLogger(); + private GenLayer field_151628_d; + + public GenLayerHills(long parLong1, GenLayer parGenLayer, GenLayer parGenLayer2) { + super(parLong1); + this.parent = parGenLayer; + this.field_151628_d = parGenLayer2; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.parent.getInts(i - 1, j - 1, k + 2, l + 2); + int[] aint1 = this.field_151628_d.getInts(i - 1, j - 1, k + 2, l + 2); + int[] aint2 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (j1 + i), (long) (i1 + j)); + int k1 = aint[j1 + 1 + (i1 + 1) * (k + 2)]; + int l1 = aint1[j1 + 1 + (i1 + 1) * (k + 2)]; + boolean flag = (l1 - 2) % 29 == 0; + if (k1 > 255) { + logger.debug("old! " + k1); + } + + if (k1 != 0 && l1 >= 2 && (l1 - 2) % 29 == 1 && k1 < 128) { + if (BiomeGenBase.getBiome(k1 + 128) != null) { + aint2[j1 + i1 * k] = k1 + 128; + } else { + aint2[j1 + i1 * k] = k1; + } + } else if (this.nextInt(3) != 0 && !flag) { + aint2[j1 + i1 * k] = k1; + } else { + int i2 = k1; + if (k1 == BiomeGenBase.desert.biomeID) { + i2 = BiomeGenBase.desertHills.biomeID; + } else if (k1 == BiomeGenBase.forest.biomeID) { + i2 = BiomeGenBase.forestHills.biomeID; + } else if (k1 == BiomeGenBase.birchForest.biomeID) { + i2 = BiomeGenBase.birchForestHills.biomeID; + } else if (k1 == BiomeGenBase.roofedForest.biomeID) { + i2 = BiomeGenBase.plains.biomeID; + } else if (k1 == BiomeGenBase.taiga.biomeID) { + i2 = BiomeGenBase.taigaHills.biomeID; + } else if (k1 == BiomeGenBase.megaTaiga.biomeID) { + i2 = BiomeGenBase.megaTaigaHills.biomeID; + } else if (k1 == BiomeGenBase.coldTaiga.biomeID) { + i2 = BiomeGenBase.coldTaigaHills.biomeID; + } else if (k1 == BiomeGenBase.plains.biomeID) { + if (this.nextInt(3) == 0) { + i2 = BiomeGenBase.forestHills.biomeID; + } else { + i2 = BiomeGenBase.forest.biomeID; + } + } else if (k1 == BiomeGenBase.icePlains.biomeID) { + i2 = BiomeGenBase.iceMountains.biomeID; + } else if (k1 == BiomeGenBase.jungle.biomeID) { + i2 = BiomeGenBase.jungleHills.biomeID; + } else if (k1 == BiomeGenBase.ocean.biomeID) { + i2 = BiomeGenBase.deepOcean.biomeID; + } else if (k1 == BiomeGenBase.extremeHills.biomeID) { + i2 = BiomeGenBase.extremeHillsPlus.biomeID; + } else if (k1 == BiomeGenBase.savanna.biomeID) { + i2 = BiomeGenBase.savannaPlateau.biomeID; + } else if (biomesEqualOrMesaPlateau(k1, BiomeGenBase.mesaPlateau_F.biomeID)) { + i2 = BiomeGenBase.mesa.biomeID; + } else if (k1 == BiomeGenBase.deepOcean.biomeID && this.nextInt(3) == 0) { + int j2 = this.nextInt(2); + if (j2 == 0) { + i2 = BiomeGenBase.plains.biomeID; + } else { + i2 = BiomeGenBase.forest.biomeID; + } + } + + if (flag && i2 != k1) { + if (BiomeGenBase.getBiome(i2 + 128) != null) { + i2 += 128; + } else { + i2 = k1; + } + } + + if (i2 == k1) { + aint2[j1 + i1 * k] = k1; + } else { + int k3 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int k2 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int l2 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int i3 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + int j3 = 0; + if (biomesEqualOrMesaPlateau(k3, k1)) { + ++j3; + } + + if (biomesEqualOrMesaPlateau(k2, k1)) { + ++j3; + } + + if (biomesEqualOrMesaPlateau(l2, k1)) { + ++j3; + } + + if (biomesEqualOrMesaPlateau(i3, k1)) { + ++j3; + } + + if (j3 >= 3) { + aint2[j1 + i1 * k] = i2; + } else { + aint2[j1 + i1 * k] = k1; + } + } + } + } + } + + return aint2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerIsland.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerIsland.java new file mode 100644 index 0000000..942eb8a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerIsland.java @@ -0,0 +1,60 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerIsland extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerIsland"); + } + + public GenLayerIsland(long parLong1) { + super(parLong1); + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (i + j1), (long) (j + i1)); + aint[j1 + i1 * k] = this.nextInt(10) == 0 ? 1 : 0; + } + } + + if (i > -k && i <= 0 && j > -l && j <= 0) { + aint[-i + -j * k] = 1; + } + + return aint; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRareBiome.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRareBiome.java new file mode 100644 index 0000000..4e608bc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRareBiome.java @@ -0,0 +1,68 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerRareBiome extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRareBiome"); + } + + public GenLayerRareBiome(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.parent.getInts(i - 1, j - 1, k + 2, l + 2); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (j1 + i), (long) (i1 + j)); + int k1 = aint[j1 + 1 + (i1 + 1) * (k + 2)]; + if (this.nextInt(57) == 0) { + if (k1 == BiomeGenBase.plains.biomeID) { + aint1[j1 + i1 * k] = BiomeGenBase.plains.biomeID + 128; + } else { + aint1[j1 + i1 * k] = k1; + } + } else { + aint1[j1 + i1 * k] = k1; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java new file mode 100644 index 0000000..979459b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerRemoveTooMuchOcean extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean"); + } + + public GenLayerRemoveTooMuchOcean(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i - 1; + int j1 = j - 1; + int k1 = k + 2; + int l1 = l + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i2 = 0; i2 < l; ++i2) { + for (int j2 = 0; j2 < k; ++j2) { + int k2 = aint[j2 + 1 + (i2 + 1 - 1) * (k + 2)]; + int l2 = aint[j2 + 1 + 1 + (i2 + 1) * (k + 2)]; + int i3 = aint[j2 + 1 - 1 + (i2 + 1) * (k + 2)]; + int j3 = aint[j2 + 1 + (i2 + 1 + 1) * (k + 2)]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + aint1[j2 + i2 * k] = k3; + this.initChunkSeed((long) (j2 + i), (long) (i2 + j)); + if (k3 == 0 && k2 == 0 && l2 == 0 && i3 == 0 && j3 == 0 && this.nextInt(2) == 0) { + aint1[j2 + i2 * k] = 1; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiver.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiver.java new file mode 100644 index 0000000..fabe71e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiver.java @@ -0,0 +1,75 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerRiver extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRiver"); + } + + public GenLayerRiver(long parLong1, GenLayer parGenLayer) { + super(parLong1); + super.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i - 1; + int j1 = j - 1; + int k1 = k + 2; + int l1 = l + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i2 = 0; i2 < l; ++i2) { + for (int j2 = 0; j2 < k; ++j2) { + int k2 = this.func_151630_c(aint[j2 + 0 + (i2 + 1) * k1]); + int l2 = this.func_151630_c(aint[j2 + 2 + (i2 + 1) * k1]); + int i3 = this.func_151630_c(aint[j2 + 1 + (i2 + 0) * k1]); + int j3 = this.func_151630_c(aint[j2 + 1 + (i2 + 2) * k1]); + int k3 = this.func_151630_c(aint[j2 + 1 + (i2 + 1) * k1]); + if (k3 == k2 && k3 == i3 && k3 == l2 && k3 == j3) { + aint1[j2 + i2 * k] = -1; + } else { + aint1[j2 + i2 * k] = BiomeGenBase.river.biomeID; + } + } + } + + return aint1; + } + + private int func_151630_c(int parInt1) { + return parInt1 >= 2 ? 2 + (parInt1 & 1) : parInt1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverInit.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverInit.java new file mode 100644 index 0000000..06d8a46 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverInit.java @@ -0,0 +1,58 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerRiverInit extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRiverInit"); + } + + public GenLayerRiverInit(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (j1 + i), (long) (i1 + j)); + aint1[j1 + i1 * k] = aint[j1 + i1 * k] > 0 ? this.nextInt(299999) + 2 : 0; + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverMix.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverMix.java new file mode 100644 index 0000000..d7790d6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverMix.java @@ -0,0 +1,87 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerRiverMix extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRiverMix"); + } + + private GenLayer biomePatternGeneratorChain; + private GenLayer riverPatternGeneratorChain; + + public GenLayerRiverMix(long parLong1, GenLayer parGenLayer, GenLayer parGenLayer2) { + super(parLong1); + this.biomePatternGeneratorChain = parGenLayer; + this.riverPatternGeneratorChain = parGenLayer2; + } + + /**+ + * Initialize layer's local worldGenSeed based on its own + * baseSeed and the world's global seed (passed in as an + * argument). + */ + public void initWorldGenSeed(long i) { + this.biomePatternGeneratorChain.initWorldGenSeed(i); + this.riverPatternGeneratorChain.initWorldGenSeed(i); + super.initWorldGenSeed(i); + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.biomePatternGeneratorChain.getInts(i, j, k, l); + int[] aint1 = this.riverPatternGeneratorChain.getInts(i, j, k, l); + int[] aint2 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < k * l; ++i1) { + if (aint[i1] != BiomeGenBase.ocean.biomeID && aint[i1] != BiomeGenBase.deepOcean.biomeID) { + if (aint1[i1] == BiomeGenBase.river.biomeID) { + if (aint[i1] == BiomeGenBase.icePlains.biomeID) { + aint2[i1] = BiomeGenBase.frozenRiver.biomeID; + } else if (aint[i1] != BiomeGenBase.mushroomIsland.biomeID + && aint[i1] != BiomeGenBase.mushroomIslandShore.biomeID) { + aint2[i1] = aint1[i1] & 255; + } else { + aint2[i1] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } else { + aint2[i1] = aint[i1]; + } + } else { + aint2[i1] = aint[i1]; + } + } + + return aint2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerShore.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerShore.java new file mode 100644 index 0000000..a014005 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerShore.java @@ -0,0 +1,158 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenJungle; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenMesa; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerShore extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerShore"); + } + + public GenLayerShore(long parLong1, GenLayer parGenLayer) { + super(parLong1); + this.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int[] aint = this.parent.getInts(i - 1, j - 1, k + 2, l + 2); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i1 = 0; i1 < l; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + this.initChunkSeed((long) (j1 + i), (long) (i1 + j)); + int k1 = aint[j1 + 1 + (i1 + 1) * (k + 2)]; + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(k1); + if (k1 == BiomeGenBase.mushroomIsland.biomeID) { + int j3 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int i4 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int l4 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int k5 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + if (j3 != BiomeGenBase.ocean.biomeID && i4 != BiomeGenBase.ocean.biomeID + && l4 != BiomeGenBase.ocean.biomeID && k5 != BiomeGenBase.ocean.biomeID) { + aint1[j1 + i1 * k] = k1; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } else if (biomegenbase != null && biomegenbase.getBiomeClass() == BiomeGenJungle.class) { + int i3 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int l3 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int k4 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int j5 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + if (this.func_151631_c(i3) && this.func_151631_c(l3) && this.func_151631_c(k4) + && this.func_151631_c(j5)) { + if (!isBiomeOceanic(i3) && !isBiomeOceanic(l3) && !isBiomeOceanic(k4) && !isBiomeOceanic(j5)) { + aint1[j1 + i1 * k] = k1; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.beach.biomeID; + } + } else { + aint1[j1 + i1 * k] = BiomeGenBase.jungleEdge.biomeID; + } + } else if (k1 != BiomeGenBase.extremeHills.biomeID && k1 != BiomeGenBase.extremeHillsPlus.biomeID + && k1 != BiomeGenBase.extremeHillsEdge.biomeID) { + if (biomegenbase != null && biomegenbase.isSnowyBiome()) { + this.func_151632_a(aint, aint1, j1, i1, k, k1, BiomeGenBase.coldBeach.biomeID); + } else if (k1 != BiomeGenBase.mesa.biomeID && k1 != BiomeGenBase.mesaPlateau_F.biomeID) { + if (k1 != BiomeGenBase.ocean.biomeID && k1 != BiomeGenBase.deepOcean.biomeID + && k1 != BiomeGenBase.river.biomeID && k1 != BiomeGenBase.swampland.biomeID) { + int l2 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int k3 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int j4 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int i5 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + if (!isBiomeOceanic(l2) && !isBiomeOceanic(k3) && !isBiomeOceanic(j4) + && !isBiomeOceanic(i5)) { + aint1[j1 + i1 * k] = k1; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.beach.biomeID; + } + } else { + aint1[j1 + i1 * k] = k1; + } + } else { + int l1 = aint[j1 + 1 + (i1 + 1 - 1) * (k + 2)]; + int i2 = aint[j1 + 1 + 1 + (i1 + 1) * (k + 2)]; + int j2 = aint[j1 + 1 - 1 + (i1 + 1) * (k + 2)]; + int k2 = aint[j1 + 1 + (i1 + 1 + 1) * (k + 2)]; + if (!isBiomeOceanic(l1) && !isBiomeOceanic(i2) && !isBiomeOceanic(j2) && !isBiomeOceanic(k2)) { + if (this.func_151633_d(l1) && this.func_151633_d(i2) && this.func_151633_d(j2) + && this.func_151633_d(k2)) { + aint1[j1 + i1 * k] = k1; + } else { + aint1[j1 + i1 * k] = BiomeGenBase.desert.biomeID; + } + } else { + aint1[j1 + i1 * k] = k1; + } + } + } else { + this.func_151632_a(aint, aint1, j1, i1, k, k1, BiomeGenBase.stoneBeach.biomeID); + } + } + } + + return aint1; + } + + private void func_151632_a(int[] parArrayOfInt, int[] parArrayOfInt2, int parInt1, int parInt2, int parInt3, + int parInt4, int parInt5) { + if (isBiomeOceanic(parInt4)) { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt4; + } else { + int i = parArrayOfInt[parInt1 + 1 + (parInt2 + 1 - 1) * (parInt3 + 2)]; + int j = parArrayOfInt[parInt1 + 1 + 1 + (parInt2 + 1) * (parInt3 + 2)]; + int k = parArrayOfInt[parInt1 + 1 - 1 + (parInt2 + 1) * (parInt3 + 2)]; + int l = parArrayOfInt[parInt1 + 1 + (parInt2 + 1 + 1) * (parInt3 + 2)]; + if (!isBiomeOceanic(i) && !isBiomeOceanic(j) && !isBiomeOceanic(k) && !isBiomeOceanic(l)) { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt4; + } else { + parArrayOfInt2[parInt1 + parInt2 * parInt3] = parInt5; + } + + } + } + + private boolean func_151631_c(int parInt1) { + return BiomeGenBase.getBiome(parInt1) != null + && BiomeGenBase.getBiome(parInt1).getBiomeClass() == BiomeGenJungle.class + ? true + : parInt1 == BiomeGenBase.jungleEdge.biomeID || parInt1 == BiomeGenBase.jungle.biomeID + || parInt1 == BiomeGenBase.jungleHills.biomeID || parInt1 == BiomeGenBase.forest.biomeID + || parInt1 == BiomeGenBase.taiga.biomeID || isBiomeOceanic(parInt1); + } + + private boolean func_151633_d(int parInt1) { + return BiomeGenBase.getBiome(parInt1) instanceof BiomeGenMesa; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerSmooth.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerSmooth.java new file mode 100644 index 0000000..dbf4827 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerSmooth.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerSmooth extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerSmooth"); + } + + public GenLayerSmooth(long parLong1, GenLayer parGenLayer) { + super(parLong1); + super.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i - 1; + int j1 = j - 1; + int k1 = k + 2; + int l1 = l + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(k * l); + + for (int i2 = 0; i2 < l; ++i2) { + for (int j2 = 0; j2 < k; ++j2) { + int k2 = aint[j2 + 0 + (i2 + 1) * k1]; + int l2 = aint[j2 + 2 + (i2 + 1) * k1]; + int i3 = aint[j2 + 1 + (i2 + 0) * k1]; + int j3 = aint[j2 + 1 + (i2 + 2) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + if (k2 == l2 && i3 == j3) { + this.initChunkSeed((long) (j2 + i), (long) (i2 + j)); + if (this.nextInt(2) == 0) { + k3 = k2; + } else { + k3 = i3; + } + } else { + if (k2 == l2) { + k3 = k2; + } + + if (i3 == j3) { + k3 = i3; + } + } + + aint1[j2 + i2 * k] = k3; + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java new file mode 100644 index 0000000..deb64ad --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java @@ -0,0 +1,111 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerVoronoiZoom extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerVoronoiZoom"); + } + + public GenLayerVoronoiZoom(long parLong1, GenLayer parGenLayer) { + super(parLong1); + super.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + i = i - 2; + j = j - 2; + int i1 = i >> 2; + int j1 = j >> 2; + int k1 = (k >> 2) + 2; + int l1 = (l >> 2) + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int i2 = k1 - 1 << 2; + int j2 = l1 - 1 << 2; + int[] aint1 = IntCache.getIntCache(i2 * j2); + + for (int k2 = 0; k2 < l1 - 1; ++k2) { + int l2 = 0; + int i3 = aint[l2 + 0 + (k2 + 0) * k1]; + + for (int j3 = aint[l2 + 0 + (k2 + 1) * k1]; l2 < k1 - 1; ++l2) { + double d0 = 3.6D; + this.initChunkSeed((long) (l2 + i1 << 2), (long) (k2 + j1 << 2)); + double d1 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double d2 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed((long) (l2 + i1 + 1 << 2), (long) (k2 + j1 << 2)); + double d3 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double d4 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed((long) (l2 + i1 << 2), (long) (k2 + j1 + 1 << 2)); + double d5 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double d6 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + this.initChunkSeed((long) (l2 + i1 + 1 << 2), (long) (k2 + j1 + 1 << 2)); + double d7 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double d8 = ((double) this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + int k3 = aint[l2 + 1 + (k2 + 0) * k1] & 255; + int l3 = aint[l2 + 1 + (k2 + 1) * k1] & 255; + + for (int i4 = 0; i4 < 4; ++i4) { + int j4 = ((k2 << 2) + i4) * i2 + (l2 << 2); + + for (int k4 = 0; k4 < 4; ++k4) { + double d9 = ((double) i4 - d2) * ((double) i4 - d2) + ((double) k4 - d1) * ((double) k4 - d1); + double d10 = ((double) i4 - d4) * ((double) i4 - d4) + ((double) k4 - d3) * ((double) k4 - d3); + double d11 = ((double) i4 - d6) * ((double) i4 - d6) + ((double) k4 - d5) * ((double) k4 - d5); + double d12 = ((double) i4 - d8) * ((double) i4 - d8) + ((double) k4 - d7) * ((double) k4 - d7); + if (d9 < d10 && d9 < d11 && d9 < d12) { + aint1[j4++] = i3; + } else if (d10 < d9 && d10 < d11 && d10 < d12) { + aint1[j4++] = k3; + } else if (d11 < d9 && d11 < d10 && d11 < d12) { + aint1[j4++] = j3; + } else { + aint1[j4++] = l3; + } + } + } + + i3 = k3; + j3 = l3; + } + } + + int[] aint2 = IntCache.getIntCache(k * l); + + for (int l4 = 0; l4 < l; ++l4) { + System.arraycopy(aint1, (l4 + (j & 3)) * i2 + (i & 3), aint2, l4 * k, k); + } + + return aint2; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerZoom.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerZoom.java new file mode 100644 index 0000000..8f42605 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerZoom.java @@ -0,0 +1,95 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.GenLayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer.IntCache; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GenLayerZoom extends GenLayer { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerZoom"); + } + + public GenLayerZoom(long parLong1, GenLayer parGenLayer) { + super(parLong1); + super.parent = parGenLayer; + } + + /**+ + * Returns a list of integer values generated by this layer. + * These may be interpreted as temperatures, rainfall amounts, + * or biomeList[] indices based on the particular GenLayer + * subclass. + */ + public int[] getInts(int i, int j, int k, int l) { + int i1 = i >> 1; + int j1 = j >> 1; + int k1 = (k >> 1) + 2; + int l1 = (l >> 1) + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int i2 = k1 - 1 << 1; + int j2 = l1 - 1 << 1; + int[] aint1 = IntCache.getIntCache(i2 * j2); + + for (int k2 = 0; k2 < l1 - 1; ++k2) { + int l2 = (k2 << 1) * i2; + int i3 = 0; + int j3 = aint[i3 + 0 + (k2 + 0) * k1]; + + for (int k3 = aint[i3 + 0 + (k2 + 1) * k1]; i3 < k1 - 1; ++i3) { + this.initChunkSeed((long) (i3 + i1 << 1), (long) (k2 + j1 << 1)); + int l3 = aint[i3 + 1 + (k2 + 0) * k1]; + int i4 = aint[i3 + 1 + (k2 + 1) * k1]; + aint1[l2] = j3; + aint1[l2++ + i2] = this.selectRandom(new int[] { j3, k3 }); + aint1[l2] = this.selectRandom(new int[] { j3, l3 }); + aint1[l2++ + i2] = this.selectModeOrRandom(j3, l3, k3, i4); + j3 = l3; + k3 = i4; + } + } + + int[] aint2 = IntCache.getIntCache(k * l); + + for (int j4 = 0; j4 < l; ++j4) { + System.arraycopy(aint1, (j4 + (j & 1)) * i2 + (i & 1), aint2, j4 * k, k); + } + + return aint2; + } + + /**+ + * Magnify a layer. Parms are seed adjustment, layer, number of + * times to magnify + */ + public static GenLayer magnify(long parLong1, GenLayer parGenLayer, int parInt1) { + Object object = parGenLayer; + + for (int i = 0; i < parInt1; ++i) { + object = new GenLayerZoom(parLong1 + (long) i, (GenLayer) object); + } + + return (GenLayer) object; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/IntCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/IntCache.java new file mode 100644 index 0000000..ffa10fe --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/IntCache.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; + +import com.google.common.collect.Lists; +import java.util.List; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 IntCache { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/layer/IntCache"); + } + + private static int intCacheSize = 256; + /**+ + * A list of pre-allocated int[256] arrays that are currently + * unused and can be returned by getIntCache() + */ + private static List freeSmallArrays = Lists.newArrayList(); + /**+ + * A list of pre-allocated int[256] arrays that were previously + * returned by getIntCache() and which will not be re-used again + * until resetIntCache() is called. + */ + private static List inUseSmallArrays = Lists.newArrayList(); + /**+ + * A list of pre-allocated int[cacheSize] arrays that are + * currently unused and can be returned by getIntCache() + */ + private static List freeLargeArrays = Lists.newArrayList(); + /**+ + * A list of pre-allocated int[cacheSize] arrays that were + * previously returned by getIntCache() and which will not be + * re-used again until resetIntCache() is called. + */ + private static List inUseLargeArrays = Lists.newArrayList(); + + public static synchronized int[] getIntCache(int parInt1) { + if (parInt1 <= 256) { + if (freeSmallArrays.isEmpty()) { + int[] aint4 = new int[256]; + inUseSmallArrays.add(aint4); + return aint4; + } else { + int[] aint3 = (int[]) freeSmallArrays.remove(freeSmallArrays.size() - 1); + inUseSmallArrays.add(aint3); + return aint3; + } + } else if (parInt1 > intCacheSize) { + intCacheSize = parInt1; + freeLargeArrays.clear(); + inUseLargeArrays.clear(); + int[] aint2 = new int[intCacheSize]; + inUseLargeArrays.add(aint2); + return aint2; + } else if (freeLargeArrays.isEmpty()) { + int[] aint1 = new int[intCacheSize]; + inUseLargeArrays.add(aint1); + return aint1; + } else { + int[] aint = (int[]) freeLargeArrays.remove(freeLargeArrays.size() - 1); + inUseLargeArrays.add(aint); + return aint; + } + } + + /**+ + * Mark all pre-allocated arrays as available for re-use by + * moving them to the appropriate free lists. + */ + public static synchronized void resetIntCache() { + if (!freeLargeArrays.isEmpty()) { + freeLargeArrays.remove(freeLargeArrays.size() - 1); + } + + if (!freeSmallArrays.isEmpty()) { + freeSmallArrays.remove(freeSmallArrays.size() - 1); + } + + freeLargeArrays.addAll(inUseLargeArrays); + freeSmallArrays.addAll(inUseSmallArrays); + inUseLargeArrays.clear(); + inUseSmallArrays.clear(); + } + + /**+ + * Gets a human-readable string that indicates the sizes of all + * the cache fields. Basically a synchronized static toString. + */ + public static synchronized String getCacheSizes() { + return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java new file mode 100644 index 0000000..3f48189 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java @@ -0,0 +1,983 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFlowerPot; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockLever; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPlanks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSandStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWire; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTripWireHook; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityWitch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ComponentScatteredFeaturePieces { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces"); + } + + public static void registerScatteredFeaturePieces() { + MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.DesertPyramid.class, "TeDP"); + MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.JunglePyramid.class, "TeJP"); + MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.SwampHut.class, "TeSH"); + } + + public static class DesertPyramid extends ComponentScatteredFeaturePieces.Feature { + private boolean[] field_74940_h = new boolean[4]; + private static final List itemsToGenerateInTemple = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), + new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), + new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), + new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1) }); + + public DesertPyramid() { + } + + public DesertPyramid(EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parRandom, parInt1, 64, parInt2, 21, 15, 21); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("hasPlacedChest0", this.field_74940_h[0]); + nbttagcompound.setBoolean("hasPlacedChest1", this.field_74940_h[1]); + nbttagcompound.setBoolean("hasPlacedChest2", this.field_74940_h[2]); + nbttagcompound.setBoolean("hasPlacedChest3", this.field_74940_h[3]); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_74940_h[0] = nbttagcompound.getBoolean("hasPlacedChest0"); + this.field_74940_h[1] = nbttagcompound.getBoolean("hasPlacedChest1"); + this.field_74940_h[2] = nbttagcompound.getBoolean("hasPlacedChest2"); + this.field_74940_h[3] = nbttagcompound.getBoolean("hasPlacedChest3"); + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, + this.scatteredFeatureSizeZ - 1, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + + for (int i = 1; i <= 9; ++i) { + this.fillWithBlocks(world, structureboundingbox, i, i, i, this.scatteredFeatureSizeX - 1 - i, i, + this.scatteredFeatureSizeZ - 1 - i, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, i + 1, i, i + 1, this.scatteredFeatureSizeX - 2 - i, i, + this.scatteredFeatureSizeZ - 2 - i, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), + false); + } + + for (int i2 = 0; i2 < this.scatteredFeatureSizeX; ++i2) { + for (int j = 0; j < this.scatteredFeatureSizeZ; ++j) { + byte b0 = -5; + this.replaceAirAndLiquidDownwards(world, Blocks.sandstone.getDefaultState(), i2, b0, j, + structureboundingbox); + } + } + + int j2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 3); + int k2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 2); + int l2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 0); + int k = this.getMetadataWithOffset(Blocks.sandstone_stairs, 1); + int l = ~EnumDyeColor.ORANGE.getDyeDamage() & 15; + int i1 = ~EnumDyeColor.BLUE.getDyeDamage() & 15; + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 9, 4, Blocks.sandstone.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 10, 1, 3, 10, 3, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(j2), 2, 10, 0, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 10, 4, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(l2), 0, 10, 2, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(k), 4, 10, 2, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 5, 0, 0, + this.scatteredFeatureSizeX - 1, 9, 4, Blocks.sandstone.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 4, 10, 1, + this.scatteredFeatureSizeX - 2, 10, 3, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(j2), this.scatteredFeatureSizeX - 3, 10, + 0, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 10, + 4, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(l2), this.scatteredFeatureSizeX - 5, 10, + 2, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(k), this.scatteredFeatureSizeX - 1, 10, + 2, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 8, 0, 0, 12, 4, 4, Blocks.sandstone.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 1, 0, 11, 3, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 9, 1, 1, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 9, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 9, 3, 1, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 10, 3, 1, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 11, 3, 1, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 11, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 11, 1, 1, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 1, 8, 3, 3, Blocks.sandstone.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 2, 8, 2, 2, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, 1, 16, 3, 3, Blocks.sandstone.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, 2, 16, 2, 2, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, + this.scatteredFeatureSizeZ - 6, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 4, 9, 11, 4, 11, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 1, 8, 8, 3, 8, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, 8, 12, 3, 8, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 8, 1, 12, 8, 3, 12, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, 12, 12, 3, 12, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 5, 4, 4, 11, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 5, 1, 5, + this.scatteredFeatureSizeX - 2, 4, 11, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 7, 9, 6, 7, 11, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 7, 7, 9, + this.scatteredFeatureSizeX - 7, 7, 11, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 5, 9, 5, 7, 11, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 6, 5, 9, + this.scatteredFeatureSizeX - 6, 7, 11, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.setBlockState(world, Blocks.air.getDefaultState(), 5, 5, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 5, 6, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 6, 6, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), this.scatteredFeatureSizeX - 6, 5, 10, + structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), this.scatteredFeatureSizeX - 6, 6, 10, + structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), this.scatteredFeatureSizeX - 7, 6, 10, + structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 2, 4, 4, 2, 6, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 3, 4, 4, + this.scatteredFeatureSizeX - 3, 6, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), + false); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(j2), 2, 4, 5, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(j2), 2, 3, 4, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(j2), this.scatteredFeatureSizeX - 3, 4, + 5, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(j2), this.scatteredFeatureSizeX - 3, 3, + 4, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 3, 2, 2, 3, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 3, 1, 3, + this.scatteredFeatureSizeX - 2, 2, 3, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.setBlockState(world, Blocks.sandstone_stairs.getDefaultState(), 1, 1, 2, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getDefaultState(), this.scatteredFeatureSizeX - 2, 1, 2, + structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SAND.getMetadata()), 1, + 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SAND.getMetadata()), + this.scatteredFeatureSizeX - 2, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(k), 2, 1, 2, structureboundingbox); + this.setBlockState(world, Blocks.sandstone_stairs.getStateFromMeta(l2), this.scatteredFeatureSizeX - 3, 1, + 2, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 5, 4, 3, 18, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 5, 3, 5, + this.scatteredFeatureSizeX - 5, 3, 17, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 5, 4, 2, 16, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.scatteredFeatureSizeX - 6, 1, 5, + this.scatteredFeatureSizeX - 5, 2, 16, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), + false); + + for (int j1 = 5; j1 <= 17; j1 += 2) { + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 4, 1, j1, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 4, 2, j1, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + this.scatteredFeatureSizeX - 5, 1, j1, structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + this.scatteredFeatureSizeX - 5, 2, j1, structureboundingbox); + } + + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 10, 0, 7, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 10, 0, 8, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 9, 0, 9, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 11, 0, 9, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 8, 0, 10, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 12, 0, 10, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 7, 0, 10, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 13, 0, 10, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 9, 0, 11, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 11, 0, 11, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 10, 0, 12, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 10, 0, 13, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 10, + structureboundingbox); + + for (int i3 = 0; i3 <= this.scatteredFeatureSizeX - 1; i3 += this.scatteredFeatureSizeX - 1) { + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 2, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 2, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 2, 3, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 3, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 3, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 3, 3, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 4, 1, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), i3, 4, 2, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 4, 3, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 5, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 5, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 5, 3, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 6, 1, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), i3, 6, 2, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 6, 3, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 7, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 7, 2, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), i3, 7, 3, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 8, 1, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 8, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), i3, 8, 3, + structureboundingbox); + } + + for (int j3 = 2; j3 <= this.scatteredFeatureSizeX - 3; j3 += this.scatteredFeatureSizeX - 3 - 2) { + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 - 1, 2, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3, 2, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 + 1, 2, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 - 1, 3, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3, 3, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 + 1, 3, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3 - 1, 4, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), j3, 4, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3 + 1, 4, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 - 1, 5, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3, 5, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 + 1, 5, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3 - 1, 6, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), j3, 6, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3 + 1, 6, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3 - 1, 7, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3, 7, 0, + structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), j3 + 1, 7, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 - 1, 8, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 0, + structureboundingbox); + this.setBlockState(world, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3 + 1, 8, 0, + structureboundingbox); + } + + this.fillWithBlocks(world, structureboundingbox, 8, 4, 0, 12, 6, 0, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.setBlockState(world, Blocks.air.getDefaultState(), 8, 6, 0, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 12, 6, 0, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 9, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + 10, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.stained_hardened_clay.getStateFromMeta(l), 11, 5, 0, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 8, -14, 8, 12, -11, 12, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 8, -10, 8, 12, -10, 12, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 8, -9, 8, 12, -9, 12, + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 8, -8, 8, 12, -1, 12, Blocks.sandstone.getDefaultState(), + Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, -11, 9, 11, -1, 11, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.setBlockState(world, Blocks.stone_pressure_plate.getDefaultState(), 10, -11, 10, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 9, -13, 9, 11, -13, 11, Blocks.tnt.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.setBlockState(world, Blocks.air.getDefaultState(), 8, -11, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 8, -10, 10, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + 7, -10, 10, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 7, -11, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 12, -11, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 12, -10, 10, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + 13, -10, 10, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 13, -11, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 10, -11, 8, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 10, -10, 8, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + 10, -10, 7, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 10, -11, 7, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 10, -11, 12, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 10, -10, 12, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), + 10, -10, 13, structureboundingbox); + this.setBlockState(world, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), + 10, -11, 13, structureboundingbox); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (!this.field_74940_h[enumfacing.getHorizontalIndex()]) { + int k1 = enumfacing.getFrontOffsetX() * 2; + int l1 = enumfacing.getFrontOffsetZ() * 2; + this.field_74940_h[enumfacing.getHorizontalIndex()] = this.generateChestContents(world, + structureboundingbox, random, 10 + k1, -11, 10 + l1, + WeightedRandomChestContent.func_177629_a(itemsToGenerateInTemple, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random) }), + 2 + random.nextInt(5)); + } + } + + return true; + } + } + + abstract static class Feature extends StructureComponent { + protected int scatteredFeatureSizeX; + protected int scatteredFeatureSizeY; + protected int scatteredFeatureSizeZ; + protected int field_74936_d = -1; + + public Feature() { + } + + protected Feature(EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, + int parInt6) { + super(0); + this.scatteredFeatureSizeX = parInt4; + this.scatteredFeatureSizeY = parInt5; + this.scatteredFeatureSizeZ = parInt6; + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(parRandom); + switch (this.coordBaseMode) { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(parInt1, parInt2, parInt3, parInt1 + parInt4 - 1, + parInt2 + parInt5 - 1, parInt3 + parInt6 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(parInt1, parInt2, parInt3, parInt1 + parInt6 - 1, + parInt2 + parInt5 - 1, parInt3 + parInt4 - 1); + } + + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setInteger("Width", this.scatteredFeatureSizeX); + nbttagcompound.setInteger("Height", this.scatteredFeatureSizeY); + nbttagcompound.setInteger("Depth", this.scatteredFeatureSizeZ); + nbttagcompound.setInteger("HPos", this.field_74936_d); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + this.scatteredFeatureSizeX = nbttagcompound.getInteger("Width"); + this.scatteredFeatureSizeY = nbttagcompound.getInteger("Height"); + this.scatteredFeatureSizeZ = nbttagcompound.getInteger("Depth"); + this.field_74936_d = nbttagcompound.getInteger("HPos"); + } + + protected boolean func_74935_a(World worldIn, StructureBoundingBox parStructureBoundingBox, int parInt1) { + if (this.field_74936_d >= 0) { + return true; + } else { + int i = 0; + int j = 0; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) { + for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) { + blockpos$mutableblockpos.func_181079_c(l, 64, k); + if (parStructureBoundingBox.isVecInside(blockpos$mutableblockpos)) { + i += Math.max(worldIn.getTopSolidOrLiquidBlock(blockpos$mutableblockpos).getY(), + worldIn.provider.getAverageGroundLevel()); + ++j; + } + } + } + + if (j == 0) { + return false; + } else { + this.field_74936_d = i / j; + this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + parInt1, 0); + return true; + } + } + } + } + + public static class JunglePyramid extends ComponentScatteredFeaturePieces.Feature { + private boolean field_74947_h; + private boolean field_74948_i; + private boolean field_74945_j; + private boolean field_74946_k; + private static final List field_175816_i = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), + new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), + new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), + new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1) }); + private static final List field_175815_j = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.arrow, 0, 2, 7, 30) }); + private static ComponentScatteredFeaturePieces.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(); + + public JunglePyramid() { + } + + public JunglePyramid(EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parRandom, parInt1, 64, parInt2, 12, 10, 15); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("placedMainChest", this.field_74947_h); + nbttagcompound.setBoolean("placedHiddenChest", this.field_74948_i); + nbttagcompound.setBoolean("placedTrap1", this.field_74945_j); + nbttagcompound.setBoolean("placedTrap2", this.field_74946_k); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_74947_h = nbttagcompound.getBoolean("placedMainChest"); + this.field_74948_i = nbttagcompound.getBoolean("placedHiddenChest"); + this.field_74945_j = nbttagcompound.getBoolean("placedTrap1"); + this.field_74946_k = nbttagcompound.getBoolean("placedTrap2"); + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (!this.func_74935_a(world, structureboundingbox, 0)) { + return false; + } else { + int i = this.getMetadataWithOffset(Blocks.stone_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.stone_stairs, 2); + int k = this.getMetadataWithOffset(Blocks.stone_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.stone_stairs, 1); + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, + this.scatteredFeatureSizeZ - 1, false, random, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 1, 2, 9, 2, 2, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 1, 12, 9, 2, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 1, 3, 2, 2, 11, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 9, 1, 3, 9, 2, 11, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 3, 1, 10, 6, 1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 3, 13, 10, 6, 13, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 3, 2, 1, 6, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 10, 3, 2, 10, 6, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 3, 2, 9, 3, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 6, 2, 9, 6, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 3, 7, 3, 8, 7, 11, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 8, 4, 7, 8, 10, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithAir(world, structureboundingbox, 3, 1, 3, 8, 2, 11); + this.fillWithAir(world, structureboundingbox, 4, 3, 6, 7, 3, 9); + this.fillWithAir(world, structureboundingbox, 2, 4, 2, 9, 5, 12); + this.fillWithAir(world, structureboundingbox, 4, 6, 5, 7, 6, 9); + this.fillWithAir(world, structureboundingbox, 5, 7, 6, 6, 7, 8); + this.fillWithAir(world, structureboundingbox, 5, 1, 2, 6, 2, 2); + this.fillWithAir(world, structureboundingbox, 5, 2, 12, 6, 2, 12); + this.fillWithAir(world, structureboundingbox, 5, 5, 1, 6, 5, 1); + this.fillWithAir(world, structureboundingbox, 5, 5, 13, 6, 5, 13); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 5, 5, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 10, 5, 5, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 5, 9, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 10, 5, 9, structureboundingbox); + + for (int i1 = 0; i1 <= 14; i1 += 14) { + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 4, i1, 2, 5, i1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 4, i1, 4, 5, i1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 7, 4, i1, 7, 5, i1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 9, 4, i1, 9, 5, i1, false, random, + junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(world, structureboundingbox, 5, 6, 0, 6, 6, 0, false, random, + junglePyramidsRandomScatteredStones); + + for (int k1 = 0; k1 <= 11; k1 += 11) { + for (int j1 = 2; j1 <= 12; j1 += 2) { + this.fillWithRandomizedBlocks(world, structureboundingbox, k1, 4, j1, k1, 5, j1, false, random, + junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(world, structureboundingbox, k1, 6, 5, k1, 6, 5, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, k1, 6, 9, k1, 6, 9, false, random, + junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 7, 2, 2, 9, 2, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 9, 7, 2, 9, 9, 2, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, 7, 12, 2, 9, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 9, 7, 12, 9, 9, 12, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 9, 4, 4, 9, 4, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 7, 9, 4, 7, 9, 4, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 9, 10, 4, 9, 10, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 7, 9, 10, 7, 9, 10, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 5, 9, 7, 6, 9, 7, false, random, + junglePyramidsRandomScatteredStones); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 5, 9, 6, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 6, 9, 6, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(j), 5, 9, 8, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(j), 6, 9, 8, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 4, 0, 0, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 5, 0, 0, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 6, 0, 0, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 7, 0, 0, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 4, 1, 8, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 4, 2, 9, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 4, 3, 10, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 7, 1, 8, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 7, 2, 9, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 7, 3, 10, structureboundingbox); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 9, 4, 1, 9, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 7, 1, 9, 7, 1, 9, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 10, 7, 2, 10, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 5, 4, 5, 6, 4, 5, false, random, + junglePyramidsRandomScatteredStones); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(k), 4, 4, 5, structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(l), 7, 4, 5, structureboundingbox); + + for (int l1 = 0; l1 < 4; ++l1) { + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(j), 5, 0 - l1, 6 + l1, + structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(j), 6, 0 - l1, 6 + l1, + structureboundingbox); + this.fillWithAir(world, structureboundingbox, 5, 0 - l1, 7 + l1, 6, 0 - l1, 9 + l1); + } + + this.fillWithAir(world, structureboundingbox, 1, -3, 12, 10, -1, 13); + this.fillWithAir(world, structureboundingbox, 1, -3, 1, 3, -1, 13); + this.fillWithAir(world, structureboundingbox, 1, -3, 1, 9, -1, 5); + + for (int i2 = 1; i2 <= 13; i2 += 2) { + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, -3, i2, 1, -2, i2, false, random, + junglePyramidsRandomScatteredStones); + } + + for (int j2 = 2; j2 <= 12; j2 += 2) { + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, -1, j2, 3, -1, j2, false, random, + junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, -2, 1, 5, -2, 1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 7, -2, 1, 9, -2, 1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 6, -3, 1, 6, -3, 1, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 6, -1, 1, 6, -1, 1, false, random, + junglePyramidsRandomScatteredStones); + this.setBlockState(world, + Blocks.tripwire_hook.getStateFromMeta( + this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.EAST.getHorizontalIndex())) + .withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), + 1, -3, 8, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire_hook.getStateFromMeta( + this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.WEST.getHorizontalIndex())) + .withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), + 4, -3, 8, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), + 2, -3, 8, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), + 3, -3, 8, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 7, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 6, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 5, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 4, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 3, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 2, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 5, -3, 1, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 4, -3, 1, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 3, -3, 1, structureboundingbox); + if (!this.field_74945_j) { + this.field_74945_j = this.generateDispenserContents(world, structureboundingbox, random, 3, -2, 1, + EnumFacing.NORTH.getIndex(), field_175815_j, 2); + } + + this.setBlockState(world, Blocks.vine.getStateFromMeta(15), 3, -2, 2, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire_hook.getStateFromMeta( + this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.NORTH.getHorizontalIndex())) + .withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), + 7, -3, 1, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire_hook.getStateFromMeta( + this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.SOUTH.getHorizontalIndex())) + .withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), + 7, -3, 5, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), + 7, -3, 2, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), + 7, -3, 3, structureboundingbox); + this.setBlockState(world, + Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), + 7, -3, 4, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 8, -3, 6, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 9, -3, 6, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 9, -3, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 4, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 9, -2, 4, structureboundingbox); + if (!this.field_74946_k) { + this.field_74946_k = this.generateDispenserContents(world, structureboundingbox, random, 9, -2, 3, + EnumFacing.WEST.getIndex(), field_175815_j, 2); + } + + this.setBlockState(world, Blocks.vine.getStateFromMeta(15), 8, -1, 3, structureboundingbox); + this.setBlockState(world, Blocks.vine.getStateFromMeta(15), 8, -2, 3, structureboundingbox); + if (!this.field_74947_h) { + this.field_74947_h = this.generateChestContents(world, structureboundingbox, random, 8, -3, 3, + WeightedRandomChestContent.func_177629_a(field_175816_i, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random) }), + 2 + random.nextInt(5)); + } + + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 2, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 8, -3, 1, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 4, -3, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 5, -2, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 5, -1, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 6, -3, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 7, -2, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 7, -1, 5, structureboundingbox); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 8, -3, 5, structureboundingbox); + this.fillWithRandomizedBlocks(world, structureboundingbox, 9, -1, 1, 9, -1, 5, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithAir(world, structureboundingbox, 8, -3, 8, 10, -1, 10); + this.setBlockState(world, Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CHISELED_META), 8, -2, 11, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CHISELED_META), 9, -2, 11, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CHISELED_META), 10, -2, 11, + structureboundingbox); + this.setBlockState(world, + Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(EnumFacing + .getFront(this.getMetadataWithOffset(Blocks.lever, EnumFacing.NORTH.getIndex())))), + 8, -2, 12, structureboundingbox); + this.setBlockState(world, + Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(EnumFacing + .getFront(this.getMetadataWithOffset(Blocks.lever, EnumFacing.NORTH.getIndex())))), + 9, -2, 12, structureboundingbox); + this.setBlockState(world, + Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(EnumFacing + .getFront(this.getMetadataWithOffset(Blocks.lever, EnumFacing.NORTH.getIndex())))), + 10, -2, 12, structureboundingbox); + this.fillWithRandomizedBlocks(world, structureboundingbox, 8, -3, 8, 8, -3, 10, false, random, + junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 10, -3, 8, 10, -3, 10, false, random, + junglePyramidsRandomScatteredStones); + this.setBlockState(world, Blocks.mossy_cobblestone.getDefaultState(), 10, -2, 9, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 8, -2, 9, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 8, -2, 10, structureboundingbox); + this.setBlockState(world, Blocks.redstone_wire.getDefaultState(), 10, -1, 9, structureboundingbox); + this.setBlockState(world, Blocks.sticky_piston.getStateFromMeta(EnumFacing.UP.getIndex()), 9, -2, 8, + structureboundingbox); + this.setBlockState(world, + Blocks.sticky_piston.getStateFromMeta( + this.getMetadataWithOffset(Blocks.sticky_piston, EnumFacing.WEST.getIndex())), + 10, -2, 8, structureboundingbox); + this.setBlockState(world, + Blocks.sticky_piston.getStateFromMeta( + this.getMetadataWithOffset(Blocks.sticky_piston, EnumFacing.WEST.getIndex())), + 10, -1, 8, structureboundingbox); + this.setBlockState(world, Blocks.unpowered_repeater.getStateFromMeta( + this.getMetadataWithOffset(Blocks.unpowered_repeater, EnumFacing.NORTH.getHorizontalIndex())), + 10, -2, 10, structureboundingbox); + if (!this.field_74948_i) { + this.field_74948_i = this.generateChestContents(world, structureboundingbox, random, 9, -3, 10, + WeightedRandomChestContent.func_177629_a(field_175816_i, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random) }), + 2 + random.nextInt(5)); + } + + return true; + } + } + + static class Stones extends StructureComponent.BlockSelector { + private Stones() { + } + + public void selectBlocks(EaglercraftRandom rand, int x, int y, int z, boolean parFlag) { + if (rand.nextFloat() < 0.4F) { + this.blockstate = Blocks.cobblestone.getDefaultState(); + } else { + this.blockstate = Blocks.mossy_cobblestone.getDefaultState(); + } + + } + } + } + + public static class SwampHut extends ComponentScatteredFeaturePieces.Feature { + private boolean hasWitch; + + public SwampHut() { + } + + public SwampHut(EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parRandom, parInt1, 64, parInt2, 7, 7, 9); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Witch", this.hasWitch); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.hasWitch = nbttagcompound.getBoolean("Witch"); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (!this.func_74935_a(world, structureboundingbox, 0)) { + return false; + } else { + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 5, 1, 7, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 2, 5, 4, 7, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 0, 4, 1, 0, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 2, 2, 2, 3, 3, 2, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 3, 1, 3, 6, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 3, 5, 3, 6, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 2, 2, 7, 4, 3, 7, + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), + Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 2, 1, 3, 2, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 0, 2, 5, 3, 2, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 7, 1, 3, 7, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 0, 7, 5, 3, 7, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 2, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 3, 3, 7, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 3, 4, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 5, 3, 4, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 5, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.flower_pot.getDefaultState().withProperty(BlockFlowerPot.CONTENTS, + BlockFlowerPot.EnumFlowerType.MUSHROOM_RED), 1, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.crafting_table.getDefaultState(), 3, 2, 6, structureboundingbox); + this.setBlockState(world, Blocks.cauldron.getDefaultState(), 4, 2, 6, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 5, 2, 1, structureboundingbox); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 1); + int k = this.getMetadataWithOffset(Blocks.oak_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 1, 6, 4, 1, + Blocks.spruce_stairs.getStateFromMeta(i), Blocks.spruce_stairs.getStateFromMeta(i), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 2, 0, 4, 7, + Blocks.spruce_stairs.getStateFromMeta(k), Blocks.spruce_stairs.getStateFromMeta(k), false); + this.fillWithBlocks(world, structureboundingbox, 6, 4, 2, 6, 4, 7, + Blocks.spruce_stairs.getStateFromMeta(j), Blocks.spruce_stairs.getStateFromMeta(j), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 8, 6, 4, 8, + Blocks.spruce_stairs.getStateFromMeta(l), Blocks.spruce_stairs.getStateFromMeta(l), false); + + for (int i1 = 2; i1 <= 7; i1 += 5) { + for (int j1 = 1; j1 <= 5; j1 += 4) { + this.replaceAirAndLiquidDownwards(world, Blocks.log.getDefaultState(), j1, -1, i1, + structureboundingbox); + } + } + + if (!this.hasWitch) { + int l1 = this.getXWithOffset(2, 5); + int i2 = this.getYWithOffset(2); + int k1 = this.getZWithOffset(2, 5); + if (structureboundingbox.isVecInside(new BlockPos(l1, i2, k1))) { + this.hasWitch = true; + EntityWitch entitywitch = new EntityWitch(world); + entitywitch.setLocationAndAngles((double) l1 + 0.5D, (double) i2, (double) k1 + 0.5D, 0.0F, + 0.0F); + entitywitch.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(l1, i2, k1)), + (IEntityLivingData) null); + world.spawnEntityInWorld(entitywitch); + } + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenMineshaft.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenMineshaft.java new file mode 100644 index 0000000..68f3ede --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenMineshaft.java @@ -0,0 +1,64 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import java.util.Map; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureMineshaftStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenMineshaft extends MapGenStructure { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenMineshaft"); + } + + private double field_82673_e = 0.004D; + + public MapGenMineshaft() { + } + + public String getStructureName() { + return "Mineshaft"; + } + + public MapGenMineshaft(Map parMap) { + for (Entry entry : parMap.entrySet()) { + if (((String) entry.getKey()).equals("chance")) { + this.field_82673_e = MathHelper.parseDoubleWithDefault((String) entry.getValue(), this.field_82673_e); + } + } + + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { + return this.rand.nextDouble() < this.field_82673_e + && this.rand.nextInt(80) < Math.max(Math.abs(chunkX), Math.abs(chunkZ)); + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) { + return new StructureMineshaftStart(this.worldObj, this.rand, chunkX, chunkZ); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenNetherBridge.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenNetherBridge.java new file mode 100644 index 0000000..13c2544 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenNetherBridge.java @@ -0,0 +1,98 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityBlaze; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityMagmaCube; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityPigZombie; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntitySkeleton; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureNetherBridgePieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenNetherBridge extends MapGenStructure { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenNetherBridge"); + } + + private List spawnList = Lists.newArrayList(); + + public MapGenNetherBridge() { + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); + } + + public String getStructureName() { + return "Fortress"; + } + + public List getSpawnList() { + return this.spawnList; + } + + protected boolean canSpawnStructureAtCoords(int i, int j) { + int k = i >> 4; + int l = j >> 4; + this.rand.setSeed((long) (k ^ l << 4) ^ this.worldObj.getSeed()); + this.rand.nextInt(); + return this.rand.nextInt(3) != 0 ? false + : (i != (k << 4) + 4 + this.rand.nextInt(8) ? false : j == (l << 4) + 4 + this.rand.nextInt(8)); + } + + protected StructureStart getStructureStart(int i, int j) { + return new MapGenNetherBridge.Start(this.worldObj, this.rand, i, j); + } + + public static class Start extends StructureStart { + public Start() { + } + + public Start(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parInt1, parInt2); + StructureNetherBridgePieces.Start structurenetherbridgepieces$start = new StructureNetherBridgePieces.Start( + parRandom, (parInt1 << 4) + 2, (parInt2 << 4) + 2); + this.components.add(structurenetherbridgepieces$start); + structurenetherbridgepieces$start.buildComponent(structurenetherbridgepieces$start, this.components, + parRandom); + List list = structurenetherbridgepieces$start.field_74967_d; + + while (!list.isEmpty()) { + int i = parRandom.nextInt(list.size()); + StructureComponent structurecomponent = (StructureComponent) list.remove(i); + structurecomponent.buildComponent(structurenetherbridgepieces$start, this.components, parRandom); + } + + this.updateBoundingBox(); + this.setRandomHeight(worldIn, parRandom, 48, 70); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenScatteredFeature.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenScatteredFeature.java new file mode 100644 index 0000000..2a97c52 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenScatteredFeature.java @@ -0,0 +1,161 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityWitch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenScatteredFeature extends MapGenStructure { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenScatteredFeature"); + } + + private static final List biomelist = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.desert, + BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland }); + private List scatteredFeatureSpawnList; + private int maxDistanceBetweenScatteredFeatures; + private int minDistanceBetweenScatteredFeatures; + + public MapGenScatteredFeature() { + this.scatteredFeatureSpawnList = Lists.newArrayList(); + this.maxDistanceBetweenScatteredFeatures = 32; + this.minDistanceBetweenScatteredFeatures = 8; + this.scatteredFeatureSpawnList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 1, 1, 1)); + } + + public MapGenScatteredFeature(Map parMap) { + this(); + + for (Entry entry : parMap.entrySet()) { + if (((String) entry.getKey()).equals("distance")) { + this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax( + (String) entry.getValue(), this.maxDistanceBetweenScatteredFeatures, + this.minDistanceBetweenScatteredFeatures + 1); + } + } + + } + + public String getStructureName() { + return "Temple"; + } + + protected boolean canSpawnStructureAtCoords(int i, int j) { + int k = i; + int l = j; + if (i < 0) { + i -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + if (j < 0) { + j -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + int i1 = i / this.maxDistanceBetweenScatteredFeatures; + int j1 = j / this.maxDistanceBetweenScatteredFeatures; + EaglercraftRandom random = this.worldObj.setRandomSeed(i1, j1, 14357617); + i1 = i1 * this.maxDistanceBetweenScatteredFeatures; + j1 = j1 * this.maxDistanceBetweenScatteredFeatures; + i1 = i1 + random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + j1 = j1 + random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + if (k == i1 && l == j1) { + BiomeGenBase biomegenbase = this.worldObj.getWorldChunkManager() + .getBiomeGenerator(new BlockPos(k * 16 + 8, 0, l * 16 + 8)); + if (biomegenbase == null) { + return false; + } + + for (BiomeGenBase biomegenbase1 : biomelist) { + if (biomegenbase == biomegenbase1) { + return true; + } + } + } + + return false; + } + + protected StructureStart getStructureStart(int i, int j) { + return new MapGenScatteredFeature.Start(this.worldObj, this.rand, i, j); + } + + public boolean func_175798_a(BlockPos parBlockPos) { + StructureStart structurestart = this.func_175797_c(parBlockPos); + if (structurestart != null && structurestart instanceof MapGenScatteredFeature.Start + && !structurestart.components.isEmpty()) { + StructureComponent structurecomponent = (StructureComponent) structurestart.components.getFirst(); + return structurecomponent instanceof ComponentScatteredFeaturePieces.SwampHut; + } else { + return false; + } + } + + /**+ + * returns possible spawns for scattered features + */ + public List getScatteredFeatureSpawnList() { + return this.scatteredFeatureSpawnList; + } + + public static class Start extends StructureStart { + public Start() { + } + + public Start(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parInt1, parInt2); + BiomeGenBase biomegenbase = worldIn + .getBiomeGenForCoords(new BlockPos(parInt1 * 16 + 8, 0, parInt2 * 16 + 8)); + if (biomegenbase != BiomeGenBase.jungle && biomegenbase != BiomeGenBase.jungleHills) { + if (biomegenbase == BiomeGenBase.swampland) { + ComponentScatteredFeaturePieces.SwampHut componentscatteredfeaturepieces$swamphut = new ComponentScatteredFeaturePieces.SwampHut( + parRandom, parInt1 * 16, parInt2 * 16); + this.components.add(componentscatteredfeaturepieces$swamphut); + } else if (biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills) { + ComponentScatteredFeaturePieces.DesertPyramid componentscatteredfeaturepieces$desertpyramid = new ComponentScatteredFeaturePieces.DesertPyramid( + parRandom, parInt1 * 16, parInt2 * 16); + this.components.add(componentscatteredfeaturepieces$desertpyramid); + } + } else { + ComponentScatteredFeaturePieces.JunglePyramid componentscatteredfeaturepieces$junglepyramid = new ComponentScatteredFeaturePieces.JunglePyramid( + parRandom, parInt1 * 16, parInt2 * 16); + this.components.add(componentscatteredfeaturepieces$junglepyramid); + } + + this.updateBoundingBox(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStronghold.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStronghold.java new file mode 100644 index 0000000..2237741 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -0,0 +1,181 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStrongholdPieces; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenStronghold extends MapGenStructure { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStronghold"); + } + + private List field_151546_e; + private boolean ranBiomeCheck; + private ChunkCoordIntPair[] structureCoords; + private double field_82671_h; + private int field_82672_i; + + public MapGenStronghold() { + this.structureCoords = new ChunkCoordIntPair[3]; + this.field_82671_h = 32.0D; + this.field_82672_i = 3; + this.field_151546_e = Lists.newArrayList(); + + for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray()) { + if (biomegenbase != null && biomegenbase.minHeight > 0.0F) { + this.field_151546_e.add(biomegenbase); + } + } + + } + + public MapGenStronghold(Map parMap) { + this(); + + for (Entry entry : parMap.entrySet()) { + if (((String) entry.getKey()).equals("distance")) { + this.field_82671_h = MathHelper.parseDoubleWithDefaultAndMax((String) entry.getValue(), + this.field_82671_h, 1.0D); + } else if (((String) entry.getKey()).equals("count")) { + this.structureCoords = new ChunkCoordIntPair[MathHelper + .parseIntWithDefaultAndMax((String) entry.getValue(), this.structureCoords.length, 1)]; + } else if (((String) entry.getKey()).equals("spread")) { + this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String) entry.getValue(), this.field_82672_i, + 1); + } + } + + } + + public String getStructureName() { + return "Stronghold"; + } + + protected boolean canSpawnStructureAtCoords(int i, int j) { + if (!this.ranBiomeCheck) { + EaglercraftRandom random = new EaglercraftRandom(); + random.setSeed(this.worldObj.getSeed()); + double d0 = random.nextDouble() * 3.141592653589793D * 2.0D; + int k = 1; + + for (int l = 0; l < this.structureCoords.length; ++l) { + double d1 = (1.25D * (double) k + random.nextDouble()) * this.field_82671_h * (double) k; + int i1 = (int) Math.round(Math.cos(d0) * d1); + int j1 = (int) Math.round(Math.sin(d0) * d1); + BlockPos blockpos = this.worldObj.getWorldChunkManager().findBiomePosition((i1 << 4) + 8, (j1 << 4) + 8, + 112, this.field_151546_e, random); + if (blockpos != null) { + i1 = blockpos.getX() >> 4; + j1 = blockpos.getZ() >> 4; + } + + this.structureCoords[l] = new ChunkCoordIntPair(i1, j1); + d0 += 6.283185307179586D * (double) k / (double) this.field_82672_i; + if (l == this.field_82672_i) { + k += 2 + random.nextInt(5); + this.field_82672_i += 1 + random.nextInt(2); + } + } + + this.ranBiomeCheck = true; + } + + for (ChunkCoordIntPair chunkcoordintpair : this.structureCoords) { + if (i == chunkcoordintpair.chunkXPos && j == chunkcoordintpair.chunkZPos) { + return true; + } + } + + return false; + } + + /**+ + * Returns a list of other locations at which the structure + * generation has been run, or null if not relevant to this + * structure generator. + */ + protected List getCoordList() { + ArrayList arraylist = Lists.newArrayList(); + + for (ChunkCoordIntPair chunkcoordintpair : this.structureCoords) { + if (chunkcoordintpair != null) { + arraylist.add(chunkcoordintpair.getCenterBlock(64)); + } + } + + return arraylist; + } + + protected StructureStart getStructureStart(int i, int j) { + MapGenStronghold.Start mapgenstronghold$start; + for (mapgenstronghold$start = new MapGenStronghold.Start(this.worldObj, this.rand, i, j); mapgenstronghold$start + .getComponents().isEmpty() + || ((StructureStrongholdPieces.Stairs2) mapgenstronghold$start.getComponents() + .get(0)).strongholdPortalRoom == null; mapgenstronghold$start = new MapGenStronghold.Start( + this.worldObj, this.rand, i, j)) { + ; + } + + return mapgenstronghold$start; + } + + public static class Start extends StructureStart { + public Start() { + } + + public Start(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parInt1, parInt2); + StructureStrongholdPieces.prepareStructurePieces(); + StructureStrongholdPieces.Stairs2 structurestrongholdpieces$stairs2 = new StructureStrongholdPieces.Stairs2( + 0, parRandom, (parInt1 << 4) + 2, (parInt2 << 4) + 2); + this.components.add(structurestrongholdpieces$stairs2); + structurestrongholdpieces$stairs2.buildComponent(structurestrongholdpieces$stairs2, this.components, + parRandom); + List list = structurestrongholdpieces$stairs2.field_75026_c; + + while (!list.isEmpty()) { + int i = parRandom.nextInt(list.size()); + StructureComponent structurecomponent = (StructureComponent) list.remove(i); + structurecomponent.buildComponent(structurestrongholdpieces$stairs2, this.components, parRandom); + } + + this.updateBoundingBox(); + this.markAvailableHeight(worldIn, parRandom, 10); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructure.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructure.java new file mode 100644 index 0000000..c46b84a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructure.java @@ -0,0 +1,259 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Maps; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.HString; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.AxisAlignedBB; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ReportedException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.ChunkPrimer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.MapGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class MapGenStructure extends MapGenBase { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStructure"); + } + + private MapGenStructureData structureData; + protected Map structureMap = Maps.newHashMap(); + + public abstract String getStructureName(); + + /**+ + * Recursively called by generate() + */ + protected final void recursiveGenerate(World world, final int i, final int j, int var4, int var5, + ChunkPrimer var6) { + this.func_143027_a(world); + if (!this.structureMap.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)))) { + this.rand.nextInt(); + + try { + if (this.canSpawnStructureAtCoords(i, j)) { + StructureStart structurestart = this.getStructureStart(i, j); + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), structurestart); + this.func_143026_a(i, j, structurestart); + } + + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, + "Exception preparing structure feature"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Feature being prepared"); + crashreportcategory.addCrashSectionCallable("Is feature chunk", new Callable() { + public String call() throws Exception { + return MapGenStructure.this.canSpawnStructureAtCoords(i, j) ? "True" : "False"; + } + }); + crashreportcategory.addCrashSection("Chunk location", + HString.format("%d,%d", new Object[] { Integer.valueOf(i), Integer.valueOf(j) })); + crashreportcategory.addCrashSectionCallable("Chunk pos hash", new Callable() { + public String call() throws Exception { + return String.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)); + } + }); + crashreportcategory.addCrashSectionCallable("Structure type", new Callable() { + public String call() throws Exception { + return MapGenStructure.this.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + } + + public boolean generateStructure(World worldIn, EaglercraftRandom randomIn, ChunkCoordIntPair chunkCoord) { + this.func_143027_a(worldIn); + int i = (chunkCoord.chunkXPos << 4) + 8; + int j = (chunkCoord.chunkZPos << 4) + 8; + boolean flag = false; + + for (StructureStart structurestart : this.structureMap.values()) { + if (structurestart.isSizeableStructure() && structurestart.func_175788_a(chunkCoord) + && structurestart.getBoundingBox().intersectsWith(i, j, i + 15, j + 15)) { + structurestart.generateStructure(worldIn, randomIn, new StructureBoundingBox(i, j, i + 15, j + 15)); + structurestart.func_175787_b(chunkCoord); + flag = true; + this.func_143026_a(structurestart.getChunkPosX(), structurestart.getChunkPosZ(), structurestart); + } + } + + return flag; + } + + public boolean func_175795_b(BlockPos pos) { + this.func_143027_a(this.worldObj); + return this.func_175797_c(pos) != null; + } + + protected StructureStart func_175797_c(BlockPos pos) { + label24: for (StructureStart structurestart : this.structureMap.values()) { + if (structurestart.isSizeableStructure() && structurestart.getBoundingBox().isVecInside(pos)) { + Iterator iterator = structurestart.getComponents().iterator(); + + while (true) { + if (!iterator.hasNext()) { + continue label24; + } + + StructureComponent structurecomponent = (StructureComponent) iterator.next(); + if (structurecomponent.getBoundingBox().isVecInside(pos)) { + break; + } + } + + return structurestart; + } + } + + return null; + } + + public boolean func_175796_a(World worldIn, BlockPos pos) { + this.func_143027_a(worldIn); + + for (StructureStart structurestart : this.structureMap.values()) { + if (structurestart.isSizeableStructure() && structurestart.getBoundingBox().isVecInside(pos)) { + return true; + } + } + + return false; + } + + public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos) { + this.worldObj = worldIn; + this.func_143027_a(worldIn); + this.rand.setSeed(worldIn.getSeed()); + long i = this.rand.nextLong(); + long j = this.rand.nextLong(); + long k = (long) (pos.getX() >> 4) * i; + long l = (long) (pos.getZ() >> 4) * j; + this.rand.setSeed(k ^ l ^ worldIn.getSeed()); + this.recursiveGenerate(worldIn, pos.getX() >> 4, pos.getZ() >> 4, 0, 0, (ChunkPrimer) null); + double d0 = Double.MAX_VALUE; + BlockPos blockpos = null; + + for (StructureStart structurestart : this.structureMap.values()) { + if (structurestart.isSizeableStructure()) { + StructureComponent structurecomponent = (StructureComponent) structurestart.getComponents().get(0); + BlockPos blockpos1 = structurecomponent.getBoundingBoxCenter(); + double d1 = blockpos1.distanceSq(pos); + if (d1 < d0) { + d0 = d1; + blockpos = blockpos1; + } + } + } + + if (blockpos != null) { + return blockpos; + } else { + List list = this.getCoordList(); + if (list != null) { + BlockPos blockpos2 = null; + + for (BlockPos blockpos3 : (List) list) { + double d2 = blockpos3.distanceSq(pos); + if (d2 < d0) { + d0 = d2; + blockpos2 = blockpos3; + } + } + + return blockpos2; + } else { + return null; + } + } + } + + /**+ + * Returns a list of other locations at which the structure + * generation has been run, or null if not relevant to this + * structure generator. + */ + protected List getCoordList() { + return null; + } + + private void func_143027_a(World worldIn) { + if (this.structureData == null) { + this.structureData = (MapGenStructureData) worldIn.loadItemData(MapGenStructureData.class, + this.getStructureName()); + if (this.structureData == null) { + this.structureData = new MapGenStructureData(this.getStructureName()); + worldIn.setItemData(this.getStructureName(), this.structureData); + } else { + NBTTagCompound nbttagcompound = this.structureData.getTagCompound(); + + for (String s : nbttagcompound.getKeySet()) { + NBTBase nbtbase = nbttagcompound.getTag(s); + if (nbtbase.getId() == 10) { + NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbtbase; + if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ")) { + int i = nbttagcompound1.getInteger("ChunkX"); + int j = nbttagcompound1.getInteger("ChunkZ"); + StructureStart structurestart = MapGenStructureIO.getStructureStart(nbttagcompound1, + worldIn); + if (structurestart != null) { + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), + structurestart); + } + } + } + } + } + } + + } + + private void func_143026_a(int start, int parInt2, StructureStart parStructureStart) { + this.structureData.writeInstance(parStructureStart.writeStructureComponentsToNBT(start, parInt2), start, + parInt2); + this.structureData.markDirty(); + } + + protected abstract boolean canSpawnStructureAtCoords(int var1, int var2); + + protected abstract StructureStart getStructureStart(int var1, int var2); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureData.java new file mode 100644 index 0000000..737cd33 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureData.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenStructureData extends WorldSavedData { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStructureData"); + } + + private NBTTagCompound tagCompound = new NBTTagCompound(); + + public MapGenStructureData(String name) { + super(name); + } + + /**+ + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbt) { + this.tagCompound = nbt.getCompoundTag("Features"); + } + + /**+ + * write data to NBTTagCompound from this MapDataBase, similar + * to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbt) { + nbt.setTag("Features", this.tagCompound); + } + + /**+ + * Writes the NBT tag of an instance of this structure type to + * the internal NBT tag, using the chunkcoordinates as the key + */ + public void writeInstance(NBTTagCompound tagCompoundIn, int chunkX, int chunkZ) { + this.tagCompound.setTag(formatChunkCoords(chunkX, chunkZ), tagCompoundIn); + } + + public static String formatChunkCoords(int chunkX, int chunkZ) { + return "[" + chunkX + "," + chunkZ + "]"; + } + + public NBTTagCompound getTagCompound() { + return this.tagCompound; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureIO.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureIO.java new file mode 100644 index 0000000..3e963c8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureIO.java @@ -0,0 +1,134 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenNetherBridge; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStronghold; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureMineshaftPieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureMineshaftStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureNetherBridgePieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureOceanMonument; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureOceanMonumentPieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStrongholdPieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureVillagePieces; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenStructureIO { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStructureIO"); + } + + private static final Logger logger = LogManager.getLogger(); + private static Map> startNameToClassMap = Maps.newHashMap(); + private static Map, String> startClassToNameMap = Maps.newHashMap(); + private static Map> componentNameToClassMap = Maps.newHashMap(); + private static Map, String> componentClassToNameMap = Maps.newHashMap(); + + private static void registerStructure(Class startClass, String structureName) { + startNameToClassMap.put(structureName, startClass); + startClassToNameMap.put(startClass, structureName); + } + + static void registerStructureComponent(Class componentClass, String componentName) { + componentNameToClassMap.put(componentName, componentClass); + componentClassToNameMap.put(componentClass, componentName); + } + + public static String getStructureStartName(StructureStart start) { + return (String) startClassToNameMap.get(start.getClass()); + } + + public static String getStructureComponentName(StructureComponent component) { + return (String) componentClassToNameMap.get(component.getClass()); + } + + public static StructureStart getStructureStart(NBTTagCompound tagCompound, World worldIn) { + StructureStart structurestart = null; + + try { + Class oclass = (Class) startNameToClassMap.get(tagCompound.getString("id")); + if (oclass != null) { + structurestart = (StructureStart) oclass.newInstance(); + } + } catch (Exception exception) { + logger.warn("Failed Start with id " + tagCompound.getString("id")); + logger.warn(exception); + } + + if (structurestart != null) { + structurestart.readStructureComponentsFromNBT(worldIn, tagCompound); + } else { + logger.warn("Skipping Structure with id " + tagCompound.getString("id")); + } + + return structurestart; + } + + public static StructureComponent getStructureComponent(NBTTagCompound tagCompound, World worldIn) { + StructureComponent structurecomponent = null; + + try { + Class oclass = (Class) componentNameToClassMap.get(tagCompound.getString("id")); + if (oclass != null) { + structurecomponent = (StructureComponent) oclass.newInstance(); + } + } catch (Exception exception) { + logger.warn("Failed Piece with id " + tagCompound.getString("id")); + logger.warn(exception); + } + + if (structurecomponent != null) { + structurecomponent.readStructureBaseNBT(worldIn, tagCompound); + } else { + logger.warn("Skipping Piece with id " + tagCompound.getString("id")); + } + + return structurecomponent; + } + + static { + registerStructure(StructureMineshaftStart.class, "Mineshaft"); + registerStructure(MapGenVillage.Start.class, "Village"); + registerStructure(MapGenNetherBridge.Start.class, "Fortress"); + registerStructure(MapGenStronghold.Start.class, "Stronghold"); + registerStructure(MapGenScatteredFeature.Start.class, "Temple"); + registerStructure(StructureOceanMonument.StartMonument.class, "Monument"); + StructureMineshaftPieces.registerStructurePieces(); + StructureVillagePieces.registerVillagePieces(); + StructureNetherBridgePieces.registerNetherFortressPieces(); + StructureStrongholdPieces.registerStrongholdPieces(); + ComponentScatteredFeaturePieces.registerScatteredFeaturePieces(); + StructureOceanMonumentPieces.registerOceanMonumentPieces(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenVillage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenVillage.java new file mode 100644 index 0000000..40277cf --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenVillage.java @@ -0,0 +1,164 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Map.Entry; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureVillagePieces; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapGenVillage extends MapGenStructure { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenVillage"); + } + + /**+ + * A list of all the biomes villages can spawn in. + */ + public static final List villageSpawnBiomes = Arrays + .asList(new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.savanna }); + private int terrainType; + private int field_82665_g; + private int field_82666_h; + + public MapGenVillage() { + this.field_82665_g = 32; + this.field_82666_h = 8; + } + + public MapGenVillage(Map parMap) { + this(); + + for (Entry entry : parMap.entrySet()) { + if (((String) entry.getKey()).equals("size")) { + this.terrainType = MathHelper.parseIntWithDefaultAndMax((String) entry.getValue(), this.terrainType, 0); + } else if (((String) entry.getKey()).equals("distance")) { + this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String) entry.getValue(), this.field_82665_g, + this.field_82666_h + 1); + } + } + + } + + public String getStructureName() { + return "Village"; + } + + protected boolean canSpawnStructureAtCoords(int i, int j) { + int k = i; + int l = j; + if (i < 0) { + i -= this.field_82665_g - 1; + } + + if (j < 0) { + j -= this.field_82665_g - 1; + } + + int i1 = i / this.field_82665_g; + int j1 = j / this.field_82665_g; + EaglercraftRandom random = this.worldObj.setRandomSeed(i1, j1, 10387312); + i1 = i1 * this.field_82665_g; + j1 = j1 * this.field_82665_g; + i1 = i1 + random.nextInt(this.field_82665_g - this.field_82666_h); + j1 = j1 + random.nextInt(this.field_82665_g - this.field_82666_h); + if (k == i1 && l == j1) { + boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(k * 16 + 8, l * 16 + 8, 0, + villageSpawnBiomes); + if (flag) { + return true; + } + } + + return false; + } + + protected StructureStart getStructureStart(int i, int j) { + return new MapGenVillage.Start(this.worldObj, this.rand, i, j, this.terrainType); + } + + public static class Start extends StructureStart { + private boolean hasMoreThanTwoComponents; + + public Start() { + } + + public Start(World worldIn, EaglercraftRandom rand, int x, int z, int parInt1) { + super(x, z); + List list = StructureVillagePieces.getStructureVillageWeightedPieceList(rand, parInt1); + StructureVillagePieces.Start structurevillagepieces$start = new StructureVillagePieces.Start( + worldIn.getWorldChunkManager(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, parInt1); + this.components.add(structurevillagepieces$start); + structurevillagepieces$start.buildComponent(structurevillagepieces$start, this.components, rand); + List list1 = structurevillagepieces$start.field_74930_j; + List list2 = structurevillagepieces$start.field_74932_i; + + while (!list1.isEmpty() || !list2.isEmpty()) { + if (list1.isEmpty()) { + int i = rand.nextInt(list2.size()); + StructureComponent structurecomponent = (StructureComponent) list2.remove(i); + structurecomponent.buildComponent(structurevillagepieces$start, this.components, rand); + } else { + int j = rand.nextInt(list1.size()); + StructureComponent structurecomponent2 = (StructureComponent) list1.remove(j); + structurecomponent2.buildComponent(structurevillagepieces$start, this.components, rand); + } + } + + this.updateBoundingBox(); + int k = 0; + + for (StructureComponent structurecomponent1 : this.components) { + if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) { + ++k; + } + } + + this.hasMoreThanTwoComponents = k > 2; + } + + public boolean isSizeableStructure() { + return this.hasMoreThanTwoComponents; + } + + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.hasMoreThanTwoComponents = nbttagcompound.getBoolean("Valid"); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureBoundingBox.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureBoundingBox.java new file mode 100644 index 0000000..3699ade --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureBoundingBox.java @@ -0,0 +1,223 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.base.Objects; +import net.minecraft.nbt.NBTTagIntArray; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec3i; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureBoundingBox { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureBoundingBox"); + } + + public int minX; + public int minY; + public int minZ; + public int maxX; + public int maxY; + public int maxZ; + + public StructureBoundingBox() { + } + + public StructureBoundingBox(int[] coords) { + if (coords.length == 6) { + this.minX = coords[0]; + this.minY = coords[1]; + this.minZ = coords[2]; + this.maxX = coords[3]; + this.maxY = coords[4]; + this.maxZ = coords[5]; + } + + } + + /**+ + * returns a new StructureBoundingBox with MAX values + */ + public static StructureBoundingBox getNewBoundingBox() { + return new StructureBoundingBox(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, + Integer.MIN_VALUE, Integer.MIN_VALUE); + } + + /**+ + * Create a bounding box with the specified dimensions and + * rotate it. Used to project a possible new component Bounding + * Box - to check if it would cut anything already spawned + */ + public static StructureBoundingBox getComponentToAddBoundingBox(int parInt1, int parInt2, int parInt3, int parInt4, + int parInt5, int parInt6, int parInt7, int parInt8, int parInt9, EnumFacing parEnumFacing) { + switch (parEnumFacing) { + case NORTH: + return new StructureBoundingBox(parInt1 + parInt4, parInt2 + parInt5, parInt3 - parInt9 + 1 + parInt6, + parInt1 + parInt7 - 1 + parInt4, parInt2 + parInt8 - 1 + parInt5, parInt3 + parInt6); + case SOUTH: + return new StructureBoundingBox(parInt1 + parInt4, parInt2 + parInt5, parInt3 + parInt6, + parInt1 + parInt7 - 1 + parInt4, parInt2 + parInt8 - 1 + parInt5, parInt3 + parInt9 - 1 + parInt6); + case WEST: + return new StructureBoundingBox(parInt1 - parInt9 + 1 + parInt6, parInt2 + parInt5, parInt3 + parInt4, + parInt1 + parInt6, parInt2 + parInt8 - 1 + parInt5, parInt3 + parInt7 - 1 + parInt4); + case EAST: + return new StructureBoundingBox(parInt1 + parInt6, parInt2 + parInt5, parInt3 + parInt4, + parInt1 + parInt9 - 1 + parInt6, parInt2 + parInt8 - 1 + parInt5, parInt3 + parInt7 - 1 + parInt4); + default: + return new StructureBoundingBox(parInt1 + parInt4, parInt2 + parInt5, parInt3 + parInt6, + parInt1 + parInt7 - 1 + parInt4, parInt2 + parInt8 - 1 + parInt5, parInt3 + parInt9 - 1 + parInt6); + } + } + + public static StructureBoundingBox func_175899_a(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, + int parInt6) { + return new StructureBoundingBox(Math.min(parInt1, parInt4), Math.min(parInt2, parInt5), + Math.min(parInt3, parInt6), Math.max(parInt1, parInt4), Math.max(parInt2, parInt5), + Math.max(parInt3, parInt6)); + } + + public StructureBoundingBox(StructureBoundingBox structurebb) { + this.minX = structurebb.minX; + this.minY = structurebb.minY; + this.minZ = structurebb.minZ; + this.maxX = structurebb.maxX; + this.maxY = structurebb.maxY; + this.maxZ = structurebb.maxZ; + } + + public StructureBoundingBox(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax) { + this.minX = xMin; + this.minY = yMin; + this.minZ = zMin; + this.maxX = xMax; + this.maxY = yMax; + this.maxZ = zMax; + } + + public StructureBoundingBox(Vec3i vec1, Vec3i vec2) { + this.minX = Math.min(vec1.getX(), vec2.getX()); + this.minY = Math.min(vec1.getY(), vec2.getY()); + this.minZ = Math.min(vec1.getZ(), vec2.getZ()); + this.maxX = Math.max(vec1.getX(), vec2.getX()); + this.maxY = Math.max(vec1.getY(), vec2.getY()); + this.maxZ = Math.max(vec1.getZ(), vec2.getZ()); + } + + public StructureBoundingBox(int xMin, int zMin, int xMax, int zMax) { + this.minX = xMin; + this.minZ = zMin; + this.maxX = xMax; + this.maxZ = zMax; + this.minY = 1; + this.maxY = 512; + } + + /**+ + * Discover if a coordinate is inside the bounding box area. + */ + public boolean intersectsWith(StructureBoundingBox structurebb) { + return this.maxX >= structurebb.minX && this.minX <= structurebb.maxX && this.maxZ >= structurebb.minZ + && this.minZ <= structurebb.maxZ && this.maxY >= structurebb.minY && this.minY <= structurebb.maxY; + } + + /**+ + * Discover if a coordinate is inside the bounding box area. + */ + public boolean intersectsWith(int minXIn, int minZIn, int maxXIn, int maxZIn) { + return this.maxX >= minXIn && this.minX <= maxXIn && this.maxZ >= minZIn && this.minZ <= maxZIn; + } + + /**+ + * Expands a bounding box's dimensions to include the supplied + * bounding box. + */ + public void expandTo(StructureBoundingBox sbb) { + this.minX = Math.min(this.minX, sbb.minX); + this.minY = Math.min(this.minY, sbb.minY); + this.minZ = Math.min(this.minZ, sbb.minZ); + this.maxX = Math.max(this.maxX, sbb.maxX); + this.maxY = Math.max(this.maxY, sbb.maxY); + this.maxZ = Math.max(this.maxZ, sbb.maxZ); + } + + /**+ + * Offsets the current bounding box by the specified + * coordinates. Args: x, y, z + */ + public void offset(int x, int y, int z) { + this.minX += x; + this.minY += y; + this.minZ += z; + this.maxX += x; + this.maxY += y; + this.maxZ += z; + } + + /**+ + * Checks if given Vec3i is inside of StructureBoundingBox + */ + public boolean isVecInside(Vec3i vec) { + return vec.getX() >= this.minX && vec.getX() <= this.maxX && vec.getZ() >= this.minZ && vec.getZ() <= this.maxZ + && vec.getY() >= this.minY && vec.getY() <= this.maxY; + } + + public Vec3i func_175896_b() { + return new Vec3i(this.maxX - this.minX, this.maxY - this.minY, this.maxZ - this.minZ); + } + + /**+ + * Get dimension of the bounding box in the x direction. + */ + public int getXSize() { + return this.maxX - this.minX + 1; + } + + /**+ + * Get dimension of the bounding box in the y direction. + */ + public int getYSize() { + return this.maxY - this.minY + 1; + } + + /**+ + * Get dimension of the bounding box in the z direction. + */ + public int getZSize() { + return this.maxZ - this.minZ + 1; + } + + public Vec3i getCenter() { + return new BlockPos(this.minX + (this.maxX - this.minX + 1) / 2, this.minY + (this.maxY - this.minY + 1) / 2, + this.minZ + (this.maxZ - this.minZ + 1) / 2); + } + + public String toString() { + return Objects.toStringHelper(this).add("x0", this.minX).add("y0", this.minY).add("z0", this.minZ) + .add("x1", this.maxX).add("y1", this.maxY).add("z1", this.maxZ).toString(); + } + + public NBTTagIntArray toNBTTagIntArray() { + return new NBTTagIntArray(new int[] { this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureComponent.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureComponent.java new file mode 100644 index 0000000..f33eaf8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureComponent.java @@ -0,0 +1,714 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDirectional; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemDoor; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityDispenser; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class StructureComponent { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureComponent"); + } + + protected StructureBoundingBox boundingBox; + protected EnumFacing coordBaseMode; + protected int componentType; + + public StructureComponent() { + } + + protected StructureComponent(int type) { + this.componentType = type; + } + + /**+ + * Writes structure base data (id, boundingbox, {@link + * net.minecraft.world.gen.structure.StructureComponent#coordBaseMode + * coordBase} and {@link + * net.minecraft.world.gen.structure.StructureComponent#componentType + * componentType}) to new NBTTagCompound and returns it. + */ + public NBTTagCompound createStructureBaseNBT() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("id", MapGenStructureIO.getStructureComponentName(this)); + nbttagcompound.setTag("BB", this.boundingBox.toNBTTagIntArray()); + nbttagcompound.setInteger("O", this.coordBaseMode == null ? -1 : this.coordBaseMode.getHorizontalIndex()); + nbttagcompound.setInteger("GD", this.componentType); + this.writeStructureToNBT(nbttagcompound); + return nbttagcompound; + } + + protected abstract void writeStructureToNBT(NBTTagCompound var1); + + /**+ + * Reads and sets structure base data (boundingbox, {@link + * net.minecraft.world.gen.structure.StructureComponent#coordBaseMode + * coordBase} and {@link + * net.minecraft.world.gen.structure.StructureComponent#componentType + * componentType}) + */ + public void readStructureBaseNBT(World worldIn, NBTTagCompound tagCompound) { + if (tagCompound.hasKey("BB")) { + this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB")); + } + + int i = tagCompound.getInteger("O"); + this.coordBaseMode = i == -1 ? null : EnumFacing.getHorizontal(i); + this.componentType = tagCompound.getInteger("GD"); + this.readStructureFromNBT(tagCompound); + } + + protected abstract void readStructureFromNBT(NBTTagCompound var1); + + /**+ + * Initiates construction of the Structure Component picked, at + * the current Location of StructGen + */ + public void buildComponent(StructureComponent var1, List var2, EaglercraftRandom var3) { + } + + public abstract boolean addComponentParts(World var1, EaglercraftRandom var2, StructureBoundingBox var3); + + public StructureBoundingBox getBoundingBox() { + return this.boundingBox; + } + + /**+ + * Returns the component type ID of this component. + */ + public int getComponentType() { + return this.componentType; + } + + /**+ + * Discover if bounding box can fit within the current bounding + * box object. + */ + public static StructureComponent findIntersecting(List listIn, + StructureBoundingBox boundingboxIn) { + for (StructureComponent structurecomponent : listIn) { + if (structurecomponent.getBoundingBox() != null + && structurecomponent.getBoundingBox().intersectsWith(boundingboxIn)) { + return structurecomponent; + } + } + + return null; + } + + public BlockPos getBoundingBoxCenter() { + return new BlockPos(this.boundingBox.getCenter()); + } + + /**+ + * checks the entire StructureBoundingBox for Liquids + */ + protected boolean isLiquidInStructureBoundingBox(World worldIn, StructureBoundingBox boundingboxIn) { + int i = Math.max(this.boundingBox.minX - 1, boundingboxIn.minX); + int j = Math.max(this.boundingBox.minY - 1, boundingboxIn.minY); + int k = Math.max(this.boundingBox.minZ - 1, boundingboxIn.minZ); + int l = Math.min(this.boundingBox.maxX + 1, boundingboxIn.maxX); + int i1 = Math.min(this.boundingBox.maxY + 1, boundingboxIn.maxY); + int j1 = Math.min(this.boundingBox.maxZ + 1, boundingboxIn.maxZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 <= l; ++k1) { + for (int l1 = k; l1 <= j1; ++l1) { + if (worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, j, l1)).getBlock().getMaterial() + .isLiquid()) { + return true; + } + + if (worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).getBlock().getMaterial() + .isLiquid()) { + return true; + } + } + } + + for (int i2 = i; i2 <= l; ++i2) { + for (int k2 = j; k2 <= i1; ++k2) { + if (worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(i2, k2, k)).getBlock().getMaterial() + .isLiquid()) { + return true; + } + + if (worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(i2, k2, j1)).getBlock().getMaterial() + .isLiquid()) { + return true; + } + } + } + + for (int j2 = k; j2 <= j1; ++j2) { + for (int l2 = j; l2 <= i1; ++l2) { + if (worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(i, l2, j2)).getBlock().getMaterial() + .isLiquid()) { + return true; + } + + if (worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, l2, j2)).getBlock().getMaterial() + .isLiquid()) { + return true; + } + } + } + + return false; + } + + protected int getXWithOffset(int x, int z) { + if (this.coordBaseMode == null) { + return x; + } else { + switch (this.coordBaseMode) { + case NORTH: + case SOUTH: + return this.boundingBox.minX + x; + case WEST: + return this.boundingBox.maxX - z; + case EAST: + return this.boundingBox.minX + z; + default: + return x; + } + } + } + + protected int getYWithOffset(int y) { + return this.coordBaseMode == null ? y : y + this.boundingBox.minY; + } + + protected int getZWithOffset(int x, int z) { + if (this.coordBaseMode == null) { + return z; + } else { + switch (this.coordBaseMode) { + case NORTH: + return this.boundingBox.maxZ - z; + case SOUTH: + return this.boundingBox.minZ + z; + case WEST: + case EAST: + return this.boundingBox.minZ + x; + default: + return z; + } + } + } + + /**+ + * Returns the direction-shifted metadata for blocks that + * require orientation, e.g. doors, stairs, ladders. + */ + protected int getMetadataWithOffset(Block blockIn, int meta) { + if (blockIn == Blocks.rail) { + if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.EAST) { + if (meta == 1) { + return 0; + } + + return 1; + } + } else if (blockIn instanceof BlockDoor) { + if (this.coordBaseMode == EnumFacing.SOUTH) { + if (meta == 0) { + return 2; + } + + if (meta == 2) { + return 0; + } + } else { + if (this.coordBaseMode == EnumFacing.WEST) { + return meta + 1 & 3; + } + + if (this.coordBaseMode == EnumFacing.EAST) { + return meta + 3 & 3; + } + } + } else if (blockIn != Blocks.stone_stairs && blockIn != Blocks.oak_stairs + && blockIn != Blocks.nether_brick_stairs && blockIn != Blocks.stone_brick_stairs + && blockIn != Blocks.sandstone_stairs) { + if (blockIn == Blocks.ladder) { + if (this.coordBaseMode == EnumFacing.SOUTH) { + if (meta == EnumFacing.NORTH.getIndex()) { + return EnumFacing.SOUTH.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) { + return EnumFacing.NORTH.getIndex(); + } + } else if (this.coordBaseMode == EnumFacing.WEST) { + if (meta == EnumFacing.NORTH.getIndex()) { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) { + return EnumFacing.SOUTH.getIndex(); + } + } else if (this.coordBaseMode == EnumFacing.EAST) { + if (meta == EnumFacing.NORTH.getIndex()) { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) { + return EnumFacing.SOUTH.getIndex(); + } + } + } else if (blockIn == Blocks.stone_button) { + if (this.coordBaseMode == EnumFacing.SOUTH) { + if (meta == 3) { + return 4; + } + + if (meta == 4) { + return 3; + } + } else if (this.coordBaseMode == EnumFacing.WEST) { + if (meta == 3) { + return 1; + } + + if (meta == 4) { + return 2; + } + + if (meta == 2) { + return 3; + } + + if (meta == 1) { + return 4; + } + } else if (this.coordBaseMode == EnumFacing.EAST) { + if (meta == 3) { + return 2; + } + + if (meta == 4) { + return 1; + } + + if (meta == 2) { + return 3; + } + + if (meta == 1) { + return 4; + } + } + } else if (blockIn != Blocks.tripwire_hook && !(blockIn instanceof BlockDirectional)) { + if (blockIn == Blocks.piston || blockIn == Blocks.sticky_piston || blockIn == Blocks.lever + || blockIn == Blocks.dispenser) { + if (this.coordBaseMode == EnumFacing.SOUTH) { + if (meta == EnumFacing.NORTH.getIndex() || meta == EnumFacing.SOUTH.getIndex()) { + return EnumFacing.getFront(meta).getOpposite().getIndex(); + } + } else if (this.coordBaseMode == EnumFacing.WEST) { + if (meta == EnumFacing.NORTH.getIndex()) { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) { + return EnumFacing.SOUTH.getIndex(); + } + } else if (this.coordBaseMode == EnumFacing.EAST) { + if (meta == EnumFacing.NORTH.getIndex()) { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) { + return EnumFacing.SOUTH.getIndex(); + } + } + } + } else { + EnumFacing enumfacing = EnumFacing.getHorizontal(meta); + if (this.coordBaseMode == EnumFacing.SOUTH) { + if (enumfacing == EnumFacing.SOUTH || enumfacing == EnumFacing.NORTH) { + return enumfacing.getOpposite().getHorizontalIndex(); + } + } else if (this.coordBaseMode == EnumFacing.WEST) { + if (enumfacing == EnumFacing.NORTH) { + return EnumFacing.WEST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.SOUTH) { + return EnumFacing.EAST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.WEST) { + return EnumFacing.NORTH.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.EAST) { + return EnumFacing.SOUTH.getHorizontalIndex(); + } + } else if (this.coordBaseMode == EnumFacing.EAST) { + if (enumfacing == EnumFacing.NORTH) { + return EnumFacing.EAST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.SOUTH) { + return EnumFacing.WEST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.WEST) { + return EnumFacing.NORTH.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.EAST) { + return EnumFacing.SOUTH.getHorizontalIndex(); + } + } + } + } else if (this.coordBaseMode == EnumFacing.SOUTH) { + if (meta == 2) { + return 3; + } + + if (meta == 3) { + return 2; + } + } else if (this.coordBaseMode == EnumFacing.WEST) { + if (meta == 0) { + return 2; + } + + if (meta == 1) { + return 3; + } + + if (meta == 2) { + return 0; + } + + if (meta == 3) { + return 1; + } + } else if (this.coordBaseMode == EnumFacing.EAST) { + if (meta == 0) { + return 2; + } + + if (meta == 1) { + return 3; + } + + if (meta == 2) { + return 1; + } + + if (meta == 3) { + return 0; + } + } + + return meta; + } + + protected void setBlockState(World worldIn, IBlockState blockstateIn, int x, int y, int z, + StructureBoundingBox boundingboxIn) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + if (boundingboxIn.isVecInside(blockpos)) { + worldIn.setBlockState(blockpos, blockstateIn, 2); + } + } + + protected IBlockState getBlockStateFromPos(World worldIn, int x, int y, int z, StructureBoundingBox boundingboxIn) { + int i = this.getXWithOffset(x, z); + int j = this.getYWithOffset(y); + int k = this.getZWithOffset(x, z); + BlockPos blockpos = new BlockPos(i, j, k); + return !boundingboxIn.isVecInside(blockpos) ? Blocks.air.getDefaultState() : worldIn.getBlockState(blockpos); + } + + /**+ + * arguments: (World worldObj, StructureBoundingBox structBB, + * int minX, int minY, int minZ, int maxX, int maxY, int maxZ) + */ + protected void fillWithAir(World worldIn, StructureBoundingBox structurebb, int minX, int minY, int minZ, int maxX, + int maxY, int maxZ) { + for (int i = minY; i <= maxY; ++i) { + for (int j = minX; j <= maxX; ++j) { + for (int k = minZ; k <= maxZ; ++k) { + this.setBlockState(worldIn, Blocks.air.getDefaultState(), j, i, k, structurebb); + } + } + } + + } + + /**+ + * Fill the given area with the selected blocks + */ + protected void fillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int xMin, int yMin, int zMin, + int xMax, int yMax, int zMax, IBlockState boundaryBlockState, IBlockState insideBlockState, + boolean existingOnly) { + for (int i = yMin; i <= yMax; ++i) { + for (int j = xMin; j <= xMax; ++j) { + for (int k = zMin; k <= zMax; ++k) { + if (!existingOnly || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() + .getMaterial() != Material.air) { + if (i != yMin && i != yMax && j != xMin && j != xMax && k != zMin && k != zMax) { + this.setBlockState(worldIn, insideBlockState, j, i, k, boundingboxIn); + } else { + this.setBlockState(worldIn, boundaryBlockState, j, i, k, boundingboxIn); + } + } + } + } + } + + } + + /**+ + * arguments: World worldObj, StructureBoundingBox structBB, int + * minX, int minY, int minZ, int maxX, int maxY, int maxZ, + * boolean alwaysreplace, Random rand, + * StructurePieceBlockSelector blockselector + */ + protected void fillWithRandomizedBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, + int minZ, int maxX, int maxY, int maxZ, boolean alwaysReplace, EaglercraftRandom rand, + StructureComponent.BlockSelector blockselector) { + for (int i = minY; i <= maxY; ++i) { + for (int j = minX; j <= maxX; ++j) { + for (int k = minZ; k <= maxZ; ++k) { + if (!alwaysReplace || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() + .getMaterial() != Material.air) { + blockselector.selectBlocks(rand, j, i, k, + i == minY || i == maxY || j == minX || j == maxX || k == minZ || k == maxZ); + this.setBlockState(worldIn, blockselector.getBlockState(), j, i, k, boundingboxIn); + } + } + } + } + + } + + protected void func_175805_a(World worldIn, StructureBoundingBox boundingboxIn, EaglercraftRandom rand, + float chance, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, IBlockState blockstate1, + IBlockState blockstate2, boolean parFlag) { + for (int i = minY; i <= maxY; ++i) { + for (int j = minX; j <= maxX; ++j) { + for (int k = minZ; k <= maxZ; ++k) { + if (rand.nextFloat() <= chance + && (!parFlag || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() + .getMaterial() != Material.air)) { + if (i != minY && i != maxY && j != minX && j != maxX && k != minZ && k != maxZ) { + this.setBlockState(worldIn, blockstate2, j, i, k, boundingboxIn); + } else { + this.setBlockState(worldIn, blockstate1, j, i, k, boundingboxIn); + } + } + } + } + } + + } + + protected void randomlyPlaceBlock(World worldIn, StructureBoundingBox boundingboxIn, EaglercraftRandom rand, + float chance, int x, int y, int z, IBlockState blockstateIn) { + if (rand.nextFloat() < chance) { + this.setBlockState(worldIn, blockstateIn, x, y, z, boundingboxIn); + } + + } + + protected void randomlyRareFillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, + int minZ, int maxX, int maxY, int maxZ, IBlockState blockstateIn, boolean parFlag) { + float f = (float) (maxX - minX + 1); + float f1 = (float) (maxY - minY + 1); + float f2 = (float) (maxZ - minZ + 1); + float f3 = (float) minX + f / 2.0F; + float f4 = (float) minZ + f2 / 2.0F; + + for (int i = minY; i <= maxY; ++i) { + float f5 = (float) (i - minY) / f1; + + for (int j = minX; j <= maxX; ++j) { + float f6 = ((float) j - f3) / (f * 0.5F); + + for (int k = minZ; k <= maxZ; ++k) { + float f7 = ((float) k - f4) / (f2 * 0.5F); + if (!parFlag || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() + .getMaterial() != Material.air) { + float f8 = f6 * f6 + f5 * f5 + f7 * f7; + if (f8 <= 1.05F) { + this.setBlockState(worldIn, blockstateIn, j, i, k, boundingboxIn); + } + } + } + } + } + + } + + /**+ + * Deletes all continuous blocks from selected position upwards. + * Stops at hitting air. + */ + protected void clearCurrentPositionBlocksUpwards(World worldIn, int x, int y, int z, + StructureBoundingBox structurebb) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + if (structurebb.isVecInside(blockpos)) { + while (!worldIn.isAirBlock(blockpos) && blockpos.getY() < 255) { + worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); + blockpos = blockpos.up(); + } + + } + } + + /**+ + * Replaces air and liquid from given position downwards. Stops + * when hitting anything else than air or liquid + */ + protected void replaceAirAndLiquidDownwards(World worldIn, IBlockState blockstateIn, int x, int y, int z, + StructureBoundingBox boundingboxIn) { + int i = this.getXWithOffset(x, z); + int j = this.getYWithOffset(y); + int k = this.getZWithOffset(x, z); + if (boundingboxIn.isVecInside(new BlockPos(i, j, k))) { + while ((worldIn.isAirBlock(new BlockPos(i, j, k)) + || worldIn.getBlockState(new BlockPos(i, j, k)).getBlock().getMaterial().isLiquid()) && j > 1) { + worldIn.setBlockState(new BlockPos(i, j, k), blockstateIn, 2); + --j; + } + + } + } + + protected boolean generateChestContents(World world, StructureBoundingBox structureboundingbox, + EaglercraftRandom random, int i, int j, int k, List list, int l) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(i, k), this.getYWithOffset(j), this.getZWithOffset(i, k)); + if (structureboundingbox.isVecInside(blockpos) && world.getBlockState(blockpos).getBlock() != Blocks.chest) { + IBlockState iblockstate = Blocks.chest.getDefaultState(); + world.setBlockState(blockpos, Blocks.chest.correctFacing(world, blockpos, iblockstate), 2); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityChest) { + WeightedRandomChestContent.generateChestContents(random, list, (TileEntityChest) tileentity, l); + } + + return true; + } else { + return false; + } + } + + protected boolean generateDispenserContents(World worldIn, StructureBoundingBox boundingBoxIn, + EaglercraftRandom rand, int x, int y, int z, int meta, List listIn, int max) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + if (boundingBoxIn.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getBlock() != Blocks.dispenser) { + worldIn.setBlockState(blockpos, + Blocks.dispenser.getStateFromMeta(this.getMetadataWithOffset(Blocks.dispenser, meta)), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + if (tileentity instanceof TileEntityDispenser) { + WeightedRandomChestContent.generateDispenserContents(rand, listIn, (TileEntityDispenser) tileentity, + max); + } + + return true; + } else { + return false; + } + } + + /**+ + * Places door on given position + */ + protected void placeDoorCurrentPosition(World worldIn, StructureBoundingBox boundingBoxIn, EaglercraftRandom rand, + int x, int y, int z, EnumFacing facing) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + if (boundingBoxIn.isVecInside(blockpos)) { + ItemDoor.placeDoor(worldIn, blockpos, facing.rotateYCCW(), Blocks.oak_door); + } + + } + + public void func_181138_a(int i, int j, int k) { + this.boundingBox.offset(i, j, k); + } + + public abstract static class BlockSelector { + protected IBlockState blockstate = Blocks.air.getDefaultState(); + + public abstract void selectBlocks(EaglercraftRandom var1, int var2, int var3, int var4, boolean var5); + + public IBlockState getBlockState() { + return this.blockstate; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftPieces.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftPieces.java new file mode 100644 index 0000000..cd9df3b --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftPieces.java @@ -0,0 +1,837 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityMinecartChest; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureMineshaftPieces { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureMineshaftPieces"); + } + + private static final List CHEST_CONTENT_WEIGHT_LIST = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), + new WeightedRandomChestContent(Items.dye, EnumDyeColor.BLUE.getDyeDamage(), 4, 9, 5), + new WeightedRandomChestContent(Items.diamond, 0, 1, 2, 3), + new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.rail), 0, 4, 8, 1), + new WeightedRandomChestContent(Items.melon_seeds, 0, 2, 4, 10), + new WeightedRandomChestContent(Items.pumpkin_seeds, 0, 2, 4, 10), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1) }); + + public static void registerStructurePieces() { + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Corridor.class, "MSCorridor"); + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Cross.class, "MSCrossing"); + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Room.class, "MSRoom"); + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Stairs.class, "MSStairs"); + } + + private static StructureComponent func_175892_a(List listIn, EaglercraftRandom rand, int x, + int y, int z, EnumFacing facing, int type) { + int i = rand.nextInt(100); + if (i >= 80) { + StructureBoundingBox structureboundingbox = StructureMineshaftPieces.Cross.func_175813_a(listIn, rand, x, y, + z, facing); + if (structureboundingbox != null) { + return new StructureMineshaftPieces.Cross(type, rand, structureboundingbox, facing); + } + } else if (i >= 70) { + StructureBoundingBox structureboundingbox1 = StructureMineshaftPieces.Stairs.func_175812_a(listIn, rand, x, + y, z, facing); + if (structureboundingbox1 != null) { + return new StructureMineshaftPieces.Stairs(type, rand, structureboundingbox1, facing); + } + } else { + StructureBoundingBox structureboundingbox2 = StructureMineshaftPieces.Corridor.func_175814_a(listIn, rand, + x, y, z, facing); + if (structureboundingbox2 != null) { + return new StructureMineshaftPieces.Corridor(type, rand, structureboundingbox2, facing); + } + } + + return null; + } + + private static StructureComponent func_175890_b(StructureComponent componentIn, List listIn, + EaglercraftRandom rand, int x, int y, int z, EnumFacing facing, int type) { + if (type > 8) { + return null; + } else if (Math.abs(x - componentIn.getBoundingBox().minX) <= 80 + && Math.abs(z - componentIn.getBoundingBox().minZ) <= 80) { + StructureComponent structurecomponent = func_175892_a(listIn, rand, x, y, z, facing, type + 1); + if (structurecomponent != null) { + listIn.add(structurecomponent); + structurecomponent.buildComponent(componentIn, listIn, rand); + } + + return structurecomponent; + } else { + return null; + } + } + + public static class Corridor extends StructureComponent { + private boolean hasRails; + private boolean hasSpiders; + private boolean spawnerPlaced; + private int sectionCount; + + public Corridor() { + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) { + tagCompound.setBoolean("hr", this.hasRails); + tagCompound.setBoolean("sc", this.hasSpiders); + tagCompound.setBoolean("hps", this.spawnerPlaced); + tagCompound.setInteger("Num", this.sectionCount); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) { + this.hasRails = tagCompound.getBoolean("hr"); + this.hasSpiders = tagCompound.getBoolean("sc"); + this.spawnerPlaced = tagCompound.getBoolean("hps"); + this.sectionCount = tagCompound.getInteger("Num"); + } + + public Corridor(int type, EaglercraftRandom rand, StructureBoundingBox structurebb, EnumFacing facing) { + super(type); + this.coordBaseMode = facing; + this.boundingBox = structurebb; + this.hasRails = rand.nextInt(3) == 0; + this.hasSpiders = !this.hasRails && rand.nextInt(23) == 0; + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.SOUTH) { + this.sectionCount = structurebb.getXSize() / 5; + } else { + this.sectionCount = structurebb.getZSize() / 5; + } + + } + + public static StructureBoundingBox func_175814_a(List rand, EaglercraftRandom x, int y, + int z, int facing, EnumFacing parEnumFacing) { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(y, z, facing, y, z + 2, facing); + + int i; + for (i = x.nextInt(3) + 2; i > 0; --i) { + int j = i * 5; + switch (parEnumFacing) { + case NORTH: + structureboundingbox.maxX = y + 2; + structureboundingbox.minZ = facing - (j - 1); + break; + case SOUTH: + structureboundingbox.maxX = y + 2; + structureboundingbox.maxZ = facing + (j - 1); + break; + case WEST: + structureboundingbox.minX = y - (j - 1); + structureboundingbox.maxZ = facing + 2; + break; + case EAST: + structureboundingbox.maxX = y + (j - 1); + structureboundingbox.maxZ = facing + 2; + } + + if (StructureComponent.findIntersecting(rand, structureboundingbox) == null) { + break; + } + } + + return i > 0 ? structureboundingbox : null; + } + + public void buildComponent(StructureComponent componentIn, List listIn, + EaglercraftRandom rand) { + int i = this.getComponentType(); + int j = rand.nextInt(4); + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + if (j <= 1) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ - 1, + this.coordBaseMode, i); + } else if (j == 2) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, EnumFacing.WEST, i); + } else { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, EnumFacing.EAST, i); + } + break; + case SOUTH: + if (j <= 1) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ + 1, + this.coordBaseMode, i); + } else if (j == 2) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ - 3, EnumFacing.WEST, + i); + } else { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ - 3, EnumFacing.EAST, + i); + } + break; + case WEST: + if (j <= 1) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, + i); + } else if (j == 2) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ - 1, + EnumFacing.NORTH, i); + } else { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ + 1, + EnumFacing.SOUTH, i); + } + break; + case EAST: + if (j <= 1) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, + i); + } else if (j == 2) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX - 3, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ - 1, + EnumFacing.NORTH, i); + } else { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX - 3, + this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ + 1, + EnumFacing.SOUTH, i); + } + } + } + + if (i < 8) { + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.SOUTH) { + for (int i1 = this.boundingBox.minX + 3; i1 + 3 <= this.boundingBox.maxX; i1 += 5) { + int j1 = rand.nextInt(5); + if (j1 == 0) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, i1, this.boundingBox.minY, + this.boundingBox.minZ - 1, EnumFacing.NORTH, i + 1); + } else if (j1 == 1) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, i1, this.boundingBox.minY, + this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i + 1); + } + } + } else { + for (int k = this.boundingBox.minZ + 3; k + 3 <= this.boundingBox.maxZ; k += 5) { + int l = rand.nextInt(5); + if (l == 0) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, + this.boundingBox.minY, k, EnumFacing.WEST, i + 1); + } else if (l == 1) { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, + this.boundingBox.minY, k, EnumFacing.EAST, i + 1); + } + } + } + } + + } + + protected boolean generateChestContents(World worldIn, StructureBoundingBox boundingBoxIn, + EaglercraftRandom rand, int x, int y, int z, List listIn, int max) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), + this.getZWithOffset(x, z)); + if (boundingBoxIn.isVecInside(blockpos) + && worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air) { + int i = rand.nextBoolean() ? 1 : 0; + worldIn.setBlockState(blockpos, + Blocks.rail.getStateFromMeta(this.getMetadataWithOffset(Blocks.rail, i)), 2); + EntityMinecartChest entityminecartchest = new EntityMinecartChest(worldIn, + (double) ((float) blockpos.getX() + 0.5F), (double) ((float) blockpos.getY() + 0.5F), + (double) ((float) blockpos.getZ() + 0.5F)); + WeightedRandomChestContent.generateChestContents(rand, listIn, entityminecartchest, max); + worldIn.spawnEntityInWorld(entityminecartchest); + return true; + } else { + return false; + } + } + + public boolean addComponentParts(World worldIn, EaglercraftRandom randomIn, + StructureBoundingBox structureBoundingBoxIn) { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) { + return false; + } else { + boolean flag = false; + boolean flag1 = true; + boolean flag2 = false; + boolean flag3 = true; + int i = this.sectionCount * 5 - 1; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 2, 1, i, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.func_175805_a(worldIn, structureBoundingBoxIn, randomIn, 0.8F, 0, 2, 0, 2, 2, i, + Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + if (this.hasSpiders) { + this.func_175805_a(worldIn, structureBoundingBoxIn, randomIn, 0.6F, 0, 0, 0, 2, 1, i, + Blocks.web.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + for (int j = 0; j < this.sectionCount; ++j) { + int k = 2 + j * 5; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, k, 0, 1, k, + Blocks.oak_fence.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 0, k, 2, 1, k, + Blocks.oak_fence.getDefaultState(), Blocks.air.getDefaultState(), false); + if (randomIn.nextInt(4) == 0) { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, k, 0, 2, k, + Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, k, 2, 2, k, + Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + } else { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, k, 2, 2, k, + Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 0, 2, k - 1, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 2, 2, k - 1, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 0, 2, k + 1, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 2, 2, k + 1, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k - 2, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k - 2, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k + 2, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k + 2, + Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k - 1, + Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k + 1, + Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + if (randomIn.nextInt(100) == 0) { + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 2, 0, k - 1, + WeightedRandomChestContent.func_177629_a( + StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(randomIn) }), + 3 + randomIn.nextInt(4)); + } + + if (randomIn.nextInt(100) == 0) { + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 0, 0, k + 1, + WeightedRandomChestContent.func_177629_a( + StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(randomIn) }), + 3 + randomIn.nextInt(4)); + } + + if (this.hasSpiders && !this.spawnerPlaced) { + int l = this.getYWithOffset(0); + int i1 = k - 1 + randomIn.nextInt(3); + int j1 = this.getXWithOffset(1, i1); + i1 = this.getZWithOffset(1, i1); + BlockPos blockpos = new BlockPos(j1, l, i1); + if (structureBoundingBoxIn.isVecInside(blockpos)) { + this.spawnerPlaced = true; + worldIn.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + if (tileentity instanceof TileEntityMobSpawner) { + ((TileEntityMobSpawner) tileentity).getSpawnerBaseLogic().setEntityName("CaveSpider"); + } + } + } + } + + for (int k1 = 0; k1 <= 2; ++k1) { + for (int i2 = 0; i2 <= i; ++i2) { + byte b0 = -1; + IBlockState iblockstate1 = this.getBlockStateFromPos(worldIn, k1, b0, i2, + structureBoundingBoxIn); + if (iblockstate1.getBlock().getMaterial() == Material.air) { + byte b1 = -1; + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), k1, b1, i2, + structureBoundingBoxIn); + } + } + } + + if (this.hasRails) { + for (int l1 = 0; l1 <= i; ++l1) { + IBlockState iblockstate = this.getBlockStateFromPos(worldIn, 1, -1, l1, structureBoundingBoxIn); + if (iblockstate.getBlock().getMaterial() != Material.air + && iblockstate.getBlock().isFullBlock()) { + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l1, + Blocks.rail.getStateFromMeta(this.getMetadataWithOffset(Blocks.rail, 0))); + } + } + } + + return true; + } + } + } + + public static class Cross extends StructureComponent { + private EnumFacing corridorDirection; + private boolean isMultipleFloors; + + public Cross() { + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setBoolean("tf", this.isMultipleFloors); + nbttagcompound.setInteger("D", this.corridorDirection.getHorizontalIndex()); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + this.isMultipleFloors = nbttagcompound.getBoolean("tf"); + this.corridorDirection = EnumFacing.getHorizontal(nbttagcompound.getInteger("D")); + } + + public Cross(int type, EaglercraftRandom rand, StructureBoundingBox structurebb, EnumFacing facing) { + super(type); + this.corridorDirection = facing; + this.boundingBox = structurebb; + this.isMultipleFloors = structurebb.getYSize() > 3; + } + + public static StructureBoundingBox func_175813_a(List listIn, EaglercraftRandom rand, int x, + int y, int z, EnumFacing facing) { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(x, y, z, x, y + 2, z); + if (rand.nextInt(4) == 0) { + structureboundingbox.maxY += 4; + } + + switch (facing) { + case NORTH: + structureboundingbox.minX = x - 1; + structureboundingbox.maxX = x + 3; + structureboundingbox.minZ = z - 4; + break; + case SOUTH: + structureboundingbox.minX = x - 1; + structureboundingbox.maxX = x + 3; + structureboundingbox.maxZ = z + 4; + break; + case WEST: + structureboundingbox.minX = x - 4; + structureboundingbox.minZ = z - 1; + structureboundingbox.maxZ = z + 3; + break; + case EAST: + structureboundingbox.maxX = x + 4; + structureboundingbox.minZ = z - 1; + structureboundingbox.maxZ = z + 3; + } + + return StructureComponent.findIntersecting(listIn, structureboundingbox) != null ? null + : structureboundingbox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + int i = this.getComponentType(); + switch (this.corridorDirection) { + case NORTH: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX - 1, + this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.maxX + 1, + this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + break; + case SOUTH: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX - 1, + this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.maxX + 1, + this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + break; + case WEST: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX - 1, + this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + break; + case EAST: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.maxX + 1, + this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + } + + if (this.isMultipleFloors) { + if (random.nextBoolean()) { + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + } + + if (random.nextBoolean()) { + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX - 1, + this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + } + + if (random.nextBoolean()) { + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.maxX + 1, + this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + } + + if (random.nextBoolean()) { + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX + 1, + this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + } + } + + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + if (this.isMultipleFloors) { + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX + 1, this.boundingBox.minY, + this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, + this.boundingBox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX, this.boundingBox.minY, + this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, + this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX + 1, + this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, + this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX, this.boundingBox.maxY - 2, + this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, + this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX + 1, + this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, + this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } else { + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX + 1, this.boundingBox.minY, + this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, + this.boundingBox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX, this.boundingBox.minY, + this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, + this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), + false); + } + + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX + 1, this.boundingBox.minY, + this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, + this.boundingBox.minZ + 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX + 1, this.boundingBox.minY, + this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, + this.boundingBox.maxZ - 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.maxX - 1, this.boundingBox.minY, + this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, + this.boundingBox.minZ + 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.maxX - 1, this.boundingBox.minY, + this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, + this.boundingBox.maxZ - 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), + false); + + for (int i = this.boundingBox.minX; i <= this.boundingBox.maxX; ++i) { + for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j) { + if (this.getBlockStateFromPos(world, i, this.boundingBox.minY - 1, j, structureboundingbox) + .getBlock().getMaterial() == Material.air) { + this.setBlockState(world, Blocks.planks.getDefaultState(), i, this.boundingBox.minY - 1, j, + structureboundingbox); + } + } + } + + return true; + } + } + } + + public static class Room extends StructureComponent { + private List roomsLinkedToTheRoom = Lists.newLinkedList(); + + public Room() { + } + + public Room(int type, EaglercraftRandom rand, int x, int z) { + super(type); + this.boundingBox = new StructureBoundingBox(x, 50, z, x + 7 + rand.nextInt(6), 54 + rand.nextInt(6), + z + 7 + rand.nextInt(6)); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + int i = this.getComponentType(); + int j = this.boundingBox.getYSize() - 3 - 1; + if (j <= 0) { + j = 1; + } + + int k; + for (k = 0; k < this.boundingBox.getXSize(); k = k + 4) { + k = k + random.nextInt(this.boundingBox.getXSize()); + if (k + 3 > this.boundingBox.getXSize()) { + break; + } + + StructureComponent structurecomponent1 = StructureMineshaftPieces.func_175890_b(structurecomponent, + list, random, this.boundingBox.minX + k, this.boundingBox.minY + random.nextInt(j) + 1, + this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + if (structurecomponent1 != null) { + StructureBoundingBox structureboundingbox = structurecomponent1.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox.minX, + structureboundingbox.minY, this.boundingBox.minZ, structureboundingbox.maxX, + structureboundingbox.maxY, this.boundingBox.minZ + 1)); + } + } + + for (k = 0; k < this.boundingBox.getXSize(); k = k + 4) { + k = k + random.nextInt(this.boundingBox.getXSize()); + if (k + 3 > this.boundingBox.getXSize()) { + break; + } + + StructureComponent structurecomponent2 = StructureMineshaftPieces.func_175890_b(structurecomponent, + list, random, this.boundingBox.minX + k, this.boundingBox.minY + random.nextInt(j) + 1, + this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + if (structurecomponent2 != null) { + StructureBoundingBox structureboundingbox1 = structurecomponent2.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox1.minX, + structureboundingbox1.minY, this.boundingBox.maxZ - 1, structureboundingbox1.maxX, + structureboundingbox1.maxY, this.boundingBox.maxZ)); + } + } + + for (k = 0; k < this.boundingBox.getZSize(); k = k + 4) { + k = k + random.nextInt(this.boundingBox.getZSize()); + if (k + 3 > this.boundingBox.getZSize()) { + break; + } + + StructureComponent structurecomponent3 = StructureMineshaftPieces.func_175890_b(structurecomponent, + list, random, this.boundingBox.minX - 1, this.boundingBox.minY + random.nextInt(j) + 1, + this.boundingBox.minZ + k, EnumFacing.WEST, i); + if (structurecomponent3 != null) { + StructureBoundingBox structureboundingbox2 = structurecomponent3.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.minX, + structureboundingbox2.minY, structureboundingbox2.minZ, this.boundingBox.minX + 1, + structureboundingbox2.maxY, structureboundingbox2.maxZ)); + } + } + + for (k = 0; k < this.boundingBox.getZSize(); k = k + 4) { + k = k + random.nextInt(this.boundingBox.getZSize()); + if (k + 3 > this.boundingBox.getZSize()) { + break; + } + + StructureComponent structurecomponent4 = StructureMineshaftPieces.func_175890_b(structurecomponent, + list, random, this.boundingBox.maxX + 1, this.boundingBox.minY + random.nextInt(j) + 1, + this.boundingBox.minZ + k, EnumFacing.EAST, i); + if (structurecomponent4 != null) { + StructureBoundingBox structureboundingbox3 = structurecomponent4.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.maxX - 1, + structureboundingbox3.minY, structureboundingbox3.minZ, this.boundingBox.maxX, + structureboundingbox3.maxY, structureboundingbox3.maxZ)); + } + } + + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX, this.boundingBox.minY, + this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, + Blocks.dirt.getDefaultState(), Blocks.air.getDefaultState(), true); + this.fillWithBlocks(world, structureboundingbox, this.boundingBox.minX, this.boundingBox.minY + 1, + this.boundingBox.minZ, this.boundingBox.maxX, + Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, + Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + for (StructureBoundingBox structureboundingbox1 : this.roomsLinkedToTheRoom) { + this.fillWithBlocks(world, structureboundingbox, structureboundingbox1.minX, + structureboundingbox1.maxY - 2, structureboundingbox1.minZ, structureboundingbox1.maxX, + structureboundingbox1.maxY, structureboundingbox1.maxZ, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + this.randomlyRareFillWithBlocks(world, structureboundingbox, this.boundingBox.minX, + this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, + this.boundingBox.maxZ, Blocks.air.getDefaultState(), false); + return true; + } + } + + public void func_181138_a(int parInt1, int parInt2, int parInt3) { + super.func_181138_a(parInt1, parInt2, parInt3); + + for (StructureBoundingBox structureboundingbox : this.roomsLinkedToTheRoom) { + structureboundingbox.offset(parInt1, parInt2, parInt3); + } + + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + NBTTagList nbttaglist = new NBTTagList(); + + for (StructureBoundingBox structureboundingbox : this.roomsLinkedToTheRoom) { + nbttaglist.appendTag(structureboundingbox.toNBTTagIntArray()); + } + + nbttagcompound.setTag("Entrances", nbttaglist); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + NBTTagList nbttaglist = nbttagcompound.getTagList("Entrances", 11); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(nbttaglist.getIntArrayAt(i))); + } + + } + } + + public static class Stairs extends StructureComponent { + public Stairs() { + } + + public Stairs(int type, EaglercraftRandom rand, StructureBoundingBox structurebb, EnumFacing facing) { + super(type); + this.coordBaseMode = facing; + this.boundingBox = structurebb; + } + + protected void writeStructureToNBT(NBTTagCompound var1) { + } + + protected void readStructureFromNBT(NBTTagCompound var1) { + } + + public static StructureBoundingBox func_175812_a(List listIn, EaglercraftRandom rand, int x, + int y, int z, EnumFacing facing) { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(x, y - 5, z, x, y + 2, z); + switch (facing) { + case NORTH: + structureboundingbox.maxX = x + 2; + structureboundingbox.minZ = z - 8; + break; + case SOUTH: + structureboundingbox.maxX = x + 2; + structureboundingbox.maxZ = z + 8; + break; + case WEST: + structureboundingbox.minX = x - 8; + structureboundingbox.maxZ = z + 2; + break; + case EAST: + structureboundingbox.maxX = x + 8; + structureboundingbox.maxZ = z + 2; + } + + return StructureComponent.findIntersecting(listIn, structureboundingbox) != null ? null + : structureboundingbox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + int i = this.getComponentType(); + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX, + this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + break; + case SOUTH: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX, + this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + break; + case WEST: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.minX - 1, + this.boundingBox.minY, this.boundingBox.minZ, EnumFacing.WEST, i); + break; + case EAST: + StructureMineshaftPieces.func_175890_b(structurecomponent, list, random, this.boundingBox.maxX + 1, + this.boundingBox.minY, this.boundingBox.minZ, EnumFacing.EAST, i); + } + } + + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 2, 7, 1, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 7, 2, 2, 8, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + + for (int i = 0; i < 5; ++i) { + this.fillWithBlocks(world, structureboundingbox, 0, 5 - i - (i < 4 ? 1 : 0), 2 + i, 2, 7 - i, 2 + i, + Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftStart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftStart.java new file mode 100644 index 0000000..a5e7dce --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftStart.java @@ -0,0 +1,48 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureMineshaftPieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureMineshaftStart extends StructureStart { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureMineshaftStart"); + } + + public StructureMineshaftStart() { + } + + public StructureMineshaftStart(World worldIn, EaglercraftRandom rand, int chunkX, int chunkZ) { + super(chunkX, chunkZ); + StructureMineshaftPieces.Room structuremineshaftpieces$room = new StructureMineshaftPieces.Room(0, rand, + (chunkX << 4) + 2, (chunkZ << 4) + 2); + this.components.add(structuremineshaftpieces$room); + structuremineshaftpieces$room.buildComponent(structuremineshaftpieces$room, this.components, rand); + this.updateBoundingBox(); + this.markAvailableHeight(worldIn, rand, 10); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java new file mode 100644 index 0000000..3fe51e5 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java @@ -0,0 +1,1695 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureNetherBridgePieces { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureNetherBridgePieces"); + } + + private static final StructureNetherBridgePieces.PieceWeight[] primaryComponents = new StructureNetherBridgePieces.PieceWeight[] { + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Straight.class, 30, 0, true), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing3.class, 10, 4), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing.class, 10, 4), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Stairs.class, 10, 3), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Throne.class, 5, 2), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Entrance.class, 5, 1) }; + private static final StructureNetherBridgePieces.PieceWeight[] secondaryComponents = new StructureNetherBridgePieces.PieceWeight[] { + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor5.class, 25, 0, true), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing2.class, 15, 5), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor2.class, 5, 10), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor.class, 5, 10), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor3.class, 10, 3, true), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor4.class, 7, 2), + new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.NetherStalkRoom.class, 5, 2) }; + + public static void registerNetherFortressPieces() { + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing3.class, "NeBCr"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.End.class, "NeBEF"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Straight.class, "NeBS"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor3.class, "NeCCS"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor4.class, "NeCTB"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Entrance.class, "NeCE"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing2.class, "NeSCSC"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor.class, "NeSCLT"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor5.class, "NeSC"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor2.class, "NeSCRT"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.NetherStalkRoom.class, "NeCSR"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Throne.class, "NeMT"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing.class, "NeRC"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Stairs.class, "NeSR"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Start.class, "NeStart"); + } + + private static StructureNetherBridgePieces.Piece func_175887_b( + StructureNetherBridgePieces.PieceWeight parPieceWeight, List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { + Class oclass = parPieceWeight.weightClass; + Object object = null; + if (oclass == StructureNetherBridgePieces.Straight.class) { + object = StructureNetherBridgePieces.Straight.func_175882_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Crossing3.class) { + object = StructureNetherBridgePieces.Crossing3.func_175885_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Crossing.class) { + object = StructureNetherBridgePieces.Crossing.func_175873_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Stairs.class) { + object = StructureNetherBridgePieces.Stairs.func_175872_a(parList, parRandom, parInt1, parInt2, parInt3, + parInt4, parEnumFacing); + } else if (oclass == StructureNetherBridgePieces.Throne.class) { + object = StructureNetherBridgePieces.Throne.func_175874_a(parList, parRandom, parInt1, parInt2, parInt3, + parInt4, parEnumFacing); + } else if (oclass == StructureNetherBridgePieces.Entrance.class) { + object = StructureNetherBridgePieces.Entrance.func_175881_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Corridor5.class) { + object = StructureNetherBridgePieces.Corridor5.func_175877_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Corridor2.class) { + object = StructureNetherBridgePieces.Corridor2.func_175876_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Corridor.class) { + object = StructureNetherBridgePieces.Corridor.func_175879_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Corridor3.class) { + object = StructureNetherBridgePieces.Corridor3.func_175883_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Corridor4.class) { + object = StructureNetherBridgePieces.Corridor4.func_175880_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.Crossing2.class) { + object = StructureNetherBridgePieces.Crossing2.func_175878_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureNetherBridgePieces.NetherStalkRoom.class) { + object = StructureNetherBridgePieces.NetherStalkRoom.func_175875_a(parList, parRandom, parInt1, parInt2, + parInt3, parEnumFacing, parInt4); + } + + return (StructureNetherBridgePieces.Piece) object; + } + + public static class Corridor extends StructureNetherBridgePieces.Piece { + private boolean field_111021_b; + + public Corridor() { + } + + public Corridor(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + this.field_111021_b = parRandom.nextInt(3) == 0; + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_111021_b = nbttagcompound.getBoolean("Chest"); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Chest", this.field_111021_b); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentX((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, 1, true); + } + + public static StructureNetherBridgePieces.Corridor func_175879_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, 0, 0, 5, 7, 5, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Corridor(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 0, 4, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 1, 4, 4, 1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 3, 4, 4, 3, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 5, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 4, 3, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 4, 1, 4, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 3, 4, 3, 4, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + if (this.field_111021_b && structureboundingbox.isVecInside( + new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) { + this.field_111021_b = false; + this.generateChestContents(world, structureboundingbox, random, 3, 2, 3, field_111019_a, + 2 + random.nextInt(4)); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) { + for (int j = 0; j <= 4; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } + + public static class Corridor2 extends StructureNetherBridgePieces.Piece { + private boolean field_111020_b; + + public Corridor2() { + } + + public Corridor2(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + this.field_111020_b = parRandom.nextInt(3) == 0; + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_111020_b = nbttagcompound.getBoolean("Chest"); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Chest", this.field_111020_b); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentZ((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, 1, true); + } + + public static StructureNetherBridgePieces.Corridor2 func_175876_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, 0, 0, 5, 7, 5, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Corridor2(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 1, 0, 4, 1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 3, 0, 4, 3, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 0, 4, 5, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 4, 4, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 4, 1, 4, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 3, 4, 3, 4, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + if (this.field_111020_b && structureboundingbox.isVecInside( + new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) { + this.field_111020_b = false; + this.generateChestContents(world, structureboundingbox, random, 1, 2, 3, field_111019_a, + 2 + random.nextInt(4)); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) { + for (int j = 0; j <= 4; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } + + public static class Corridor3 extends StructureNetherBridgePieces.Piece { + public Corridor3() { + } + + public Corridor3(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 1, 0, + true); + } + + public static StructureNetherBridgePieces.Corridor3 func_175883_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -7, 0, 5, 14, 10, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Corridor3(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + int i = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 2); + + for (int j = 0; j <= 9; ++j) { + int k = Math.max(1, 7 - j); + int l = Math.min(Math.max(k + 5, 14 - j), 13); + int i1 = j; + this.fillWithBlocks(world, structureboundingbox, 0, 0, j, 4, k, j, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, k + 1, j, 3, l - 1, j, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + if (j <= 6) { + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i), 1, k + 1, j, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i), 2, k + 1, j, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i), 3, k + 1, j, + structureboundingbox); + } + + this.fillWithBlocks(world, structureboundingbox, 0, l, j, 4, l, j, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, k + 1, j, 0, l - 1, j, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, k + 1, j, 4, l - 1, j, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + if ((j & 1) == 0) { + this.fillWithBlocks(world, structureboundingbox, 0, k + 2, j, 0, k + 3, j, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 4, k + 2, j, 4, k + 3, j, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + } + + for (int j1 = 0; j1 <= 4; ++j1) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), j1, -1, i1, + structureboundingbox); + } + } + + return true; + } + } + + public static class Corridor4 extends StructureNetherBridgePieces.Piece { + public Corridor4() { + } + + public Corridor4(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + byte b0 = 1; + if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.NORTH) { + b0 = 5; + } + + this.getNextComponentX((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, b0, + random.nextInt(8) > 0); + this.getNextComponentZ((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, b0, + random.nextInt(8) > 0); + } + + public static StructureNetherBridgePieces.Corridor4 func_175880_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -3, 0, 0, 9, 7, 9, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Corridor4(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 8, 1, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 8, 5, 8, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 6, 0, 8, 6, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 2, 5, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 2, 0, 8, 5, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 0, 1, 4, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 3, 0, 7, 4, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 4, 8, 2, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 4, 2, 2, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 4, 7, 2, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 8, 8, 3, 8, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 6, 0, 3, 7, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 3, 6, 8, 3, 7, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 4, 0, 5, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 3, 4, 8, 5, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 5, 2, 5, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 3, 5, 7, 5, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 5, 1, 5, 5, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 4, 5, 7, 5, 5, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 0; i <= 5; ++i) { + for (int j = 0; j <= 8; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), j, -1, i, + structureboundingbox); + } + } + + return true; + } + } + + public static class Corridor5 extends StructureNetherBridgePieces.Piece { + public Corridor5() { + } + + public Corridor5(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 1, 0, + true); + } + + public static StructureNetherBridgePieces.Corridor5 func_175877_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, 0, 0, 5, 7, 5, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Corridor5(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 0, 4, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 1, 0, 4, 1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 3, 0, 4, 3, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 1, 4, 4, 1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 3, 4, 4, 3, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) { + for (int j = 0; j <= 4; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } + + public static class Crossing extends StructureNetherBridgePieces.Piece { + public Crossing() { + } + + public Crossing(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 2, 0, + false); + this.getNextComponentX((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, 2, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, 2, false); + } + + public static StructureNetherBridgePieces.Crossing func_175873_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -2, 0, 0, 7, 9, 7, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Crossing(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 6, 1, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 6, 7, 6, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 1, 6, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 6, 1, 6, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 0, 6, 6, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 6, 6, 6, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 6, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 5, 0, 6, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 2, 0, 6, 6, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 2, 5, 6, 6, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 6, 0, 4, 6, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 0, 4, 5, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 6, 6, 4, 6, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 6, 4, 5, 6, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 6, 2, 0, 6, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 2, 0, 5, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 6, 2, 6, 6, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 5, 2, 6, 5, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 0; i <= 6; ++i) { + for (int j = 0; j <= 6; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } + + public static class Crossing2 extends StructureNetherBridgePieces.Piece { + public Crossing2() { + } + + public Crossing2(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 1, 0, + true); + this.getNextComponentX((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, 1, true); + this.getNextComponentZ((StructureNetherBridgePieces.Start) structurecomponent, list, random, 0, 1, true); + } + + public static StructureNetherBridgePieces.Crossing2 func_175878_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, 0, 0, 5, 7, 5, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Crossing2(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 5, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 0, 4, 5, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 4, 0, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 4, 4, 5, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) { + for (int j = 0; j <= 4; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } + + public static class Crossing3 extends StructureNetherBridgePieces.Piece { + public Crossing3() { + } + + public Crossing3(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + protected Crossing3(EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(0); + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(parRandom); + switch (this.coordBaseMode) { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(parInt1, 64, parInt2, parInt1 + 19 - 1, 73, + parInt2 + 19 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(parInt1, 64, parInt2, parInt1 + 19 - 1, 73, + parInt2 + 19 - 1); + } + + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 8, 3, + false); + this.getNextComponentX((StructureNetherBridgePieces.Start) structurecomponent, list, random, 3, 8, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start) structurecomponent, list, random, 3, 8, false); + } + + public static StructureNetherBridgePieces.Crossing3 func_175885_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -8, -3, 0, 19, 10, 19, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Crossing3(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 7, 3, 0, 11, 4, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 7, 18, 4, 11, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 0, 10, 7, 18, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 8, 18, 7, 10, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 5, 0, 7, 5, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 5, 11, 7, 5, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 11, 5, 0, 11, 5, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 11, 5, 11, 11, 5, 18, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 7, 7, 5, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 11, 5, 7, 18, 5, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 11, 7, 5, 11, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 11, 5, 11, 18, 5, 11, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 0, 11, 2, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 13, 11, 2, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 0, 0, 11, 1, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 0, 15, 11, 1, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int i = 7; i <= 11; ++i) { + for (int j = 0; j <= 2; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, 18 - j, + structureboundingbox); + } + } + + this.fillWithBlocks(world, structureboundingbox, 0, 2, 7, 5, 2, 11, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 13, 2, 7, 18, 2, 11, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 7, 3, 1, 11, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 15, 0, 7, 18, 1, 11, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int k = 0; k <= 2; ++k) { + for (int l = 7; l <= 11; ++l) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), k, -1, l, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), 18 - k, -1, l, + structureboundingbox); + } + } + + return true; + } + } + + public static class End extends StructureNetherBridgePieces.Piece { + private int fillSeed; + + public End() { + } + + public End(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + this.fillSeed = parRandom.nextInt(); + } + + public static StructureNetherBridgePieces.End func_175884_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -3, 0, 5, 10, 8, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.End(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.fillSeed = nbttagcompound.getInteger("Seed"); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("Seed", this.fillSeed); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + EaglercraftRandom random = new EaglercraftRandom((long) this.fillSeed); + + for (int i = 0; i <= 4; ++i) { + for (int j = 3; j <= 4; ++j) { + int k = random.nextInt(8); + this.fillWithBlocks(world, structureboundingbox, i, j, 0, i, j, k, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + } + + int l = random.nextInt(8); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 0, 5, l, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + l = random.nextInt(8); + this.fillWithBlocks(world, structureboundingbox, 4, 5, 0, 4, 5, l, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (l = 0; l <= 4; ++l) { + int i1 = random.nextInt(5); + this.fillWithBlocks(world, structureboundingbox, l, 2, 0, l, 2, i1, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + + for (l = 0; l <= 4; ++l) { + for (int j1 = 0; j1 <= 1; ++j1) { + int k1 = random.nextInt(3); + this.fillWithBlocks(world, structureboundingbox, l, j1, 0, l, j1, k1, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + } + + return true; + } + } + + public static class Entrance extends StructureNetherBridgePieces.Piece { + public Entrance() { + } + + public Entrance(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 5, 3, + true); + } + + public static StructureNetherBridgePieces.Entrance func_175881_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -5, -3, 0, 13, 14, 13, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Entrance(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 11, 5, 0, 12, 12, 12, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 11, 10, 12, 12, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 11, 2, 10, 12, 10, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 8, 0, 7, 8, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 1; i <= 11; i += 2) { + this.fillWithBlocks(world, structureboundingbox, i, 10, 0, i, 11, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, i, 10, 12, i, 11, 12, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 0, 10, i, 0, 11, i, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 12, 10, i, 12, 11, i, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, + structureboundingbox); + } + + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureboundingbox); + + for (int k = 3; k <= 9; k += 2) { + this.fillWithBlocks(world, structureboundingbox, 1, 7, k, 1, 8, k, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 11, 7, k, 11, 8, k, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + } + + this.fillWithBlocks(world, structureboundingbox, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int l = 4; l <= 8; ++l) { + for (int j = 0; j <= 2; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), l, -1, j, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), l, -1, 12 - j, + structureboundingbox); + } + } + + for (int i1 = 0; i1 <= 2; ++i1) { + for (int j1 = 4; j1 <= 8; ++j1) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i1, -1, j1, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), 12 - i1, -1, j1, + structureboundingbox); + } + } + + this.fillWithBlocks(world, structureboundingbox, 5, 5, 5, 7, 5, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 6, 6, 4, 6, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), 6, 0, 6, structureboundingbox); + this.setBlockState(world, Blocks.flowing_lava.getDefaultState(), 6, 5, 6, structureboundingbox); + BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), + this.getZWithOffset(6, 6)); + if (structureboundingbox.isVecInside(blockpos)) { + world.forceBlockUpdateTick(Blocks.flowing_lava, blockpos, random); + } + + return true; + } + } + + public static class NetherStalkRoom extends StructureNetherBridgePieces.Piece { + public NetherStalkRoom() { + } + + public NetherStalkRoom(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 5, 3, + true); + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 5, 11, + true); + } + + public static StructureNetherBridgePieces.NetherStalkRoom func_175875_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -5, -3, 0, 13, 14, 13, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.NetherStalkRoom(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 11, 5, 0, 12, 12, 12, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 11, 10, 12, 12, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 11, 2, 10, 12, 10, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 1; i <= 11; i += 2) { + this.fillWithBlocks(world, structureboundingbox, i, 10, 0, i, 11, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, i, 10, 12, i, 11, 12, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 0, 10, i, 0, 11, i, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 12, 10, i, 12, 11, i, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, + structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, + structureboundingbox); + } + + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureboundingbox); + + for (int j1 = 3; j1 <= 9; j1 += 2) { + this.fillWithBlocks(world, structureboundingbox, 1, 7, j1, 1, 8, j1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + this.fillWithBlocks(world, structureboundingbox, 11, 7, j1, 11, 8, j1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), + false); + } + + int k1 = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 3); + + for (int j = 0; j <= 6; ++j) { + int k = j + 4; + + for (int l = 5; l <= 7; ++l) { + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(k1), l, 5 + j, k, + structureboundingbox); + } + + if (k >= 5 && k <= 8) { + this.fillWithBlocks(world, structureboundingbox, 5, 5, k, 7, j + 4, k, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } else if (k >= 9 && k <= 10) { + this.fillWithBlocks(world, structureboundingbox, 5, 8, k, 7, j + 4, k, + Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + + if (j >= 1) { + this.fillWithBlocks(world, structureboundingbox, 5, 6 + j, k, 7, 9 + j, k, + Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + } + + for (int l1 = 5; l1 <= 7; ++l1) { + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(k1), l1, 12, 11, + structureboundingbox); + } + + this.fillWithBlocks(world, structureboundingbox, 5, 6, 7, 5, 7, 7, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 6, 7, 7, 7, 7, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 13, 12, 7, 13, 12, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 2, 3, 5, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 9, 3, 5, 10, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 4, 2, 5, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 5, 2, 10, 5, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 5, 9, 10, 5, 10, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 10, 5, 4, 10, 5, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + int i2 = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 0); + int j2 = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 1); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 2, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 3, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 9, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 10, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 2, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 3, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 9, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 10, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 3, 4, 4, 4, 4, 8, Blocks.soul_sand.getDefaultState(), + Blocks.soul_sand.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 4, 4, 9, 4, 8, Blocks.soul_sand.getDefaultState(), + Blocks.soul_sand.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 5, 4, 4, 5, 8, Blocks.nether_wart.getDefaultState(), + Blocks.nether_wart.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 4, 9, 5, 8, Blocks.nether_wart.getDefaultState(), + Blocks.nether_wart.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int k2 = 4; k2 <= 8; ++k2) { + for (int i1 = 0; i1 <= 2; ++i1) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), k2, -1, i1, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), k2, -1, 12 - i1, + structureboundingbox); + } + } + + for (int l2 = 0; l2 <= 2; ++l2) { + for (int i3 = 4; i3 <= 8; ++i3) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), l2, -1, i3, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), 12 - l2, -1, i3, + structureboundingbox); + } + } + + return true; + } + } + + abstract static class Piece extends StructureComponent { + protected static final List field_111019_a = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), + new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 2, 4, 2) }); + + public Piece() { + } + + protected Piece(int parInt1) { + super(parInt1); + } + + protected void readStructureFromNBT(NBTTagCompound var1) { + } + + protected void writeStructureToNBT(NBTTagCompound var1) { + } + + private int getTotalWeight(List parList) { + boolean flag = false; + int i = 0; + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight : parList) { + if (structurenetherbridgepieces$pieceweight.field_78824_d > 0 + && structurenetherbridgepieces$pieceweight.field_78827_c < structurenetherbridgepieces$pieceweight.field_78824_d) { + flag = true; + } + + i += structurenetherbridgepieces$pieceweight.field_78826_b; + } + + return flag ? i : -1; + } + + private StructureNetherBridgePieces.Piece func_175871_a(StructureNetherBridgePieces.Start parStart, + List parList, List parList2, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + int i = this.getTotalWeight(parList); + boolean flag = i > 0 && parInt4 <= 30; + int j = 0; + + while (j < 5 && flag) { + ++j; + int k = parRandom.nextInt(i); + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight : parList) { + k -= structurenetherbridgepieces$pieceweight.field_78826_b; + if (k < 0) { + if (!structurenetherbridgepieces$pieceweight.func_78822_a(parInt4) + || structurenetherbridgepieces$pieceweight == parStart.theNetherBridgePieceWeight + && !structurenetherbridgepieces$pieceweight.field_78825_e) { + break; + } + + StructureNetherBridgePieces.Piece structurenetherbridgepieces$piece = StructureNetherBridgePieces + .func_175887_b(structurenetherbridgepieces$pieceweight, parList2, parRandom, parInt1, + parInt2, parInt3, parEnumFacing, parInt4); + if (structurenetherbridgepieces$piece != null) { + ++structurenetherbridgepieces$pieceweight.field_78827_c; + parStart.theNetherBridgePieceWeight = structurenetherbridgepieces$pieceweight; + if (!structurenetherbridgepieces$pieceweight.func_78823_a()) { + parList.remove(structurenetherbridgepieces$pieceweight); + } + + return structurenetherbridgepieces$piece; + } + } + } + } + + return StructureNetherBridgePieces.End.func_175884_a(parList2, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } + + private StructureComponent func_175870_a(StructureNetherBridgePieces.Start parStart, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4, boolean parFlag) { + if (Math.abs(parInt1 - parStart.getBoundingBox().minX) <= 112 + && Math.abs(parInt3 - parStart.getBoundingBox().minZ) <= 112) { + List list = parStart.primaryWeights; + if (parFlag) { + list = parStart.secondaryWeights; + } + + StructureNetherBridgePieces.Piece structurenetherbridgepieces$piece = this.func_175871_a(parStart, list, + parList, parRandom, parInt1, parInt2, parInt3, parEnumFacing, parInt4 + 1); + if (structurenetherbridgepieces$piece != null) { + parList.add(structurenetherbridgepieces$piece); + parStart.field_74967_d.add(structurenetherbridgepieces$piece); + } + + return structurenetherbridgepieces$piece; + } else { + return StructureNetherBridgePieces.End.func_175884_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } + } + + protected StructureComponent getNextComponentNormal(StructureNetherBridgePieces.Start parStart, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2, + boolean parFlag) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX + parInt1, + this.boundingBox.minY + parInt2, this.boundingBox.minZ - 1, this.coordBaseMode, + this.getComponentType(), parFlag); + case SOUTH: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX + parInt1, + this.boundingBox.minY + parInt2, this.boundingBox.maxZ + 1, this.coordBaseMode, + this.getComponentType(), parFlag); + case WEST: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX - 1, + this.boundingBox.minY + parInt2, this.boundingBox.minZ + parInt1, this.coordBaseMode, + this.getComponentType(), parFlag); + case EAST: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.maxX + 1, + this.boundingBox.minY + parInt2, this.boundingBox.minZ + parInt1, this.coordBaseMode, + this.getComponentType(), parFlag); + } + } + + return null; + } + + protected StructureComponent getNextComponentX(StructureNetherBridgePieces.Start parStart, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2, + boolean parFlag) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX - 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.WEST, + this.getComponentType(), parFlag); + case SOUTH: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX - 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.WEST, + this.getComponentType(), parFlag); + case WEST: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.minZ - 1, EnumFacing.NORTH, + this.getComponentType(), parFlag); + case EAST: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.minZ - 1, EnumFacing.NORTH, + this.getComponentType(), parFlag); + } + } + + return null; + } + + protected StructureComponent getNextComponentZ(StructureNetherBridgePieces.Start parStart, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2, + boolean parFlag) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.maxX + 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.EAST, + this.getComponentType(), parFlag); + case SOUTH: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.maxX + 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.EAST, + this.getComponentType(), parFlag); + case WEST: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, + this.getComponentType(), parFlag); + case EAST: + return this.func_175870_a(parStart, parList, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, + this.getComponentType(), parFlag); + } + } + + return null; + } + + protected static boolean isAboveGround(StructureBoundingBox parStructureBoundingBox) { + return parStructureBoundingBox != null && parStructureBoundingBox.minY > 10; + } + } + + static class PieceWeight { + public Class weightClass; + public final int field_78826_b; + public int field_78827_c; + public int field_78824_d; + public boolean field_78825_e; + + public PieceWeight(Class parClass1, int parInt1, int parInt2, + boolean parFlag) { + this.weightClass = parClass1; + this.field_78826_b = parInt1; + this.field_78824_d = parInt2; + this.field_78825_e = parFlag; + } + + public PieceWeight(Class parClass1, int parInt1, int parInt2) { + this(parClass1, parInt1, parInt2, false); + } + + public boolean func_78822_a(int parInt1) { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + + public boolean func_78823_a() { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + } + + public static class Stairs extends StructureNetherBridgePieces.Piece { + public Stairs() { + } + + public Stairs(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentZ((StructureNetherBridgePieces.Start) structurecomponent, list, random, 6, 2, false); + } + + public static StructureNetherBridgePieces.Stairs func_175872_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, int parInt4, + EnumFacing parEnumFacing) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -2, 0, 0, 7, 11, 7, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Stairs(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 6, 1, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 6, 10, 6, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 1, 8, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 0, 6, 8, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 1, 0, 8, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 2, 1, 6, 8, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 6, 5, 8, 6, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 2, 0, 5, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 3, 2, 6, 5, 2, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 3, 4, 6, 5, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.setBlockState(world, Blocks.nether_brick.getDefaultState(), 5, 2, 5, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 4, 2, 5, 4, 3, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 2, 5, 3, 4, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 2, 5, 2, 5, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 5, 1, 6, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 7, 1, 5, 7, 4, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 8, 2, 6, 8, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 6, 0, 4, 8, 0, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 5, 0, 4, 5, 0, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 0; i <= 6; ++i) { + for (int j = 0; j <= 6; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } + + public static class Start extends StructureNetherBridgePieces.Crossing3 { + public StructureNetherBridgePieces.PieceWeight theNetherBridgePieceWeight; + public List primaryWeights; + public List secondaryWeights; + public List field_74967_d = Lists.newArrayList(); + + public Start() { + } + + public Start(EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parRandom, parInt1, parInt2); + this.primaryWeights = Lists.newArrayList(); + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight : StructureNetherBridgePieces.primaryComponents) { + structurenetherbridgepieces$pieceweight.field_78827_c = 0; + this.primaryWeights.add(structurenetherbridgepieces$pieceweight); + } + + this.secondaryWeights = Lists.newArrayList(); + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight1 : StructureNetherBridgePieces.secondaryComponents) { + structurenetherbridgepieces$pieceweight1.field_78827_c = 0; + this.secondaryWeights.add(structurenetherbridgepieces$pieceweight1); + } + + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + } + } + + public static class Straight extends StructureNetherBridgePieces.Piece { + public Straight() { + } + + public Straight(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start) structurecomponent, list, random, 1, 3, + false); + } + + public static StructureNetherBridgePieces.Straight func_175882_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -3, 0, 5, 10, 19, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Straight(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 4, 4, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 0, 3, 7, 18, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 0, 5, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 5, 0, 4, 5, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 4, 2, 5, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 13, 4, 2, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 1, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 15, 4, 1, 18, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) { + for (int j = 0; j <= 2; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, 18 - j, + structureboundingbox); + } + } + + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 4, 1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 4, 0, 4, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 14, 0, 4, 14, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 17, 0, 4, 17, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 1, 4, 4, 1, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 4, 4, 4, 4, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 3, 14, 4, 4, 14, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 17, 4, 4, 17, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + return true; + } + } + + public static class Throne extends StructureNetherBridgePieces.Piece { + private boolean hasSpawner; + + public Throne() { + } + + public Throne(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.hasSpawner = nbttagcompound.getBoolean("Mob"); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Mob", this.hasSpawner); + } + + public static StructureNetherBridgePieces.Throne func_175874_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, int parInt4, + EnumFacing parEnumFacing) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -2, 0, 0, 7, 8, 9, parEnumFacing); + return isAboveGround(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureNetherBridgePieces.Throne(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 6, 7, 7, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 5, 1, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 1, 5, 2, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 2, 5, 3, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 3, 5, 4, 7, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 1, 4, 2, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 0, 5, 4, 2, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 2, 1, 5, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 5, 2, 5, 5, 3, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 3, 0, 5, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 5, 3, 6, 5, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 8, 5, 5, 8, Blocks.nether_brick.getDefaultState(), + Blocks.nether_brick.getDefaultState(), false); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 1, 6, 3, structureboundingbox); + this.setBlockState(world, Blocks.nether_brick_fence.getDefaultState(), 5, 6, 3, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 0, 6, 3, 0, 6, 8, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 6, 3, 6, 6, 8, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 6, 8, 5, 7, 8, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 8, 8, 4, 8, 8, + Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + if (!this.hasSpawner) { + BlockPos blockpos = new BlockPos(this.getXWithOffset(3, 5), this.getYWithOffset(5), + this.getZWithOffset(3, 5)); + if (structureboundingbox.isVecInside(blockpos)) { + this.hasSpawner = true; + world.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityMobSpawner) { + ((TileEntityMobSpawner) tileentity).getSpawnerBaseLogic().setEntityName("Blaze"); + } + } + } + + for (int i = 0; i <= 6; ++i) { + for (int j = 0; j <= 6; ++j) { + this.replaceAirAndLiquidDownwards(world, Blocks.nether_brick.getDefaultState(), i, -1, j, + structureboundingbox); + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonument.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonument.java new file mode 100644 index 0000000..fb03c2c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonument.java @@ -0,0 +1,204 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import java.util.Set; +import java.util.Map.Entry; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructure; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureOceanMonumentPieces; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureStart; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureOceanMonument extends MapGenStructure { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureOceanMonument"); + } + + private int field_175800_f; + private int field_175801_g; + public static final List field_175802_d = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, + BiomeGenBase.deepOcean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver }); + private static final List field_175803_h = Lists.newArrayList(); + + public StructureOceanMonument() { + this.field_175800_f = 32; + this.field_175801_g = 5; + } + + public StructureOceanMonument(Map parMap) { + this(); + + for (Entry entry : parMap.entrySet()) { + if (((String) entry.getKey()).equals("spacing")) { + this.field_175800_f = MathHelper.parseIntWithDefaultAndMax((String) entry.getValue(), + this.field_175800_f, 1); + } else if (((String) entry.getKey()).equals("separation")) { + this.field_175801_g = MathHelper.parseIntWithDefaultAndMax((String) entry.getValue(), + this.field_175801_g, 1); + } + } + + } + + public String getStructureName() { + return "Monument"; + } + + protected boolean canSpawnStructureAtCoords(int i, int j) { + int k = i; + int l = j; + if (i < 0) { + i -= this.field_175800_f - 1; + } + + if (j < 0) { + j -= this.field_175800_f - 1; + } + + int i1 = i / this.field_175800_f; + int j1 = j / this.field_175800_f; + EaglercraftRandom random = this.worldObj.setRandomSeed(i1, j1, 10387313); + i1 = i1 * this.field_175800_f; + j1 = j1 * this.field_175800_f; + i1 = i1 + (random.nextInt(this.field_175800_f - this.field_175801_g) + + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2; + j1 = j1 + (random.nextInt(this.field_175800_f - this.field_175801_g) + + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2; + if (k == i1 && l == j1) { + if (this.worldObj.getWorldChunkManager().getBiomeGenerator(new BlockPos(k * 16 + 8, 64, l * 16 + 8), + (BiomeGenBase) null) != BiomeGenBase.deepOcean) { + return false; + } + + boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(k * 16 + 8, l * 16 + 8, 29, + field_175802_d); + if (flag) { + return true; + } + } + + return false; + } + + protected StructureStart getStructureStart(int i, int j) { + return new StructureOceanMonument.StartMonument(this.worldObj, this.rand, i, j); + } + + public List func_175799_b() { + return field_175803_h; + } + + static { + field_175803_h.add(new BiomeGenBase.SpawnListEntry(EntityGuardian.class, 1, 2, 4)); + } + + public static class StartMonument extends StructureStart { + private Set field_175791_c = Sets.newHashSet(); + private boolean field_175790_d; + + public StartMonument() { + } + + public StartMonument(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { + super(parInt1, parInt2); + this.func_175789_b(worldIn, parRandom, parInt1, parInt2); + } + + private void func_175789_b(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { + parRandom.setSeed(worldIn.getSeed()); + long i = parRandom.nextLong(); + long j = parRandom.nextLong(); + long k = (long) parInt1 * i; + long l = (long) parInt2 * j; + parRandom.setSeed(k ^ l ^ worldIn.getSeed()); + int i1 = parInt1 * 16 + 8 - 29; + int j1 = parInt2 * 16 + 8 - 29; + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(parRandom); + this.components.add(new StructureOceanMonumentPieces.MonumentBuilding(parRandom, i1, j1, enumfacing)); + this.updateBoundingBox(); + this.field_175790_d = true; + } + + public void generateStructure(World worldIn, EaglercraftRandom rand, StructureBoundingBox structurebb) { + if (!this.field_175790_d) { + this.components.clear(); + this.func_175789_b(worldIn, rand, this.getChunkPosX(), this.getChunkPosZ()); + } + + super.generateStructure(worldIn, rand, structurebb); + } + + public boolean func_175788_a(ChunkCoordIntPair pair) { + return this.field_175791_c.contains(pair) ? false : super.func_175788_a(pair); + } + + public void func_175787_b(ChunkCoordIntPair pair) { + super.func_175787_b(pair); + this.field_175791_c.add(pair); + } + + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (ChunkCoordIntPair chunkcoordintpair : this.field_175791_c) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setInteger("X", chunkcoordintpair.chunkXPos); + nbttagcompound.setInteger("Z", chunkcoordintpair.chunkZPos); + nbttaglist.appendTag(nbttagcompound); + } + + tagCompound.setTag("Processed", nbttaglist); + } + + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + if (tagCompound.hasKey("Processed", 9)) { + NBTTagList nbttaglist = tagCompound.getTagList("Processed", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + this.field_175791_c + .add(new ChunkCoordIntPair(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Z"))); + } + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java new file mode 100644 index 0000000..4437c18 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java @@ -0,0 +1,2298 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.ArrayUtils; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockPrismarine; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.monster.EntityGuardian; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureOceanMonumentPieces { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureOceanMonumentPieces"); + } + + public static void registerOceanMonumentPieces() { + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.MonumentBuilding.class, "OMB"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.MonumentCoreRoom.class, "OMCR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleXRoom.class, "OMDXR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleXYRoom.class, "OMDXYR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleYRoom.class, "OMDYR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleYZRoom.class, "OMDYZR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleZRoom.class, "OMDZR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.EntryRoom.class, "OMEntry"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.Penthouse.class, "OMPenthouse"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.SimpleRoom.class, "OMSimple"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.SimpleTopRoom.class, "OMSimpleT"); + } + + public static class DoubleXRoom extends StructureOceanMonumentPieces.Piece { + public DoubleXRoom() { + } + + public DoubleXRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 2, 1, 1); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.EAST + .getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 8, 0, + structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(world, structureboundingbox, 0, 0, + structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 4, 1, 7, 4, 6, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 8, 4, 1, 14, 4, 6, field_175828_a); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 0, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 15, 3, 0, 15, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 0, 15, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 7, 14, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 15, 2, 0, 15, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 15, 2, 0, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 7, 14, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 15, 1, 0, 15, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 15, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 7, 14, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 0, 10, 1, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 2, 0, 9, 2, 3, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 5, 3, 0, 10, 3, 4, field_175826_b, field_175826_b, false); + this.setBlockState(world, field_175825_e, 6, 2, 3, structureboundingbox); + this.setBlockState(world, field_175825_e, 9, 2, 3, structureboundingbox); + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 7, 4, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 11, 1, 0, 12, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 11, 1, 7, 12, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 15, 1, 3, 15, 2, 4, false); + } + + return true; + } + } + + public static class DoubleXYRoom extends StructureOceanMonumentPieces.Piece { + public DoubleXYRoom() { + } + + public DoubleXYRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 2, 2, 1); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.EAST + .getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition2 = structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP + .getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition3 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP + .getIndex()]; + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 8, 0, + structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(world, structureboundingbox, 0, 0, + structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 8, 1, 7, 8, 6, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 8, 8, 1, 14, 8, 6, field_175828_a); + } + + for (int i = 1; i <= 7; ++i) { + IBlockState iblockstate = field_175826_b; + if (i == 2 || i == 6) { + iblockstate = field_175828_a; + } + + this.fillWithBlocks(world, structureboundingbox, 0, i, 0, 0, i, 7, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 15, i, 0, 15, i, 7, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 0, 15, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 7, 14, i, 7, iblockstate, iblockstate, false); + } + + this.fillWithBlocks(world, structureboundingbox, 2, 1, 3, 2, 7, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 2, 4, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 5, 4, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 13, 1, 3, 13, 7, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 11, 1, 2, 12, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 11, 1, 5, 12, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 3, 5, 3, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 1, 3, 10, 3, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 7, 2, 10, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 5, 2, 5, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 5, 2, 10, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 5, 5, 5, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 5, 5, 10, 7, 5, field_175826_b, field_175826_b, false); + this.setBlockState(world, field_175826_b, 6, 6, 2, structureboundingbox); + this.setBlockState(world, field_175826_b, 9, 6, 2, structureboundingbox); + this.setBlockState(world, field_175826_b, 6, 6, 5, structureboundingbox); + this.setBlockState(world, field_175826_b, 9, 6, 5, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 5, 4, 3, 6, 4, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 9, 4, 3, 10, 4, 4, field_175826_b, field_175826_b, false); + this.setBlockState(world, field_175825_e, 5, 4, 2, structureboundingbox); + this.setBlockState(world, field_175825_e, 5, 4, 5, structureboundingbox); + this.setBlockState(world, field_175825_e, 10, 4, 2, structureboundingbox); + this.setBlockState(world, field_175825_e, 10, 4, 5, structureboundingbox); + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 7, 4, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 11, 1, 0, 12, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 11, 1, 7, 12, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 15, 1, 3, 15, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 5, 0, 4, 6, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 5, 7, 4, 6, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 5, 3, 0, 6, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 11, 5, 0, 12, 6, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 11, 5, 7, 12, 6, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 15, 5, 3, 15, 6, 4, false); + } + + return true; + } + } + + public static class DoubleYRoom extends StructureOceanMonumentPieces.Piece { + public DoubleYRoom() { + } + + public DoubleYRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 1, 2, 1); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 0, 0, + this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.UP + .getIndex()]; + if (structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 8, 1, 6, 8, 6, field_175828_a); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 4, 0, 0, 4, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 7, 4, 0, 7, 4, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 0, 6, 4, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 7, 6, 4, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 2, 4, 1, 2, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 2, 1, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 4, 1, 5, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 4, 2, 6, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 2, 4, 5, 2, 4, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 5, 1, 4, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 4, 5, 5, 4, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 4, 5, 6, 4, 5, field_175826_b, field_175826_b, false); + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + + for (int i = 1; i <= 5; i += 4) { + byte b0 = 0; + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 2, i, b0, 2, i + 2, b0, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, i, b0, 5, i + 2, b0, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, i + 2, b0, 4, i + 2, b0, field_175826_b, + field_175826_b, false); + } else { + this.fillWithBlocks(world, structureboundingbox, 0, i, b0, 7, i + 2, b0, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, i + 1, b0, 7, i + 1, b0, field_175828_a, + field_175828_a, false); + } + + b0 = 7; + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 2, i, b0, 2, i + 2, b0, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, i, b0, 5, i + 2, b0, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, i + 2, b0, 4, i + 2, b0, field_175826_b, + field_175826_b, false); + } else { + this.fillWithBlocks(world, structureboundingbox, 0, i, b0, 7, i + 2, b0, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, i + 1, b0, 7, i + 1, b0, field_175828_a, + field_175828_a, false); + } + + byte b1 = 0; + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, b1, i, 2, b1, i + 2, 2, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b1, i, 5, b1, i + 2, 5, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b1, i + 2, 3, b1, i + 2, 4, field_175826_b, + field_175826_b, false); + } else { + this.fillWithBlocks(world, structureboundingbox, b1, i, 0, b1, i + 2, 7, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b1, i + 1, 0, b1, i + 1, 7, field_175828_a, + field_175828_a, false); + } + + b1 = 7; + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, b1, i, 2, b1, i + 2, 2, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b1, i, 5, b1, i + 2, 5, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b1, i + 2, 3, b1, i + 2, 4, field_175826_b, + field_175826_b, false); + } else { + this.fillWithBlocks(world, structureboundingbox, b1, i, 0, b1, i + 2, 7, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b1, i + 1, 0, b1, i + 1, 7, field_175828_a, + field_175828_a, false); + } + + structureoceanmonumentpieces$roomdefinition1 = structureoceanmonumentpieces$roomdefinition; + } + + return true; + } + } + + public static class DoubleYZRoom extends StructureOceanMonumentPieces.Piece { + public DoubleYZRoom() { + } + + public DoubleYZRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 1, 2, 2); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.NORTH + .getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition2 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP + .getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition3 = structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP + .getIndex()]; + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 0, 8, + structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(world, structureboundingbox, 0, 0, + structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 8, 1, 6, 8, 7, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 8, 8, 6, 8, 14, field_175828_a); + } + + for (int i = 1; i <= 7; ++i) { + IBlockState iblockstate = field_175826_b; + if (i == 2 || i == 6) { + iblockstate = field_175828_a; + } + + this.fillWithBlocks(world, structureboundingbox, 0, i, 0, 0, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 7, i, 0, 7, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 0, 6, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 15, 6, i, 15, iblockstate, iblockstate, false); + } + + for (int j = 1; j <= 7; ++j) { + IBlockState iblockstate1 = field_175827_c; + if (j == 2 || j == 6) { + iblockstate1 = field_175825_e; + } + + this.fillWithBlocks(world, structureboundingbox, 3, j, 7, 4, j, 8, iblockstate1, iblockstate1, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 1, 3, 7, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 15, 4, 2, 15, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 11, 0, 2, 12, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 1, 11, 7, 2, 12, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 5, 0, 4, 6, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 5, 3, 7, 6, 4, false); + this.fillWithBlocks(world, structureboundingbox, 5, 4, 2, 6, 4, 5, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 2, 6, 3, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 5, 6, 3, 5, field_175826_b, field_175826_b, + false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 5, 3, 0, 6, 4, false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 2, 2, 4, 5, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 2, 1, 3, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 5, 1, 3, 5, field_175826_b, field_175826_b, + false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 5, 15, 4, 6, 15, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 5, 11, 0, 6, 12, false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 10, 2, 4, 13, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 10, 1, 3, 10, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 13, 1, 3, 13, field_175826_b, field_175826_b, + false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 5, 11, 7, 6, 12, false); + this.fillWithBlocks(world, structureboundingbox, 5, 4, 10, 6, 4, 13, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 10, 6, 3, 10, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 13, 6, 3, 13, field_175826_b, field_175826_b, + false); + } + + return true; + } + } + + public static class DoubleZRoom extends StructureOceanMonumentPieces.Piece { + public DoubleZRoom() { + } + + public DoubleZRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 1, 1, 2); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.NORTH + .getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 0, 8, + structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(world, structureboundingbox, 0, 0, + structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 4, 1, 6, 4, 7, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 4, 8, 6, 4, 14, field_175828_a); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 0, 3, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 7, 3, 0, 7, 3, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 0, 7, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 15, 6, 3, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 2, 15, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 0, 7, 2, 15, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 7, 2, 0, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 15, 6, 2, 15, field_175828_a, field_175828_a, false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 1, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 0, 7, 1, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 7, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 15, 6, 1, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 1, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 1, 6, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 1, 1, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 3, 1, 6, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 13, 1, 1, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 13, 6, 1, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 13, 1, 3, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 3, 13, 6, 3, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 6, 2, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 6, 5, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 9, 2, 3, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 9, 5, 3, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, 2, 6, 4, 2, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, 2, 9, 4, 2, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 2, 2, 7, 2, 2, 8, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 7, 5, 2, 8, field_175826_b, field_175826_b, false); + this.setBlockState(world, field_175825_e, 2, 2, 5, structureboundingbox); + this.setBlockState(world, field_175825_e, 5, 2, 5, structureboundingbox); + this.setBlockState(world, field_175825_e, 2, 2, 10, structureboundingbox); + this.setBlockState(world, field_175825_e, 5, 2, 10, structureboundingbox); + this.setBlockState(world, field_175826_b, 2, 3, 5, structureboundingbox); + this.setBlockState(world, field_175826_b, 5, 3, 5, structureboundingbox); + this.setBlockState(world, field_175826_b, 2, 3, 10, structureboundingbox); + this.setBlockState(world, field_175826_b, 5, 3, 10, structureboundingbox); + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 1, 3, 7, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 15, 4, 2, 15, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 11, 0, 2, 12, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 1, 11, 7, 2, 12, false); + } + + return true; + } + } + + public static class EntryRoom extends StructureOceanMonumentPieces.Piece { + public EntryRoom() { + } + + public EntryRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition) { + super(1, parEnumFacing, parRoomDefinition, 1, 1, 1); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 2, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 3, 0, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 1, 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 2, 0, 7, 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 0, 7, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 7, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 2, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 0, 6, 3, 0, field_175826_b, field_175826_b, false); + if (this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 7, 4, 2, 7, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 3, 1, 2, 4, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 6, 1, 3, 7, 2, 4, false); + } + + return true; + } + } + + static class FitSimpleRoomHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private FitSimpleRoomHelper() { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition var1) { + return true; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing enumfacing, + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition, + EaglercraftRandom random) { + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + return new StructureOceanMonumentPieces.SimpleRoom(enumfacing, structureoceanmonumentpieces$roomdefinition, + random); + } + } + + static class FitSimpleRoomTopHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private FitSimpleRoomTopHelper() { + } + + public boolean func_175969_a( + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition) { + return !structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.WEST.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.SOUTH.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.UP.getIndex()]; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing enumfacing, + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition, + EaglercraftRandom random) { + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + return new StructureOceanMonumentPieces.SimpleTopRoom(enumfacing, + structureoceanmonumentpieces$roomdefinition, random); + } + } + + public static class MonumentBuilding extends StructureOceanMonumentPieces.Piece { + private StructureOceanMonumentPieces.RoomDefinition field_175845_o; + private StructureOceanMonumentPieces.RoomDefinition field_175844_p; + private List field_175843_q = Lists.newArrayList(); + + public MonumentBuilding() { + } + + public MonumentBuilding(EaglercraftRandom parRandom, int parInt1, int parInt2, EnumFacing parEnumFacing) { + super(0); + this.coordBaseMode = parEnumFacing; + switch (this.coordBaseMode) { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(parInt1, 39, parInt2, parInt1 + 58 - 1, 61, + parInt2 + 58 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(parInt1, 39, parInt2, parInt1 + 58 - 1, 61, + parInt2 + 58 - 1); + } + + List list = this.func_175836_a(parRandom); + this.field_175845_o.field_175963_d = true; + this.field_175843_q + .add(new StructureOceanMonumentPieces.EntryRoom(this.coordBaseMode, this.field_175845_o)); + this.field_175843_q.add(new StructureOceanMonumentPieces.MonumentCoreRoom(this.coordBaseMode, + this.field_175844_p, parRandom)); + ArrayList arraylist = Lists.newArrayList(); + arraylist.add(new StructureOceanMonumentPieces.XYDoubleRoomFitHelper()); + arraylist.add(new StructureOceanMonumentPieces.YZDoubleRoomFitHelper()); + arraylist.add(new StructureOceanMonumentPieces.ZDoubleRoomFitHelper()); + arraylist.add(new StructureOceanMonumentPieces.XDoubleRoomFitHelper()); + arraylist.add(new StructureOceanMonumentPieces.YDoubleRoomFitHelper()); + arraylist.add(new StructureOceanMonumentPieces.FitSimpleRoomTopHelper()); + arraylist.add(new StructureOceanMonumentPieces.FitSimpleRoomHelper()); + + label319: for (StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition : (List) list) { + if (!structureoceanmonumentpieces$roomdefinition.field_175963_d + && !structureoceanmonumentpieces$roomdefinition.func_175961_b()) { + Iterator iterator = arraylist.iterator(); + + StructureOceanMonumentPieces.MonumentRoomFitHelper structureoceanmonumentpieces$monumentroomfithelper; + while (true) { + if (!iterator.hasNext()) { + continue label319; + } + + structureoceanmonumentpieces$monumentroomfithelper = (StructureOceanMonumentPieces.MonumentRoomFitHelper) iterator + .next(); + if (structureoceanmonumentpieces$monumentroomfithelper + .func_175969_a(structureoceanmonumentpieces$roomdefinition)) { + break; + } + } + + this.field_175843_q.add(structureoceanmonumentpieces$monumentroomfithelper + .func_175968_a(this.coordBaseMode, structureoceanmonumentpieces$roomdefinition, parRandom)); + } + } + + int j = this.boundingBox.minY; + int k = this.getXWithOffset(9, 22); + int l = this.getZWithOffset(9, 22); + + for (StructureOceanMonumentPieces.Piece structureoceanmonumentpieces$piece : this.field_175843_q) { + structureoceanmonumentpieces$piece.getBoundingBox().offset(k, j, l); + } + + StructureBoundingBox structureboundingbox1 = StructureBoundingBox.func_175899_a(this.getXWithOffset(1, 1), + this.getYWithOffset(1), this.getZWithOffset(1, 1), this.getXWithOffset(23, 21), + this.getYWithOffset(8), this.getZWithOffset(23, 21)); + StructureBoundingBox structureboundingbox2 = StructureBoundingBox.func_175899_a(this.getXWithOffset(34, 1), + this.getYWithOffset(1), this.getZWithOffset(34, 1), this.getXWithOffset(56, 21), + this.getYWithOffset(8), this.getZWithOffset(56, 21)); + StructureBoundingBox structureboundingbox = StructureBoundingBox.func_175899_a(this.getXWithOffset(22, 22), + this.getYWithOffset(13), this.getZWithOffset(22, 22), this.getXWithOffset(35, 35), + this.getYWithOffset(17), this.getZWithOffset(35, 35)); + int i = parRandom.nextInt(); + this.field_175843_q + .add(new StructureOceanMonumentPieces.WingRoom(this.coordBaseMode, structureboundingbox1, i++)); + this.field_175843_q + .add(new StructureOceanMonumentPieces.WingRoom(this.coordBaseMode, structureboundingbox2, i++)); + this.field_175843_q + .add(new StructureOceanMonumentPieces.Penthouse(this.coordBaseMode, structureboundingbox)); + } + + private List func_175836_a(EaglercraftRandom parRandom) { + StructureOceanMonumentPieces.RoomDefinition[] astructureoceanmonumentpieces$roomdefinition = new StructureOceanMonumentPieces.RoomDefinition[75]; + + for (int i = 0; i < 5; ++i) { + for (int j = 0; j < 4; ++j) { + byte b0 = 0; + int k = func_175820_a(i, b0, j); + astructureoceanmonumentpieces$roomdefinition[k] = new StructureOceanMonumentPieces.RoomDefinition( + k); + } + } + + for (int l1 = 0; l1 < 5; ++l1) { + for (int k2 = 0; k2 < 4; ++k2) { + byte b1 = 1; + int k3 = func_175820_a(l1, b1, k2); + astructureoceanmonumentpieces$roomdefinition[k3] = new StructureOceanMonumentPieces.RoomDefinition( + k3); + } + } + + for (int i2 = 1; i2 < 4; ++i2) { + for (int l2 = 0; l2 < 2; ++l2) { + byte b2 = 2; + int l3 = func_175820_a(i2, b2, l2); + astructureoceanmonumentpieces$roomdefinition[l3] = new StructureOceanMonumentPieces.RoomDefinition( + l3); + } + } + + this.field_175845_o = astructureoceanmonumentpieces$roomdefinition[field_175823_g]; + + for (int j2 = 0; j2 < 5; ++j2) { + for (int i3 = 0; i3 < 5; ++i3) { + for (int j3 = 0; j3 < 3; ++j3) { + int i4 = func_175820_a(j2, j3, i3); + if (astructureoceanmonumentpieces$roomdefinition[i4] != null) { + for (EnumFacing enumfacing : EnumFacing.values()) { + int l = j2 + enumfacing.getFrontOffsetX(); + int i1 = j3 + enumfacing.getFrontOffsetY(); + int j1 = i3 + enumfacing.getFrontOffsetZ(); + if (l >= 0 && l < 5 && j1 >= 0 && j1 < 5 && i1 >= 0 && i1 < 3) { + int k1 = func_175820_a(l, i1, j1); + if (astructureoceanmonumentpieces$roomdefinition[k1] != null) { + if (j1 != i3) { + astructureoceanmonumentpieces$roomdefinition[i4].func_175957_a( + enumfacing.getOpposite(), + astructureoceanmonumentpieces$roomdefinition[k1]); + } else { + astructureoceanmonumentpieces$roomdefinition[i4].func_175957_a(enumfacing, + astructureoceanmonumentpieces$roomdefinition[k1]); + } + } + } + } + } + } + } + } + + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition; + astructureoceanmonumentpieces$roomdefinition[field_175831_h].func_175957_a(EnumFacing.UP, + structureoceanmonumentpieces$roomdefinition = new StructureOceanMonumentPieces.RoomDefinition( + 1003)); + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1; + astructureoceanmonumentpieces$roomdefinition[field_175832_i].func_175957_a(EnumFacing.SOUTH, + structureoceanmonumentpieces$roomdefinition1 = new StructureOceanMonumentPieces.RoomDefinition( + 1001)); + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition2; + astructureoceanmonumentpieces$roomdefinition[field_175829_j].func_175957_a(EnumFacing.SOUTH, + structureoceanmonumentpieces$roomdefinition2 = new StructureOceanMonumentPieces.RoomDefinition( + 1002)); + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition1.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition2.field_175963_d = true; + this.field_175845_o.field_175964_e = true; + this.field_175844_p = astructureoceanmonumentpieces$roomdefinition[func_175820_a(parRandom.nextInt(4), 0, + 2)]; + this.field_175844_p.field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.NORTH + .getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.NORTH.getIndex()].field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.NORTH + .getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + ArrayList arraylist = Lists.newArrayList(); + + for (StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition4 : astructureoceanmonumentpieces$roomdefinition) { + if (structureoceanmonumentpieces$roomdefinition4 != null) { + structureoceanmonumentpieces$roomdefinition4.func_175958_a(); + arraylist.add(structureoceanmonumentpieces$roomdefinition4); + } + } + + structureoceanmonumentpieces$roomdefinition.func_175958_a(); + ArrayUtils.eaglerShuffle(arraylist, parRandom); + int j4 = 1; + + for (StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition3 : (ArrayList) arraylist) { + int k4 = 0; + int l4 = 0; + + while (k4 < 2 && l4 < 5) { + ++l4; + int i5 = parRandom.nextInt(6); + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[i5]) { + int j5 = EnumFacing.getFront(i5).getOpposite().getIndex(); + structureoceanmonumentpieces$roomdefinition3.field_175966_c[i5] = false; + structureoceanmonumentpieces$roomdefinition3.field_175965_b[i5].field_175966_c[j5] = false; + if (structureoceanmonumentpieces$roomdefinition3.func_175959_a(j4++) + && structureoceanmonumentpieces$roomdefinition3.field_175965_b[i5] + .func_175959_a(j4++)) { + ++k4; + } else { + structureoceanmonumentpieces$roomdefinition3.field_175966_c[i5] = true; + structureoceanmonumentpieces$roomdefinition3.field_175965_b[i5].field_175966_c[j5] = true; + } + } + } + } + + arraylist.add(structureoceanmonumentpieces$roomdefinition); + arraylist.add(structureoceanmonumentpieces$roomdefinition1); + arraylist.add(structureoceanmonumentpieces$roomdefinition2); + return arraylist; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + int i = Math.max(world.func_181545_F(), 64) - this.boundingBox.minY; + this.func_181655_a(world, structureboundingbox, 0, 0, 0, 58, i, 58, false); + this.func_175840_a(false, 0, world, random, structureboundingbox); + this.func_175840_a(true, 33, world, random, structureboundingbox); + this.func_175839_b(world, random, structureboundingbox); + this.func_175837_c(world, random, structureboundingbox); + this.func_175841_d(world, random, structureboundingbox); + this.func_175835_e(world, random, structureboundingbox); + this.func_175842_f(world, random, structureboundingbox); + this.func_175838_g(world, random, structureboundingbox); + + for (int j = 0; j < 7; ++j) { + int k = 0; + + while (k < 7) { + if (k == 0 && j == 3) { + k = 6; + } + + int l = j * 9; + int i1 = k * 9; + + for (int j1 = 0; j1 < 4; ++j1) { + for (int k1 = 0; k1 < 4; ++k1) { + this.setBlockState(world, field_175826_b, l + j1, 0, i1 + k1, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, field_175826_b, l + j1, -1, i1 + k1, + structureboundingbox); + } + } + + if (j != 0 && j != 6) { + k += 6; + } else { + ++k; + } + } + } + + for (int l1 = 0; l1 < 5; ++l1) { + this.func_181655_a(world, structureboundingbox, -1 - l1, 0 + l1 * 2, -1 - l1, -1 - l1, 23, 58 + l1, + false); + this.func_181655_a(world, structureboundingbox, 58 + l1, 0 + l1 * 2, -1 - l1, 58 + l1, 23, 58 + l1, + false); + this.func_181655_a(world, structureboundingbox, 0 - l1, 0 + l1 * 2, -1 - l1, 57 + l1, 23, -1 - l1, + false); + this.func_181655_a(world, structureboundingbox, 0 - l1, 0 + l1 * 2, 58 + l1, 57 + l1, 23, 58 + l1, + false); + } + + for (StructureOceanMonumentPieces.Piece structureoceanmonumentpieces$piece : this.field_175843_q) { + if (structureoceanmonumentpieces$piece.getBoundingBox().intersectsWith(structureboundingbox)) { + structureoceanmonumentpieces$piece.addComponentParts(world, random, structureboundingbox); + } + } + + return true; + } + + private void func_175840_a(boolean worldIn, int parInt1, World parWorld, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + boolean flag = true; + if (this.func_175818_a(parStructureBoundingBox, parInt1, 0, parInt1 + 23, 20)) { + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 0, 0, 0, parInt1 + 24, 0, 20, + field_175828_a, field_175828_a, false); + this.func_181655_a(parWorld, parStructureBoundingBox, parInt1 + 0, 1, 0, parInt1 + 24, 10, 20, false); + + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + i, i + 1, i, parInt1 + i, i + 1, + 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + i + 7, i + 5, i + 7, + parInt1 + i + 7, i + 5, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 17 - i, i + 5, i + 7, + parInt1 + 17 - i, i + 5, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 24 - i, i + 1, i, parInt1 + 24 - i, + i + 1, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + i + 1, i + 1, i, parInt1 + 23 - i, + i + 1, i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + i + 8, i + 5, i + 7, + parInt1 + 16 - i, i + 5, i + 7, field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 4, 4, 4, parInt1 + 6, 4, 20, + field_175828_a, field_175828_a, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 7, 4, 4, parInt1 + 17, 4, 6, + field_175828_a, field_175828_a, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 18, 4, 4, parInt1 + 20, 4, 20, + field_175828_a, field_175828_a, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 11, 8, 11, parInt1 + 13, 8, 20, + field_175828_a, field_175828_a, false); + this.setBlockState(parWorld, field_175824_d, parInt1 + 12, 9, 12, parStructureBoundingBox); + this.setBlockState(parWorld, field_175824_d, parInt1 + 12, 9, 15, parStructureBoundingBox); + this.setBlockState(parWorld, field_175824_d, parInt1 + 12, 9, 18, parStructureBoundingBox); + int i1 = worldIn ? parInt1 + 19 : parInt1 + 5; + int j = worldIn ? parInt1 + 5 : parInt1 + 19; + + for (int k = 20; k >= 5; k -= 3) { + this.setBlockState(parWorld, field_175824_d, i1, 5, k, parStructureBoundingBox); + } + + for (int j1 = 19; j1 >= 7; j1 -= 3) { + this.setBlockState(parWorld, field_175824_d, j, 5, j1, parStructureBoundingBox); + } + + for (int k1 = 0; k1 < 4; ++k1) { + int l = worldIn ? parInt1 + (24 - (17 - k1 * 3)) : parInt1 + 17 - k1 * 3; + this.setBlockState(parWorld, field_175824_d, l, 5, 5, parStructureBoundingBox); + } + + this.setBlockState(parWorld, field_175824_d, j, 5, 5, parStructureBoundingBox); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 11, 1, 12, parInt1 + 13, 7, 12, + field_175828_a, field_175828_a, false); + this.fillWithBlocks(parWorld, parStructureBoundingBox, parInt1 + 12, 1, 11, parInt1 + 12, 7, 13, + field_175828_a, field_175828_a, false); + } + + } + + private void func_175839_b(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + if (this.func_175818_a(parStructureBoundingBox, 22, 5, 35, 17)) { + this.func_181655_a(worldIn, parStructureBoundingBox, 25, 0, 0, 32, 8, 20, false); + + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 24, 2, 5 + i * 4, 24, 4, 5 + i * 4, + field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 22, 4, 5 + i * 4, 23, 4, 5 + i * 4, + field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 25, 5, 5 + i * 4, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 26, 6, 5 + i * 4, parStructureBoundingBox); + this.setBlockState(worldIn, field_175825_e, 26, 5, 5 + i * 4, parStructureBoundingBox); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 33, 2, 5 + i * 4, 33, 4, 5 + i * 4, + field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 34, 4, 5 + i * 4, 35, 4, 5 + i * 4, + field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 32, 5, 5 + i * 4, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 31, 6, 5 + i * 4, parStructureBoundingBox); + this.setBlockState(worldIn, field_175825_e, 31, 5, 5 + i * 4, parStructureBoundingBox); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 27, 6, 5 + i * 4, 30, 6, 5 + i * 4, + field_175828_a, field_175828_a, false); + } + } + + } + + private void func_175837_c(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + if (this.func_175818_a(parStructureBoundingBox, 15, 20, 42, 21)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 15, 0, 21, 42, 0, 21, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 26, 1, 21, 31, 3, 21, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21, 12, 21, 36, 12, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 17, 11, 21, 40, 11, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 16, 10, 21, 41, 10, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 15, 7, 21, 42, 9, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 16, 6, 21, 41, 6, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 17, 5, 21, 40, 5, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21, 4, 21, 36, 4, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 22, 3, 21, 26, 3, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 31, 3, 21, 35, 3, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 23, 2, 21, 25, 2, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 32, 2, 21, 34, 2, 21, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 28, 4, 20, 29, 4, 21, field_175826_b, + field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 27, 3, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 30, 3, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 26, 2, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 31, 2, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 25, 1, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 32, 1, 21, parStructureBoundingBox); + + for (int i = 0; i < 7; ++i) { + this.setBlockState(worldIn, field_175827_c, 28 - i, 6 + i, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175827_c, 29 + i, 6 + i, 21, parStructureBoundingBox); + } + + for (int j = 0; j < 4; ++j) { + this.setBlockState(worldIn, field_175827_c, 28 - j, 9 + j, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175827_c, 29 + j, 9 + j, 21, parStructureBoundingBox); + } + + this.setBlockState(worldIn, field_175827_c, 28, 12, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175827_c, 29, 12, 21, parStructureBoundingBox); + + for (int k = 0; k < 3; ++k) { + this.setBlockState(worldIn, field_175827_c, 22 - k * 2, 8, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175827_c, 22 - k * 2, 9, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175827_c, 35 + k * 2, 8, 21, parStructureBoundingBox); + this.setBlockState(worldIn, field_175827_c, 35 + k * 2, 9, 21, parStructureBoundingBox); + } + + this.func_181655_a(worldIn, parStructureBoundingBox, 15, 13, 21, 42, 15, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 15, 1, 21, 15, 6, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 16, 1, 21, 16, 5, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 17, 1, 21, 20, 4, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 21, 1, 21, 21, 3, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 22, 1, 21, 22, 2, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 23, 1, 21, 24, 1, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 42, 1, 21, 42, 6, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 41, 1, 21, 41, 5, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 37, 1, 21, 40, 4, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 36, 1, 21, 36, 3, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 33, 1, 21, 34, 1, 21, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 35, 1, 21, 35, 2, 21, false); + } + + } + + private void func_175841_d(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + if (this.func_175818_a(parStructureBoundingBox, 21, 21, 36, 36)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21, 0, 22, 36, 0, 36, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 21, 1, 22, 36, 23, 36, false); + + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21 + i, 13 + i, 21 + i, 36 - i, 13 + i, + 21 + i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21 + i, 13 + i, 36 - i, 36 - i, 13 + i, + 36 - i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21 + i, 13 + i, 22 + i, 21 + i, 13 + i, + 35 - i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 36 - i, 13 + i, 22 + i, 36 - i, 13 + i, + 35 - i, field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(worldIn, parStructureBoundingBox, 25, 16, 25, 32, 16, 32, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 25, 17, 25, 25, 19, 25, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 32, 17, 25, 32, 19, 25, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 25, 17, 32, 25, 19, 32, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 32, 17, 32, 32, 19, 32, field_175826_b, + field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 26, 20, 26, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 27, 21, 27, parStructureBoundingBox); + this.setBlockState(worldIn, field_175825_e, 27, 20, 27, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 26, 20, 31, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 27, 21, 30, parStructureBoundingBox); + this.setBlockState(worldIn, field_175825_e, 27, 20, 30, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 31, 20, 31, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 30, 21, 30, parStructureBoundingBox); + this.setBlockState(worldIn, field_175825_e, 30, 20, 30, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 31, 20, 26, parStructureBoundingBox); + this.setBlockState(worldIn, field_175826_b, 30, 21, 27, parStructureBoundingBox); + this.setBlockState(worldIn, field_175825_e, 30, 20, 27, parStructureBoundingBox); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 28, 21, 27, 29, 21, 27, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 27, 21, 28, 27, 21, 29, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 28, 21, 30, 29, 21, 30, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 30, 21, 28, 30, 21, 29, field_175828_a, + field_175828_a, false); + } + + } + + private void func_175835_e(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + if (this.func_175818_a(parStructureBoundingBox, 0, 21, 6, 58)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 0, 0, 21, 6, 0, 57, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 0, 1, 21, 6, 7, 57, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 4, 4, 21, 6, 4, 53, field_175828_a, + field_175828_a, false); + + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, i, i + 1, 21, i, i + 1, 57 - i, + field_175826_b, field_175826_b, false); + } + + for (int j = 23; j < 53; j += 3) { + this.setBlockState(worldIn, field_175824_d, 5, 5, j, parStructureBoundingBox); + } + + this.setBlockState(worldIn, field_175824_d, 5, 5, 52, parStructureBoundingBox); + + for (int k = 0; k < 4; ++k) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, k, k + 1, 21, k, k + 1, 57 - k, + field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(worldIn, parStructureBoundingBox, 4, 1, 52, 6, 3, 52, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 5, 1, 51, 5, 3, 53, field_175828_a, + field_175828_a, false); + } + + if (this.func_175818_a(parStructureBoundingBox, 51, 21, 58, 58)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 51, 0, 21, 57, 0, 57, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 51, 1, 21, 57, 7, 57, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 51, 4, 21, 53, 4, 53, field_175828_a, + field_175828_a, false); + + for (int l = 0; l < 4; ++l) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 57 - l, l + 1, 21, 57 - l, l + 1, 57 - l, + field_175826_b, field_175826_b, false); + } + + for (int i1 = 23; i1 < 53; i1 += 3) { + this.setBlockState(worldIn, field_175824_d, 52, 5, i1, parStructureBoundingBox); + } + + this.setBlockState(worldIn, field_175824_d, 52, 5, 52, parStructureBoundingBox); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 51, 1, 52, 53, 3, 52, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 52, 1, 51, 52, 3, 53, field_175828_a, + field_175828_a, false); + } + + if (this.func_175818_a(parStructureBoundingBox, 0, 51, 57, 57)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 7, 0, 51, 50, 0, 57, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 7, 1, 51, 50, 10, 57, false); + + for (int j1 = 0; j1 < 4; ++j1) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, j1 + 1, j1 + 1, 57 - j1, 56 - j1, j1 + 1, + 57 - j1, field_175826_b, field_175826_b, false); + } + } + + } + + private void func_175842_f(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + if (this.func_175818_a(parStructureBoundingBox, 7, 21, 13, 50)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 7, 0, 21, 13, 0, 50, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 7, 1, 21, 13, 10, 50, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 11, 8, 21, 13, 8, 53, field_175828_a, + field_175828_a, false); + + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, i + 7, i + 5, 21, i + 7, i + 5, 54, + field_175826_b, field_175826_b, false); + } + + for (int j = 21; j <= 45; j += 3) { + this.setBlockState(worldIn, field_175824_d, 12, 9, j, parStructureBoundingBox); + } + } + + if (this.func_175818_a(parStructureBoundingBox, 44, 21, 50, 54)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 44, 0, 21, 50, 0, 50, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 44, 1, 21, 50, 10, 50, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 44, 8, 21, 46, 8, 53, field_175828_a, + field_175828_a, false); + + for (int k = 0; k < 4; ++k) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 50 - k, k + 5, 21, 50 - k, k + 5, 54, + field_175826_b, field_175826_b, false); + } + + for (int l = 21; l <= 45; l += 3) { + this.setBlockState(worldIn, field_175824_d, 45, 9, l, parStructureBoundingBox); + } + } + + if (this.func_175818_a(parStructureBoundingBox, 8, 44, 49, 54)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 14, 0, 44, 43, 0, 50, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 14, 1, 44, 43, 10, 50, false); + + for (int i1 = 12; i1 <= 45; i1 += 3) { + this.setBlockState(worldIn, field_175824_d, i1, 9, 45, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 9, 52, parStructureBoundingBox); + if (i1 == 12 || i1 == 18 || i1 == 24 || i1 == 33 || i1 == 39 || i1 == 45) { + this.setBlockState(worldIn, field_175824_d, i1, 9, 47, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 9, 50, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 10, 45, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 10, 46, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 10, 51, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 10, 52, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 11, 47, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 11, 50, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 12, 48, parStructureBoundingBox); + this.setBlockState(worldIn, field_175824_d, i1, 12, 49, parStructureBoundingBox); + } + } + + for (int j1 = 0; j1 < 3; ++j1) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 8 + j1, 5 + j1, 54, 49 - j1, 5 + j1, 54, + field_175828_a, field_175828_a, false); + } + + this.fillWithBlocks(worldIn, parStructureBoundingBox, 11, 8, 54, 46, 8, 54, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 14, 8, 44, 43, 8, 53, field_175828_a, + field_175828_a, false); + } + + } + + private void func_175838_g(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox) { + if (this.func_175818_a(parStructureBoundingBox, 14, 21, 20, 43)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 14, 0, 21, 20, 0, 43, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 14, 1, 22, 20, 14, 43, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 18, 12, 22, 20, 12, 39, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 18, 12, 21, 20, 12, 21, field_175826_b, + field_175826_b, false); + + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, i + 14, i + 9, 21, i + 14, i + 9, 43 - i, + field_175826_b, field_175826_b, false); + } + + for (int j = 23; j <= 39; j += 3) { + this.setBlockState(worldIn, field_175824_d, 19, 13, j, parStructureBoundingBox); + } + } + + if (this.func_175818_a(parStructureBoundingBox, 37, 21, 43, 43)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 37, 0, 21, 43, 0, 43, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 37, 1, 22, 43, 14, 43, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 37, 12, 22, 39, 12, 39, field_175828_a, + field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 37, 12, 21, 39, 12, 21, field_175826_b, + field_175826_b, false); + + for (int k = 0; k < 4; ++k) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 43 - k, k + 9, 21, 43 - k, k + 9, 43 - k, + field_175826_b, field_175826_b, false); + } + + for (int l = 23; l <= 39; l += 3) { + this.setBlockState(worldIn, field_175824_d, 38, 13, l, parStructureBoundingBox); + } + } + + if (this.func_175818_a(parStructureBoundingBox, 15, 37, 42, 43)) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21, 0, 37, 36, 0, 43, field_175828_a, + field_175828_a, false); + this.func_181655_a(worldIn, parStructureBoundingBox, 21, 1, 37, 36, 14, 43, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, 21, 12, 37, 36, 12, 39, field_175828_a, + field_175828_a, false); + + for (int i1 = 0; i1 < 4; ++i1) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, 15 + i1, i1 + 9, 43 - i1, 42 - i1, i1 + 9, + 43 - i1, field_175826_b, field_175826_b, false); + } + + for (int j1 = 21; j1 <= 36; j1 += 3) { + this.setBlockState(worldIn, field_175824_d, j1, 13, 38, parStructureBoundingBox); + } + } + + } + } + + public static class MonumentCoreRoom extends StructureOceanMonumentPieces.Piece { + public MonumentCoreRoom() { + } + + public MonumentCoreRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 2, 2, 2); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.func_175819_a(world, structureboundingbox, 1, 8, 0, 14, 8, 14, field_175828_a); + int i = 7; + IBlockState iblockstate = field_175826_b; + this.fillWithBlocks(world, structureboundingbox, 0, i, 0, 0, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 15, i, 0, 15, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 0, 15, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 15, 14, i, 15, iblockstate, iblockstate, false); + + for (i = 1; i <= 6; ++i) { + iblockstate = field_175826_b; + if (i == 2 || i == 6) { + iblockstate = field_175828_a; + } + + for (int j = 0; j <= 15; j += 15) { + this.fillWithBlocks(world, structureboundingbox, j, i, 0, j, i, 1, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, j, i, 6, j, i, 9, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, j, i, 14, j, i, 15, iblockstate, iblockstate, + false); + } + + this.fillWithBlocks(world, structureboundingbox, 1, i, 0, 1, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 6, i, 0, 9, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 14, i, 0, 14, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(world, structureboundingbox, 1, i, 15, 14, i, 15, iblockstate, iblockstate, false); + } + + this.fillWithBlocks(world, structureboundingbox, 6, 3, 6, 9, 6, 9, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 7, 4, 7, 8, 5, 8, Blocks.gold_block.getDefaultState(), + Blocks.gold_block.getDefaultState(), false); + + for (i = 3; i <= 6; i += 3) { + for (int k = 6; k <= 9; k += 3) { + this.setBlockState(world, field_175825_e, k, i, 6, structureboundingbox); + this.setBlockState(world, field_175825_e, k, i, 9, structureboundingbox); + } + } + + this.fillWithBlocks(world, structureboundingbox, 5, 1, 6, 5, 2, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 9, 5, 2, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 1, 6, 10, 2, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 1, 9, 10, 2, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 5, 6, 2, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 9, 1, 5, 9, 2, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 10, 6, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 9, 1, 10, 9, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 5, 5, 6, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 10, 5, 6, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 2, 5, 10, 6, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 2, 10, 10, 6, 10, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 7, 1, 5, 7, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 7, 1, 10, 7, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 5, 7, 9, 5, 7, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 10, 7, 9, 10, 7, 14, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 7, 5, 6, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 7, 10, 6, 7, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 9, 7, 5, 14, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 9, 7, 10, 14, 7, 10, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 2, 2, 1, 3, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 2, 3, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 13, 1, 2, 13, 1, 3, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, 2, 12, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 12, 2, 1, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 13, 3, 1, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 13, 1, 12, 13, 1, 13, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, 13, 12, 1, 13, field_175826_b, field_175826_b, + false); + return true; + } + } + + interface MonumentRoomFitHelper { + boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition var1); + + StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing var1, + StructureOceanMonumentPieces.RoomDefinition var2, EaglercraftRandom var3); + } + + public static class Penthouse extends StructureOceanMonumentPieces.Piece { + public Penthouse() { + } + + public Penthouse(EnumFacing parEnumFacing, StructureBoundingBox parStructureBoundingBox) { + super(parEnumFacing, parStructureBoundingBox); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + this.fillWithBlocks(world, structureboundingbox, 2, -1, 2, 11, -1, 11, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, -1, 0, 1, -1, 11, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 12, -1, 0, 13, -1, 11, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 2, -1, 0, 11, -1, 1, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 2, -1, 12, 11, -1, 13, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 0, 0, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 13, 0, 0, 13, 0, 13, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 12, 0, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 13, 12, 0, 13, field_175826_b, field_175826_b, + false); + + for (int i = 2; i <= 11; i += 3) { + this.setBlockState(world, field_175825_e, 0, 0, i, structureboundingbox); + this.setBlockState(world, field_175825_e, 13, 0, i, structureboundingbox); + this.setBlockState(world, field_175825_e, i, 0, 0, structureboundingbox); + } + + this.fillWithBlocks(world, structureboundingbox, 2, 0, 3, 4, 0, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 9, 0, 3, 11, 0, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 9, 9, 0, 11, field_175826_b, field_175826_b, false); + this.setBlockState(world, field_175826_b, 5, 0, 8, structureboundingbox); + this.setBlockState(world, field_175826_b, 8, 0, 8, structureboundingbox); + this.setBlockState(world, field_175826_b, 10, 0, 10, structureboundingbox); + this.setBlockState(world, field_175826_b, 3, 0, 10, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 3, 0, 3, 3, 0, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 10, 0, 3, 10, 0, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 6, 0, 10, 7, 0, 10, field_175827_c, field_175827_c, false); + byte b0 = 3; + + for (int j = 0; j < 2; ++j) { + for (int k = 2; k <= 8; k += 3) { + this.fillWithBlocks(world, structureboundingbox, b0, 0, k, b0, 2, k, field_175826_b, field_175826_b, + false); + } + + b0 = 10; + } + + this.fillWithBlocks(world, structureboundingbox, 5, 0, 10, 5, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 8, 0, 10, 8, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 6, -1, 7, 7, -1, 8, field_175827_c, field_175827_c, false); + this.func_181655_a(world, structureboundingbox, 6, -1, 3, 7, -1, 4, false); + this.func_175817_a(world, structureboundingbox, 6, 1, 6); + return true; + } + } + + public abstract static class Piece extends StructureComponent { + protected static final IBlockState field_175828_a = Blocks.prismarine + .getStateFromMeta(BlockPrismarine.ROUGH_META); + protected static final IBlockState field_175826_b = Blocks.prismarine + .getStateFromMeta(BlockPrismarine.BRICKS_META); + protected static final IBlockState field_175827_c = Blocks.prismarine + .getStateFromMeta(BlockPrismarine.DARK_META); + protected static final IBlockState field_175824_d = field_175826_b; + protected static final IBlockState field_175825_e = Blocks.sea_lantern.getDefaultState(); + protected static final IBlockState field_175822_f = Blocks.water.getDefaultState(); + protected static final int field_175823_g = func_175820_a(2, 0, 0); + protected static final int field_175831_h = func_175820_a(2, 2, 0); + protected static final int field_175832_i = func_175820_a(0, 1, 0); + protected static final int field_175829_j = func_175820_a(4, 1, 0); + protected StructureOceanMonumentPieces.RoomDefinition field_175830_k; + + protected static final int func_175820_a(int parInt1, int parInt2, int parInt3) { + return parInt2 * 25 + parInt3 * 5 + parInt1; + } + + public Piece() { + super(0); + } + + public Piece(int parInt1) { + super(parInt1); + } + + public Piece(EnumFacing parEnumFacing, StructureBoundingBox parStructureBoundingBox) { + super(1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + protected Piece(int parInt1, EnumFacing parEnumFacing, + StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, int parInt2, int parInt3, int parInt4) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_175830_k = parRoomDefinition; + int i = parRoomDefinition.field_175967_a; + int j = i % 5; + int k = i / 5 % 5; + int l = i / 25; + if (parEnumFacing != EnumFacing.NORTH && parEnumFacing != EnumFacing.SOUTH) { + this.boundingBox = new StructureBoundingBox(0, 0, 0, parInt4 * 8 - 1, parInt3 * 4 - 1, parInt2 * 8 - 1); + } else { + this.boundingBox = new StructureBoundingBox(0, 0, 0, parInt2 * 8 - 1, parInt3 * 4 - 1, parInt4 * 8 - 1); + } + + switch (parEnumFacing) { + case NORTH: + this.boundingBox.offset(j * 8, l * 4, -(k + parInt4) * 8 + 1); + break; + case SOUTH: + this.boundingBox.offset(j * 8, l * 4, k * 8); + break; + case WEST: + this.boundingBox.offset(-(k + parInt4) * 8 + 1, l * 4, j * 8); + break; + default: + this.boundingBox.offset(k * 8, l * 4, j * 8); + } + + } + + protected void writeStructureToNBT(NBTTagCompound var1) { + } + + protected void readStructureFromNBT(NBTTagCompound var1) { + } + + protected void func_181655_a(World parWorld, StructureBoundingBox parStructureBoundingBox, int parInt1, + int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, boolean parFlag) { + for (int i = parInt2; i <= parInt5; ++i) { + for (int j = parInt1; j <= parInt4; ++j) { + for (int k = parInt3; k <= parInt6; ++k) { + if (!parFlag || this.getBlockStateFromPos(parWorld, j, i, k, parStructureBoundingBox).getBlock() + .getMaterial() != Material.air) { + if (this.getYWithOffset(i) >= parWorld.func_181545_F()) { + this.setBlockState(parWorld, Blocks.air.getDefaultState(), j, i, k, + parStructureBoundingBox); + } else { + this.setBlockState(parWorld, field_175822_f, j, i, k, parStructureBoundingBox); + } + } + } + } + } + + } + + protected void func_175821_a(World worldIn, StructureBoundingBox parStructureBoundingBox, int parInt1, + int parInt2, boolean parFlag) { + if (parFlag) { + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 0, 0, parInt2 + 0, parInt1 + 2, 0, + parInt2 + 8 - 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 5, 0, parInt2 + 0, parInt1 + 8 - 1, 0, + parInt2 + 8 - 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 3, 0, parInt2 + 0, parInt1 + 4, 0, + parInt2 + 2, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 3, 0, parInt2 + 5, parInt1 + 4, 0, + parInt2 + 8 - 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 3, 0, parInt2 + 2, parInt1 + 4, 0, + parInt2 + 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 3, 0, parInt2 + 5, parInt1 + 4, 0, + parInt2 + 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 2, 0, parInt2 + 3, parInt1 + 2, 0, + parInt2 + 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 5, 0, parInt2 + 3, parInt1 + 5, 0, + parInt2 + 4, field_175826_b, field_175826_b, false); + } else { + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1 + 0, 0, parInt2 + 0, parInt1 + 8 - 1, 0, + parInt2 + 8 - 1, field_175828_a, field_175828_a, false); + } + + } + + protected void func_175819_a(World worldIn, StructureBoundingBox parStructureBoundingBox, int parInt1, + int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, IBlockState parIBlockState) { + for (int i = parInt2; i <= parInt5; ++i) { + for (int j = parInt1; j <= parInt4; ++j) { + for (int k = parInt3; k <= parInt6; ++k) { + if (this.getBlockStateFromPos(worldIn, j, i, k, parStructureBoundingBox) == field_175822_f) { + this.setBlockState(worldIn, parIBlockState, j, i, k, parStructureBoundingBox); + } + } + } + } + + } + + protected boolean func_175818_a(StructureBoundingBox parStructureBoundingBox, int parInt1, int parInt2, + int parInt3, int parInt4) { + int i = this.getXWithOffset(parInt1, parInt2); + int j = this.getZWithOffset(parInt1, parInt2); + int k = this.getXWithOffset(parInt3, parInt4); + int l = this.getZWithOffset(parInt3, parInt4); + return parStructureBoundingBox.intersectsWith(Math.min(i, k), Math.min(j, l), Math.max(i, k), + Math.max(j, l)); + } + + protected boolean func_175817_a(World worldIn, StructureBoundingBox parStructureBoundingBox, int parInt1, + int parInt2, int parInt3) { + int i = this.getXWithOffset(parInt1, parInt3); + int j = this.getYWithOffset(parInt2); + int k = this.getZWithOffset(parInt1, parInt3); + if (parStructureBoundingBox.isVecInside(new BlockPos(i, j, k))) { + EntityGuardian entityguardian = new EntityGuardian(worldIn); + entityguardian.setElder(true); + entityguardian.heal(entityguardian.getMaxHealth()); + entityguardian.setLocationAndAngles((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F); + entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), + (IEntityLivingData) null); + worldIn.spawnEntityInWorld(entityguardian); + return true; + } else { + return false; + } + } + } + + static class RoomDefinition { + int field_175967_a; + StructureOceanMonumentPieces.RoomDefinition[] field_175965_b = new StructureOceanMonumentPieces.RoomDefinition[6]; + boolean[] field_175966_c = new boolean[6]; + boolean field_175963_d; + boolean field_175964_e; + int field_175962_f; + + public RoomDefinition(int parInt1) { + this.field_175967_a = parInt1; + } + + public void func_175957_a(EnumFacing parEnumFacing, + StructureOceanMonumentPieces.RoomDefinition parRoomDefinition) { + this.field_175965_b[parEnumFacing.getIndex()] = parRoomDefinition; + parRoomDefinition.field_175965_b[parEnumFacing.getOpposite().getIndex()] = this; + } + + public void func_175958_a() { + for (int i = 0; i < 6; ++i) { + this.field_175966_c[i] = this.field_175965_b[i] != null; + } + + } + + public boolean func_175959_a(int parInt1) { + if (this.field_175964_e) { + return true; + } else { + this.field_175962_f = parInt1; + + for (int i = 0; i < 6; ++i) { + if (this.field_175965_b[i] != null && this.field_175966_c[i] + && this.field_175965_b[i].field_175962_f != parInt1 + && this.field_175965_b[i].func_175959_a(parInt1)) { + return true; + } + } + + return false; + } + } + + public boolean func_175961_b() { + return this.field_175967_a >= 75; + } + + public int func_175960_c() { + int i = 0; + + for (int j = 0; j < 6; ++j) { + if (this.field_175966_c[j]) { + ++i; + } + } + + return i; + } + } + + public static class SimpleRoom extends StructureOceanMonumentPieces.Piece { + private int field_175833_o; + + public SimpleRoom() { + } + + public SimpleRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 1, 1, 1); + this.field_175833_o = parRandom.nextInt(3); + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 0, 0, + this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (this.field_175830_k.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 4, 1, 6, 4, 6, field_175828_a); + } + + boolean flag = this.field_175833_o != 0 && random.nextBoolean() + && !this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()] + && !this.field_175830_k.field_175966_c[EnumFacing.UP.getIndex()] + && this.field_175830_k.func_175960_c() > 1; + if (this.field_175833_o == 0) { + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 2, 1, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 2, 3, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 2, 2, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 2, 2, 0, field_175828_a, field_175828_a, + false); + this.setBlockState(world, field_175825_e, 1, 2, 1, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 0, 7, 1, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 3, 0, 7, 3, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 0, 7, 2, 2, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 0, 6, 2, 0, field_175828_a, field_175828_a, + false); + this.setBlockState(world, field_175825_e, 6, 2, 1, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 5, 2, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 5, 2, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 5, 0, 2, 7, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 7, 2, 2, 7, field_175828_a, field_175828_a, + false); + this.setBlockState(world, field_175825_e, 1, 2, 6, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 5, 7, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 3, 5, 7, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 5, 7, 2, 7, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 7, 6, 2, 7, field_175828_a, field_175828_a, + false); + this.setBlockState(world, field_175825_e, 6, 2, 6, structureboundingbox); + if (this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 3, 3, 0, 4, 3, 0, field_175826_b, field_175826_b, + false); + } else { + this.fillWithBlocks(world, structureboundingbox, 3, 3, 0, 4, 3, 1, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 2, 0, 4, 2, 0, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 0, 4, 1, 1, field_175826_b, field_175826_b, + false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 3, 3, 7, 4, 3, 7, field_175826_b, field_175826_b, + false); + } else { + this.fillWithBlocks(world, structureboundingbox, 3, 3, 6, 4, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 2, 7, 4, 2, 7, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 6, 4, 1, 7, field_175826_b, field_175826_b, + false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 3, 0, 3, 4, field_175826_b, field_175826_b, + false); + } else { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 3, 1, 3, 4, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 3, 0, 2, 4, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 3, 1, 1, 4, field_175826_b, field_175826_b, + false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 7, 3, 3, 7, 3, 4, field_175826_b, field_175826_b, + false); + } else { + this.fillWithBlocks(world, structureboundingbox, 6, 3, 3, 7, 3, 4, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 3, 7, 2, 4, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 3, 7, 1, 4, field_175826_b, field_175826_b, + false); + } + } else if (this.field_175833_o == 1) { + this.fillWithBlocks(world, structureboundingbox, 2, 1, 2, 2, 3, 2, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 5, 2, 3, 5, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 5, 5, 3, 5, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 2, 5, 3, 2, field_175826_b, field_175826_b, + false); + this.setBlockState(world, field_175825_e, 2, 2, 2, structureboundingbox); + this.setBlockState(world, field_175825_e, 2, 2, 5, structureboundingbox); + this.setBlockState(world, field_175825_e, 5, 2, 5, structureboundingbox); + this.setBlockState(world, field_175825_e, 5, 2, 2, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 1, 3, 0, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 3, 1, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 7, 1, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 6, 0, 3, 6, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 7, 7, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 6, 7, 3, 6, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 0, 7, 3, 0, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 1, 7, 3, 1, field_175826_b, field_175826_b, + false); + this.setBlockState(world, field_175828_a, 1, 2, 0, structureboundingbox); + this.setBlockState(world, field_175828_a, 0, 2, 1, structureboundingbox); + this.setBlockState(world, field_175828_a, 1, 2, 7, structureboundingbox); + this.setBlockState(world, field_175828_a, 0, 2, 6, structureboundingbox); + this.setBlockState(world, field_175828_a, 6, 2, 7, structureboundingbox); + this.setBlockState(world, field_175828_a, 7, 2, 6, structureboundingbox); + this.setBlockState(world, field_175828_a, 6, 2, 0, structureboundingbox); + this.setBlockState(world, field_175828_a, 7, 2, 1, structureboundingbox); + if (!this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 1, 3, 0, 6, 3, 0, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 6, 2, 0, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 6, 1, 0, field_175826_b, field_175826_b, + false); + } + + if (!this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 1, 3, 7, 6, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 7, 6, 2, 7, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 7, 6, 1, 7, field_175826_b, field_175826_b, + false); + } + + if (!this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 1, 0, 3, 6, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 1, 0, 2, 6, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 1, 6, field_175826_b, field_175826_b, + false); + } + + if (!this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.fillWithBlocks(world, structureboundingbox, 7, 3, 1, 7, 3, 6, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 1, 7, 2, 6, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 1, 7, 1, 6, field_175826_b, field_175826_b, + false); + } + } else if (this.field_175833_o == 2) { + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 0, 7, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 6, 1, 0, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 7, 6, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 2, 7, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 0, 7, 2, 7, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 6, 2, 0, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 7, 6, 2, 7, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 0, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 3, 0, 7, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 0, 6, 3, 0, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 7, 6, 3, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 3, 0, 2, 4, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 3, 7, 2, 4, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 0, 4, 2, 0, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 7, 4, 2, 7, field_175827_c, field_175827_c, + false); + if (this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 0, 4, 2, 0, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 7, 4, 2, 7, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 0, 1, 3, 0, 2, 4, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 7, 1, 3, 7, 2, 4, false); + } + } + + if (flag) { + this.fillWithBlocks(world, structureboundingbox, 3, 1, 3, 4, 1, 4, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 2, 3, 4, 2, 4, field_175828_a, field_175828_a, + false); + this.fillWithBlocks(world, structureboundingbox, 3, 3, 3, 4, 3, 4, field_175826_b, field_175826_b, + false); + } + + return true; + } + } + + public static class SimpleTopRoom extends StructureOceanMonumentPieces.Piece { + public SimpleTopRoom() { + } + + public SimpleTopRoom(EnumFacing parEnumFacing, StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, + EaglercraftRandom parRandom) { + super(1, parEnumFacing, parRoomDefinition, 1, 1, 1); + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_175830_k.field_175967_a / 25 > 0) { + this.func_175821_a(world, structureboundingbox, 0, 0, + this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (this.field_175830_k.field_175965_b[EnumFacing.UP.getIndex()] == null) { + this.func_175819_a(world, structureboundingbox, 1, 4, 1, 6, 4, 6, field_175828_a); + } + + for (int i = 1; i <= 6; ++i) { + for (int j = 1; j <= 6; ++j) { + if (random.nextInt(3) != 0) { + int k = 2 + (random.nextInt(4) == 0 ? 0 : 1); + this.fillWithBlocks(world, structureboundingbox, i, k, j, i, 3, j, + Blocks.sponge.getStateFromMeta(1), Blocks.sponge.getStateFromMeta(1), false); + } + } + } + + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 0, 7, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 6, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 7, 6, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 0, 7, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 6, 2, 0, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 7, 6, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 0, 3, 0, 0, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 7, 3, 0, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 0, 6, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 7, 6, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 3, 0, 2, 4, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 3, 7, 2, 4, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 0, 4, 2, 0, field_175827_c, field_175827_c, false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 7, 4, 2, 7, field_175827_c, field_175827_c, false); + if (this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) { + this.func_181655_a(world, structureboundingbox, 3, 1, 0, 4, 2, 0, false); + } + + return true; + } + } + + public static class WingRoom extends StructureOceanMonumentPieces.Piece { + private int field_175834_o; + + public WingRoom() { + } + + public WingRoom(EnumFacing parEnumFacing, StructureBoundingBox parStructureBoundingBox, int parInt1) { + super(parEnumFacing, parStructureBoundingBox); + this.field_175834_o = parInt1 & 1; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.field_175834_o == 0) { + for (int i = 0; i < 4; ++i) { + this.fillWithBlocks(world, structureboundingbox, 10 - i, 3 - i, 20 - i, 12 + i, 3 - i, 20, + field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(world, structureboundingbox, 7, 0, 6, 15, 0, 16, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 6, 0, 6, 6, 3, 20, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 16, 0, 6, 16, 3, 20, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 7, 7, 1, 20, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 15, 1, 7, 15, 1, 20, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 7, 1, 6, 9, 3, 6, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 13, 1, 6, 15, 3, 6, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 8, 1, 7, 9, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 13, 1, 7, 14, 1, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 9, 0, 5, 13, 0, 5, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 10, 0, 7, 12, 0, 7, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 8, 0, 10, 8, 0, 12, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 14, 0, 10, 14, 0, 12, field_175827_c, field_175827_c, + false); + + for (int k = 18; k >= 7; k -= 3) { + this.setBlockState(world, field_175825_e, 6, 3, k, structureboundingbox); + this.setBlockState(world, field_175825_e, 16, 3, k, structureboundingbox); + } + + this.setBlockState(world, field_175825_e, 10, 0, 10, structureboundingbox); + this.setBlockState(world, field_175825_e, 12, 0, 10, structureboundingbox); + this.setBlockState(world, field_175825_e, 10, 0, 12, structureboundingbox); + this.setBlockState(world, field_175825_e, 12, 0, 12, structureboundingbox); + this.setBlockState(world, field_175825_e, 8, 3, 6, structureboundingbox); + this.setBlockState(world, field_175825_e, 14, 3, 6, structureboundingbox); + this.setBlockState(world, field_175826_b, 4, 2, 4, structureboundingbox); + this.setBlockState(world, field_175825_e, 4, 1, 4, structureboundingbox); + this.setBlockState(world, field_175826_b, 4, 0, 4, structureboundingbox); + this.setBlockState(world, field_175826_b, 18, 2, 4, structureboundingbox); + this.setBlockState(world, field_175825_e, 18, 1, 4, structureboundingbox); + this.setBlockState(world, field_175826_b, 18, 0, 4, structureboundingbox); + this.setBlockState(world, field_175826_b, 4, 2, 18, structureboundingbox); + this.setBlockState(world, field_175825_e, 4, 1, 18, structureboundingbox); + this.setBlockState(world, field_175826_b, 4, 0, 18, structureboundingbox); + this.setBlockState(world, field_175826_b, 18, 2, 18, structureboundingbox); + this.setBlockState(world, field_175825_e, 18, 1, 18, structureboundingbox); + this.setBlockState(world, field_175826_b, 18, 0, 18, structureboundingbox); + this.setBlockState(world, field_175826_b, 9, 7, 20, structureboundingbox); + this.setBlockState(world, field_175826_b, 13, 7, 20, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 6, 0, 21, 7, 4, 21, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 15, 0, 21, 16, 4, 21, field_175826_b, field_175826_b, + false); + this.func_175817_a(world, structureboundingbox, 11, 2, 16); + } else if (this.field_175834_o == 1) { + this.fillWithBlocks(world, structureboundingbox, 9, 3, 18, 13, 3, 20, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 9, 0, 18, 9, 2, 18, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, 13, 0, 18, 13, 2, 18, field_175826_b, field_175826_b, + false); + byte b2 = 9; + byte b0 = 20; + byte b1 = 5; + + for (int j = 0; j < 2; ++j) { + this.setBlockState(world, field_175826_b, b2, b1 + 1, b0, structureboundingbox); + this.setBlockState(world, field_175825_e, b2, b1, b0, structureboundingbox); + this.setBlockState(world, field_175826_b, b2, b1 - 1, b0, structureboundingbox); + b2 = 13; + } + + this.fillWithBlocks(world, structureboundingbox, 7, 3, 7, 15, 3, 14, field_175826_b, field_175826_b, + false); + b2 = 10; + + for (int l = 0; l < 2; ++l) { + this.fillWithBlocks(world, structureboundingbox, b2, 0, 10, b2, 6, 10, field_175826_b, + field_175826_b, false); + this.fillWithBlocks(world, structureboundingbox, b2, 0, 12, b2, 6, 12, field_175826_b, + field_175826_b, false); + this.setBlockState(world, field_175825_e, b2, 0, 10, structureboundingbox); + this.setBlockState(world, field_175825_e, b2, 0, 12, structureboundingbox); + this.setBlockState(world, field_175825_e, b2, 4, 10, structureboundingbox); + this.setBlockState(world, field_175825_e, b2, 4, 12, structureboundingbox); + b2 = 12; + } + + b2 = 8; + + for (int i1 = 0; i1 < 2; ++i1) { + this.fillWithBlocks(world, structureboundingbox, b2, 0, 7, b2, 2, 7, field_175826_b, field_175826_b, + false); + this.fillWithBlocks(world, structureboundingbox, b2, 0, 14, b2, 2, 14, field_175826_b, + field_175826_b, false); + b2 = 14; + } + + this.fillWithBlocks(world, structureboundingbox, 8, 3, 8, 8, 3, 13, field_175827_c, field_175827_c, + false); + this.fillWithBlocks(world, structureboundingbox, 14, 3, 8, 14, 3, 13, field_175827_c, field_175827_c, + false); + this.func_175817_a(world, structureboundingbox, 11, 5, 13); + } + + return true; + } + } + + static class XDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private XDoubleRoomFitHelper() { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition parRoomDefinition) { + return parRoomDefinition.field_175966_c[EnumFacing.EAST.getIndex()] + && !parRoomDefinition.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing parEnumFacing, + StructureOceanMonumentPieces.RoomDefinition parRoomDefinition, EaglercraftRandom parRandom) { + parRoomDefinition.field_175963_d = true; + parRoomDefinition.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleXRoom(parEnumFacing, parRoomDefinition, parRandom); + } + } + + static class XYDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private XYDoubleRoomFitHelper() { + } + + public boolean func_175969_a( + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition) { + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.EAST + .getIndex()].field_175963_d + && structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.UP.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.EAST + .getIndex()]; + return structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.UP.getIndex()] + && !structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d; + } else { + return false; + } + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing enumfacing, + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition, + EaglercraftRandom random) { + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.EAST + .getIndex()].field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.EAST + .getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleXYRoom(enumfacing, + structureoceanmonumentpieces$roomdefinition, random); + } + } + + static class YDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private YDoubleRoomFitHelper() { + } + + public boolean func_175969_a( + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition) { + return structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.UP.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing enumfacing, + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition, + EaglercraftRandom random) { + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleYRoom(enumfacing, structureoceanmonumentpieces$roomdefinition, + random); + } + } + + static class YZDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private YZDoubleRoomFitHelper() { + } + + public boolean func_175969_a( + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition) { + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH + .getIndex()].field_175963_d + && structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.UP.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH + .getIndex()]; + return structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.UP.getIndex()] + && !structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP + .getIndex()].field_175963_d; + } else { + return false; + } + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing enumfacing, + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition, + EaglercraftRandom random) { + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH + .getIndex()].field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH + .getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleYZRoom(enumfacing, + structureoceanmonumentpieces$roomdefinition, random); + } + } + + static class ZDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper { + private ZDoubleRoomFitHelper() { + } + + public boolean func_175969_a( + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition) { + return structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()] + && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH + .getIndex()].field_175963_d; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing enumfacing, + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition, + EaglercraftRandom random) { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = structureoceanmonumentpieces$roomdefinition; + if (!structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()] + || structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH + .getIndex()].field_175963_d) { + structureoceanmonumentpieces$roomdefinition1 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.SOUTH + .getIndex()]; + } + + structureoceanmonumentpieces$roomdefinition1.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.NORTH + .getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleZRoom(enumfacing, + structureoceanmonumentpieces$roomdefinition1, random); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStart.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStart.java new file mode 100644 index 0000000..09090b6 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStart.java @@ -0,0 +1,196 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.LinkedList; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.ChunkCoordIntPair; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class StructureStart { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureStart"); + } + + /**+ + * List of all StructureComponents that are part of this + * structure + */ + protected LinkedList components = new LinkedList(); + protected StructureBoundingBox boundingBox; + private int chunkPosX; + private int chunkPosZ; + + public StructureStart() { + } + + public StructureStart(int chunkX, int chunkZ) { + this.chunkPosX = chunkX; + this.chunkPosZ = chunkZ; + } + + public StructureBoundingBox getBoundingBox() { + return this.boundingBox; + } + + public LinkedList getComponents() { + return this.components; + } + + /**+ + * Keeps iterating Structure Pieces and spawning them until the + * checks tell it to stop + */ + public void generateStructure(World world, EaglercraftRandom random, StructureBoundingBox structureboundingbox) { + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) { + StructureComponent structurecomponent = (StructureComponent) iterator.next(); + if (structurecomponent.getBoundingBox().intersectsWith(structureboundingbox) + && !structurecomponent.addComponentParts(world, random, structureboundingbox)) { + iterator.remove(); + } + } + + } + + /**+ + * Calculates total bounding box based on components' bounding + * boxes and saves it to boundingBox + */ + protected void updateBoundingBox() { + this.boundingBox = StructureBoundingBox.getNewBoundingBox(); + + for (StructureComponent structurecomponent : this.components) { + this.boundingBox.expandTo(structurecomponent.getBoundingBox()); + } + + } + + public NBTTagCompound writeStructureComponentsToNBT(int chunkX, int chunkZ) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("id", MapGenStructureIO.getStructureStartName(this)); + nbttagcompound.setInteger("ChunkX", chunkX); + nbttagcompound.setInteger("ChunkZ", chunkZ); + nbttagcompound.setTag("BB", this.boundingBox.toNBTTagIntArray()); + NBTTagList nbttaglist = new NBTTagList(); + + for (StructureComponent structurecomponent : this.components) { + nbttaglist.appendTag(structurecomponent.createStructureBaseNBT()); + } + + nbttagcompound.setTag("Children", nbttaglist); + this.writeToNBT(nbttagcompound); + return nbttagcompound; + } + + public void writeToNBT(NBTTagCompound var1) { + } + + public void readStructureComponentsFromNBT(World worldIn, NBTTagCompound tagCompound) { + this.chunkPosX = tagCompound.getInteger("ChunkX"); + this.chunkPosZ = tagCompound.getInteger("ChunkZ"); + if (tagCompound.hasKey("BB")) { + this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB")); + } + + NBTTagList nbttaglist = tagCompound.getTagList("Children", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + this.components.add(MapGenStructureIO.getStructureComponent(nbttaglist.getCompoundTagAt(i), worldIn)); + } + + this.readFromNBT(tagCompound); + } + + public void readFromNBT(NBTTagCompound var1) { + } + + /**+ + * offsets the structure Bounding Boxes up to a certain height, + * typically 63 - 10 + */ + protected void markAvailableHeight(World worldIn, EaglercraftRandom rand, int parInt1) { + int i = worldIn.func_181545_F() - parInt1; + int j = this.boundingBox.getYSize() + 1; + if (j < i) { + j += rand.nextInt(i - j); + } + + int k = j - this.boundingBox.maxY; + this.boundingBox.offset(0, k, 0); + + for (StructureComponent structurecomponent : this.components) { + structurecomponent.func_181138_a(0, k, 0); + } + + } + + protected void setRandomHeight(World worldIn, EaglercraftRandom rand, int parInt1, int parInt2) { + int i = parInt2 - parInt1 + 1 - this.boundingBox.getYSize(); + int j = 1; + if (i > 1) { + j = parInt1 + rand.nextInt(i); + } else { + j = parInt1; + } + + int k = j - this.boundingBox.minY; + this.boundingBox.offset(0, k, 0); + + for (StructureComponent structurecomponent : this.components) { + structurecomponent.func_181138_a(0, k, 0); + } + + } + + /**+ + * currently only defined for Villages, returns true if Village + * has more than 2 non-road components + */ + public boolean isSizeableStructure() { + return true; + } + + public boolean func_175788_a(ChunkCoordIntPair var1) { + return true; + } + + public void func_175787_b(ChunkCoordIntPair var1) { + } + + public int getChunkPosX() { + return this.chunkPosX; + } + + public int getChunkPosZ() { + return this.chunkPosZ; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStrongholdPieces.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStrongholdPieces.java new file mode 100644 index 0000000..60cb56f --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStrongholdPieces.java @@ -0,0 +1,1747 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockEndPortalFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSilverfish; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneBrick; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStoneSlab; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.tileentity.TileEntityMobSpawner; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureStrongholdPieces { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureStrongholdPieces"); + } + + private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] { + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), + new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) { + public boolean canSpawnMoreStructuresOfType(int parInt1) { + return super.canSpawnMoreStructuresOfType(parInt1) && parInt1 > 4; + } + }, new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.PortalRoom.class, 20, 1) { + public boolean canSpawnMoreStructuresOfType(int i) { + return super.canSpawnMoreStructuresOfType(i) && i > 5; + } + } }; + private static List structurePieceList; + private static Class strongComponentType; + static int totalWeight; + private static final StructureStrongholdPieces.Stones strongholdStones = new StructureStrongholdPieces.Stones(); + + public static void registerStrongholdPieces() { + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.ChestCorridor.class, "SHCC"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Corridor.class, "SHFC"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Crossing.class, "SH5C"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.LeftTurn.class, "SHLT"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Library.class, "SHLi"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.PortalRoom.class, "SHPR"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Prison.class, "SHPH"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RightTurn.class, "SHRT"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RoomCrossing.class, "SHRC"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs.class, "SHSD"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs2.class, "SHStart"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Straight.class, "SHS"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.StairsStraight.class, "SHSSD"); + } + + /**+ + * sets up Arrays with the Structure pieces and their weights + */ + public static void prepareStructurePieces() { + structurePieceList = Lists.newArrayList(); + + for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : pieceWeightArray) { + structurestrongholdpieces$pieceweight.instancesSpawned = 0; + structurePieceList.add(structurestrongholdpieces$pieceweight); + } + + strongComponentType = null; + } + + private static boolean canAddStructurePieces() { + boolean flag = false; + totalWeight = 0; + + for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : structurePieceList) { + if (structurestrongholdpieces$pieceweight.instancesLimit > 0 + && structurestrongholdpieces$pieceweight.instancesSpawned < structurestrongholdpieces$pieceweight.instancesLimit) { + flag = true; + } + + totalWeight += structurestrongholdpieces$pieceweight.pieceWeight; + } + + return flag; + } + + private static StructureStrongholdPieces.Stronghold func_175954_a( + Class parClass1, List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { + Object object = null; + if (parClass1 == StructureStrongholdPieces.Straight.class) { + object = StructureStrongholdPieces.Straight.func_175862_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.Prison.class) { + object = StructureStrongholdPieces.Prison.func_175860_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.LeftTurn.class) { + object = StructureStrongholdPieces.LeftTurn.func_175867_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.RightTurn.class) { + object = StructureStrongholdPieces.RightTurn.func_175867_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.RoomCrossing.class) { + object = StructureStrongholdPieces.RoomCrossing.func_175859_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.StairsStraight.class) { + object = StructureStrongholdPieces.StairsStraight.func_175861_a(parList, parRandom, parInt1, parInt2, + parInt3, parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.Stairs.class) { + object = StructureStrongholdPieces.Stairs.func_175863_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.Crossing.class) { + object = StructureStrongholdPieces.Crossing.func_175866_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.ChestCorridor.class) { + object = StructureStrongholdPieces.ChestCorridor.func_175868_a(parList, parRandom, parInt1, parInt2, + parInt3, parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.Library.class) { + object = StructureStrongholdPieces.Library.func_175864_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (parClass1 == StructureStrongholdPieces.PortalRoom.class) { + object = StructureStrongholdPieces.PortalRoom.func_175865_a(parList, parRandom, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } + + return (StructureStrongholdPieces.Stronghold) object; + } + + private static StructureStrongholdPieces.Stronghold func_175955_b(StructureStrongholdPieces.Stairs2 parStairs2_1, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + if (!canAddStructurePieces()) { + return null; + } else { + if (strongComponentType != null) { + StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold = func_175954_a( + strongComponentType, parList, parRandom, parInt1, parInt2, parInt3, parEnumFacing, parInt4); + strongComponentType = null; + if (structurestrongholdpieces$stronghold != null) { + return structurestrongholdpieces$stronghold; + } + } + + int j = 0; + + while (j < 5) { + ++j; + int i = parRandom.nextInt(totalWeight); + + for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : structurePieceList) { + i -= structurestrongholdpieces$pieceweight.pieceWeight; + if (i < 0) { + if (!structurestrongholdpieces$pieceweight.canSpawnMoreStructuresOfType(parInt4) + || structurestrongholdpieces$pieceweight == parStairs2_1.strongholdPieceWeight) { + break; + } + + StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold1 = func_175954_a( + structurestrongholdpieces$pieceweight.pieceClass, parList, parRandom, parInt1, parInt2, + parInt3, parEnumFacing, parInt4); + if (structurestrongholdpieces$stronghold1 != null) { + ++structurestrongholdpieces$pieceweight.instancesSpawned; + parStairs2_1.strongholdPieceWeight = structurestrongholdpieces$pieceweight; + if (!structurestrongholdpieces$pieceweight.canSpawnMoreStructures()) { + structurePieceList.remove(structurestrongholdpieces$pieceweight); + } + + return structurestrongholdpieces$stronghold1; + } + } + } + } + + StructureBoundingBox structureboundingbox = StructureStrongholdPieces.Corridor.func_175869_a(parList, + parRandom, parInt1, parInt2, parInt3, parEnumFacing); + if (structureboundingbox != null && structureboundingbox.minY > 1) { + return new StructureStrongholdPieces.Corridor(parInt4, parRandom, structureboundingbox, parEnumFacing); + } else { + return null; + } + } + } + + private static StructureComponent func_175953_c(StructureStrongholdPieces.Stairs2 parStairs2_1, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + if (parInt4 > 50) { + return null; + } else if (Math.abs(parInt1 - parStairs2_1.getBoundingBox().minX) <= 112 + && Math.abs(parInt3 - parStairs2_1.getBoundingBox().minZ) <= 112) { + StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold = func_175955_b(parStairs2_1, + parList, parRandom, parInt1, parInt2, parInt3, parEnumFacing, parInt4 + 1); + if (structurestrongholdpieces$stronghold != null) { + parList.add(structurestrongholdpieces$stronghold); + parStairs2_1.field_75026_c.add(structurestrongholdpieces$stronghold); + } + + return structurestrongholdpieces$stronghold; + } else { + return null; + } + } + + public static class ChestCorridor extends StructureStrongholdPieces.Stronghold { + private static final List strongholdChestContents = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.ender_pearl, 0, 1, 1, 10), + new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1) }); + private boolean hasMadeChest; + + public ChestCorridor() { + } + + public ChestCorridor(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Chest", this.hasMadeChest); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.hasMadeChest = nbttagcompound.getBoolean("Chest"); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } + + public static StructureStrongholdPieces.ChestCorridor func_175868_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -1, 0, 5, 5, 7, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.ChestCorridor(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 4, 4, 6, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 1, 0); + this.placeDoor(world, random, structureboundingbox, StructureStrongholdPieces.Stronghold.Door.OPENING, + 1, 1, 6); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 2, 3, 1, 4, Blocks.stonebrick.getDefaultState(), + Blocks.stonebrick.getDefaultState(), false); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 1, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 5, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 4, + structureboundingbox); + + for (int i = 2; i <= 4; ++i) { + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 2, 1, + i, structureboundingbox); + } + + if (!this.hasMadeChest && structureboundingbox.isVecInside( + new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) { + this.hasMadeChest = true; + this.generateChestContents(world, structureboundingbox, random, 3, 2, 3, + WeightedRandomChestContent.func_177629_a(strongholdChestContents, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random) }), + 2 + random.nextInt(2)); + } + + return true; + } + } + } + + public static class Corridor extends StructureStrongholdPieces.Stronghold { + private int field_74993_a; + + public Corridor() { + } + + public Corridor(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + this.field_74993_a = parEnumFacing != EnumFacing.NORTH && parEnumFacing != EnumFacing.SOUTH + ? parStructureBoundingBox.getXSize() + : parStructureBoundingBox.getZSize(); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("Steps", this.field_74993_a); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_74993_a = nbttagcompound.getInteger("Steps"); + } + + public static StructureBoundingBox func_175869_a(List parList, EaglercraftRandom parRandom, + int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing) { + boolean flag = true; + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -1, 0, 5, 5, 4, parEnumFacing); + StructureComponent structurecomponent = StructureComponent.findIntersecting(parList, structureboundingbox); + if (structurecomponent == null) { + return null; + } else { + if (structurecomponent.getBoundingBox().minY == structureboundingbox.minY) { + for (int i = 3; i >= 1; --i) { + structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, parInt2, + parInt3, -1, -1, 0, 5, 5, i - 1, parEnumFacing); + if (!structurecomponent.getBoundingBox().intersectsWith(structureboundingbox)) { + return StructureBoundingBox.getComponentToAddBoundingBox(parInt1, parInt2, parInt3, -1, -1, + 0, 5, 5, i, parEnumFacing); + } + } + } + + return null; + } + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + for (int i = 0; i < this.field_74993_a; ++i) { + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 0, 0, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 0, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 2, 0, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 0, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 4, 0, i, structureboundingbox); + + for (int j = 1; j <= 3; ++j) { + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 0, j, i, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, j, i, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, j, i, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 3, j, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 4, j, i, structureboundingbox); + } + + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 0, 4, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 4, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 2, 4, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 4, i, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 4, 4, i, structureboundingbox); + } + + return true; + } + } + } + + public static class Crossing extends StructureStrongholdPieces.Stronghold { + private boolean field_74996_b; + private boolean field_74997_c; + private boolean field_74995_d; + private boolean field_74999_h; + + public Crossing() { + } + + public Crossing(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + this.field_74996_b = parRandom.nextBoolean(); + this.field_74997_c = parRandom.nextBoolean(); + this.field_74995_d = parRandom.nextBoolean(); + this.field_74999_h = parRandom.nextInt(3) > 0; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("leftLow", this.field_74996_b); + nbttagcompound.setBoolean("leftHigh", this.field_74997_c); + nbttagcompound.setBoolean("rightLow", this.field_74995_d); + nbttagcompound.setBoolean("rightHigh", this.field_74999_h); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_74996_b = nbttagcompound.getBoolean("leftLow"); + this.field_74997_c = nbttagcompound.getBoolean("leftHigh"); + this.field_74995_d = nbttagcompound.getBoolean("rightLow"); + this.field_74999_h = nbttagcompound.getBoolean("rightHigh"); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + int i = 3; + int j = 5; + if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.NORTH) { + i = 8 - i; + j = 8 - j; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 5, 1); + if (this.field_74996_b) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, i, 1); + } + + if (this.field_74997_c) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, j, 7); + } + + if (this.field_74995_d) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, i, 1); + } + + if (this.field_74999_h) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, j, 7); + } + + } + + public static StructureStrongholdPieces.Crossing func_175866_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -4, -3, 0, 10, 9, 11, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.Crossing(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 9, 8, 10, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 4, 3, 0); + if (this.field_74996_b) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, 1, 0, 5, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + if (this.field_74995_d) { + this.fillWithBlocks(world, structureboundingbox, 9, 3, 1, 9, 5, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + if (this.field_74997_c) { + this.fillWithBlocks(world, structureboundingbox, 0, 5, 7, 0, 7, 9, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + if (this.field_74999_h) { + this.fillWithBlocks(world, structureboundingbox, 9, 5, 7, 9, 7, 9, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + this.fillWithBlocks(world, structureboundingbox, 5, 1, 10, 7, 3, 10, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 2, 1, 8, 2, 6, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 5, 4, 4, 9, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 8, 1, 5, 8, 4, 9, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 4, 7, 3, 4, 9, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 3, 5, 3, 3, 6, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 4, 3, 3, 4, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 6, 3, 4, 6, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithRandomizedBlocks(world, structureboundingbox, 5, 1, 7, 7, 1, 8, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 9, 7, 1, 9, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 2, 7, 7, 2, 7, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 5, 7, 4, 5, 9, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 5, 7, 8, 5, 9, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 5, 7, 7, 5, 9, + Blocks.double_stone_slab.getDefaultState(), Blocks.double_stone_slab.getDefaultState(), false); + this.setBlockState(world, Blocks.torch.getDefaultState(), 6, 5, 6, structureboundingbox); + return true; + } + } + } + + public static class LeftTurn extends StructureStrongholdPieces.Stronghold { + public LeftTurn() { + } + + public LeftTurn(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } else { + this.getNextComponentX((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } + + } + + public static StructureStrongholdPieces.LeftTurn func_175867_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -1, 0, 5, 5, 5, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.LeftTurn(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 4, 4, 4, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 1, 0); + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) { + this.fillWithBlocks(world, structureboundingbox, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } else { + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } + + public static class Library extends StructureStrongholdPieces.Stronghold { + private static final List strongholdLibraryChestContents = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), + new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), + new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1) }); + private boolean isLargeRoom; + + public Library() { + } + + public Library(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + this.isLargeRoom = parStructureBoundingBox.getYSize() > 6; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Tall", this.isLargeRoom); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.isLargeRoom = nbttagcompound.getBoolean("Tall"); + } + + public static StructureStrongholdPieces.Library func_175864_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -4, -1, 0, 14, 11, 15, parEnumFacing); + if (!canStrongholdGoDeeper(structureboundingbox) + || StructureComponent.findIntersecting(parList, structureboundingbox) != null) { + structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, parInt2, parInt3, -4, + -1, 0, 14, 6, 15, parEnumFacing); + if (!canStrongholdGoDeeper(structureboundingbox) + || StructureComponent.findIntersecting(parList, structureboundingbox) != null) { + return null; + } + } + + return new StructureStrongholdPieces.Library(parInt4, parRandom, structureboundingbox, parEnumFacing); + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + byte b0 = 11; + if (!this.isLargeRoom) { + b0 = 6; + } + + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 13, b0 - 1, 14, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 4, 1, 0); + this.func_175805_a(world, structureboundingbox, random, 0.07F, 2, 1, 1, 11, 4, 13, + Blocks.web.getDefaultState(), Blocks.web.getDefaultState(), false); + boolean flag = true; + boolean flag1 = true; + + for (int i = 1; i <= 13; ++i) { + if ((i - 1) % 4 == 0) { + this.fillWithBlocks(world, structureboundingbox, 1, 1, i, 1, 4, i, + Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, i, 12, 4, i, + Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.torch.getDefaultState(), 2, 3, i, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), 11, 3, i, structureboundingbox); + if (this.isLargeRoom) { + this.fillWithBlocks(world, structureboundingbox, 1, 6, i, 1, 9, i, + Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 6, i, 12, 9, i, + Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + } + } else { + this.fillWithBlocks(world, structureboundingbox, 1, 1, i, 1, 4, i, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 1, i, 12, 4, i, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + if (this.isLargeRoom) { + this.fillWithBlocks(world, structureboundingbox, 1, 6, i, 1, 9, i, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 6, i, 12, 9, i, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + } + } + } + + for (int j = 3; j < 12; j += 2) { + this.fillWithBlocks(world, structureboundingbox, 3, 1, j, 4, 3, j, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, j, 7, 3, j, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 1, j, 10, 3, j, + Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + } + + if (this.isLargeRoom) { + this.fillWithBlocks(world, structureboundingbox, 1, 5, 1, 3, 5, 13, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 10, 5, 1, 12, 5, 13, + Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 5, 1, 9, 5, 2, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 5, 12, 9, 5, 13, + Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.planks.getDefaultState(), 9, 5, 11, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 5, 11, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 9, 5, 10, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 3, 6, 2, 3, 6, 12, + Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 10, 6, 2, 10, 6, 10, + Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 6, 2, 9, 6, 2, + Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 6, 12, 8, 6, 12, + Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 9, 6, 11, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 8, 6, 11, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 9, 6, 10, structureboundingbox); + int k = this.getMetadataWithOffset(Blocks.ladder, 3); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 1, 13, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 2, 13, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 3, 13, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 4, 13, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 5, 13, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 6, 13, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(k), 10, 7, 13, structureboundingbox); + byte b1 = 7; + byte b2 = 7; + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 - 1, 9, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1, 9, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 - 1, 8, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1, 8, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 - 1, 7, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1, 7, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 - 2, 7, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 + 1, 7, b2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 - 1, 7, b2 - 1, + structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1 - 1, 7, b2 + 1, + structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1, 7, b2 - 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), b1, 7, b2 + 1, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), b1 - 2, 8, b2, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), b1 + 1, 8, b2, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), b1 - 1, 8, b2 - 1, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), b1 - 1, 8, b2 + 1, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), b1, 8, b2 - 1, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), b1, 8, b2 + 1, structureboundingbox); + } + + this.generateChestContents(world, structureboundingbox, random, 3, 3, 5, + WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random, 1, 5, 2) }), + 1 + random.nextInt(4)); + if (this.isLargeRoom) { + this.setBlockState(world, Blocks.air.getDefaultState(), 12, 9, 1, structureboundingbox); + this.generateChestContents(world, structureboundingbox, random, 12, 8, 1, + WeightedRandomChestContent + .func_177629_a(strongholdLibraryChestContents, + new WeightedRandomChestContent[] { + Items.enchanted_book.getRandom(random, 1, 5, 2) }), + 1 + random.nextInt(4)); + } + + return true; + } + } + } + + static class PieceWeight { + public Class pieceClass; + public final int pieceWeight; + public int instancesSpawned; + public int instancesLimit; + + public PieceWeight(Class parClass1, int parInt1, int parInt2) { + this.pieceClass = parClass1; + this.pieceWeight = parInt1; + this.instancesLimit = parInt2; + } + + public boolean canSpawnMoreStructuresOfType(int var1) { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + + public boolean canSpawnMoreStructures() { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + } + + public static class PortalRoom extends StructureStrongholdPieces.Stronghold { + private boolean hasSpawner; + + public PortalRoom() { + } + + public PortalRoom(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.boundingBox = parStructureBoundingBox; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Mob", this.hasSpawner); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.hasSpawner = nbttagcompound.getBoolean("Mob"); + } + + public void buildComponent(StructureComponent structurecomponent, List var2, + EaglercraftRandom var3) { + if (structurecomponent != null) { + ((StructureStrongholdPieces.Stairs2) structurecomponent).strongholdPortalRoom = this; + } + + } + + public static StructureStrongholdPieces.PortalRoom func_175865_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -4, -1, 0, 11, 8, 16, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.PortalRoom(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 10, 7, 15, false, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, StructureStrongholdPieces.Stronghold.Door.GRATES, 4, 1, + 0); + int i = 6; + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, i, 1, 1, i, 14, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 9, i, 1, 9, i, 14, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, i, 1, 8, i, 2, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 2, i, 14, 8, i, 14, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 1, 1, 1, 2, 1, 4, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 8, 1, 1, 9, 1, 4, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 1, 1, 3, Blocks.flowing_lava.getDefaultState(), + Blocks.flowing_lava.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 1, 1, 9, 1, 3, Blocks.flowing_lava.getDefaultState(), + Blocks.flowing_lava.getDefaultState(), false); + this.fillWithRandomizedBlocks(world, structureboundingbox, 3, 1, 8, 7, 1, 12, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 9, 6, 1, 11, Blocks.flowing_lava.getDefaultState(), + Blocks.flowing_lava.getDefaultState(), false); + + for (int j = 3; j < 14; j += 2) { + this.fillWithBlocks(world, structureboundingbox, 0, 3, j, 0, 4, j, Blocks.iron_bars.getDefaultState(), + Blocks.iron_bars.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 10, 3, j, 10, 4, j, Blocks.iron_bars.getDefaultState(), + Blocks.iron_bars.getDefaultState(), false); + } + + for (int k1 = 2; k1 < 9; k1 += 2) { + this.fillWithBlocks(world, structureboundingbox, k1, 3, 15, k1, 4, 15, + Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false); + } + + int l1 = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 3); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 5, 6, 1, 7, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 2, 6, 6, 2, 7, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 3, 7, 6, 3, 7, false, random, + StructureStrongholdPieces.strongholdStones); + + for (int k = 4; k <= 6; ++k) { + this.setBlockState(world, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 1, 4, + structureboundingbox); + this.setBlockState(world, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 2, 5, + structureboundingbox); + this.setBlockState(world, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 3, 6, + structureboundingbox); + } + + int i2 = EnumFacing.NORTH.getHorizontalIndex(); + int l = EnumFacing.SOUTH.getHorizontalIndex(); + int i1 = EnumFacing.EAST.getHorizontalIndex(); + int j1 = EnumFacing.WEST.getHorizontalIndex(); + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case SOUTH: + i2 = EnumFacing.SOUTH.getHorizontalIndex(); + l = EnumFacing.NORTH.getHorizontalIndex(); + break; + case WEST: + i2 = EnumFacing.WEST.getHorizontalIndex(); + l = EnumFacing.EAST.getHorizontalIndex(); + i1 = EnumFacing.SOUTH.getHorizontalIndex(); + j1 = EnumFacing.NORTH.getHorizontalIndex(); + break; + case EAST: + i2 = EnumFacing.EAST.getHorizontalIndex(); + l = EnumFacing.WEST.getHorizontalIndex(); + i1 = EnumFacing.SOUTH.getHorizontalIndex(); + j1 = EnumFacing.NORTH.getHorizontalIndex(); + } + } + + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 4, 3, 8, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 5, 3, 8, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 6, 3, 8, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 4, 3, 12, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 5, 3, 12, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 6, 3, 12, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 3, 3, 9, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 3, 3, 10, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 3, 3, 11, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 7, 3, 9, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 7, 3, 10, structureboundingbox); + this.setBlockState(world, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, + Boolean.valueOf(random.nextFloat() > 0.9F)), 7, 3, 11, structureboundingbox); + if (!this.hasSpawner) { + i = this.getYWithOffset(3); + BlockPos blockpos = new BlockPos(this.getXWithOffset(5, 6), i, this.getZWithOffset(5, 6)); + if (structureboundingbox.isVecInside(blockpos)) { + this.hasSpawner = true; + world.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityMobSpawner) { + ((TileEntityMobSpawner) tileentity).getSpawnerBaseLogic().setEntityName("Silverfish"); + } + } + } + + return true; + } + } + + public static class Prison extends StructureStrongholdPieces.Stronghold { + public Prison() { + } + + public Prison(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } + + public static StructureStrongholdPieces.Prison func_175860_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -1, 0, 9, 5, 11, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.Prison(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 8, 4, 10, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 1, 0); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 10, 3, 3, 10, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 1, 4, 3, 1, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 3, 4, 3, 3, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 7, 4, 3, 7, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(world, structureboundingbox, 4, 1, 9, 4, 3, 9, false, random, + StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 4, 4, 3, 6, Blocks.iron_bars.getDefaultState(), + Blocks.iron_bars.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 5, 7, 3, 5, Blocks.iron_bars.getDefaultState(), + Blocks.iron_bars.getDefaultState(), false); + this.setBlockState(world, Blocks.iron_bars.getDefaultState(), 4, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.iron_bars.getDefaultState(), 4, 3, 8, structureboundingbox); + this.setBlockState(world, + Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3)), 4, 1, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3) + 8), 4, 2, 2, + structureboundingbox); + this.setBlockState(world, + Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3)), 4, 1, 8, + structureboundingbox); + this.setBlockState(world, + Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3) + 8), 4, 2, 8, + structureboundingbox); + return true; + } + } + } + + public static class RightTurn extends StructureStrongholdPieces.LeftTurn { + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } else { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } + + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 4, 4, 4, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 1, 0); + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) { + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } else { + this.fillWithBlocks(world, structureboundingbox, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } + + public static class RoomCrossing extends StructureStrongholdPieces.Stronghold { + private static final List strongholdRoomCrossingChestContents = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), + new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1) }); + protected int roomType; + + public RoomCrossing() { + } + + public RoomCrossing(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + this.roomType = parRandom.nextInt(5); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("Type", this.roomType); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.roomType = nbttagcompound.getInteger("Type"); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 4, 1); + this.getNextComponentX((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 4); + this.getNextComponentZ((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 4); + } + + public static StructureStrongholdPieces.RoomCrossing func_175859_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -4, -1, 0, 11, 7, 11, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.RoomCrossing(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 10, 6, 10, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 4, 1, 0); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 10, 6, 3, 10, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 4, 0, 3, 6, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 10, 1, 4, 10, 3, 6, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + switch (this.roomType) { + case 0: + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 5, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 5, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 5, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), 4, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), 6, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), 5, 3, 4, structureboundingbox); + this.setBlockState(world, Blocks.torch.getDefaultState(), 5, 3, 6, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 4, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 4, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 4, 1, 6, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 6, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 6, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 6, 1, 6, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 5, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.stone_slab.getDefaultState(), 5, 1, 6, structureboundingbox); + break; + case 1: + for (int i1 = 0; i1 < 5; ++i1) { + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 1, 3 + i1, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 7, 1, 3 + i1, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3 + i1, 1, 3, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3 + i1, 1, 7, + structureboundingbox); + } + + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 5, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 5, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 5, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.flowing_water.getDefaultState(), 5, 4, 5, structureboundingbox); + break; + case 2: + for (int i = 1; i <= 9; ++i) { + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 1, 3, i, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 9, 3, i, structureboundingbox); + } + + for (int j = 1; j <= 9; ++j) { + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), j, 3, 1, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), j, 3, 9, structureboundingbox); + } + + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 5, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 5, 1, 6, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 5, 3, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 5, 3, 6, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 6, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 3, 5, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 6, 3, 5, structureboundingbox); + + for (int k = 1; k <= 3; ++k) { + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, k, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 6, k, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, k, 6, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 6, k, 6, structureboundingbox); + } + + this.setBlockState(world, Blocks.torch.getDefaultState(), 5, 3, 5, structureboundingbox); + + for (int l = 2; l <= 8; ++l) { + this.setBlockState(world, Blocks.planks.getDefaultState(), 2, 3, l, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 3, 3, l, structureboundingbox); + if (l <= 3 || l >= 7) { + this.setBlockState(world, Blocks.planks.getDefaultState(), 4, 3, l, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 5, 3, l, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 6, 3, l, structureboundingbox); + } + + this.setBlockState(world, Blocks.planks.getDefaultState(), 7, 3, l, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 3, l, structureboundingbox); + } + + this.setBlockState(world, + Blocks.ladder.getStateFromMeta( + this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), + 9, 1, 3, structureboundingbox); + this.setBlockState(world, + Blocks.ladder.getStateFromMeta( + this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), + 9, 2, 3, structureboundingbox); + this.setBlockState(world, + Blocks.ladder.getStateFromMeta( + this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), + 9, 3, 3, structureboundingbox); + this.generateChestContents(world, structureboundingbox, random, 3, 4, 8, + WeightedRandomChestContent.func_177629_a(strongholdRoomCrossingChestContents, + new WeightedRandomChestContent[] { Items.enchanted_book.getRandom(random) }), + 1 + random.nextInt(4)); + } + + return true; + } + } + } + + public static class Stairs extends StructureStrongholdPieces.Stronghold { + private boolean field_75024_a; + + public Stairs() { + } + + public Stairs(int parInt1, EaglercraftRandom parRandom, int parInt2, int parInt3) { + super(parInt1); + this.field_75024_a = true; + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(parRandom); + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + switch (this.coordBaseMode) { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(parInt2, 64, parInt3, parInt2 + 5 - 1, 74, parInt3 + 5 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(parInt2, 64, parInt3, parInt2 + 5 - 1, 74, parInt3 + 5 - 1); + } + + } + + public Stairs(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.field_75024_a = false; + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Source", this.field_75024_a); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.field_75024_a = nbttagcompound.getBoolean("Source"); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + if (this.field_75024_a) { + StructureStrongholdPieces.strongComponentType = StructureStrongholdPieces.Crossing.class; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } + + public static StructureStrongholdPieces.Stairs func_175863_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -7, 0, 5, 11, 5, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.Stairs(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 4, 10, 4, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 7, 0); + this.placeDoor(world, random, structureboundingbox, StructureStrongholdPieces.Stronghold.Door.OPENING, + 1, 1, 4); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 2, 6, 1, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 5, 1, structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 6, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 5, 2, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 4, 3, structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 5, 3, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 2, 4, 3, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 3, 3, structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 4, 3, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 2, 1, structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 3, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 2, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 1, 1, structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 2, 1, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 1, 2, structureboundingbox); + this.setBlockState(world, + Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 1, 3, + structureboundingbox); + return true; + } + } + } + + public static class Stairs2 extends StructureStrongholdPieces.Stairs { + public StructureStrongholdPieces.PieceWeight strongholdPieceWeight; + public StructureStrongholdPieces.PortalRoom strongholdPortalRoom; + public List field_75026_c = Lists.newArrayList(); + + public Stairs2() { + } + + public Stairs2(int parInt1, EaglercraftRandom parRandom, int parInt2, int parInt3) { + super(0, parRandom, parInt2, parInt3); + } + + public BlockPos getBoundingBoxCenter() { + return this.strongholdPortalRoom != null ? this.strongholdPortalRoom.getBoundingBoxCenter() + : super.getBoundingBoxCenter(); + } + } + + public static class StairsStraight extends StructureStrongholdPieces.Stronghold { + public StairsStraight() { + } + + public StairsStraight(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + } + + public static StructureStrongholdPieces.StairsStraight func_175861_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -7, 0, 5, 11, 8, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.StairsStraight(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 4, 10, 7, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 7, 0); + this.placeDoor(world, random, structureboundingbox, StructureStrongholdPieces.Stronghold.Door.OPENING, + 1, 1, 7); + int i = this.getMetadataWithOffset(Blocks.stone_stairs, 2); + + for (int j = 0; j < 6; ++j) { + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 1, 6 - j, 1 + j, + structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 2, 6 - j, 1 + j, + structureboundingbox); + this.setBlockState(world, Blocks.stone_stairs.getStateFromMeta(i), 3, 6 - j, 1 + j, + structureboundingbox); + if (j < 5) { + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 1, 5 - j, 1 + j, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 2, 5 - j, 1 + j, + structureboundingbox); + this.setBlockState(world, Blocks.stonebrick.getDefaultState(), 3, 5 - j, 1 + j, + structureboundingbox); + } + } + + return true; + } + } + } + + static class Stones extends StructureComponent.BlockSelector { + private Stones() { + } + + public void selectBlocks(EaglercraftRandom random, int var2, int var3, int var4, boolean flag) { + if (flag) { + float f = random.nextFloat(); + if (f < 0.2F) { + this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CRACKED_META); + } else if (f < 0.5F) { + this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.MOSSY_META); + } else if (f < 0.55F) { + this.blockstate = Blocks.monster_egg + .getStateFromMeta(BlockSilverfish.EnumType.STONEBRICK.getMetadata()); + } else { + this.blockstate = Blocks.stonebrick.getDefaultState(); + } + } else { + this.blockstate = Blocks.air.getDefaultState(); + } + + } + } + + public static class Straight extends StructureStrongholdPieces.Stronghold { + private boolean expandsX; + private boolean expandsZ; + + public Straight() { + } + + public Straight(int parInt1, EaglercraftRandom parRandom, StructureBoundingBox parStructureBoundingBox, + EnumFacing parEnumFacing) { + super(parInt1); + this.coordBaseMode = parEnumFacing; + this.field_143013_d = this.getRandomDoor(parRandom); + this.boundingBox = parStructureBoundingBox; + this.expandsX = parRandom.nextInt(2) == 0; + this.expandsZ = parRandom.nextInt(2) == 0; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Left", this.expandsX); + nbttagcompound.setBoolean("Right", this.expandsZ); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.expandsX = nbttagcompound.getBoolean("Left"); + this.expandsZ = nbttagcompound.getBoolean("Right"); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 1); + if (this.expandsX) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 2); + } + + if (this.expandsZ) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2) structurecomponent, list, random, 1, 2); + } + + } + + public static StructureStrongholdPieces.Straight func_175862_a(List parList, + EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, + int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, -1, -1, 0, 5, 5, 7, parEnumFacing); + return canStrongholdGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(parList, structureboundingbox) == null + ? new StructureStrongholdPieces.Straight(parInt4, parRandom, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.isLiquidInStructureBoundingBox(world, structureboundingbox)) { + return false; + } else { + this.fillWithRandomizedBlocks(world, structureboundingbox, 0, 0, 0, 4, 4, 6, true, random, + StructureStrongholdPieces.strongholdStones); + this.placeDoor(world, random, structureboundingbox, this.field_143013_d, 1, 1, 0); + this.placeDoor(world, random, structureboundingbox, StructureStrongholdPieces.Stronghold.Door.OPENING, + 1, 1, 6); + this.randomlyPlaceBlock(world, structureboundingbox, random, 0.1F, 1, 2, 1, + Blocks.torch.getDefaultState()); + this.randomlyPlaceBlock(world, structureboundingbox, random, 0.1F, 3, 2, 1, + Blocks.torch.getDefaultState()); + this.randomlyPlaceBlock(world, structureboundingbox, random, 0.1F, 1, 2, 5, + Blocks.torch.getDefaultState()); + this.randomlyPlaceBlock(world, structureboundingbox, random, 0.1F, 3, 2, 5, + Blocks.torch.getDefaultState()); + if (this.expandsX) { + this.fillWithBlocks(world, structureboundingbox, 0, 1, 2, 0, 3, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + if (this.expandsZ) { + this.fillWithBlocks(world, structureboundingbox, 4, 1, 2, 4, 3, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } + + abstract static class Stronghold extends StructureComponent { + protected StructureStrongholdPieces.Stronghold.Door field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + + public Stronghold() { + } + + protected Stronghold(int parInt1) { + super(parInt1); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setString("EntryDoor", this.field_143013_d.name()); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door + .valueOf(nbttagcompound.getString("EntryDoor")); + } + + protected void placeDoor(World worldIn, EaglercraftRandom parRandom, + StructureBoundingBox parStructureBoundingBox, StructureStrongholdPieces.Stronghold.Door parDoor, + int parInt1, int parInt2, int parInt3) { + switch (parDoor) { + case OPENING: + default: + this.fillWithBlocks(worldIn, parStructureBoundingBox, parInt1, parInt2, parInt3, parInt1 + 3 - 1, + parInt2 + 3 - 1, parInt3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + break; + case WOOD_DOOR: + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 1, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 2, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 2, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 2, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.oak_door.getDefaultState(), parInt1 + 1, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.oak_door.getStateFromMeta(8), parInt1 + 1, parInt2 + 1, parInt3, + parStructureBoundingBox); + break; + case GRATES: + this.setBlockState(worldIn, Blocks.air.getDefaultState(), parInt1 + 1, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), parInt1 + 1, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1 + 1, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1 + 2, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1 + 2, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), parInt1 + 2, parInt2, parInt3, + parStructureBoundingBox); + break; + case IRON_DOOR: + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 1, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 2, parInt2 + 2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 2, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), parInt1 + 2, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_door.getDefaultState(), parInt1 + 1, parInt2, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(8), parInt1 + 1, parInt2 + 1, parInt3, + parStructureBoundingBox); + this.setBlockState(worldIn, + Blocks.stone_button.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_button, 4)), + parInt1 + 2, parInt2 + 1, parInt3 + 1, parStructureBoundingBox); + this.setBlockState(worldIn, + Blocks.stone_button.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_button, 3)), + parInt1 + 2, parInt2 + 1, parInt3 - 1, parStructureBoundingBox); + } + + } + + protected StructureStrongholdPieces.Stronghold.Door getRandomDoor(EaglercraftRandom parRandom) { + int i = parRandom.nextInt(5); + switch (i) { + case 0: + case 1: + default: + return StructureStrongholdPieces.Stronghold.Door.OPENING; + case 2: + return StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR; + case 3: + return StructureStrongholdPieces.Stronghold.Door.GRATES; + case 4: + return StructureStrongholdPieces.Stronghold.Door.IRON_DOOR; + } + } + + protected StructureComponent getNextComponentNormal(StructureStrongholdPieces.Stairs2 parStairs2_1, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX + parInt1, this.boundingBox.minY + parInt2, this.boundingBox.minZ - 1, + this.coordBaseMode, this.getComponentType()); + case SOUTH: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX + parInt1, this.boundingBox.minY + parInt2, this.boundingBox.maxZ + 1, + this.coordBaseMode, this.getComponentType()); + case WEST: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX - 1, this.boundingBox.minY + parInt2, this.boundingBox.minZ + parInt1, + this.coordBaseMode, this.getComponentType()); + case EAST: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.maxX + 1, this.boundingBox.minY + parInt2, this.boundingBox.minZ + parInt1, + this.coordBaseMode, this.getComponentType()); + } + } + + return null; + } + + protected StructureComponent getNextComponentX(StructureStrongholdPieces.Stairs2 parStairs2_1, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX - 1, this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, + EnumFacing.WEST, this.getComponentType()); + case SOUTH: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX - 1, this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, + EnumFacing.WEST, this.getComponentType()); + case WEST: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX + parInt2, this.boundingBox.minY + parInt1, this.boundingBox.minZ - 1, + EnumFacing.NORTH, this.getComponentType()); + case EAST: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX + parInt2, this.boundingBox.minY + parInt1, this.boundingBox.minZ - 1, + EnumFacing.NORTH, this.getComponentType()); + } + } + + return null; + } + + protected StructureComponent getNextComponentZ(StructureStrongholdPieces.Stairs2 parStairs2_1, + List parList, EaglercraftRandom parRandom, int parInt1, int parInt2) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.maxX + 1, this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, + EnumFacing.EAST, this.getComponentType()); + case SOUTH: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.maxX + 1, this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, + EnumFacing.EAST, this.getComponentType()); + case WEST: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX + parInt2, this.boundingBox.minY + parInt1, this.boundingBox.maxZ + 1, + EnumFacing.SOUTH, this.getComponentType()); + case EAST: + return StructureStrongholdPieces.func_175953_c(parStairs2_1, parList, parRandom, + this.boundingBox.minX + parInt2, this.boundingBox.minY + parInt1, this.boundingBox.maxZ + 1, + EnumFacing.SOUTH, this.getComponentType()); + } + } + + return null; + } + + protected static boolean canStrongholdGoDeeper(StructureBoundingBox parStructureBoundingBox) { + return parStructureBoundingBox != null && parStructureBoundingBox.minY > 10; + } + + public static enum Door { + OPENING, WOOD_DOOR, GRATES, IRON_DOOR; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureVillagePieces.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureVillagePieces.java new file mode 100644 index 0000000..6c8aba8 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureVillagePieces.java @@ -0,0 +1,2057 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockSandStone; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockStairs; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockTorch; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.IEntityLivingData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.passive.EntityVillager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.EnumDyeColor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.WeightedRandomChestContent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome.WorldChunkManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureIO; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenVillage; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureBoundingBox; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.StructureComponent; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 StructureVillagePieces { + + static { + __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureVillagePieces"); + } + + public static void registerVillagePieces() { + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House1.class, "ViBH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Field1.class, "ViDF"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Field2.class, "ViF"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Torch.class, "ViL"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Hall.class, "ViPH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House4Garden.class, "ViSH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.WoodHut.class, "ViSmH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Church.class, "ViST"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House2.class, "ViS"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Start.class, "ViStart"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Path.class, "ViSR"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House3.class, "ViTRH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Well.class, "ViW"); + } + + public static List getStructureVillageWeightedPieceList( + EaglercraftRandom random, int parInt1) { + ArrayList arraylist = Lists.newArrayList(); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House4Garden.class, 4, + MathHelper.getRandomIntegerInRange(random, 2 + parInt1, 4 + parInt1 * 2))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Church.class, 20, + MathHelper.getRandomIntegerInRange(random, 0 + parInt1, 1 + parInt1))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House1.class, 20, + MathHelper.getRandomIntegerInRange(random, 0 + parInt1, 2 + parInt1))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.WoodHut.class, 3, + MathHelper.getRandomIntegerInRange(random, 2 + parInt1, 5 + parInt1 * 3))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Hall.class, 15, + MathHelper.getRandomIntegerInRange(random, 0 + parInt1, 2 + parInt1))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field1.class, 3, + MathHelper.getRandomIntegerInRange(random, 1 + parInt1, 4 + parInt1))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, + MathHelper.getRandomIntegerInRange(random, 2 + parInt1, 4 + parInt1 * 2))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, + MathHelper.getRandomIntegerInRange(random, 0, 1 + parInt1))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, + MathHelper.getRandomIntegerInRange(random, 0 + parInt1, 3 + parInt1 * 2))); + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) { + if (((StructureVillagePieces.PieceWeight) iterator.next()).villagePiecesLimit == 0) { + iterator.remove(); + } + } + + return arraylist; + } + + private static int func_75079_a(List parList) { + boolean flag = false; + int i = 0; + + for (StructureVillagePieces.PieceWeight structurevillagepieces$pieceweight : parList) { + if (structurevillagepieces$pieceweight.villagePiecesLimit > 0 + && structurevillagepieces$pieceweight.villagePiecesSpawned < structurevillagepieces$pieceweight.villagePiecesLimit) { + flag = true; + } + + i += structurevillagepieces$pieceweight.villagePieceWeight; + } + + return flag ? i : -1; + } + + private static StructureVillagePieces.Village func_176065_a(StructureVillagePieces.Start start, + StructureVillagePieces.PieceWeight weight, List rand, EaglercraftRandom facing, + int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { + Class oclass = weight.villagePieceClass; + Object object = null; + if (oclass == StructureVillagePieces.House4Garden.class) { + object = StructureVillagePieces.House4Garden.func_175858_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.Church.class) { + object = StructureVillagePieces.Church.func_175854_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.House1.class) { + object = StructureVillagePieces.House1.func_175850_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.WoodHut.class) { + object = StructureVillagePieces.WoodHut.func_175853_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.Hall.class) { + object = StructureVillagePieces.Hall.func_175857_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.Field1.class) { + object = StructureVillagePieces.Field1.func_175851_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.Field2.class) { + object = StructureVillagePieces.Field2.func_175852_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.House2.class) { + object = StructureVillagePieces.House2.func_175855_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } else if (oclass == StructureVillagePieces.House3.class) { + object = StructureVillagePieces.House3.func_175849_a(start, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + } + + return (StructureVillagePieces.Village) object; + } + + private static StructureVillagePieces.Village func_176067_c(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + int i = func_75079_a(start.structureVillageWeightedPieceList); + if (i <= 0) { + return null; + } else { + int j = 0; + + while (j < 5) { + ++j; + int k = facing.nextInt(i); + + for (StructureVillagePieces.PieceWeight structurevillagepieces$pieceweight : start.structureVillageWeightedPieceList) { + k -= structurevillagepieces$pieceweight.villagePieceWeight; + if (k < 0) { + if (!structurevillagepieces$pieceweight.canSpawnMoreVillagePiecesOfType(parInt4) + || structurevillagepieces$pieceweight == start.structVillagePieceWeight + && start.structureVillageWeightedPieceList.size() > 1) { + break; + } + + StructureVillagePieces.Village structurevillagepieces$village = func_176065_a(start, + structurevillagepieces$pieceweight, rand, facing, parInt1, parInt2, parInt3, + parEnumFacing, parInt4); + if (structurevillagepieces$village != null) { + ++structurevillagepieces$pieceweight.villagePiecesSpawned; + start.structVillagePieceWeight = structurevillagepieces$pieceweight; + if (!structurevillagepieces$pieceweight.canSpawnMoreVillagePieces()) { + start.structureVillageWeightedPieceList.remove(structurevillagepieces$pieceweight); + } + + return structurevillagepieces$village; + } + } + } + } + + StructureBoundingBox structureboundingbox = StructureVillagePieces.Torch.func_175856_a(start, rand, facing, + parInt1, parInt2, parInt3, parEnumFacing); + if (structureboundingbox != null) { + return new StructureVillagePieces.Torch(start, parInt4, facing, structureboundingbox, parEnumFacing); + } else { + return null; + } + } + } + + private static StructureComponent func_176066_d(StructureVillagePieces.Start start, List rand, + EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { + if (parInt4 > 50) { + return null; + } else if (Math.abs(parInt1 - start.getBoundingBox().minX) <= 112 + && Math.abs(parInt3 - start.getBoundingBox().minZ) <= 112) { + StructureVillagePieces.Village structurevillagepieces$village = func_176067_c(start, rand, facing, parInt1, + parInt2, parInt3, parEnumFacing, parInt4 + 1); + if (structurevillagepieces$village != null) { + int i = (structurevillagepieces$village.boundingBox.minX + + structurevillagepieces$village.boundingBox.maxX) / 2; + int j = (structurevillagepieces$village.boundingBox.minZ + + structurevillagepieces$village.boundingBox.maxZ) / 2; + int k = structurevillagepieces$village.boundingBox.maxX + - structurevillagepieces$village.boundingBox.minX; + int l = structurevillagepieces$village.boundingBox.maxZ + - structurevillagepieces$village.boundingBox.minZ; + int i1 = k > l ? k : l; + if (start.getWorldChunkManager().areBiomesViable(i, j, i1 / 2 + 4, MapGenVillage.villageSpawnBiomes)) { + rand.add(structurevillagepieces$village); + start.field_74932_i.add(structurevillagepieces$village); + return structurevillagepieces$village; + } + } + + return null; + } else { + return null; + } + } + + private static StructureComponent func_176069_e(StructureVillagePieces.Start start, List rand, + EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { + if (parInt4 > 3 + start.terrainType) { + return null; + } else if (Math.abs(parInt1 - start.getBoundingBox().minX) <= 112 + && Math.abs(parInt3 - start.getBoundingBox().minZ) <= 112) { + StructureBoundingBox structureboundingbox = StructureVillagePieces.Path.func_175848_a(start, rand, facing, + parInt1, parInt2, parInt3, parEnumFacing); + if (structureboundingbox != null && structureboundingbox.minY > 10) { + StructureVillagePieces.Path structurevillagepieces$path = new StructureVillagePieces.Path(start, + parInt4, facing, structureboundingbox, parEnumFacing); + int i = (structurevillagepieces$path.boundingBox.minX + structurevillagepieces$path.boundingBox.maxX) + / 2; + int j = (structurevillagepieces$path.boundingBox.minZ + structurevillagepieces$path.boundingBox.maxZ) + / 2; + int k = structurevillagepieces$path.boundingBox.maxX - structurevillagepieces$path.boundingBox.minX; + int l = structurevillagepieces$path.boundingBox.maxZ - structurevillagepieces$path.boundingBox.minZ; + int i1 = k > l ? k : l; + if (start.getWorldChunkManager().areBiomesViable(i, j, i1 / 2 + 4, MapGenVillage.villageSpawnBiomes)) { + rand.add(structurevillagepieces$path); + start.field_74930_j.add(structurevillagepieces$path); + return structurevillagepieces$path; + } + } + + return null; + } else { + return null; + } + } + + public static class Church extends StructureVillagePieces.Village { + public Church() { + } + + public Church(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + } + + public static StructureVillagePieces.Church func_175854_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 5, 12, 9, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.Church(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 12 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 3, 3, 7, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 1, 3, 9, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 3, 0, 8, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 3, 10, 0, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 10, 3, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 1, 4, 10, 3, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 4, 0, 4, 7, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 4, 4, 4, 7, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 8, 3, 4, 8, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 4, 3, 10, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 5, 3, 5, 7, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 9, 0, 4, 9, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 0, 4, 4, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 11, 2, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 11, 2, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 2, 11, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 2, 11, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 1, 1, 6, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 1, 1, 7, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 2, 1, 7, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 3, 1, 6, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 3, 1, 7, structureboundingbox); + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 1, 1, 5, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 1, 6, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 3, 1, 5, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 1)), 1, 2, 7, + structureboundingbox); + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 0)), 3, 2, 7, + structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 6, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 7, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 6, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 7, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 6, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 7, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 6, 4, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 7, 4, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 3, 6, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 3, 6, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 3, 8, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 2, + 4, 7, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), 1, 4, + 6, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), 3, + 4, 6, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 4, 5, + structureboundingbox); + int i = this.getMetadataWithOffset(Blocks.ladder, 4); + + for (int j = 1; j <= 9; ++j) { + this.setBlockState(world, Blocks.ladder.getStateFromMeta(i), 3, j, 3, structureboundingbox); + } + + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 2, 0, structureboundingbox); + this.placeDoorCurrentPosition(world, structureboundingbox, random, 2, 1, 0, + EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + if (this.getBlockStateFromPos(world, 2, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, 2, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, + -1, structureboundingbox); + } + + for (int l = 0; l < 9; ++l) { + for (int k = 0; k < 5; ++k) { + this.clearCurrentPositionBlocksUpwards(world, k, 12, l, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), k, -1, l, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 2, 1, 2, 1); + return true; + } + + protected int func_180779_c(int var1, int var2) { + return 2; + } + } + + public static class Field1 extends StructureVillagePieces.Village { + private Block cropTypeA; + private Block cropTypeB; + private Block cropTypeC; + private Block cropTypeD; + + public Field1() { + } + + public Field1(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + this.cropTypeA = this.func_151559_a(rand); + this.cropTypeB = this.func_151559_a(rand); + this.cropTypeC = this.func_151559_a(rand); + this.cropTypeD = this.func_151559_a(rand); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + nbttagcompound.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + nbttagcompound.setInteger("CC", Block.blockRegistry.getIDForObject(this.cropTypeC)); + nbttagcompound.setInteger("CD", Block.blockRegistry.getIDForObject(this.cropTypeD)); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.cropTypeA = Block.getBlockById(nbttagcompound.getInteger("CA")); + this.cropTypeB = Block.getBlockById(nbttagcompound.getInteger("CB")); + this.cropTypeC = Block.getBlockById(nbttagcompound.getInteger("CC")); + this.cropTypeD = Block.getBlockById(nbttagcompound.getInteger("CD")); + } + + private Block func_151559_a(EaglercraftRandom rand) { + switch (rand.nextInt(5)) { + case 0: + return Blocks.carrots; + case 1: + return Blocks.potatoes; + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field1 func_175851_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 13, 4, 9, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.Field1(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 12, 4, 8, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 1, 2, 0, 7, Blocks.farmland.getDefaultState(), + Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 1, 5, 0, 7, Blocks.farmland.getDefaultState(), + Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 0, 1, 8, 0, 7, Blocks.farmland.getDefaultState(), + Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 10, 0, 1, 11, 0, 7, Blocks.farmland.getDefaultState(), + Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 0, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 0, 0, 6, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 12, 0, 0, 12, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 11, 0, 0, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 8, 11, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 0, 1, 3, 0, 7, Blocks.water.getDefaultState(), + Blocks.water.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 0, 1, 9, 0, 7, Blocks.water.getDefaultState(), + Blocks.water.getDefaultState(), false); + + for (int i = 1; i <= 7; ++i) { + this.setBlockState(world, + this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 1, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 2, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 4, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 5, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeC.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 7, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeC.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 8, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeD.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 10, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeD.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 11, 1, i, + structureboundingbox); + } + + for (int k = 0; k < 9; ++k) { + for (int j = 0; j < 13; ++j) { + this.clearCurrentPositionBlocksUpwards(world, j, 4, k, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.dirt.getDefaultState(), j, -1, k, + structureboundingbox); + } + } + + return true; + } + } + + public static class Field2 extends StructureVillagePieces.Village { + private Block cropTypeA; + private Block cropTypeB; + + public Field2() { + } + + public Field2(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + this.cropTypeA = this.func_151560_a(rand); + this.cropTypeB = this.func_151560_a(rand); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + nbttagcompound.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.cropTypeA = Block.getBlockById(nbttagcompound.getInteger("CA")); + this.cropTypeB = Block.getBlockById(nbttagcompound.getInteger("CB")); + } + + private Block func_151560_a(EaglercraftRandom rand) { + switch (rand.nextInt(5)) { + case 0: + return Blocks.carrots; + case 1: + return Blocks.potatoes; + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field2 func_175852_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 7, 4, 9, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.Field2(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 6, 4, 8, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 1, 2, 0, 7, Blocks.farmland.getDefaultState(), + Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 0, 1, 5, 0, 7, Blocks.farmland.getDefaultState(), + Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 0, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 0, 0, 6, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 5, 0, 0, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 8, 5, 0, 8, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 0, 1, 3, 0, 7, Blocks.water.getDefaultState(), + Blocks.water.getDefaultState(), false); + + for (int i = 1; i <= 7; ++i) { + this.setBlockState(world, + this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 1, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 2, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 4, 1, i, + structureboundingbox); + this.setBlockState(world, + this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(random, 2, 7)), 5, 1, i, + structureboundingbox); + } + + for (int k = 0; k < 9; ++k) { + for (int j = 0; j < 7; ++j) { + this.clearCurrentPositionBlocksUpwards(world, j, 4, k, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.dirt.getDefaultState(), j, -1, k, + structureboundingbox); + } + } + + return true; + } + } + + public static class Hall extends StructureVillagePieces.Village { + public Hall() { + } + + public Hall(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + } + + public static StructureVillagePieces.Hall func_175857_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 9, 7, 11, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.Hall(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 7, 4, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 6, 8, 4, 10, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 0, 6, 8, 0, 10, Blocks.dirt.getDefaultState(), + Blocks.dirt.getDefaultState(), false); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 6, 0, 6, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 6, 2, 1, 10, Blocks.oak_fence.getDefaultState(), + Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 1, 6, 8, 1, 10, Blocks.oak_fence.getDefaultState(), + Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 10, 7, 1, 10, Blocks.oak_fence.getDefaultState(), + Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 1, 7, 0, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 0, 3, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 0, 0, 8, 3, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 7, 1, 0, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 5, 7, 1, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 7, 3, 0, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 5, 7, 3, 5, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 1, 8, 4, 1, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 4, 8, 4, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 2, 8, 5, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.planks.getDefaultState(), 0, 4, 2, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 0, 4, 3, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 4, 2, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 4, 3, structureboundingbox); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + + for (int k = -1; k <= 2; ++k) { + for (int l = 0; l <= 8; ++l) { + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(i), l, 4 + k, k, structureboundingbox); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j), l, 4 + k, 5 - k, + structureboundingbox); + } + } + + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 8, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 8, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 3, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 5, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 6, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 2, 1, 3, structureboundingbox); + this.setBlockState(world, Blocks.wooden_pressure_plate.getDefaultState(), 2, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 1, 1, 4, structureboundingbox); + this.setBlockState(world, + Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 3)), 2, 1, 4, + structureboundingbox); + this.setBlockState(world, + Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 1)), 1, 1, 3, + structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 5, 0, 1, 7, 0, 3, + Blocks.double_stone_slab.getDefaultState(), Blocks.double_stone_slab.getDefaultState(), false); + this.setBlockState(world, Blocks.double_stone_slab.getDefaultState(), 6, 1, 1, structureboundingbox); + this.setBlockState(world, Blocks.double_stone_slab.getDefaultState(), 6, 1, 2, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 2, 0, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, + structureboundingbox); + this.placeDoorCurrentPosition(world, structureboundingbox, random, 2, 1, 0, + EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + if (this.getBlockStateFromPos(world, 2, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, 2, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, + -1, structureboundingbox); + } + + this.setBlockState(world, Blocks.air.getDefaultState(), 6, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 6, 2, 5, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 6, + 3, 4, structureboundingbox); + this.placeDoorCurrentPosition(world, structureboundingbox, random, 6, 1, 5, + EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + + for (int i1 = 0; i1 < 5; ++i1) { + for (int j1 = 0; j1 < 9; ++j1) { + this.clearCurrentPositionBlocksUpwards(world, j1, 7, i1, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), j1, -1, i1, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 4, 1, 2, 2); + return true; + } + + protected int func_180779_c(int i, int j) { + return i == 0 ? 4 : super.func_180779_c(i, j); + } + } + + public static class House1 extends StructureVillagePieces.Village { + public House1() { + } + + public House1(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + } + + public static StructureVillagePieces.House1 func_175850_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 9, 9, 6, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.House1(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 9 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 7, 5, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 8, 0, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 8, 5, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 6, 1, 8, 6, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 7, 2, 8, 7, 3, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + + for (int k = -1; k <= 2; ++k) { + for (int l = 0; l <= 8; ++l) { + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(i), l, 6 + k, k, structureboundingbox); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j), l, 6 + k, 5 - k, + structureboundingbox); + } + } + + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 1, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 5, 8, 1, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 1, 0, 8, 1, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 0, 7, 1, 0, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 0, 0, 4, 0, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 5, 0, 4, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 2, 5, 8, 4, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 2, 0, 8, 4, 0, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 2, 1, 0, 4, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 5, 7, 4, 5, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 2, 1, 8, 4, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 7, 4, 0, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 5, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 6, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 5, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 6, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 3, 3, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 3, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 3, 3, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 3, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 5, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 6, 2, 5, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 1, 7, 4, 1, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 4, 7, 4, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 3, 4, 7, 3, 4, Blocks.bookshelf.getDefaultState(), + Blocks.bookshelf.getDefaultState(), false); + this.setBlockState(world, Blocks.planks.getDefaultState(), 7, 1, 4, structureboundingbox); + this.setBlockState(world, + Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 0)), 7, 1, 3, + structureboundingbox); + int j1 = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j1), 6, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j1), 5, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j1), 4, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j1), 3, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 6, 1, 3, structureboundingbox); + this.setBlockState(world, Blocks.wooden_pressure_plate.getDefaultState(), 6, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 1, 3, structureboundingbox); + this.setBlockState(world, Blocks.wooden_pressure_plate.getDefaultState(), 4, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.crafting_table.getDefaultState(), 7, 1, 1, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 2, 0, structureboundingbox); + this.placeDoorCurrentPosition(world, structureboundingbox, random, 1, 1, 0, + EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + if (this.getBlockStateFromPos(world, 1, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, 1, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 1, 0, + -1, structureboundingbox); + } + + for (int k1 = 0; k1 < 6; ++k1) { + for (int i1 = 0; i1 < 9; ++i1) { + this.clearCurrentPositionBlocksUpwards(world, i1, 9, k1, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), i1, -1, k1, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 2, 1, 2, 1); + return true; + } + + protected int func_180779_c(int parInt1, int parInt2) { + return 1; + } + } + + public static class House2 extends StructureVillagePieces.Village { + private static final List villageBlacksmithChestContents = Lists.newArrayList( + new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1) }); + private boolean hasMadeChest; + + public House2() { + } + + public House2(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + } + + public static StructureVillagePieces.House2 func_175855_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 10, 6, 7, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.House2(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Chest", this.hasMadeChest); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.hasMadeChest = nbttagcompound.getBoolean("Chest"); + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 9, 4, 6, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 9, 0, 6, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 0, 9, 4, 6, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 0, 9, 5, 6, Blocks.stone_slab.getDefaultState(), + Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 5, 1, 8, 5, 5, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 2, 3, 0, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 4, 0, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 0, 3, 4, 0, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 6, 0, 4, 6, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.setBlockState(world, Blocks.planks.getDefaultState(), 3, 3, 1, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 2, 3, 3, 2, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 3, 5, 3, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 3, 5, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 6, 5, 3, 6, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 1, 0, 5, 3, 0, Blocks.oak_fence.getDefaultState(), + Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 9, 1, 0, 9, 3, 0, Blocks.oak_fence.getDefaultState(), + Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 1, 4, 9, 4, 6, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.setBlockState(world, Blocks.flowing_lava.getDefaultState(), 7, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.flowing_lava.getDefaultState(), 8, 1, 5, structureboundingbox); + this.setBlockState(world, Blocks.iron_bars.getDefaultState(), 9, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.iron_bars.getDefaultState(), 9, 2, 4, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 7, 2, 4, 8, 2, 5, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 6, 1, 3, structureboundingbox); + this.setBlockState(world, Blocks.furnace.getDefaultState(), 6, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.furnace.getDefaultState(), 6, 3, 3, structureboundingbox); + this.setBlockState(world, Blocks.double_stone_slab.getDefaultState(), 8, 1, 1, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 2, 6, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 2, 6, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 2, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.wooden_pressure_plate.getDefaultState(), 2, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 1, 1, 5, structureboundingbox); + this.setBlockState(world, + Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 3)), 2, 1, 5, + structureboundingbox); + this.setBlockState(world, + Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 1)), 1, 1, 4, + structureboundingbox); + if (!this.hasMadeChest && structureboundingbox.isVecInside( + new BlockPos(this.getXWithOffset(5, 5), this.getYWithOffset(1), this.getZWithOffset(5, 5)))) { + this.hasMadeChest = true; + this.generateChestContents(world, structureboundingbox, random, 5, 1, 5, villageBlacksmithChestContents, + 3 + random.nextInt(6)); + } + + for (int i = 6; i <= 8; ++i) { + if (this.getBlockStateFromPos(world, i, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, i, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), i, + 0, -1, structureboundingbox); + } + } + + for (int k = 0; k < 7; ++k) { + for (int j = 0; j < 10; ++j) { + this.clearCurrentPositionBlocksUpwards(world, j, 6, k, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), j, -1, k, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 7, 1, 1, 1); + return true; + } + + protected int func_180779_c(int var1, int var2) { + return 3; + } + } + + public static class House3 extends StructureVillagePieces.Village { + public House3() { + } + + public House3(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + } + + public static StructureVillagePieces.House3 func_175849_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 9, 7, 12, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.House3(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 7, 4, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 1, 6, 8, 4, 10, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 0, 5, 8, 0, 10, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 1, 7, 0, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 0, 3, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 8, 0, 0, 8, 3, 10, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 0, 7, 2, 0, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 5, 2, 1, 5, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 2, 0, 6, 2, 3, 10, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 0, 10, 7, 3, 10, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 0, 7, 3, 0, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 2, 5, 2, 3, 5, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 1, 8, 4, 1, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 4, 3, 4, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 5, 2, 8, 5, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.planks.getDefaultState(), 0, 4, 2, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 0, 4, 3, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 4, 2, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 4, 3, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 4, 4, structureboundingbox); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + + for (int k = -1; k <= 2; ++k) { + for (int l = 0; l <= 8; ++l) { + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(i), l, 4 + k, k, structureboundingbox); + if ((k > -1 || l <= 1) && (k > 0 || l <= 3) && (k > 1 || l <= 4 || l >= 6)) { + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(j), l, 4 + k, 5 - k, + structureboundingbox); + } + } + } + + this.fillWithBlocks(world, structureboundingbox, 3, 4, 5, 3, 4, 10, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 7, 4, 2, 7, 4, 10, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 5, 4, 4, 5, 10, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 6, 5, 4, 6, 5, 10, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 5, 6, 3, 5, 6, 10, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + int k1 = this.getMetadataWithOffset(Blocks.oak_stairs, 0); + + for (int l1 = 4; l1 >= 1; --l1) { + this.setBlockState(world, Blocks.planks.getDefaultState(), l1, 2 + l1, 7 - l1, structureboundingbox); + + for (int i1 = 8 - l1; i1 <= 10; ++i1) { + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(k1), l1, 2 + l1, i1, + structureboundingbox); + } + } + + int i2 = this.getMetadataWithOffset(Blocks.oak_stairs, 1); + this.setBlockState(world, Blocks.planks.getDefaultState(), 6, 6, 3, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 7, 5, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(i2), 6, 6, 4, structureboundingbox); + + for (int j2 = 6; j2 <= 8; ++j2) { + for (int j1 = 5; j1 <= 10; ++j1) { + this.setBlockState(world, Blocks.oak_stairs.getStateFromMeta(i2), j2, 12 - j2, j1, + structureboundingbox); + } + } + + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 4, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 5, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 6, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 8, 2, 1, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 8, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 8, 2, 5, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 8, 2, 6, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 7, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 8, 2, 8, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 8, 2, 9, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 2, 2, 6, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 2, 7, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 2, 8, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 2, 2, 9, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 4, 4, 10, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 5, 4, 10, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 6, 4, 10, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 5, 5, 10, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 2, 0, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, + structureboundingbox); + this.placeDoorCurrentPosition(world, structureboundingbox, random, 2, 1, 0, + EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + this.fillWithBlocks(world, structureboundingbox, 1, 0, -1, 3, 2, -1, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + if (this.getBlockStateFromPos(world, 2, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, 2, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, + -1, structureboundingbox); + } + + for (int k2 = 0; k2 < 5; ++k2) { + for (int i3 = 0; i3 < 9; ++i3) { + this.clearCurrentPositionBlocksUpwards(world, i3, 7, k2, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), i3, -1, k2, + structureboundingbox); + } + } + + for (int l2 = 5; l2 < 11; ++l2) { + for (int j3 = 2; j3 < 9; ++j3) { + this.clearCurrentPositionBlocksUpwards(world, j3, 7, l2, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), j3, -1, l2, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 4, 1, 2, 2); + return true; + } + } + + public static class House4Garden extends StructureVillagePieces.Village { + private boolean isRoofAccessible; + + public House4Garden() { + } + + public House4Garden(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + this.isRoofAccessible = rand.nextBoolean(); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setBoolean("Terrace", this.isRoofAccessible); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.isRoofAccessible = nbttagcompound.getBoolean("Terrace"); + } + + public static StructureVillagePieces.House4Garden func_175858_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 5, 6, 5, parEnumFacing); + return StructureComponent.findIntersecting(rand, structureboundingbox) != null ? null + : new StructureVillagePieces.House4Garden(start, parInt4, facing, structureboundingbox, + parEnumFacing); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 4, 0, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 4, 0, 4, 4, 4, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 4, 1, 3, 4, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 0, 3, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 1, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.cobblestone.getDefaultState(), 4, 3, 4, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 3, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 4, 1, 1, 4, 3, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 4, 3, 3, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 2, 2, 4, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 4, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 1, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 1, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 1, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 2, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 3, 3, 0, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 3, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.planks.getDefaultState(), 3, 1, 0, structureboundingbox); + if (this.getBlockStateFromPos(world, 2, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, 2, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, + -1, structureboundingbox); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 3, 3, 3, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + if (this.isRoofAccessible) { + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 0, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 2, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 3, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 5, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 0, 5, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 5, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 2, 5, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 3, 5, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 5, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 5, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 5, 2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 5, 3, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 0, 5, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 0, 5, 2, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 0, 5, 3, structureboundingbox); + } + + if (this.isRoofAccessible) { + int i = this.getMetadataWithOffset(Blocks.ladder, 3); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(i), 3, 1, 3, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(i), 3, 2, 3, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(i), 3, 3, 3, structureboundingbox); + this.setBlockState(world, Blocks.ladder.getStateFromMeta(i), 3, 4, 3, structureboundingbox); + } + + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, + structureboundingbox); + + for (int k = 0; k < 5; ++k) { + for (int j = 0; j < 5; ++j) { + this.clearCurrentPositionBlocksUpwards(world, j, 6, k, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), j, -1, k, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 1, 1, 2, 1); + return true; + } + } + + public static class Path extends StructureVillagePieces.Road { + private int length; + + public Path() { + } + + public Path(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + this.length = Math.max(parStructureBoundingBox.getXSize(), parStructureBoundingBox.getZSize()); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("Length", this.length); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.length = nbttagcompound.getInteger("Length"); + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + boolean flag = false; + + for (int i = random.nextInt(5); i < this.length - 8; i += 2 + random.nextInt(5)) { + StructureComponent structurecomponent1 = this + .getNextComponentNN((StructureVillagePieces.Start) structurecomponent, list, random, 0, i); + if (structurecomponent1 != null) { + i += Math.max(structurecomponent1.boundingBox.getXSize(), + structurecomponent1.boundingBox.getZSize()); + flag = true; + } + } + + for (int j = random.nextInt(5); j < this.length - 8; j += 2 + random.nextInt(5)) { + StructureComponent structurecomponent2 = this + .getNextComponentPP((StructureVillagePieces.Start) structurecomponent, list, random, 0, j); + if (structurecomponent2 != null) { + j += Math.max(structurecomponent2.boundingBox.getXSize(), + structurecomponent2.boundingBox.getZSize()); + flag = true; + } + } + + if (flag && random.nextInt(3) > 0 && this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, + EnumFacing.WEST, this.getComponentType()); + break; + case SOUTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, + EnumFacing.WEST, this.getComponentType()); + break; + case WEST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, + EnumFacing.NORTH, this.getComponentType()); + break; + case EAST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, + EnumFacing.NORTH, this.getComponentType()); + } + } + + if (flag && random.nextInt(3) > 0 && this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, + EnumFacing.EAST, this.getComponentType()); + break; + case SOUTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, + EnumFacing.EAST, this.getComponentType()); + break; + case WEST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, + EnumFacing.SOUTH, this.getComponentType()); + break; + case EAST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, + random, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, + EnumFacing.SOUTH, this.getComponentType()); + } + } + + } + + public static StructureBoundingBox func_175848_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing) { + for (int i = 7 * MathHelper.getRandomIntegerInRange(facing, 3, 5); i >= 7; i -= 7) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 3, 3, i, parEnumFacing); + if (StructureComponent.findIntersecting(rand, structureboundingbox) == null) { + return structureboundingbox; + } + } + + return null; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + IBlockState iblockstate = this.func_175847_a(Blocks.gravel.getDefaultState()); + IBlockState iblockstate1 = this.func_175847_a(Blocks.cobblestone.getDefaultState()); + + for (int i = this.boundingBox.minX; i <= this.boundingBox.maxX; ++i) { + for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j) { + BlockPos blockpos = new BlockPos(i, 64, j); + if (structureboundingbox.isVecInside(blockpos)) { + blockpos = world.getTopSolidOrLiquidBlock(blockpos).down(); + world.setBlockState(blockpos, iblockstate, 2); + world.setBlockState(blockpos.down(), iblockstate1, 2); + } + } + } + + return true; + } + } + + public static class PieceWeight { + public Class villagePieceClass; + public final int villagePieceWeight; + public int villagePiecesSpawned; + public int villagePiecesLimit; + + public PieceWeight(Class parClass1, int parInt1, int parInt2) { + this.villagePieceClass = parClass1; + this.villagePieceWeight = parInt1; + this.villagePiecesLimit = parInt2; + } + + public boolean canSpawnMoreVillagePiecesOfType(int parInt1) { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + + public boolean canSpawnMoreVillagePieces() { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + } + + public abstract static class Road extends StructureVillagePieces.Village { + public Road() { + } + + protected Road(StructureVillagePieces.Start start, int type) { + super(start, type); + } + } + + public static class Start extends StructureVillagePieces.Well { + public WorldChunkManager worldChunkMngr; + public boolean inDesert; + public int terrainType; + public StructureVillagePieces.PieceWeight structVillagePieceWeight; + public List structureVillageWeightedPieceList; + public List field_74932_i = Lists.newArrayList(); + public List field_74930_j = Lists.newArrayList(); + + public Start() { + } + + public Start(WorldChunkManager chunkManagerIn, int parInt1, EaglercraftRandom rand, int parInt2, int parInt3, + List parList, int parInt4) { + super((StructureVillagePieces.Start) null, 0, rand, parInt2, parInt3); + this.worldChunkMngr = chunkManagerIn; + this.structureVillageWeightedPieceList = parList; + this.terrainType = parInt4; + BiomeGenBase biomegenbase = chunkManagerIn.getBiomeGenerator(new BlockPos(parInt2, 0, parInt3), + BiomeGenBase.field_180279_ad); + this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; + this.func_175846_a(this.inDesert); + } + + public WorldChunkManager getWorldChunkManager() { + return this.worldChunkMngr; + } + } + + public static class Torch extends StructureVillagePieces.Village { + public Torch() { + } + + public Torch(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + } + + public static StructureBoundingBox func_175856_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 3, 4, 2, parEnumFacing); + return StructureComponent.findIntersecting(rand, structureboundingbox) != null ? null + : structureboundingbox; + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 2, 3, 1, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 0, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 2, 0, structureboundingbox); + this.setBlockState(world, Blocks.wool.getStateFromMeta(EnumDyeColor.WHITE.getDyeDamage()), 1, 3, 0, + structureboundingbox); + boolean flag = this.coordBaseMode == EnumFacing.EAST || this.coordBaseMode == EnumFacing.NORTH; + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), + flag ? 2 : 0, 3, 0, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, + structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), + flag ? 0 : 2, 3, 0, structureboundingbox); + this.setBlockState(world, + Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, + 3, -1, structureboundingbox); + return true; + } + } + + abstract static class Village extends StructureComponent { + protected int field_143015_k = -1; + private int villagersSpawned; + private boolean isDesertVillage; + + public Village() { + } + + protected Village(StructureVillagePieces.Start start, int type) { + super(type); + if (start != null) { + this.isDesertVillage = start.inDesert; + } + + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setInteger("HPos", this.field_143015_k); + nbttagcompound.setInteger("VCount", this.villagersSpawned); + nbttagcompound.setBoolean("Desert", this.isDesertVillage); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + this.field_143015_k = nbttagcompound.getInteger("HPos"); + this.villagersSpawned = nbttagcompound.getInteger("VCount"); + this.isDesertVillage = nbttagcompound.getBoolean("Desert"); + } + + protected StructureComponent getNextComponentNN(StructureVillagePieces.Start start, + List rand, EaglercraftRandom parRandom, int parInt1, int parInt2) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.minX - 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.WEST, + this.getComponentType()); + case SOUTH: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.minX - 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.WEST, + this.getComponentType()); + case WEST: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.minZ - 1, EnumFacing.NORTH, + this.getComponentType()); + case EAST: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.minZ - 1, EnumFacing.NORTH, + this.getComponentType()); + } + } + + return null; + } + + protected StructureComponent getNextComponentPP(StructureVillagePieces.Start start, + List rand, EaglercraftRandom parRandom, int parInt1, int parInt2) { + if (this.coordBaseMode != null) { + switch (this.coordBaseMode) { + case NORTH: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.maxX + 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.EAST, + this.getComponentType()); + case SOUTH: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.maxX + 1, + this.boundingBox.minY + parInt1, this.boundingBox.minZ + parInt2, EnumFacing.EAST, + this.getComponentType()); + case WEST: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, + this.getComponentType()); + case EAST: + return StructureVillagePieces.func_176066_d(start, rand, parRandom, this.boundingBox.minX + parInt2, + this.boundingBox.minY + parInt1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, + this.getComponentType()); + } + } + + return null; + } + + protected int getAverageGroundLevel(World worldIn, StructureBoundingBox parStructureBoundingBox) { + int i = 0; + int j = 0; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) { + for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) { + blockpos$mutableblockpos.func_181079_c(l, 64, k); + if (parStructureBoundingBox.isVecInside(blockpos$mutableblockpos)) { + i += Math.max(worldIn.getTopSolidOrLiquidBlock(blockpos$mutableblockpos).getY(), + worldIn.provider.getAverageGroundLevel()); + ++j; + } + } + } + + if (j == 0) { + return -1; + } else { + return i / j; + } + } + + protected static boolean canVillageGoDeeper(StructureBoundingBox parStructureBoundingBox) { + return parStructureBoundingBox != null && parStructureBoundingBox.minY > 10; + } + + protected void spawnVillagers(World worldIn, StructureBoundingBox parStructureBoundingBox, int parInt1, + int parInt2, int parInt3, int parInt4) { + if (this.villagersSpawned < parInt4) { + for (int i = this.villagersSpawned; i < parInt4; ++i) { + int j = this.getXWithOffset(parInt1 + i, parInt3); + int k = this.getYWithOffset(parInt2); + int l = this.getZWithOffset(parInt1 + i, parInt3); + if (!parStructureBoundingBox.isVecInside(new BlockPos(j, k, l))) { + break; + } + + ++this.villagersSpawned; + EntityVillager entityvillager = new EntityVillager(worldIn); + entityvillager.setLocationAndAngles((double) j + 0.5D, (double) k, (double) l + 0.5D, 0.0F, 0.0F); + entityvillager.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityvillager)), + (IEntityLivingData) null); + entityvillager.setProfession(this.func_180779_c(i, entityvillager.getProfession())); + worldIn.spawnEntityInWorld(entityvillager); + } + + } + } + + protected int func_180779_c(int var1, int i) { + return i; + } + + protected IBlockState func_175847_a(IBlockState parIBlockState) { + if (this.isDesertVillage) { + if (parIBlockState.getBlock() == Blocks.log || parIBlockState.getBlock() == Blocks.log2) { + return Blocks.sandstone.getDefaultState(); + } + + if (parIBlockState.getBlock() == Blocks.cobblestone) { + return Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.DEFAULT.getMetadata()); + } + + if (parIBlockState.getBlock() == Blocks.planks) { + return Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()); + } + + if (parIBlockState.getBlock() == Blocks.oak_stairs) { + return Blocks.sandstone_stairs.getDefaultState().withProperty(BlockStairs.FACING, + parIBlockState.getValue(BlockStairs.FACING)); + } + + if (parIBlockState.getBlock() == Blocks.stone_stairs) { + return Blocks.sandstone_stairs.getDefaultState().withProperty(BlockStairs.FACING, + parIBlockState.getValue(BlockStairs.FACING)); + } + + if (parIBlockState.getBlock() == Blocks.gravel) { + return Blocks.sandstone.getDefaultState(); + } + } + + return parIBlockState; + } + + protected void setBlockState(World world, IBlockState iblockstate, int i, int j, int k, + StructureBoundingBox structureboundingbox) { + IBlockState iblockstate1 = this.func_175847_a(iblockstate); + super.setBlockState(world, iblockstate1, i, j, k, structureboundingbox); + } + + protected void fillWithBlocks(World world, StructureBoundingBox structureboundingbox, int i, int j, int k, + int l, int i1, int j1, IBlockState iblockstate, IBlockState iblockstate1, boolean flag) { + IBlockState iblockstate2 = this.func_175847_a(iblockstate); + IBlockState iblockstate3 = this.func_175847_a(iblockstate1); + super.fillWithBlocks(world, structureboundingbox, i, j, k, l, i1, j1, iblockstate2, iblockstate3, flag); + } + + protected void replaceAirAndLiquidDownwards(World world, IBlockState iblockstate, int i, int j, int k, + StructureBoundingBox structureboundingbox) { + IBlockState iblockstate1 = this.func_175847_a(iblockstate); + super.replaceAirAndLiquidDownwards(world, iblockstate1, i, j, k, structureboundingbox); + } + + protected void func_175846_a(boolean parFlag) { + this.isDesertVillage = parFlag; + } + } + + public static class Well extends StructureVillagePieces.Village { + public Well() { + } + + public Well(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, int parInt2, int parInt3) { + super(start, parInt1); + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(rand); + switch (this.coordBaseMode) { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(parInt2, 64, parInt3, parInt2 + 6 - 1, 78, parInt3 + 6 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(parInt2, 64, parInt3, parInt2 + 6 - 1, 78, parInt3 + 6 - 1); + } + + } + + public void buildComponent(StructureComponent structurecomponent, List list, + EaglercraftRandom random) { + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, random, + this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, EnumFacing.WEST, + this.getComponentType()); + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, random, + this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, EnumFacing.EAST, + this.getComponentType()); + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, random, + this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, EnumFacing.NORTH, + this.getComponentType()); + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start) structurecomponent, list, random, + this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, + this.getComponentType()); + } + + public boolean addComponentParts(World world, EaglercraftRandom var2, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 0, 1, 4, 12, 4, Blocks.cobblestone.getDefaultState(), + Blocks.flowing_water.getDefaultState(), false); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 12, 2, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 3, 12, 2, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 2, 12, 3, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 3, 12, 3, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 13, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 14, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 13, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 14, 1, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 13, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 1, 14, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 13, 4, structureboundingbox); + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), 4, 14, 4, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 1, 15, 1, 4, 15, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + + for (int i = 0; i <= 5; ++i) { + for (int j = 0; j <= 5; ++j) { + if (j == 0 || j == 5 || i == 0 || i == 5) { + this.setBlockState(world, Blocks.gravel.getDefaultState(), j, 11, i, structureboundingbox); + this.clearCurrentPositionBlocksUpwards(world, j, 12, i, structureboundingbox); + } + } + } + + return true; + } + } + + public static class WoodHut extends StructureVillagePieces.Village { + private boolean isTallHouse; + private int tablePosition; + + public WoodHut() { + } + + public WoodHut(StructureVillagePieces.Start start, int parInt1, EaglercraftRandom rand, + StructureBoundingBox parStructureBoundingBox, EnumFacing facing) { + super(start, parInt1); + this.coordBaseMode = facing; + this.boundingBox = parStructureBoundingBox; + this.isTallHouse = rand.nextBoolean(); + this.tablePosition = rand.nextInt(3); + } + + protected void writeStructureToNBT(NBTTagCompound nbttagcompound) { + super.writeStructureToNBT(nbttagcompound); + nbttagcompound.setInteger("T", this.tablePosition); + nbttagcompound.setBoolean("C", this.isTallHouse); + } + + protected void readStructureFromNBT(NBTTagCompound nbttagcompound) { + super.readStructureFromNBT(nbttagcompound); + this.tablePosition = nbttagcompound.getInteger("T"); + this.isTallHouse = nbttagcompound.getBoolean("C"); + } + + public static StructureVillagePieces.WoodHut func_175853_a(StructureVillagePieces.Start start, + List rand, EaglercraftRandom facing, int parInt1, int parInt2, int parInt3, + EnumFacing parEnumFacing, int parInt4) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(parInt1, + parInt2, parInt3, 0, 0, 0, 4, 6, 5, parEnumFacing); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(rand, structureboundingbox) == null + ? new StructureVillagePieces.WoodHut(start, parInt4, facing, structureboundingbox, + parEnumFacing) + : null; + } + + public boolean addComponentParts(World world, EaglercraftRandom random, + StructureBoundingBox structureboundingbox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(world, structureboundingbox); + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(world, structureboundingbox, 1, 1, 1, 3, 5, 4, Blocks.air.getDefaultState(), + Blocks.air.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 0, 0, 3, 0, 4, Blocks.cobblestone.getDefaultState(), + Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 0, 1, 2, 0, 3, Blocks.dirt.getDefaultState(), + Blocks.dirt.getDefaultState(), false); + if (this.isTallHouse) { + this.fillWithBlocks(world, structureboundingbox, 1, 4, 1, 2, 4, 3, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + } else { + this.fillWithBlocks(world, structureboundingbox, 1, 5, 1, 2, 5, 3, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + } + + this.setBlockState(world, Blocks.log.getDefaultState(), 1, 4, 0, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 2, 4, 0, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 1, 4, 4, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 2, 4, 4, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 4, 1, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 4, 2, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 0, 4, 3, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 3, 4, 1, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 3, 4, 2, structureboundingbox); + this.setBlockState(world, Blocks.log.getDefaultState(), 3, 4, 3, structureboundingbox); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 0, 0, 3, 0, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 0, 3, 3, 0, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 4, 0, 3, 4, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 4, 3, 3, 4, Blocks.log.getDefaultState(), + Blocks.log.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 0, 1, 1, 0, 3, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 3, 1, 1, 3, 3, 3, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 0, 2, 3, 0, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(world, structureboundingbox, 1, 1, 4, 2, 3, 4, Blocks.planks.getDefaultState(), + Blocks.planks.getDefaultState(), false); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureboundingbox); + this.setBlockState(world, Blocks.glass_pane.getDefaultState(), 3, 2, 2, structureboundingbox); + if (this.tablePosition > 0) { + this.setBlockState(world, Blocks.oak_fence.getDefaultState(), this.tablePosition, 1, 3, + structureboundingbox); + this.setBlockState(world, Blocks.wooden_pressure_plate.getDefaultState(), this.tablePosition, 2, 3, + structureboundingbox); + } + + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 1, 0, structureboundingbox); + this.setBlockState(world, Blocks.air.getDefaultState(), 1, 2, 0, structureboundingbox); + this.placeDoorCurrentPosition(world, structureboundingbox, random, 1, 1, 0, + EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + if (this.getBlockStateFromPos(world, 1, 0, -1, structureboundingbox).getBlock() + .getMaterial() == Material.air + && this.getBlockStateFromPos(world, 1, -1, -1, structureboundingbox).getBlock() + .getMaterial() != Material.air) { + this.setBlockState(world, + Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 1, 0, + -1, structureboundingbox); + } + + for (int i = 0; i < 5; ++i) { + for (int j = 0; j < 4; ++j) { + this.clearCurrentPositionBlocksUpwards(world, j, 6, i, structureboundingbox); + this.replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getDefaultState(), j, -1, i, + structureboundingbox); + } + } + + this.spawnVillagers(world, structureboundingbox, 1, 1, 2, 1); + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/NodeProcessor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/NodeProcessor.java new file mode 100644 index 0000000..7da76d1 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/NodeProcessor.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IntHashMap; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class NodeProcessor { + + static { + __checkIntegratedContextValid("net/minecraft/world/pathfinder/NodeProcessor"); + } + + protected IBlockAccess blockaccess; + protected IntHashMap pointMap = new IntHashMap(); + protected int entitySizeX; + protected int entitySizeY; + protected int entitySizeZ; + + public void initProcessor(IBlockAccess iblockaccessIn, Entity entityIn) { + this.blockaccess = iblockaccessIn; + this.pointMap.clearMap(); + this.entitySizeX = MathHelper.floor_float(entityIn.width + 1.0F); + this.entitySizeY = MathHelper.floor_float(entityIn.height + 1.0F); + this.entitySizeZ = MathHelper.floor_float(entityIn.width + 1.0F); + } + + /**+ + * This method is called when all nodes have been processed and + * PathEntity is created.\n {@link + * net.minecraft.world.pathfinder.WalkNodeProcessor + * WalkNodeProcessor} uses this to change its field {@link + * net.minecraft.world.pathfinder.WalkNodeProcessor#avoidsWater + * avoidsWater} + */ + public void postProcess() { + } + + /**+ + * Returns a mapped point or creates and adds one + */ + protected PathPoint openPoint(int x, int y, int z) { + int i = PathPoint.makeHash(x, y, z); + PathPoint pathpoint = (PathPoint) this.pointMap.lookup(i); + if (pathpoint == null) { + pathpoint = new PathPoint(x, y, z); + this.pointMap.addKey(i, pathpoint); + } + + return pathpoint; + } + + public abstract PathPoint getPathPointTo(Entity var1); + + public abstract PathPoint getPathPointToCoords(Entity var1, double var2, double var4, double var6); + + public abstract int findPathOptions(PathPoint[] var1, Entity var2, PathPoint var3, PathPoint var4, float var5); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/SwimNodeProcessor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/SwimNodeProcessor.java new file mode 100644 index 0000000..7135ecb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/SwimNodeProcessor.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumFacing; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder.NodeProcessor; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SwimNodeProcessor extends NodeProcessor { + + static { + __checkIntegratedContextValid("net/minecraft/world/pathfinder/SwimNodeProcessor"); + } + + public void initProcessor(IBlockAccess iblockaccess, Entity entity) { + super.initProcessor(iblockaccess, entity); + } + + /**+ + * This method is called when all nodes have been processed and + * PathEntity is created.\n {@link + * net.minecraft.world.pathfinder.WalkNodeProcessor + * WalkNodeProcessor} uses this to change its field {@link + * net.minecraft.world.pathfinder.WalkNodeProcessor#avoidsWater + * avoidsWater} + */ + public void postProcess() { + super.postProcess(); + } + + /**+ + * Returns given entity's position as PathPoint + */ + public PathPoint getPathPointTo(Entity entity) { + return this.openPoint(MathHelper.floor_double(entity.getEntityBoundingBox().minX), + MathHelper.floor_double(entity.getEntityBoundingBox().minY + 0.5D), + MathHelper.floor_double(entity.getEntityBoundingBox().minZ)); + } + + /**+ + * Returns PathPoint for given coordinates + */ + public PathPoint getPathPointToCoords(Entity entity, double d0, double d1, double d2) { + return this.openPoint(MathHelper.floor_double(d0 - (double) (entity.width / 2.0F)), + MathHelper.floor_double(d1 + 0.5D), MathHelper.floor_double(d2 - (double) (entity.width / 2.0F))); + } + + public int findPathOptions(PathPoint[] apathpoint, Entity entity, PathPoint pathpoint, PathPoint pathpoint1, + float f) { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) { + PathPoint pathpoint2 = this.getSafePoint(entity, pathpoint.xCoord + enumfacing.getFrontOffsetX(), + pathpoint.yCoord + enumfacing.getFrontOffsetY(), pathpoint.zCoord + enumfacing.getFrontOffsetZ()); + if (pathpoint2 != null && !pathpoint2.visited && pathpoint2.distanceTo(pathpoint1) < f) { + apathpoint[i++] = pathpoint2; + } + } + + return i; + } + + /**+ + * Returns a point that the entity can safely move to + */ + private PathPoint getSafePoint(Entity entityIn, int x, int y, int z) { + int i = this.func_176186_b(entityIn, x, y, z); + return i == -1 ? this.openPoint(x, y, z) : null; + } + + private int func_176186_b(Entity entityIn, int x, int y, int z) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i = x; i < x + this.entitySizeX; ++i) { + for (int j = y; j < y + this.entitySizeY; ++j) { + for (int k = z; k < z + this.entitySizeZ; ++k) { + Block block = this.blockaccess.getBlockState(blockpos$mutableblockpos.func_181079_c(i, j, k)) + .getBlock(); + if (block.getMaterial() != Material.water) { + return 0; + } + } + } + } + + return -1; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/WalkNodeProcessor.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/WalkNodeProcessor.java new file mode 100644 index 0000000..4406ed4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/WalkNodeProcessor.java @@ -0,0 +1,291 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockDoor; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFence; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockFenceGate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockRailBase; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.BlockWall; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.Entity; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Blocks; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding.PathPoint; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.IBlockAccess; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder.NodeProcessor; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WalkNodeProcessor extends NodeProcessor { + + static { + __checkIntegratedContextValid("net/minecraft/world/pathfinder/WalkNodeProcessor"); + } + + private boolean canEnterDoors; + private boolean canBreakDoors; + private boolean avoidsWater; + private boolean canSwim; + private boolean shouldAvoidWater; + + public void initProcessor(IBlockAccess iblockaccess, Entity entity) { + super.initProcessor(iblockaccess, entity); + this.shouldAvoidWater = this.avoidsWater; + } + + /**+ + * This method is called when all nodes have been processed and + * PathEntity is created.\n {@link + * net.minecraft.world.pathfinder.WalkNodeProcessor + * WalkNodeProcessor} uses this to change its field {@link + * net.minecraft.world.pathfinder.WalkNodeProcessor#avoidsWater + * avoidsWater} + */ + public void postProcess() { + super.postProcess(); + this.avoidsWater = this.shouldAvoidWater; + } + + /**+ + * Returns given entity's position as PathPoint + */ + public PathPoint getPathPointTo(Entity entity) { + int i; + if (this.canSwim && entity.isInWater()) { + i = (int) entity.getEntityBoundingBox().minY; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos( + MathHelper.floor_double(entity.posX), i, MathHelper.floor_double(entity.posZ)); + + for (Block block = this.blockaccess.getBlockState(blockpos$mutableblockpos) + .getBlock(); block == Blocks.flowing_water + || block == Blocks.water; block = this.blockaccess.getBlockState(blockpos$mutableblockpos) + .getBlock()) { + ++i; + blockpos$mutableblockpos.func_181079_c(MathHelper.floor_double(entity.posX), i, + MathHelper.floor_double(entity.posZ)); + } + + this.avoidsWater = false; + } else { + i = MathHelper.floor_double(entity.getEntityBoundingBox().minY + 0.5D); + } + + return this.openPoint(MathHelper.floor_double(entity.getEntityBoundingBox().minX), i, + MathHelper.floor_double(entity.getEntityBoundingBox().minZ)); + } + + /**+ + * Returns PathPoint for given coordinates + */ + public PathPoint getPathPointToCoords(Entity entity, double d0, double d1, double d2) { + return this.openPoint(MathHelper.floor_double(d0 - (double) (entity.width / 2.0F)), MathHelper.floor_double(d1), + MathHelper.floor_double(d2 - (double) (entity.width / 2.0F))); + } + + public int findPathOptions(PathPoint[] apathpoint, Entity entity, PathPoint pathpoint, PathPoint pathpoint1, + float f) { + int i = 0; + byte b0 = 0; + if (this.getVerticalOffset(entity, pathpoint.xCoord, pathpoint.yCoord + 1, pathpoint.zCoord) == 1) { + b0 = 1; + } + + PathPoint pathpoint2 = this.getSafePoint(entity, pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord + 1, b0); + PathPoint pathpoint3 = this.getSafePoint(entity, pathpoint.xCoord - 1, pathpoint.yCoord, pathpoint.zCoord, b0); + PathPoint pathpoint4 = this.getSafePoint(entity, pathpoint.xCoord + 1, pathpoint.yCoord, pathpoint.zCoord, b0); + PathPoint pathpoint5 = this.getSafePoint(entity, pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord - 1, b0); + if (pathpoint2 != null && !pathpoint2.visited && pathpoint2.distanceTo(pathpoint1) < f) { + apathpoint[i++] = pathpoint2; + } + + if (pathpoint3 != null && !pathpoint3.visited && pathpoint3.distanceTo(pathpoint1) < f) { + apathpoint[i++] = pathpoint3; + } + + if (pathpoint4 != null && !pathpoint4.visited && pathpoint4.distanceTo(pathpoint1) < f) { + apathpoint[i++] = pathpoint4; + } + + if (pathpoint5 != null && !pathpoint5.visited && pathpoint5.distanceTo(pathpoint1) < f) { + apathpoint[i++] = pathpoint5; + } + + return i; + } + + /**+ + * Returns a point that the entity can safely move to + */ + private PathPoint getSafePoint(Entity entityIn, int x, int y, int z, int parInt4) { + PathPoint pathpoint = null; + int i = this.getVerticalOffset(entityIn, x, y, z); + if (i == 2) { + return this.openPoint(x, y, z); + } else { + if (i == 1) { + pathpoint = this.openPoint(x, y, z); + } + + if (pathpoint == null && parInt4 > 0 && i != -3 && i != -4 + && this.getVerticalOffset(entityIn, x, y + parInt4, z) == 1) { + pathpoint = this.openPoint(x, y + parInt4, z); + y += parInt4; + } + + if (pathpoint != null) { + int j = 0; + + int k; + for (k = 0; y > 0; pathpoint = this.openPoint(x, y, z)) { + k = this.getVerticalOffset(entityIn, x, y - 1, z); + if (this.avoidsWater && k == -1) { + return null; + } + + if (k != 1) { + break; + } + + if (j++ >= entityIn.getMaxFallHeight()) { + return null; + } + + --y; + if (y <= 0) { + return null; + } + } + + if (k == -2) { + return null; + } + } + + return pathpoint; + } + } + + /**+ + * Checks if an entity collides with blocks at a + * position.\nReturns 1 if clear, 0 for colliding with any solid + * block, -1 for water(if avoids water),\n-2 for lava, -3 for + * fence and wall, -4 for closed trapdoor, 2 if otherwise clear + * except for open trapdoor or water(if not avoiding) + */ + private int getVerticalOffset(Entity entityIn, int x, int y, int z) { + return func_176170_a(this.blockaccess, entityIn, x, y, z, this.entitySizeX, this.entitySizeY, this.entitySizeZ, + this.avoidsWater, this.canBreakDoors, this.canEnterDoors); + } + + public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, + int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors) { + boolean flag = false; + BlockPos blockpos = new BlockPos(entityIn); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i = x; i < x + sizeX; ++i) { + for (int j = y; j < y + sizeY; ++j) { + for (int k = z; k < z + sizeZ; ++k) { + blockpos$mutableblockpos.func_181079_c(i, j, k); + Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock(); + if (block.getMaterial() != Material.air) { + if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor) { + if (block != Blocks.flowing_water && block != Blocks.water) { + if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood) { + return 0; + } + } else { + if (avoidWater) { + return -1; + } + + flag = true; + } + } else { + flag = true; + } + + if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos) + .getBlock() instanceof BlockRailBase) { + if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) + && !(entityIn.worldObj.getBlockState(blockpos.down()) + .getBlock() instanceof BlockRailBase)) { + return -3; + } + } else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors + || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood)) { + if (block instanceof BlockFence || block instanceof BlockFenceGate + || block instanceof BlockWall) { + return -3; + } + + if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor) { + return -4; + } + + Material material = block.getMaterial(); + if (material != Material.lava) { + return 0; + } + + if (!entityIn.isInLava()) { + return -2; + } + } + } + } + } + } + + return flag ? 2 : 1; + } + + public void setEnterDoors(boolean canEnterDoorsIn) { + this.canEnterDoors = canEnterDoorsIn; + } + + public void setBreakDoors(boolean canBreakDoorsIn) { + this.canBreakDoors = canBreakDoorsIn; + } + + public void setAvoidsWater(boolean avoidsWaterIn) { + this.avoidsWater = avoidsWaterIn; + } + + public void setCanSwim(boolean canSwimIn) { + this.canSwim = canSwimIn; + } + + public boolean getEnterDoors() { + return this.canEnterDoors; + } + + public boolean getCanSwim() { + return this.canSwim; + } + + public boolean getAvoidsWater() { + return this.avoidsWater; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/DerivedWorldInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/DerivedWorldInfo.java new file mode 100644 index 0000000..925e9ed --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/DerivedWorldInfo.java @@ -0,0 +1,294 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.GameRules; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DerivedWorldInfo extends WorldInfo { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/DerivedWorldInfo"); + } + + private final WorldInfo theWorldInfo; + + public DerivedWorldInfo(WorldInfo parWorldInfo) { + this.theWorldInfo = parWorldInfo; + } + + /**+ + * Gets the NBTTagCompound for the worldInfo + */ + public NBTTagCompound getNBTTagCompound() { + return this.theWorldInfo.getNBTTagCompound(); + } + + /**+ + * Creates a new NBTTagCompound for the world, with the given + * NBTTag as the "Player" + */ + public NBTTagCompound cloneNBTCompound(NBTTagCompound nbt) { + return this.theWorldInfo.cloneNBTCompound(nbt); + } + + /**+ + * Returns the seed of current world. + */ + public long getSeed() { + return this.theWorldInfo.getSeed(); + } + + /**+ + * Returns the x spawn position + */ + public int getSpawnX() { + return this.theWorldInfo.getSpawnX(); + } + + /**+ + * Return the Y axis spawning point of the player. + */ + public int getSpawnY() { + return this.theWorldInfo.getSpawnY(); + } + + /**+ + * Returns the z spawn position + */ + public int getSpawnZ() { + return this.theWorldInfo.getSpawnZ(); + } + + public long getWorldTotalTime() { + return this.theWorldInfo.getWorldTotalTime(); + } + + /**+ + * Get current world time + */ + public long getWorldTime() { + return this.theWorldInfo.getWorldTime(); + } + + public long getSizeOnDisk() { + return this.theWorldInfo.getSizeOnDisk(); + } + + /**+ + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + + /**+ + * Get current world name + */ + public String getWorldName() { + return this.theWorldInfo.getWorldName(); + } + + /**+ + * Returns the save version of this world + */ + public int getSaveVersion() { + return this.theWorldInfo.getSaveVersion(); + } + + /**+ + * Return the last time the player was in this world. + */ + public long getLastTimePlayed() { + return this.theWorldInfo.getLastTimePlayed(); + } + + /**+ + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() { + return this.theWorldInfo.isThundering(); + } + + /**+ + * Returns the number of ticks until next thunderbolt. + */ + public int getThunderTime() { + return this.theWorldInfo.getThunderTime(); + } + + /**+ + * Returns true if it is raining, false otherwise. + */ + public boolean isRaining() { + return this.theWorldInfo.isRaining(); + } + + /**+ + * Return the number of ticks until rain. + */ + public int getRainTime() { + return this.theWorldInfo.getRainTime(); + } + + /**+ + * Gets the GameType. + */ + public WorldSettings.GameType getGameType() { + return this.theWorldInfo.getGameType(); + } + + /**+ + * Set the x spawn position to the passed in value + */ + public void setSpawnX(int x) { + } + + /**+ + * Sets the y spawn position + */ + public void setSpawnY(int y) { + } + + /**+ + * Set the z spawn position to the passed in value + */ + public void setSpawnZ(int z) { + } + + public void setWorldTotalTime(long time) { + } + + /**+ + * Set current world time + */ + public void setWorldTime(long time) { + } + + public void setSpawn(BlockPos spawnPoint) { + } + + public void setWorldName(String worldName) { + } + + /**+ + * Sets the save version of the world + */ + public void setSaveVersion(int version) { + } + + /**+ + * Sets whether it is thundering or not. + */ + public void setThundering(boolean thunderingIn) { + } + + /**+ + * Defines the number of ticks until next thunderbolt. + */ + public void setThunderTime(int time) { + } + + /**+ + * Sets whether it is raining or not. + */ + public void setRaining(boolean isRaining) { + } + + /**+ + * Sets the number of ticks until rain. + */ + public void setRainTime(int time) { + } + + /**+ + * Get whether the map features (e.g. strongholds) generation is + * enabled or disabled. + */ + public boolean isMapFeaturesEnabled() { + return this.theWorldInfo.isMapFeaturesEnabled(); + } + + /**+ + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean isHardcoreModeEnabled() { + return this.theWorldInfo.isHardcoreModeEnabled(); + } + + public WorldType getTerrainType() { + return this.theWorldInfo.getTerrainType(); + } + + public void setTerrainType(WorldType type) { + } + + /**+ + * Returns true if commands are allowed on this World. + */ + public boolean areCommandsAllowed() { + return this.theWorldInfo.areCommandsAllowed(); + } + + public void setAllowCommands(boolean allow) { + } + + /**+ + * Returns true if the World is initialized. + */ + public boolean isInitialized() { + return this.theWorldInfo.isInitialized(); + } + + /**+ + * Sets the initialization status of the World. + */ + public void setServerInitialized(boolean initializedIn) { + } + + /**+ + * Gets the GameRules class Instance. + */ + public GameRules getGameRulesInstance() { + return this.theWorldInfo.getGameRulesInstance(); + } + + public EnumDifficulty getDifficulty() { + return this.theWorldInfo.getDifficulty(); + } + + public void setDifficulty(EnumDifficulty newDifficulty) { + } + + public boolean isDifficultyLocked() { + return this.theWorldInfo.isDifficultyLocked(); + } + + public void setDifficultyLocked(boolean locked) { + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/IPlayerFileData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/IPlayerFileData.java new file mode 100644 index 0000000..c9386fd --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/IPlayerFileData.java @@ -0,0 +1,44 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface IPlayerFileData { + /**+ + * Writes the player data to disk from the specified + * PlayerEntityMP. + */ + void writePlayerData(EntityPlayer var1); + + /**+ + * Reads the player data from disk into the specified + * PlayerEntityMP. + */ + NBTTagCompound readPlayerData(EntityPlayer var1); + + /**+ + * Returns an array of usernames for which player.dat exists + * for. + */ + String[] getAvailablePlayerDat(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveFormat.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveFormat.java new file mode 100644 index 0000000..8f03e08 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveFormat.java @@ -0,0 +1,81 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +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.SaveFormatComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ISaveFormat { + /**+ + * Returns the name of the save format. + */ + String getName(); + + /**+ + * Returns back a loader for the specified save directory + */ + ISaveHandler getSaveLoader(String var1, boolean var2); + + List getSaveList(); + + void flushCache(); + + /**+ + * Returns the world's WorldInfo object + */ + WorldInfo getWorldInfo(String var1); + + boolean func_154335_d(String var1); + + /**+ + * @args: Takes one argument - the name of the directory of the + * world to delete. @desc: Delete the world by deleting the + * associated directory recursively. + */ + boolean deleteWorldDirectory(String var1); + + /**+ + * Renames the world by storing the new name in level.dat. It + * does *not* rename the directory containing the world data. + */ + boolean renameWorld(String var1, String var2); + + boolean func_154334_a(String var1); + + /**+ + * gets if the map is old chunk saving (true) or McRegion + * (false) + */ + boolean isOldMapFormat(String var1); + + /**+ + * converts the map to mcRegion + */ + boolean convertMapFormat(String var1, IProgressUpdate var2); + + /**+ + * Return whether the given world can be loaded. + */ + boolean canLoadWorld(String var1); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveHandler.java new file mode 100644 index 0000000..82955dc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveHandler.java @@ -0,0 +1,83 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.IChunkLoader; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.IPlayerFileData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ISaveHandler { + /**+ + * Loads and returns the world info + */ + WorldInfo loadWorldInfo(); + + /**+ + * Checks the session lock to prevent save collisions + */ + void checkSessionLock() throws MinecraftException; + + /**+ + * initializes and returns the chunk loader for the specified + * world provider + */ + IChunkLoader getChunkLoader(WorldProvider var1); + + /**+ + * Saves the given World Info with the given NBTTagCompound as + * the Player. + */ + void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2); + + /**+ + * used to update level.dat from old format to MCRegion format + */ + void saveWorldInfo(WorldInfo var1); + + IPlayerFileData getPlayerNBTManager(); + + /**+ + * Called to flush all changes to disk, waiting for them to + * complete. + */ + void flush(); + + /**+ + * Gets the File object corresponding to the base directory of + * this world. + */ + VFile2 getWorldDirectory(); + + /**+ + * Gets the file location of the given map + */ + VFile2 getMapFileFromName(String var1); + + /**+ + * Returns the name of the directory where world information is + * saved. + */ + String getWorldDirectoryName(); +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapData.java new file mode 100644 index 0000000..344fb73 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapData.java @@ -0,0 +1,290 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.item.EntityItemFrame; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S34PacketMaps; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.Vec4b; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapData extends WorldSavedData { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/MapData"); + } + + public int xCenter; + public int zCenter; + public byte dimension; + public byte scale; + /**+ + * colours + */ + public byte[] colors = new byte[16384]; + /**+ + * Holds a reference to the MapInfo of the players who own a + * copy of the map + */ + public List playersArrayList = Lists.newArrayList(); + private Map playersHashMap = Maps.newHashMap(); + public Map mapDecorations = Maps.newLinkedHashMap(); + + public MapData(String mapname) { + super(mapname); + } + + public void calculateMapCenter(double x, double z, int mapScale) { + int i = 128 * (1 << mapScale); + int j = MathHelper.floor_double((x + 64.0D) / (double) i); + int k = MathHelper.floor_double((z + 64.0D) / (double) i); + this.xCenter = j * i + i / 2 - 64; + this.zCenter = k * i + i / 2 - 64; + } + + /**+ + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbttagcompound) { + this.dimension = nbttagcompound.getByte("dimension"); + this.xCenter = nbttagcompound.getInteger("xCenter"); + this.zCenter = nbttagcompound.getInteger("zCenter"); + this.scale = nbttagcompound.getByte("scale"); + this.scale = (byte) MathHelper.clamp_int(this.scale, 0, 4); + short short1 = nbttagcompound.getShort("width"); + short short2 = nbttagcompound.getShort("height"); + if (short1 == 128 && short2 == 128) { + this.colors = nbttagcompound.getByteArray("colors"); + } else { + byte[] abyte = nbttagcompound.getByteArray("colors"); + this.colors = new byte[16384]; + int i = (128 - short1) / 2; + int j = (128 - short2) / 2; + + for (int k = 0; k < short2; ++k) { + int l = k + j; + if (l >= 0 || l < 128) { + for (int i1 = 0; i1 < short1; ++i1) { + int j1 = i1 + i; + if (j1 >= 0 || j1 < 128) { + this.colors[j1 + l * 128] = abyte[i1 + k * short1]; + } + } + } + } + } + + } + + /**+ + * write data to NBTTagCompound from this MapDataBase, similar + * to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbttagcompound) { + nbttagcompound.setByte("dimension", this.dimension); + nbttagcompound.setInteger("xCenter", this.xCenter); + nbttagcompound.setInteger("zCenter", this.zCenter); + nbttagcompound.setByte("scale", this.scale); + nbttagcompound.setShort("width", (short) 128); + nbttagcompound.setShort("height", (short) 128); + nbttagcompound.setByteArray("colors", this.colors); + } + + /**+ + * Adds the player passed to the list of visible players and + * checks to see which players are visible + */ + public void updateVisiblePlayers(EntityPlayer player, ItemStack mapStack) { + if (!this.playersHashMap.containsKey(player)) { + MapData.MapInfo mapdata$mapinfo = new MapData.MapInfo(player); + this.playersHashMap.put(player, mapdata$mapinfo); + this.playersArrayList.add(mapdata$mapinfo); + } + + if (!player.inventory.hasItemStack(mapStack)) { + this.mapDecorations.remove(player.getName()); + } + + for (int i = 0; i < this.playersArrayList.size(); ++i) { + MapData.MapInfo mapdata$mapinfo1 = (MapData.MapInfo) this.playersArrayList.get(i); + if (!mapdata$mapinfo1.entityplayerObj.isDead + && (mapdata$mapinfo1.entityplayerObj.inventory.hasItemStack(mapStack) + || mapStack.isOnItemFrame())) { + if (!mapStack.isOnItemFrame() && mapdata$mapinfo1.entityplayerObj.dimension == this.dimension) { + this.updateDecorations(0, mapdata$mapinfo1.entityplayerObj.worldObj, + mapdata$mapinfo1.entityplayerObj.getName(), mapdata$mapinfo1.entityplayerObj.posX, + mapdata$mapinfo1.entityplayerObj.posZ, + (double) mapdata$mapinfo1.entityplayerObj.rotationYaw); + } + } else { + this.playersHashMap.remove(mapdata$mapinfo1.entityplayerObj); + this.playersArrayList.remove(mapdata$mapinfo1); + } + } + + if (mapStack.isOnItemFrame()) { + EntityItemFrame entityitemframe = mapStack.getItemFrame(); + BlockPos blockpos = entityitemframe.getHangingPosition(); + this.updateDecorations(1, player.worldObj, "frame-" + entityitemframe.getEntityId(), + (double) blockpos.getX(), (double) blockpos.getZ(), + (double) (entityitemframe.facingDirection.getHorizontalIndex() * 90)); + } + + if (mapStack.hasTagCompound() && mapStack.getTagCompound().hasKey("Decorations", 9)) { + NBTTagList nbttaglist = mapStack.getTagCompound().getTagList("Decorations", 10); + + for (int j = 0; j < nbttaglist.tagCount(); ++j) { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j); + if (!this.mapDecorations.containsKey(nbttagcompound.getString("id"))) { + this.updateDecorations(nbttagcompound.getByte("type"), player.worldObj, + nbttagcompound.getString("id"), nbttagcompound.getDouble("x"), + nbttagcompound.getDouble("z"), nbttagcompound.getDouble("rot")); + } + } + } + + } + + private void updateDecorations(int type, World worldIn, String entityIdentifier, double worldX, double worldZ, + double rotation) { + int i = 1 << this.scale; + float f = (float) (worldX - (double) this.xCenter) / (float) i; + float f1 = (float) (worldZ - (double) this.zCenter) / (float) i; + byte b0 = (byte) ((int) ((double) (f * 2.0F) + 0.5D)); + byte b1 = (byte) ((int) ((double) (f1 * 2.0F) + 0.5D)); + byte b3 = 63; + byte b2; + if (f >= (float) (-b3) && f1 >= (float) (-b3) && f <= (float) b3 && f1 <= (float) b3) { + rotation = rotation + (rotation < 0.0D ? -8.0D : 8.0D); + b2 = (byte) ((int) (rotation * 16.0D / 360.0D)); + if (this.dimension < 0) { + int j = (int) (worldIn.getWorldInfo().getWorldTime() / 10L); + b2 = (byte) (j * j * 34187121 + j * 121 >> 15 & 15); + } + } else { + if (Math.abs(f) >= 320.0F || Math.abs(f1) >= 320.0F) { + this.mapDecorations.remove(entityIdentifier); + return; + } + + type = 6; + b2 = 0; + if (f <= (float) (-b3)) { + b0 = (byte) ((int) ((double) (b3 * 2) + 2.5D)); + } + + if (f1 <= (float) (-b3)) { + b1 = (byte) ((int) ((double) (b3 * 2) + 2.5D)); + } + + if (f >= (float) b3) { + b0 = (byte) (b3 * 2 + 1); + } + + if (f1 >= (float) b3) { + b1 = (byte) (b3 * 2 + 1); + } + } + + this.mapDecorations.put(entityIdentifier, new Vec4b((byte) type, b0, b1, b2)); + } + + public Packet getMapPacket(ItemStack mapStack, World worldIn, EntityPlayer player) { + MapData.MapInfo mapdata$mapinfo = (MapData.MapInfo) this.playersHashMap.get(player); + return mapdata$mapinfo == null ? null : mapdata$mapinfo.getPacket(mapStack); + } + + public void updateMapData(int x, int y) { + super.markDirty(); + + for (MapData.MapInfo mapdata$mapinfo : this.playersArrayList) { + mapdata$mapinfo.update(x, y); + } + + } + + public MapData.MapInfo getMapInfo(EntityPlayer player) { + MapData.MapInfo mapdata$mapinfo = (MapData.MapInfo) this.playersHashMap.get(player); + if (mapdata$mapinfo == null) { + mapdata$mapinfo = new MapData.MapInfo(player); + this.playersHashMap.put(player, mapdata$mapinfo); + this.playersArrayList.add(mapdata$mapinfo); + } + + return mapdata$mapinfo; + } + + public class MapInfo { + public final EntityPlayer entityplayerObj; + private boolean field_176105_d = true; + private int minX = 0; + private int minY = 0; + private int maxX = 127; + private int maxY = 127; + private int field_176109_i; + public int field_82569_d; + + public MapInfo(EntityPlayer player) { + this.entityplayerObj = player; + } + + public Packet getPacket(ItemStack stack) { + if (this.field_176105_d) { + this.field_176105_d = false; + return new S34PacketMaps(stack.getMetadata(), MapData.this.scale, MapData.this.mapDecorations.values(), + MapData.this.colors, this.minX, this.minY, this.maxX + 1 - this.minX, + this.maxY + 1 - this.minY); + } else { + return this.field_176109_i++ % 5 == 0 ? new S34PacketMaps(stack.getMetadata(), MapData.this.scale, + MapData.this.mapDecorations.values(), MapData.this.colors, 0, 0, 0, 0) : null; + } + } + + public void update(int x, int y) { + if (this.field_176105_d) { + this.minX = Math.min(this.minX, x); + this.minY = Math.min(this.minY, y); + this.maxX = Math.max(this.maxX, x); + this.maxY = Math.max(this.maxY, y); + } else { + this.field_176105_d = true; + this.minX = x; + this.minY = y; + this.maxX = x; + this.maxY = y; + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapStorage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapStorage.java new file mode 100644 index 0000000..ea0ecf3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapStorage.java @@ -0,0 +1,238 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagShort; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard.ScoreboardSaveData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village.VillageCollection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure.MapGenStructureData; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.ISaveHandler; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 MapStorage { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/MapStorage"); + } + + private ISaveHandler saveHandler; + protected Map loadedDataMap = Maps.newHashMap(); + /**+ + * List of loaded MapDataBases. + */ + private List loadedDataList = Lists.newArrayList(); + private Map idCounts = Maps.newHashMap(); + + public static interface MapStorageProvider { + WorldSavedData createInstance(String mapFileName); + } + + public static final Map, MapStorageProvider> storageProviders = new HashMap(); + + static { + storageProviders.put(MapData.class, (s) -> new MapData(s)); + storageProviders.put(MapGenStructureData.class, (s) -> new MapGenStructureData(s)); + storageProviders.put(ScoreboardSaveData.class, (s) -> new ScoreboardSaveData(s)); + storageProviders.put(VillageCollection.class, (s) -> new VillageCollection(s)); + } + + public MapStorage(ISaveHandler saveHandlerIn) { + this.saveHandler = saveHandlerIn; + this.loadIdCounts(); + } + + /**+ + * Loads an existing MapDataBase corresponding to the given + * String id from disk, instantiating the given Class, or + * returns null if none such file exists. args: Class to + * instantiate, String dataid + */ + public WorldSavedData loadData(Class oclass, String s) { + WorldSavedData worldsaveddata = (WorldSavedData) this.loadedDataMap.get(s); + if (worldsaveddata != null) { + return worldsaveddata; + } else { + if (this.saveHandler != null) { + try { + VFile2 file1 = this.saveHandler.getMapFileFromName(s); + if (file1 != null && file1.exists()) { + try { + worldsaveddata = (WorldSavedData) storageProviders.get(oclass).createInstance(s); + } catch (Exception exception) { + throw new RuntimeException("Failed to instantiate " + oclass.toString(), exception); + } + try (InputStream is = file1.getInputStream()) { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(is); + worldsaveddata.readFromNBT(nbttagcompound.getCompoundTag("data")); + } + } + } catch (Exception exception1) { + EagRuntime.debugPrintStackTrace(exception1); + } + } + + if (worldsaveddata != null) { + this.loadedDataMap.put(s, worldsaveddata); + this.loadedDataList.add(worldsaveddata); + } + + return worldsaveddata; + } + } + + /**+ + * Assigns the given String id to the given MapDataBase, + * removing any existing ones of the same id. + */ + public void setData(String s, WorldSavedData worldsaveddata) { + if (this.loadedDataMap.containsKey(s)) { + this.loadedDataList.remove(this.loadedDataMap.remove(s)); + } + + this.loadedDataMap.put(s, worldsaveddata); + this.loadedDataList.add(worldsaveddata); + } + + /**+ + * Saves all dirty loaded MapDataBases to disk. + */ + public void saveAllData() { + for (int i = 0; i < this.loadedDataList.size(); ++i) { + WorldSavedData worldsaveddata = (WorldSavedData) this.loadedDataList.get(i); + if (worldsaveddata.isDirty()) { + this.saveData(worldsaveddata); + worldsaveddata.setDirty(false); + } + } + + } + + /**+ + * Saves the given MapDataBase to disk. + */ + private void saveData(WorldSavedData parWorldSavedData) { + if (this.saveHandler != null) { + try { + VFile2 file1 = this.saveHandler.getMapFileFromName(parWorldSavedData.mapName); + if (file1 != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + parWorldSavedData.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("data", nbttagcompound); + + try (OutputStream fileoutputstream = file1.getOutputStream()) { + CompressedStreamTools.writeCompressed(nbttagcompound1, fileoutputstream); + } + } + } catch (Exception exception) { + EagRuntime.debugPrintStackTrace(exception); + } + + } + } + + /**+ + * Loads the idCounts Map from the 'idcounts' file. + */ + private void loadIdCounts() { + try { + this.idCounts.clear(); + if (this.saveHandler == null) { + return; + } + + VFile2 file1 = this.saveHandler.getMapFileFromName("idcounts"); + if (file1 != null && file1.exists()) { + NBTTagCompound nbttagcompound; + try (DataInputStream datainputstream = new DataInputStream(file1.getInputStream())) { + nbttagcompound = CompressedStreamTools.read(datainputstream); + } + + for (String s : nbttagcompound.getKeySet()) { + NBTBase nbtbase = nbttagcompound.getTag(s); + if (nbtbase instanceof NBTTagShort) { + NBTTagShort nbttagshort = (NBTTagShort) nbtbase; + short short1 = nbttagshort.getShort(); + this.idCounts.put(s, Short.valueOf(short1)); + } + } + } + } catch (Exception exception) { + EagRuntime.debugPrintStackTrace(exception); + } + + } + + /**+ + * Returns an unique new data id for the given prefix and saves + * the idCounts map to the 'idcounts' file. + */ + public int getUniqueDataId(String s) { + Short oshort = (Short) this.idCounts.get(s); + if (oshort == null) { + oshort = Short.valueOf((short) 0); + } else { + oshort = Short.valueOf((short) (oshort.shortValue() + 1)); + } + + this.idCounts.put(s, oshort); + if (this.saveHandler == null) { + return oshort.shortValue(); + } else { + try { + VFile2 file1 = this.saveHandler.getMapFileFromName("idcounts"); + if (file1 != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (String s1 : this.idCounts.keySet()) { + short short1 = ((Short) this.idCounts.get(s1)).shortValue(); + nbttagcompound.setShort(s1, short1); + } + + try (DataOutputStream dataoutputstream = new DataOutputStream(file1.getOutputStream())) { + CompressedStreamTools.write(nbttagcompound, (DataOutput) dataoutputstream); + } + } + } catch (Exception exception) { + EagRuntime.debugPrintStackTrace(exception); + } + + return oshort.shortValue(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveDataMemoryStorage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveDataMemoryStorage.java new file mode 100644 index 0000000..716f8c2 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveDataMemoryStorage.java @@ -0,0 +1,70 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSavedData; +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.MapStorage; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SaveDataMemoryStorage extends MapStorage { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/SaveDataMemoryStorage"); + } + + public SaveDataMemoryStorage() { + super((ISaveHandler) null); + } + + /**+ + * Loads an existing MapDataBase corresponding to the given + * String id from disk, instantiating the given Class, or + * returns null if none such file exists. args: Class to + * instantiate, String dataid + */ + public WorldSavedData loadData(Class clazz, String dataIdentifier) { + return (WorldSavedData) this.loadedDataMap.get(dataIdentifier); + } + + /**+ + * Assigns the given String id to the given MapDataBase, + * removing any existing ones of the same id. + */ + public void setData(String dataIdentifier, WorldSavedData data) { + this.loadedDataMap.put(dataIdentifier, data); + } + + /**+ + * Saves all dirty loaded MapDataBases to disk. + */ + public void saveAllData() { + } + + /**+ + * Returns an unique new data id for the given prefix and saves + * the idCounts map to the 'idcounts' file. + */ + public int getUniqueDataId(String key) { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatComparator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatComparator.java new file mode 100644 index 0000000..3973ad9 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatComparator.java @@ -0,0 +1,104 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SaveFormatComparator implements Comparable { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/SaveFormatComparator"); + } + + private final String fileName; + private final String displayName; + private final long lastTimePlayed; + private final long sizeOnDisk; + private final boolean requiresConversion; + private final WorldSettings.GameType theEnumGameType; + private final boolean hardcore; + private final boolean cheatsEnabled; + + public SaveFormatComparator(String fileNameIn, String displayNameIn, long lastTimePlayedIn, long sizeOnDiskIn, + WorldSettings.GameType theEnumGameTypeIn, boolean requiresConversionIn, boolean hardcoreIn, + boolean cheatsEnabledIn) { + this.fileName = fileNameIn; + this.displayName = displayNameIn; + this.lastTimePlayed = lastTimePlayedIn; + this.sizeOnDisk = sizeOnDiskIn; + this.theEnumGameType = theEnumGameTypeIn; + this.requiresConversion = requiresConversionIn; + this.hardcore = hardcoreIn; + this.cheatsEnabled = cheatsEnabledIn; + } + + /**+ + * return the file name + */ + public String getFileName() { + return this.fileName; + } + + /**+ + * return the display name of the save + */ + public String getDisplayName() { + return this.displayName; + } + + public long getSizeOnDisk() { + return this.sizeOnDisk; + } + + public boolean requiresConversion() { + return this.requiresConversion; + } + + public long getLastTimePlayed() { + return this.lastTimePlayed; + } + + public int compareTo(SaveFormatComparator saveformatcomparator) { + return this.lastTimePlayed < saveformatcomparator.lastTimePlayed ? 1 + : (this.lastTimePlayed > saveformatcomparator.lastTimePlayed ? -1 + : this.fileName.compareTo(saveformatcomparator.fileName)); + } + + /**+ + * Gets the EnumGameType. + */ + public WorldSettings.GameType getEnumGameType() { + return this.theEnumGameType; + } + + public boolean isHardcoreModeEnabled() { + return this.hardcore; + } + + /**+ + * @return {@code true} if cheats are enabled for this world + */ + public boolean getCheatsEnabled() { + return this.cheatsEnabled; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatOld.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatOld.java new file mode 100644 index 0000000..b198c8a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatOld.java @@ -0,0 +1,244 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import com.google.common.collect.Lists; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IProgressUpdate; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.ISaveFormat; +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.SaveFormatComparator; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.SaveHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SaveFormatOld implements ISaveFormat { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/SaveFormatOld"); + } + + private static final Logger logger = LogManager.getLogger(); + protected final VFile2 savesDirectory; + + public SaveFormatOld(VFile2 parFile) { + this.savesDirectory = parFile; + } + + /**+ + * Returns the name of the save format. + */ + public String getName() { + return "Old Format"; + } + + public List getSaveList() { + ArrayList arraylist = Lists.newArrayList(); + + for (int i = 0; i < 5; ++i) { + String s = "World" + (i + 1); + WorldInfo worldinfo = this.getWorldInfo(s); + if (worldinfo != null) { + arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), + worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), + worldinfo.areCommandsAllowed())); + } + } + + return arraylist; + } + + public void flushCache() { + } + + /**+ + * Returns the world's WorldInfo object + */ + public WorldInfo getWorldInfo(String saveName) { + VFile2 file1 = new VFile2(this.savesDirectory, saveName); + if (!file1.exists()) { + return null; + } else { + VFile2 file2 = new VFile2(file1, "level.dat"); + if (file2.exists()) { + try { + NBTTagCompound nbttagcompound2; + try (InputStream is = file2.getInputStream()) { + nbttagcompound2 = CompressedStreamTools.readCompressed(is); + } + NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound3); + } catch (Exception exception1) { + logger.error("Exception reading " + file2, exception1); + } + } + + file2 = new VFile2(file1, "level.dat_old"); + if (file2.exists()) { + try { + NBTTagCompound nbttagcompound; + try (InputStream is = file2.getInputStream()) { + nbttagcompound = CompressedStreamTools.readCompressed(is); + } + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound1); + } catch (Exception exception) { + logger.error("Exception reading " + file2, exception); + } + } + + return null; + } + } + + /**+ + * Renames the world by storing the new name in level.dat. It + * does *not* rename the directory containing the world data. + */ + public boolean renameWorld(String dirName, String newName) { + VFile2 file1 = new VFile2(this.savesDirectory, dirName); + VFile2 file2 = new VFile2(file1, "level.dat"); + { + if (file2.exists()) { + try { + NBTTagCompound nbttagcompound; + try (InputStream is = file2.getInputStream()) { + nbttagcompound = CompressedStreamTools.readCompressed(is); + } + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + nbttagcompound1.setString("LevelName", newName); + try (OutputStream os = file2.getOutputStream()) { + CompressedStreamTools.writeCompressed(nbttagcompound, os); + } + return true; + } catch (Throwable exception) { + logger.error("Failed to rename world \"{}\"!", dirName); + logger.error(exception); + } + } + + } + return false; + } + + public boolean func_154335_d(String parString1) { + return !canLoadWorld(parString1); + } + + /**+ + * @args: Takes one argument - the name of the directory of the + * world to delete. @desc: Delete the world by deleting the + * associated directory recursively. + */ + public boolean deleteWorldDirectory(String parString1) { + VFile2 file1 = new VFile2(this.savesDirectory, parString1); + logger.info("Deleting level " + parString1); + + for (int i = 1; i <= 5; ++i) { + logger.info("Attempt " + i + "..."); + if (deleteFiles(file1.listFiles(true), "singleplayer.busy.deleting")) { + return true; + } + + logger.warn("Unsuccessful in deleting contents."); + if (i < 5) { + try { + Thread.sleep(500L); + } catch (InterruptedException var5) { + ; + } + } + } + + return false; + } + + /**+ + * @args: Takes one argument - the list of files and directories + * to delete. @desc: Deletes the files and directory listed in + * the list recursively. + */ + protected static boolean deleteFiles(List files, String progressString) { + long totalSize = 0l; + long lastUpdate = 0; + for (int i = 0, l = files.size(); i < l; ++i) { + VFile2 file1 = files.get(i); + if (progressString != null) { + totalSize += file1.length(); + if (totalSize - lastUpdate > 10000) { + lastUpdate = totalSize; + EaglerIntegratedServerWorker.sendProgress(progressString, totalSize); + } + } + if (!file1.delete()) { + logger.warn("Couldn\'t delete file " + file1); + return false; + } + } + + return true; + } + + /**+ + * Returns back a loader for the specified save directory + */ + public ISaveHandler getSaveLoader(String s, boolean flag) { + return new SaveHandler(this.savesDirectory, s); + } + + public boolean func_154334_a(String var1) { + return false; + } + + /**+ + * gets if the map is old chunk saving (true) or McRegion + * (false) + */ + public boolean isOldMapFormat(String var1) { + return false; + } + + /**+ + * converts the map to mcRegion + */ + public boolean convertMapFormat(String var1, IProgressUpdate var2) { + return false; + } + + /**+ + * Return whether the given world can be loaded. + */ + public boolean canLoadWorld(String parString1) { + return (new VFile2(this.savesDirectory, parString1, "level.dat")).exists() + || (new VFile2(this.savesDirectory, parString1, "level.dat_old")).exists(); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveHandler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveHandler.java new file mode 100644 index 0000000..8f94b01 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveHandler.java @@ -0,0 +1,290 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +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.MinecraftException; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldProvider; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.IChunkLoader; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.IPlayerFileData; +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.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SaveHandler implements ISaveHandler, IPlayerFileData { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/SaveHandler"); + } + + private static final Logger logger = LogManager.getLogger(); + private final VFile2 worldDirectory; + private final VFile2 playersDirectory; + private final VFile2 mapDataDir; + /**+ + * The time in milliseconds when this field was initialized. + * Stored in the session lock file. + */ + private final long initializationTime = MinecraftServer.getCurrentTimeMillis(); + private final String saveDirectoryName; + + public SaveHandler(VFile2 savesDirectory, String directoryName) { + this.worldDirectory = new VFile2(savesDirectory, directoryName); + this.playersDirectory = new VFile2(this.worldDirectory, "player"); + this.mapDataDir = new VFile2(this.worldDirectory, "data"); + this.saveDirectoryName = directoryName; + + } + + /**+ + * Gets the File object corresponding to the base directory of + * this world. + */ + public VFile2 getWorldDirectory() { + return this.worldDirectory; + } + + /**+ + * Checks the session lock to prevent save collisions + */ + public void checkSessionLock() throws MinecraftException { + } + + /**+ + * initializes and returns the chunk loader for the specified + * world provider + */ + public IChunkLoader getChunkLoader(WorldProvider var1) { + throw new RuntimeException("eagler"); + } + + /**+ + * Loads and returns the world info + */ + public WorldInfo loadWorldInfo() { + VFile2 file1 = new VFile2(this.worldDirectory, "level.dat"); + if (file1.exists()) { + try (InputStream is = file1.getInputStream()) { + NBTTagCompound nbttagcompound2 = CompressedStreamTools.readCompressed(is); + NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound3); + } catch (Exception exception1) { + logger.error("Failed to load level.dat!"); + logger.error(exception1); + } + } + + file1 = new VFile2(this.worldDirectory, "level.dat_old"); + if (file1.exists()) { + try (InputStream is = file1.getInputStream()) { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(is); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound1); + } catch (Exception exception) { + logger.error("Failed to load level.dat_old!"); + logger.error(exception); + } + } + + return null; + } + + /**+ + * Saves the given World Info with the given NBTTagCompound as + * the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo worldinfo, NBTTagCompound nbttagcompound) { + NBTTagCompound nbttagcompound1 = worldinfo.cloneNBTCompound(nbttagcompound); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setTag("Data", nbttagcompound1); + + try { + VFile2 file1 = new VFile2(this.worldDirectory, "level.dat_new"); + VFile2 file2 = new VFile2(this.worldDirectory, "level.dat_old"); + VFile2 file3 = new VFile2(this.worldDirectory, "level.dat"); + try (OutputStream os = file1.getOutputStream()) { + CompressedStreamTools.writeCompressed(nbttagcompound2, os); + } + if (file2.exists()) { + file2.delete(); + } + + file3.renameTo(file2); + if (file3.exists()) { + file3.delete(); + } + + file1.renameTo(file3); + if (file1.exists()) { + file1.delete(); + } + } catch (Exception exception) { + logger.error("Failed to write level.dat!"); + logger.error(exception); + } + + } + + /**+ + * used to update level.dat from old format to MCRegion format + */ + public void saveWorldInfo(WorldInfo worldInformation) { + NBTTagCompound nbttagcompound = worldInformation.getNBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("Data", nbttagcompound); + + try { + VFile2 file1 = new VFile2(this.worldDirectory, "level.dat_new"); + VFile2 file2 = new VFile2(this.worldDirectory, "level.dat_old"); + VFile2 file3 = new VFile2(this.worldDirectory, "level.dat"); + try (OutputStream os = file1.getOutputStream()) { + CompressedStreamTools.writeCompressed(nbttagcompound1, os); + } + if (file2.exists()) { + file2.delete(); + } + + file3.renameTo(file2); + if (file3.exists()) { + file3.delete(); + } + + file1.renameTo(file3); + if (file1.exists()) { + file1.delete(); + } + } catch (Exception exception) { + logger.error("Failed to write level.dat!"); + logger.error(exception); + } + + } + + /**+ + * Writes the player data to disk from the specified + * PlayerEntityMP. + */ + public void writePlayerData(EntityPlayer player) { + try { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + player.writeToNBT(nbttagcompound); + String s = player.getName().toLowerCase(); + VFile2 file1 = new VFile2(this.playersDirectory, s + ".dat.tmp"); + VFile2 file2 = new VFile2(this.playersDirectory, s + ".dat"); + try (OutputStream os = file1.getOutputStream()) { + CompressedStreamTools.writeCompressed(nbttagcompound, os); + } + if (file2.exists()) { + file2.delete(); + } + + file1.renameTo(file2); + } catch (Exception var5) { + logger.error("Failed to save player data for {}", player.getName()); + logger.error(var5); + } + + } + + /**+ + * Reads the player data from disk into the specified + * PlayerEntityMP. + */ + public NBTTagCompound readPlayerData(EntityPlayer player) { + NBTTagCompound nbttagcompound = null; + + try { + VFile2 file1 = new VFile2(this.playersDirectory, player.getName().toLowerCase() + ".dat"); + if (file1.exists()) { + try (InputStream is = file1.getInputStream()) { + nbttagcompound = CompressedStreamTools.readCompressed(is); + } + } + } catch (Exception var4) { + logger.error("Failed to load player data for {}", player.getName()); + logger.error(var4); + } + + if (nbttagcompound != null) { + player.readFromNBT(nbttagcompound); + } + + return nbttagcompound; + } + + public IPlayerFileData getPlayerNBTManager() { + return this; + } + + /**+ + * Returns an array of usernames for which player.dat exists + * for. + */ + public String[] getAvailablePlayerDat() { + List astring = this.playersDirectory.listFilenames(false); + + for (int i = 0, l = astring.size(); i < l; ++i) { + String str = astring.get(i); + if (str.endsWith(".dat")) { + astring.set(i, str.substring(0, str.length() - 4)); + } + } + + return astring.toArray(new String[astring.size()]); + } + + /**+ + * Called to flush all changes to disk, waiting for them to + * complete. + */ + public void flush() { + } + + /**+ + * Gets the file location of the given map + */ + public VFile2 getMapFileFromName(String mapName) { + return new VFile2(this.mapDataDir, mapName + ".dat"); + } + + /**+ + * Returns the name of the directory where world information is + * saved. + */ + public String getWorldDirectoryName() { + return this.saveDirectoryName; + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/WorldInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/WorldInfo.java new file mode 100644 index 0000000..273877c --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/WorldInfo.java @@ -0,0 +1,796 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.EnumDifficulty; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.GameRules; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldSettings; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldType; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__checkIntegratedContextValid; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 WorldInfo { + + static { + __checkIntegratedContextValid("net/minecraft/world/storage/WorldInfo"); + } + + public static final EnumDifficulty DEFAULT_DIFFICULTY = EnumDifficulty.NORMAL; + private long randomSeed; + private WorldType terrainType = WorldType.DEFAULT; + private String generatorOptions = ""; + private int spawnX; + private int spawnY; + private int spawnZ; + private long totalTime; + private long worldTime; + private long lastTimePlayed; + private long sizeOnDisk; + private NBTTagCompound playerTag; + private int dimension; + private String levelName; + private int saveVersion; + private int cleanWeatherTime; + private boolean raining; + private int rainTime; + private boolean thundering; + private int thunderTime; + private WorldSettings.GameType theGameType; + private boolean mapFeaturesEnabled; + private boolean hardcore; + private boolean allowCommands; + private boolean initialized; + private EnumDifficulty difficulty; + private boolean difficultyLocked; + private double borderCenterX = 0.0D; + private double borderCenterZ = 0.0D; + private double borderSize = 6.0E7D; + private long borderSizeLerpTime = 0L; + private double borderSizeLerpTarget = 0.0D; + private double borderSafeZone = 5.0D; + private double borderDamagePerBlock = 0.2D; + private int borderWarningDistance = 5; + private int borderWarningTime = 15; + private GameRules theGameRules = new GameRules(); + + protected WorldInfo() { + } + + public WorldInfo(NBTTagCompound nbt) { + this.randomSeed = nbt.getLong("RandomSeed"); + if (nbt.hasKey("generatorName", 8)) { + String s = nbt.getString("generatorName"); + this.terrainType = WorldType.parseWorldType(s); + if (this.terrainType == null) { + this.terrainType = WorldType.DEFAULT; + } else if (this.terrainType.isVersioned()) { + int i = 0; + if (nbt.hasKey("generatorVersion", 99)) { + i = nbt.getInteger("generatorVersion"); + } + + this.terrainType = this.terrainType.getWorldTypeForGeneratorVersion(i); + } + + if (nbt.hasKey("generatorOptions", 8)) { + this.generatorOptions = nbt.getString("generatorOptions"); + } + } + + this.theGameType = WorldSettings.GameType.getByID(nbt.getInteger("GameType")); + if (nbt.hasKey("MapFeatures", 99)) { + this.mapFeaturesEnabled = nbt.getBoolean("MapFeatures"); + } else { + this.mapFeaturesEnabled = true; + } + + this.spawnX = nbt.getInteger("SpawnX"); + this.spawnY = nbt.getInteger("SpawnY"); + this.spawnZ = nbt.getInteger("SpawnZ"); + this.totalTime = nbt.getLong("Time"); + if (nbt.hasKey("DayTime", 99)) { + this.worldTime = nbt.getLong("DayTime"); + } else { + this.worldTime = this.totalTime; + } + + this.lastTimePlayed = nbt.getLong("LastPlayed"); + this.sizeOnDisk = nbt.getLong("SizeOnDisk"); + this.levelName = nbt.getString("LevelName"); + this.saveVersion = nbt.getInteger("version"); + this.cleanWeatherTime = nbt.getInteger("clearWeatherTime"); + this.rainTime = nbt.getInteger("rainTime"); + this.raining = nbt.getBoolean("raining"); + this.thunderTime = nbt.getInteger("thunderTime"); + this.thundering = nbt.getBoolean("thundering"); + this.hardcore = nbt.getBoolean("hardcore"); + if (nbt.hasKey("initialized", 99)) { + this.initialized = nbt.getBoolean("initialized"); + } else { + this.initialized = true; + } + + if (nbt.hasKey("allowCommands", 99)) { + this.allowCommands = nbt.getBoolean("allowCommands"); + } else { + this.allowCommands = this.theGameType == WorldSettings.GameType.CREATIVE; + } + + if (nbt.hasKey("Player", 10)) { + this.playerTag = nbt.getCompoundTag("Player"); + this.dimension = this.playerTag.getInteger("Dimension"); + } + + if (nbt.hasKey("GameRules", 10)) { + this.theGameRules.readFromNBT(nbt.getCompoundTag("GameRules")); + } + + if (nbt.hasKey("Difficulty", 99)) { + this.difficulty = EnumDifficulty.getDifficultyEnum(nbt.getByte("Difficulty")); + } + + if (nbt.hasKey("DifficultyLocked", 1)) { + this.difficultyLocked = nbt.getBoolean("DifficultyLocked"); + } + + if (nbt.hasKey("BorderCenterX", 99)) { + this.borderCenterX = nbt.getDouble("BorderCenterX"); + } + + if (nbt.hasKey("BorderCenterZ", 99)) { + this.borderCenterZ = nbt.getDouble("BorderCenterZ"); + } + + if (nbt.hasKey("BorderSize", 99)) { + this.borderSize = nbt.getDouble("BorderSize"); + } + + if (nbt.hasKey("BorderSizeLerpTime", 99)) { + this.borderSizeLerpTime = nbt.getLong("BorderSizeLerpTime"); + } + + if (nbt.hasKey("BorderSizeLerpTarget", 99)) { + this.borderSizeLerpTarget = nbt.getDouble("BorderSizeLerpTarget"); + } + + if (nbt.hasKey("BorderSafeZone", 99)) { + this.borderSafeZone = nbt.getDouble("BorderSafeZone"); + } + + if (nbt.hasKey("BorderDamagePerBlock", 99)) { + this.borderDamagePerBlock = nbt.getDouble("BorderDamagePerBlock"); + } + + if (nbt.hasKey("BorderWarningBlocks", 99)) { + this.borderWarningDistance = nbt.getInteger("BorderWarningBlocks"); + } + + if (nbt.hasKey("BorderWarningTime", 99)) { + this.borderWarningTime = nbt.getInteger("BorderWarningTime"); + } + + } + + public WorldInfo(WorldSettings settings, String name) { + this.populateFromWorldSettings(settings); + this.levelName = name; + this.difficulty = DEFAULT_DIFFICULTY; + this.initialized = false; + } + + public void populateFromWorldSettings(WorldSettings settings) { + this.randomSeed = settings.getSeed(); + this.theGameType = settings.getGameType(); + this.mapFeaturesEnabled = settings.isMapFeaturesEnabled(); + this.hardcore = settings.getHardcoreEnabled(); + this.terrainType = settings.getTerrainType(); + this.generatorOptions = settings.getWorldName(); + this.allowCommands = settings.areCommandsAllowed(); + } + + public WorldInfo(WorldInfo worldInformation) { + this.randomSeed = worldInformation.randomSeed; + this.terrainType = worldInformation.terrainType; + this.generatorOptions = worldInformation.generatorOptions; + this.theGameType = worldInformation.theGameType; + this.mapFeaturesEnabled = worldInformation.mapFeaturesEnabled; + this.spawnX = worldInformation.spawnX; + this.spawnY = worldInformation.spawnY; + this.spawnZ = worldInformation.spawnZ; + this.totalTime = worldInformation.totalTime; + this.worldTime = worldInformation.worldTime; + this.lastTimePlayed = worldInformation.lastTimePlayed; + this.sizeOnDisk = worldInformation.sizeOnDisk; + this.playerTag = worldInformation.playerTag; + this.dimension = worldInformation.dimension; + this.levelName = worldInformation.levelName; + this.saveVersion = worldInformation.saveVersion; + this.rainTime = worldInformation.rainTime; + this.raining = worldInformation.raining; + this.thunderTime = worldInformation.thunderTime; + this.thundering = worldInformation.thundering; + this.hardcore = worldInformation.hardcore; + this.allowCommands = worldInformation.allowCommands; + this.initialized = worldInformation.initialized; + this.theGameRules = worldInformation.theGameRules; + this.difficulty = worldInformation.difficulty; + this.difficultyLocked = worldInformation.difficultyLocked; + this.borderCenterX = worldInformation.borderCenterX; + this.borderCenterZ = worldInformation.borderCenterZ; + this.borderSize = worldInformation.borderSize; + this.borderSizeLerpTime = worldInformation.borderSizeLerpTime; + this.borderSizeLerpTarget = worldInformation.borderSizeLerpTarget; + this.borderSafeZone = worldInformation.borderSafeZone; + this.borderDamagePerBlock = worldInformation.borderDamagePerBlock; + this.borderWarningTime = worldInformation.borderWarningTime; + this.borderWarningDistance = worldInformation.borderWarningDistance; + } + + /**+ + * Gets the NBTTagCompound for the worldInfo + */ + public NBTTagCompound getNBTTagCompound() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.updateTagCompound(nbttagcompound, this.playerTag); + return nbttagcompound; + } + + /**+ + * Creates a new NBTTagCompound for the world, with the given + * NBTTag as the "Player" + */ + public NBTTagCompound cloneNBTCompound(NBTTagCompound nbttagcompound) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + this.updateTagCompound(nbttagcompound1, nbttagcompound); + return nbttagcompound1; + } + + private void updateTagCompound(NBTTagCompound nbt, NBTTagCompound playerNbt) { + nbt.setLong("RandomSeed", this.randomSeed); + nbt.setString("generatorName", this.terrainType.getWorldTypeName()); + nbt.setInteger("generatorVersion", this.terrainType.getGeneratorVersion()); + nbt.setString("generatorOptions", this.generatorOptions); + nbt.setInteger("GameType", this.theGameType.getID()); + nbt.setBoolean("MapFeatures", this.mapFeaturesEnabled); + nbt.setInteger("SpawnX", this.spawnX); + nbt.setInteger("SpawnY", this.spawnY); + nbt.setInteger("SpawnZ", this.spawnZ); + nbt.setLong("Time", this.totalTime); + nbt.setLong("DayTime", this.worldTime); + nbt.setLong("SizeOnDisk", this.sizeOnDisk); + nbt.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis()); + nbt.setString("LevelName", this.levelName); + nbt.setInteger("version", this.saveVersion); + nbt.setInteger("clearWeatherTime", this.cleanWeatherTime); + nbt.setInteger("rainTime", this.rainTime); + nbt.setBoolean("raining", this.raining); + nbt.setInteger("thunderTime", this.thunderTime); + nbt.setBoolean("thundering", this.thundering); + nbt.setBoolean("hardcore", this.hardcore); + nbt.setBoolean("allowCommands", this.allowCommands); + nbt.setBoolean("initialized", this.initialized); + nbt.setDouble("BorderCenterX", this.borderCenterX); + nbt.setDouble("BorderCenterZ", this.borderCenterZ); + nbt.setDouble("BorderSize", this.borderSize); + nbt.setLong("BorderSizeLerpTime", this.borderSizeLerpTime); + nbt.setDouble("BorderSafeZone", this.borderSafeZone); + nbt.setDouble("BorderDamagePerBlock", this.borderDamagePerBlock); + nbt.setDouble("BorderSizeLerpTarget", this.borderSizeLerpTarget); + nbt.setDouble("BorderWarningBlocks", (double) this.borderWarningDistance); + nbt.setDouble("BorderWarningTime", (double) this.borderWarningTime); + if (this.difficulty != null) { + nbt.setByte("Difficulty", (byte) this.difficulty.getDifficultyId()); + } + + nbt.setBoolean("DifficultyLocked", this.difficultyLocked); + nbt.setTag("GameRules", this.theGameRules.writeToNBT()); + if (playerNbt != null) { + nbt.setTag("Player", playerNbt); + } + + } + + /**+ + * Returns the seed of current world. + */ + public long getSeed() { + return this.randomSeed; + } + + /**+ + * Returns the x spawn position + */ + public int getSpawnX() { + return this.spawnX; + } + + /**+ + * Return the Y axis spawning point of the player. + */ + public int getSpawnY() { + return this.spawnY; + } + + /**+ + * Returns the z spawn position + */ + public int getSpawnZ() { + return this.spawnZ; + } + + public long getWorldTotalTime() { + return this.totalTime; + } + + /**+ + * Get current world time + */ + public long getWorldTime() { + return this.worldTime; + } + + public long getSizeOnDisk() { + return this.sizeOnDisk; + } + + /**+ + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() { + return this.playerTag; + } + + /**+ + * Set the x spawn position to the passed in value + */ + public void setSpawnX(int i) { + this.spawnX = i; + } + + /**+ + * Sets the y spawn position + */ + public void setSpawnY(int i) { + this.spawnY = i; + } + + /**+ + * Set the z spawn position to the passed in value + */ + public void setSpawnZ(int i) { + this.spawnZ = i; + } + + public void setWorldTotalTime(long i) { + this.totalTime = i; + } + + /**+ + * Set current world time + */ + public void setWorldTime(long i) { + this.worldTime = i; + } + + public void setSpawn(BlockPos blockpos) { + this.spawnX = blockpos.getX(); + this.spawnY = blockpos.getY(); + this.spawnZ = blockpos.getZ(); + } + + /**+ + * Get current world name + */ + public String getWorldName() { + return this.levelName; + } + + public void setWorldName(String s) { + this.levelName = s; + } + + /**+ + * Returns the save version of this world + */ + public int getSaveVersion() { + return this.saveVersion; + } + + /**+ + * Sets the save version of the world + */ + public void setSaveVersion(int i) { + this.saveVersion = i; + } + + /**+ + * Return the last time the player was in this world. + */ + public long getLastTimePlayed() { + return this.lastTimePlayed; + } + + public int getCleanWeatherTime() { + return this.cleanWeatherTime; + } + + public void setCleanWeatherTime(int cleanWeatherTimeIn) { + this.cleanWeatherTime = cleanWeatherTimeIn; + } + + /**+ + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() { + return this.thundering; + } + + /**+ + * Sets whether it is thundering or not. + */ + public void setThundering(boolean flag) { + this.thundering = flag; + } + + /**+ + * Returns the number of ticks until next thunderbolt. + */ + public int getThunderTime() { + return this.thunderTime; + } + + /**+ + * Defines the number of ticks until next thunderbolt. + */ + public void setThunderTime(int i) { + this.thunderTime = i; + } + + /**+ + * Returns true if it is raining, false otherwise. + */ + public boolean isRaining() { + return this.raining; + } + + /**+ + * Sets whether it is raining or not. + */ + public void setRaining(boolean flag) { + this.raining = flag; + } + + /**+ + * Return the number of ticks until rain. + */ + public int getRainTime() { + return this.rainTime; + } + + /**+ + * Sets the number of ticks until rain. + */ + public void setRainTime(int i) { + this.rainTime = i; + } + + /**+ + * Gets the GameType. + */ + public WorldSettings.GameType getGameType() { + return this.theGameType; + } + + /**+ + * Get whether the map features (e.g. strongholds) generation is + * enabled or disabled. + */ + public boolean isMapFeaturesEnabled() { + return this.mapFeaturesEnabled; + } + + public void setMapFeaturesEnabled(boolean enabled) { + this.mapFeaturesEnabled = enabled; + } + + /**+ + * Sets the GameType. + */ + public void setGameType(WorldSettings.GameType type) { + this.theGameType = type; + } + + /**+ + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean isHardcoreModeEnabled() { + return this.hardcore; + } + + public void setHardcore(boolean hardcoreIn) { + this.hardcore = hardcoreIn; + } + + public WorldType getTerrainType() { + return this.terrainType; + } + + public void setTerrainType(WorldType worldtype) { + this.terrainType = worldtype; + } + + public String getGeneratorOptions() { + return this.generatorOptions; + } + + /**+ + * Returns true if commands are allowed on this World. + */ + public boolean areCommandsAllowed() { + return this.allowCommands; + } + + public void setAllowCommands(boolean flag) { + this.allowCommands = flag; + } + + /**+ + * Returns true if the World is initialized. + */ + public boolean isInitialized() { + return this.initialized; + } + + /**+ + * Sets the initialization status of the World. + */ + public void setServerInitialized(boolean flag) { + this.initialized = flag; + } + + /**+ + * Gets the GameRules class Instance. + */ + public GameRules getGameRulesInstance() { + return this.theGameRules; + } + + /**+ + * Returns the border center X position + */ + public double getBorderCenterX() { + return this.borderCenterX; + } + + /**+ + * Returns the border center Z position + */ + public double getBorderCenterZ() { + return this.borderCenterZ; + } + + public double getBorderSize() { + return this.borderSize; + } + + /**+ + * Sets the border size + */ + public void setBorderSize(double size) { + this.borderSize = size; + } + + /**+ + * Returns the border lerp time + */ + public long getBorderLerpTime() { + return this.borderSizeLerpTime; + } + + /**+ + * Sets the border lerp time + */ + public void setBorderLerpTime(long time) { + this.borderSizeLerpTime = time; + } + + /**+ + * Returns the border lerp target + */ + public double getBorderLerpTarget() { + return this.borderSizeLerpTarget; + } + + /**+ + * Sets the border lerp target + */ + public void setBorderLerpTarget(double lerpSize) { + this.borderSizeLerpTarget = lerpSize; + } + + /**+ + * Returns the border center Z position + */ + public void getBorderCenterZ(double posZ) { + this.borderCenterZ = posZ; + } + + /**+ + * Returns the border center X position + */ + public void getBorderCenterX(double posX) { + this.borderCenterX = posX; + } + + /**+ + * Returns the border safe zone + */ + public double getBorderSafeZone() { + return this.borderSafeZone; + } + + /**+ + * Sets the border safe zone + */ + public void setBorderSafeZone(double amount) { + this.borderSafeZone = amount; + } + + /**+ + * Returns the border damage per block + */ + public double getBorderDamagePerBlock() { + return this.borderDamagePerBlock; + } + + /**+ + * Sets the border damage per block + */ + public void setBorderDamagePerBlock(double damage) { + this.borderDamagePerBlock = damage; + } + + /**+ + * Returns the border warning distance + */ + public int getBorderWarningDistance() { + return this.borderWarningDistance; + } + + /**+ + * Returns the border warning time + */ + public int getBorderWarningTime() { + return this.borderWarningTime; + } + + /**+ + * Sets the border warning distance + */ + public void setBorderWarningDistance(int amountOfBlocks) { + this.borderWarningDistance = amountOfBlocks; + } + + /**+ + * Sets the border warning time + */ + public void setBorderWarningTime(int ticks) { + this.borderWarningTime = ticks; + } + + public EnumDifficulty getDifficulty() { + return this.difficulty; + } + + public void setDifficulty(EnumDifficulty enumdifficulty) { + this.difficulty = enumdifficulty; + } + + public boolean isDifficultyLocked() { + return this.difficultyLocked; + } + + public void setDifficultyLocked(boolean flag) { + this.difficultyLocked = flag; + } + + /**+ + * Adds this WorldInfo instance to the crash report. + */ + public void addToCrashReport(CrashReportCategory category) { + category.addCrashSectionCallable("Level seed", new Callable() { + public String call() throws Exception { + return String.valueOf(WorldInfo.this.getSeed()); + } + }); + category.addCrashSectionCallable("Level generator", new Callable() { + public String call() throws Exception { + return HString.format("ID %02d - %s, ver %d. Features enabled: %b", + new Object[] { Integer.valueOf(WorldInfo.this.terrainType.getWorldTypeID()), + WorldInfo.this.terrainType.getWorldTypeName(), + Integer.valueOf(WorldInfo.this.terrainType.getGeneratorVersion()), + Boolean.valueOf(WorldInfo.this.mapFeaturesEnabled) }); + } + }); + category.addCrashSectionCallable("Level generator options", new Callable() { + public String call() throws Exception { + return WorldInfo.this.generatorOptions; + } + }); + category.addCrashSectionCallable("Level spawn location", new Callable() { + public String call() throws Exception { + return CrashReportCategory.getCoordinateInfo((double) WorldInfo.this.spawnX, + (double) WorldInfo.this.spawnY, (double) WorldInfo.this.spawnZ); + } + }); + category.addCrashSectionCallable("Level time", new Callable() { + public String call() throws Exception { + return HString.format("%d game time, %d day time", new Object[] { + Long.valueOf(WorldInfo.this.totalTime), Long.valueOf(WorldInfo.this.worldTime) }); + } + }); + category.addCrashSectionCallable("Level dimension", new Callable() { + public String call() throws Exception { + return String.valueOf(WorldInfo.this.dimension); + } + }); + category.addCrashSectionCallable("Level storage version", new Callable() { + public String call() throws Exception { + String s = "Unknown?"; + + try { + switch (WorldInfo.this.saveVersion) { + case 19132: + s = "McRegion"; + break; + case 19133: + s = "Anvil"; + } + } catch (Throwable var3) { + ; + } + + return HString.format("0x%05X - %s", new Object[] { Integer.valueOf(WorldInfo.this.saveVersion), s }); + } + }); + category.addCrashSectionCallable("Level weather", new Callable() { + public String call() throws Exception { + return HString.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", + new Object[] { Integer.valueOf(WorldInfo.this.rainTime), + Boolean.valueOf(WorldInfo.this.raining), Integer.valueOf(WorldInfo.this.thunderTime), + Boolean.valueOf(WorldInfo.this.thundering) }); + } + }); + category.addCrashSectionCallable("Level game mode", new Callable() { + public String call() throws Exception { + return HString.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[] { + WorldInfo.this.theGameType.getName(), Integer.valueOf(WorldInfo.this.theGameType.getID()), + Boolean.valueOf(WorldInfo.this.hardcore), Boolean.valueOf(WorldInfo.this.allowCommands) }); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java new file mode 100644 index 0000000..2671279 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java @@ -0,0 +1,167 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.export; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.zip.CRC32; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; + +/** + * 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 EPKCompiler { + + private final ByteArrayOutputStream os; + private final CRC32 checkSum = new CRC32(); + private int lengthIntegerOffset = 0; + private int totalFileCount = 0; + + public EPKCompiler(String name, String owner, String type) { + os = new ByteArrayOutputStream(0x200000); + try { + + os.write(new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36}); // EAGPKG$$ + os.write(new byte[]{(byte)6,(byte)118,(byte)101,(byte)114,(byte)50,(byte)46,(byte)48}); // 6 + ver2.0 + Date d = new Date(); + + byte[] filename = (name + ".epk").getBytes(StandardCharsets.UTF_8); + os.write(filename.length); + os.write(filename); + + byte[] comment = ("\n\n # Eagler EPK v2.0 (c) " + EagRuntime.fixDateFormat(new SimpleDateFormat("yyyy")).format(d) + " " + + owner + "\n # export: on " + EagRuntime.fixDateFormat(new SimpleDateFormat("MM/dd/yyyy")).format(d) + " at " + + EagRuntime.fixDateFormat(new SimpleDateFormat("hh:mm:ss aa")).format(d) + "\n\n # world name: " + name + "\n\n") + .getBytes(StandardCharsets.UTF_8); + + os.write((comment.length >> 8) & 255); + os.write(comment.length & 255); + os.write(comment); + + writeLong(d.getTime(), os); + + lengthIntegerOffset = os.size(); + os.write(new byte[]{(byte)255,(byte)255,(byte)255,(byte)255}); // this will be replaced with the file count + + os.write('0'); // compression type: none + + os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD + os.write(new byte[]{(byte)9,(byte)102,(byte)105,(byte)108,(byte)101,(byte)45,(byte)116,(byte)121, + (byte)112,(byte)101}); // 9 + file-type + + byte[] typeBytes = type.getBytes(StandardCharsets.UTF_8); + writeInt(typeBytes.length, os); + os.write(typeBytes); // write type + os.write('>'); + + ++totalFileCount; + + os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD + os.write(new byte[]{(byte)10,(byte)119,(byte)111,(byte)114,(byte)108,(byte)100,(byte)45,(byte)110, + (byte)97,(byte)109,(byte)101}); // 10 + world-name + + byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8); + writeInt(nameBytes.length, os); + os.write(nameBytes); // write name + os.write('>'); + + ++totalFileCount; + + os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD + os.write(new byte[]{(byte)11,(byte)119,(byte)111,(byte)114,(byte)108,(byte)100,(byte)45,(byte)111, + (byte)119,(byte)110,(byte)101,(byte)114}); // 11 + world-owner + + byte[] ownerBytes = owner.getBytes(StandardCharsets.UTF_8); + writeInt(ownerBytes.length, os); + os.write(ownerBytes); // write owner + os.write('>'); + + ++totalFileCount; + + }catch(IOException ex) { + throw new RuntimeException("This happened somehow", ex); + } + } + + public void append(String name, byte[] dat) { + try { + + checkSum.reset(); + checkSum.update(dat, 0, dat.length); + long sum = checkSum.getValue(); + + os.write(new byte[]{(byte)70,(byte)73,(byte)76,(byte)69}); // FILE + + byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8); + os.write(nameBytes.length); + os.write(nameBytes); + + writeInt(dat.length + 5, os); + writeInt((int)sum, os); + + os.write(dat); + + os.write(':'); + os.write('>'); + + ++totalFileCount; + + }catch(IOException ex) { + throw new RuntimeException("This happened somehow", ex); + } + } + + public byte[] complete() { + try { + + os.write(new byte[]{(byte)69,(byte)78,(byte)68,(byte)36}); // END$ + os.write(new byte[]{(byte)58,(byte)58,(byte)58,(byte)89,(byte)69,(byte)69,(byte)58,(byte)62}); // :::YEE:> + + byte[] ret = os.toByteArray(); + + ret[lengthIntegerOffset] = (byte)((totalFileCount >> 24) & 0xFF); + ret[lengthIntegerOffset + 1] = (byte)((totalFileCount >> 16) & 0xFF); + ret[lengthIntegerOffset + 2] = (byte)((totalFileCount >> 8) & 0xFF); + ret[lengthIntegerOffset + 3] = (byte)(totalFileCount & 0xFF); + + return ret; + + }catch(IOException ex) { + throw new RuntimeException("This happened somehow", ex); + } + } + + public static void writeInt(int i, OutputStream os) throws IOException { + os.write((i >> 24) & 0xFF); + os.write((i >> 16) & 0xFF); + os.write((i >> 8) & 0xFF); + os.write(i & 0xFF); + } + + public static void writeLong(long i, OutputStream os) throws IOException { + os.write((int)((i >> 56) & 0xFF)); + os.write((int)((i >> 48) & 0xFF)); + os.write((int)((i >> 40) & 0xFF)); + os.write((int)((i >> 32) & 0xFF)); + os.write((int)((i >> 24) & 0xFF)); + os.write((int)((i >> 16) & 0xFF)); + os.write((int)((i >> 8) & 0xFF)); + os.write((int)(i & 0xFF)); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java new file mode 100644 index 0000000..4453f3d --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java @@ -0,0 +1,180 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.export; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.zip.CRC32; + +import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; + +/** + * 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 EPKDecompiler { + + public static class FileEntry { + public final String type; + public final String name; + public final byte[] data; + protected FileEntry(String type, String name, byte[] data) { + this.type = type; + this.name = name; + this.data = data; + } + } + + private ByteArrayInputStream in2; + private InputStream zis; + private CRC32 crc32; + private int numFiles; + private boolean isFinished = false; + + public EPKDecompiler(byte[] data) throws IOException { + in2 = new ByteArrayInputStream(data); + + byte[] header = new byte[8]; + in2.read(header); + + if(Arrays.equals(header, new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36})) { + byte[] endCode = new byte[] { (byte)':', (byte)':', (byte)':', (byte)'Y', + (byte)'E', (byte)'E', (byte)':', (byte)'>' }; + for(int i = 0; i < 8; ++i) { + if(data[data.length - 8 + i] != endCode[i]) { + throw new IOException("EPK file is missing EOF code (:::YEE:>)"); + } + } + in2 = new ByteArrayInputStream(data, 8, data.length - 16); + InputStream is = in2; + + String vers = readASCII(is); + if(!vers.startsWith("ver2.")) { + throw new IOException("Unknown or invalid EPK version: " + vers); + } + + is.skip(is.read()); // skip filename + is.skip(loadShort(is)); // skip comment + is.skip(8); // skip millis date + + numFiles = loadInt(is); + + char compressionType = (char)is.read(); + + switch(compressionType) { + case 'G': + zis = EaglerZLIB.newGZIPInputStream(is); + break; + case 'Z': + zis = EaglerZLIB.newInflaterInputStream(is); + break; + case '0': + zis = is; + break; + default: + throw new IOException("Invalid or unsupported EPK compression: " + compressionType); + } + + crc32 = new CRC32(); + }else if(Arrays.equals(header, new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)33,(byte)33})) { + throw new IOException("FILE IS AN UNSUPPORTED LEGACY FORMAT!"); + }else { + throw new IOException("FILE IS NOT AN EPK FILE!"); + } + + } + + public FileEntry readFile() throws IOException { + if(isFinished) { + return null; + } + + byte[] typeBytes = new byte[4]; + zis.read(typeBytes); + String type = readASCII(typeBytes); + + if(numFiles == 0) { + if(!"END$".equals(type)) { + throw new IOException("EPK file is missing END code (END$)"); + } + isFinished = true; + return null; + }else { + if("END$".equals(type)) { + throw new IOException("Unexpected END when there are still " + numFiles + " files remaining"); + }else { + String name = readASCII(zis); + int len = loadInt(zis); + byte[] data; + + if("FILE".equals(type)) { + if(len < 5) { + throw new IOException("File '" + name + "' is incomplete (no crc)"); + } + + int loadedCrc = loadInt(zis); + + data = new byte[len - 5]; + zis.read(data); + + crc32.reset(); + crc32.update(data, 0, data.length); + if((int)crc32.getValue() != loadedCrc) { + throw new IOException("File '" + name + "' has an invalid checksum"); + } + + if(zis.read() != ':') { + throw new IOException("File '" + name + "' is incomplete"); + } + }else { + data = new byte[len]; + zis.read(data); + } + + if(zis.read() != '>') { + throw new IOException("Object '" + name + "' is incomplete"); + } + + --numFiles; + return new FileEntry(type, name, data); + } + } + } + + private static final int loadShort(InputStream is) throws IOException { + return (is.read() << 8) | is.read(); + } + + private static final int loadInt(InputStream is) throws IOException { + return (is.read() << 24) | (is.read() << 16) | (is.read() << 8) | is.read(); + } + + public static final String readASCII(byte[] bytesIn) throws IOException { + char[] charIn = new char[bytesIn.length]; + for(int i = 0; i < bytesIn.length; ++i) { + charIn[i] = (char)((int)bytesIn[i] & 0xFF); + } + return new String(charIn); + } + + private static final String readASCII(InputStream bytesIn) throws IOException { + int len = bytesIn.read(); + char[] charIn = new char[len]; + for(int i = 0; i < len; ++i) { + charIn[i] = (char)(bytesIn.read() & 0xFF); + } + return new String(charIn); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/RandomAccessMemoryFile.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/RandomAccessMemoryFile.java new file mode 100644 index 0000000..d0052cc --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/RandomAccessMemoryFile.java @@ -0,0 +1,310 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.export; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.EOFException; +import java.io.IOException; + +/** + * 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 RandomAccessMemoryFile implements DataInput, DataOutput { + + private byte[] buffer; + private int length; + private int pos; + + public RandomAccessMemoryFile(byte[] initialBuffer, int initialLength) { + this.buffer = initialBuffer; + this.length = initialLength; + this.pos = 0; + } + + private void grow(int newMaxSize) { + if (length < newMaxSize) { + if (buffer.length < newMaxSize) { + byte[] newBuffer = new byte[newMaxSize | 0x7FFFF]; + System.arraycopy(buffer, 0, newBuffer, 0, length); + buffer = newBuffer; + } + length = newMaxSize; + } + } + + public byte[] getByteArray() { + byte[] b = new byte[length]; + System.arraycopy(buffer, 0, b, 0, length); + return b; + } + + public int read() throws IOException { + return (pos < length) ? (buffer[pos++] & 0xff) : -1; + } + + private int readBytes(byte b[], int off, int len) throws IOException { + if (pos >= length) { + return -1; + } + + int avail = length - pos; + if (len > avail) { + len = avail; + } + if (len <= 0) { + return 0; + } + System.arraycopy(buffer, pos, b, off, len); + pos += len; + return len; + } + + public int read(byte b[], int off, int len) throws IOException { + return readBytes(b, off, len); + } + + public int read(byte b[]) throws IOException { + return readBytes(b, 0, b.length); + } + + public final void readFully(byte b[]) throws IOException { + readFully(b, 0, b.length); + } + + public final void readFully(byte b[], int off, int len) throws IOException { + int n = 0; + do { + int count = this.read(b, off + n, len - n); + if (count < 0) + throw new EOFException(); + n += count; + } while (n < len); + } + + public int skipBytes(int n) throws IOException { + int newpos; + + if (n <= 0) { + return 0; + } + newpos = pos + n; + if (newpos > length) { + newpos = length; + } + seek(newpos); + + return (int) (newpos - pos); + } + + public void write(int b) throws IOException { + grow(pos + 1); + buffer[pos] = (byte) b; + pos += 1; + } + + private void writeBytes(byte b[], int off, int len) throws IOException { + grow(pos + len); + System.arraycopy(b, off, buffer, pos, len); + pos += len; + } + + public void write(byte b[]) throws IOException { + writeBytes(b, 0, b.length); + } + + public void write(byte b[], int off, int len) throws IOException { + writeBytes(b, off, len); + } + + public void seek(int pos) { + this.pos = pos; + } + + public int getLength() { + return length; + } + + public void setLength(int newLength) { + grow(newLength); + } + + public final boolean readBoolean() throws IOException { + int ch = this.read(); + if (ch < 0) + throw new EOFException(); + return (ch != 0); + } + + public final byte readByte() throws IOException { + int ch = this.read(); + if (ch < 0) + throw new EOFException(); + return (byte) (ch); + } + + public final int readUnsignedByte() throws IOException { + int ch = this.read(); + if (ch < 0) + throw new EOFException(); + return ch; + } + + public final short readShort() throws IOException { + int ch1 = this.read(); + int ch2 = this.read(); + if ((ch1 | ch2) < 0) + throw new EOFException(); + return (short) ((ch1 << 8) + (ch2 << 0)); + } + + public final int readUnsignedShort() throws IOException { + int ch1 = this.read(); + int ch2 = this.read(); + if ((ch1 | ch2) < 0) + throw new EOFException(); + return (ch1 << 8) + (ch2 << 0); + } + + public final char readChar() throws IOException { + int ch1 = this.read(); + int ch2 = this.read(); + if ((ch1 | ch2) < 0) + throw new EOFException(); + return (char) ((ch1 << 8) + (ch2 << 0)); + } + + public final int readInt() throws IOException { + int ch1 = this.read(); + int ch2 = this.read(); + int ch3 = this.read(); + int ch4 = this.read(); + if ((ch1 | ch2 | ch3 | ch4) < 0) + throw new EOFException(); + return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); + } + + public final long readLong() throws IOException { + return ((long) (readInt()) << 32) + (readInt() & 0xFFFFFFFFL); + } + + public final float readFloat() throws IOException { + return Float.intBitsToFloat(readInt()); + } + + public final double readDouble() throws IOException { + return Double.longBitsToDouble(readLong()); + } + + public final String readLine() throws IOException { + StringBuilder input = new StringBuilder(); + int c = -1; + boolean eol = false; + + while (!eol) { + switch (c = read()) { + case -1: + case '\n': + eol = true; + break; + case '\r': + eol = true; + int cur = pos; + if ((read()) != '\n') { + seek(cur); + } + break; + default: + input.append((char) c); + break; + } + } + + if ((c == -1) && (input.length() == 0)) { + return null; + } + return input.toString(); + } + + public final String readUTF() throws IOException { + throw new IOException("TODO"); + } + + public final void writeBoolean(boolean v) throws IOException { + write(v ? 1 : 0); + } + + public final void writeByte(int v) throws IOException { + write(v); + } + + public final void writeShort(int v) throws IOException { + write((v >>> 8) & 0xFF); + write((v >>> 0) & 0xFF); + } + + public final void writeChar(int v) throws IOException { + write((v >>> 8) & 0xFF); + write((v >>> 0) & 0xFF); + } + + public final void writeInt(int v) throws IOException { + write((v >>> 24) & 0xFF); + write((v >>> 16) & 0xFF); + write((v >>> 8) & 0xFF); + write((v >>> 0) & 0xFF); + } + + public final void writeLong(long v) throws IOException { + write((int) (v >>> 56) & 0xFF); + write((int) (v >>> 48) & 0xFF); + write((int) (v >>> 40) & 0xFF); + write((int) (v >>> 32) & 0xFF); + write((int) (v >>> 24) & 0xFF); + write((int) (v >>> 16) & 0xFF); + write((int) (v >>> 8) & 0xFF); + write((int) (v >>> 0) & 0xFF); + } + + public final void writeFloat(float v) throws IOException { + writeInt(Float.floatToIntBits(v)); + } + + public final void writeDouble(double v) throws IOException { + writeLong(Double.doubleToLongBits(v)); + } + + public final void writeBytes(String s) throws IOException { + int len = s.length(); + byte[] b = new byte[len]; + s.getBytes(0, len, b, 0); + writeBytes(b, 0, len); + } + + public final void writeChars(String s) throws IOException { + int clen = s.length(); + int blen = 2 * clen; + byte[] b = new byte[blen]; + char[] c = new char[clen]; + s.getChars(0, clen, c, 0); + for (int i = 0, j = 0; i < clen; i++) { + b[j++] = (byte) (c[i] >>> 8); + b[j++] = (byte) (c[i] >>> 0); + } + writeBytes(b, 0, blen); + } + + public final void writeUTF(String str) throws IOException { + throw new IOException("TODO"); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java new file mode 100644 index 0000000..727ca99 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java @@ -0,0 +1,128 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.export; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerSaveFormat; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 WorldConverterEPK { + + private static final Logger logger = LogManager.getLogger("WorldConverterEPK"); + + public static void importWorld(byte[] archiveContents, String newName) throws IOException { + logger.info("Importing world \"{}\" from EPK", newName); + String folderName = newName.replaceAll("[\\./\"]", "_"); + VFile2 worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); + while((new VFile2(worldDir, "level.dat")).exists() || (new VFile2(worldDir, "level.dat_old")).exists()) { + folderName += "_"; + worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); + } + EPKDecompiler dc = new EPKDecompiler(archiveContents); + EPKDecompiler.FileEntry f = null; + int lastProgUpdate = 0; + int prog = 0; + String hasReadType = null; + boolean has152Format = false; + int cnt = 0; + while((f = dc.readFile()) != null) { + byte[] b = f.data; + if(hasReadType == null) { + if (f.type.equals("HEAD") && f.name.equals("file-type") + && ((hasReadType = EPKDecompiler.readASCII(f.data)).equals("epk/world188") + || (has152Format = hasReadType.equals("epk/world152")))) { + if(has152Format) { + logger.warn("World type detected as 1.5.2, it will be converted to 1.8.8 format"); + } + continue; + }else { + throw new IOException("file does not contain a singleplayer 1.5.2 or 1.8.8 world!"); + } + } + if(f.type.equals("FILE")) { + if(f.name.equals("level.dat") || f.name.equals("level.dat_old")) { + NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b)); + worldDatNBT.getCompoundTag("Data").setString("LevelName", newName); + worldDatNBT.getCompoundTag("Data").setLong("LastPlayed", System.currentTimeMillis()); + ByteArrayOutputStream tmp = new ByteArrayOutputStream(); + CompressedStreamTools.writeCompressed(worldDatNBT, tmp); + b = tmp.toByteArray(); + } + VFile2 ff = new VFile2(worldDir, f.name); + ff.setAllBytes(b); + prog += b.length; + ++cnt; + if(prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + logger.info("Extracted {} files, {} bytes from EPK...", cnt, prog); + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.importing.1", prog); + } + } + } + logger.info("EPK was successfully extracted into directory \"{}\"", worldDir.getPath()); + String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines(); + if(worldsTxt == null || worldsTxt.length <= 0 || (worldsTxt.length == 1 && worldsTxt[0].trim().length() <= 0)) { + worldsTxt = new String[] { folderName }; + }else { + String[] tmp = worldsTxt; + worldsTxt = new String[worldsTxt.length + 1]; + System.arraycopy(tmp, 0, worldsTxt, 0, tmp.length); + worldsTxt[worldsTxt.length - 1] = folderName; + } + EaglerSaveFormat.worldsList.setAllChars(String.join("\n", worldsTxt)); + } + + public static byte[] exportWorld(String worldName) { + String realWorldName = worldName; + String worldOwner = "UNKNOWN"; + String splitter = new String(new char[] { (char)253, (char)233, (char)233 }); + if(worldName.contains(splitter)) { + int i = worldName.lastIndexOf(splitter); + worldOwner = worldName.substring(i + 3); + realWorldName = worldName.substring(0, i); + } + VFile2 worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(realWorldName, false).getWorldDirectory(); + logger.info("Exporting world directory \"{}\" as EPK", worldDir.getPath()); + final int[] bytesWritten = new int[1]; + final int[] filesWritten = new int[1]; + final int[] lastUpdate = new int[1]; + EPKCompiler c = new EPKCompiler(realWorldName, worldOwner, "epk/world188"); + String pfx = worldDir.getPath(); + for(VFile2 vf : worldDir.listFiles(true)) { + ++filesWritten[0]; + byte[] b = vf.getAllBytes(); + c.append(vf.getPath().substring(pfx.length() + 1), b); + bytesWritten[0] += b.length; + if (bytesWritten[0] - lastUpdate[0] > 25000) { + lastUpdate[0] = bytesWritten[0]; + logger.info("Exporting {} files, {} bytes to EPK...", filesWritten[0], bytesWritten[0]); + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.1", bytesWritten[0]); + } + } + byte[] r = c.complete(); + logger.info("World directory \"{}\" was successfully exported as EPK", worldDir.getPath()); + return r; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java new file mode 100644 index 0000000..4414050 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java @@ -0,0 +1,298 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.export; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerChunkLoader; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerSaveFormat; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage.RegionFile; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + +/** + * 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 WorldConverterMCA { + + private static final Logger logger = LogManager.getLogger("WorldConverterMCA"); + + public static void importWorld(byte[] archiveContents, String newName, byte gameRules) throws IOException { + logger.info("Importing world \"{}\" from MCA", newName); + String folderName = newName.replaceAll("[\\./\"]", "_"); + VFile2 worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); + while((new VFile2(worldDir, "level.dat")).exists() || (new VFile2(worldDir, "level.dat_old")).exists()) { + folderName += "_"; + worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); + } + ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(archiveContents)); + ZipEntry folderNameFile = null; + List fileNames = new ArrayList<>(); + while((folderNameFile = zis.getNextEntry()) != null) { + if (folderNameFile.getName().contains("__MACOSX/")) continue; + if (folderNameFile.isDirectory()) continue; + String lowerName = folderNameFile.getName().toLowerCase(); + if (!(lowerName.endsWith(".dat") || lowerName.endsWith(".dat_old") || lowerName.endsWith(".mca") || lowerName.endsWith(".mcr"))) continue; + fileNames.add(folderNameFile.getName().toCharArray()); + } + final int[] i = new int[] { 0 }; + while(fileNames.get(0).length > i[0] && fileNames.stream().allMatch(w -> w[i[0]] == fileNames.get(0)[i[0]])) i[0]++; + int folderPrefixOffset = i[0]; + zis = new ZipInputStream(new ByteArrayInputStream(archiveContents)); + ZipEntry f = null; + int lastProgUpdate = 0; + int prog = 0; + byte[] bb = new byte[16384]; + while ((f = zis.getNextEntry()) != null) { + if (f.getName().contains("__MACOSX/")) continue; + if (f.isDirectory()) continue; + String lowerName = f.getName().toLowerCase(); + if (!(lowerName.endsWith(".dat") || lowerName.endsWith(".dat_old") || lowerName.endsWith(".mca") || lowerName.endsWith(".mcr") || lowerName.endsWith(".bmp"))) continue; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + int len; + while ((len = zis.read(bb)) != -1) { + baos.write(bb, 0, len); + } + baos.close(); + byte[] b = baos.toByteArray(); + String fileName = f.getName().substring(folderPrefixOffset); + if (fileName.equals("level.dat") || fileName.equals("level.dat_old")) { + NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b)); + + NBTTagCompound gameRulesNBT = worldDatNBT.getCompoundTag("Data").getCompoundTag("GameRules"); + gameRulesNBT.setString("loadSpawnChunks", (gameRules & 2) != 0 ? "true" : "false"); + String s = (gameRules & 1) != 0 ? "true" : "false"; + gameRulesNBT.setString("bedSpawnPoint", s); + gameRulesNBT.setString("clickToRide", "false"); + gameRulesNBT.setString("clickToSit", s); + gameRulesNBT.setString("colorCodes", s); + gameRulesNBT.setString("doSignEditing", s); + worldDatNBT.getCompoundTag("Data").setTag("GameRules", gameRulesNBT); + + worldDatNBT.getCompoundTag("Data").setString("LevelName", newName); + worldDatNBT.getCompoundTag("Data").setLong("LastPlayed", System.currentTimeMillis()); + ByteArrayOutputStream bo = new ByteArrayOutputStream(); + CompressedStreamTools.writeCompressed(worldDatNBT, bo); + b = bo.toByteArray(); + VFile2 ff = new VFile2(worldDir, fileName); + ff.setAllBytes(b); + prog += b.length; + } else if ((fileName.endsWith(".mcr") || fileName.endsWith(".mca")) && (fileName.startsWith("region/") || fileName.startsWith("DIM1/region/") || fileName.startsWith("DIM-1/region/"))) { + VFile2 chunkFolder = new VFile2(worldDir, fileName.startsWith("DIM1") ? "level1" : (fileName.startsWith("DIM-1") ? "level-1" : "level0")); + RegionFile mca = new RegionFile(new RandomAccessMemoryFile(b, b.length)); + int loadChunksCount = 0; + for(int j = 0; j < 32; ++j) { + for(int k = 0; k < 32; ++k) { + if(mca.isChunkSaved(j, k)) { + NBTTagCompound chunkNBT; + NBTTagCompound chunkLevel; + try { + chunkNBT = CompressedStreamTools.read(mca.getChunkDataInputStream(j, k)); + if(!chunkNBT.hasKey("Level", 10)) { + throw new IOException("Chunk is missing level data!"); + } + chunkLevel = chunkNBT.getCompoundTag("Level"); + }catch(Throwable t) { + logger.error("{}: Could not read chunk: {}, {}", fileName, j, k); + logger.error(t); + continue; + } + int chunkX = chunkLevel.getInteger("xPos"); + int chunkZ = chunkLevel.getInteger("zPos"); + VFile2 chunkOut = new VFile2(chunkFolder, EaglerChunkLoader.getChunkPath(chunkX, chunkZ) + ".dat"); + if(chunkOut.exists()) { + logger.error("{}: Chunk already exists: {}", fileName, chunkOut.getPath()); + continue; + } + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + CompressedStreamTools.writeCompressed(chunkNBT, bao); + b = bao.toByteArray(); + chunkOut.setAllBytes(b); + prog += b.length; + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.importing.2", prog); + } + ++loadChunksCount; + } + } + } + logger.info("{}: Imported {} chunks successfully ({} bytes)", fileName, loadChunksCount, prog); + } else if (fileName.startsWith("playerdata/") || fileName.startsWith("stats/")) { + //TODO: LAN player inventories + } else if (fileName.startsWith("data/") || fileName.startsWith("players/") || fileName.startsWith("eagler/skulls/")) { + VFile2 ff = new VFile2(worldDir, fileName); + ff.setAllBytes(b); + prog += b.length; + } else if (!fileName.equals("level.dat_mcr") && !fileName.equals("session.lock")) { + logger.info("Skipping file: {}", fileName); + } + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.importing.2", prog); + } + } + logger.info("MCA was successfully extracted into directory \"{}\"", worldDir.getPath()); + String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines(); + if(worldsTxt == null || worldsTxt.length <= 0 || (worldsTxt.length == 1 && worldsTxt[0].trim().length() <= 0)) { + worldsTxt = new String[] { folderName }; + }else { + String[] tmp = worldsTxt; + worldsTxt = new String[worldsTxt.length + 1]; + System.arraycopy(tmp, 0, worldsTxt, 0, tmp.length); + worldsTxt[worldsTxt.length - 1] = folderName; + } + EaglerSaveFormat.worldsList.setAllChars(String.join("\n", worldsTxt)); + } + + public static byte[] exportWorld(String folderName) throws IOException { + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + ZipOutputStream zos = new ZipOutputStream(bao); + zos.setComment("contains backup of world '" + folderName + "'"); + VFile2 worldFolder = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); + logger.info("Exporting world directory \"{}\" as MCA", worldFolder.getPath()); + VFile2 vf = new VFile2(worldFolder, "level.dat"); + byte[] b; + int lastProgUpdate = 0; + int prog = 0; + boolean safe = false; + if(vf.exists()) { + zos.putNextEntry(new ZipEntry(folderName + "/level.dat")); + b = vf.getAllBytes(); + zos.write(b); + prog += b.length; + safe = true; + } + vf = new VFile2(worldFolder, "level.dat_old"); + if(vf.exists()) { + zos.putNextEntry(new ZipEntry(folderName + "/level.dat_old")); + b = vf.getAllBytes(); + zos.write(b); + prog += b.length; + safe = true; + } + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog); + } + String[] srcFolderNames = new String[] { "level0", "level-1", "level1" }; + String[] dstFolderNames = new String[] { "/region/", "/DIM-1/region/", "/DIM1/region/" }; + List fileList; + for(int i = 0; i < 3; ++i) { + vf = new VFile2(worldFolder, srcFolderNames[i]); + fileList = vf.listFiles(true); + String regionFolder = folderName + dstFolderNames[i]; + logger.info("Converting chunks in \"{}\" as MCA to \"{}\"...", vf.getPath(), regionFolder); + Map regionFiles = new HashMap(); + for(VFile2 chunkFile : fileList) { + NBTTagCompound chunkNBT; + NBTTagCompound chunkLevel; + try { + b = chunkFile.getAllBytes(); + chunkNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b)); + if(!chunkNBT.hasKey("Level", 10)) { + throw new IOException("Chunk is missing level data!"); + } + chunkLevel = chunkNBT.getCompoundTag("Level"); + }catch(IOException t) { + logger.error("Could not read chunk: {}", chunkFile.getPath()); + logger.error(t); + continue; + } + int chunkX = chunkLevel.getInteger("xPos"); + int chunkZ = chunkLevel.getInteger("zPos"); + String regionFileName = "r." + (chunkX >> 5) + "." + (chunkZ >> 5) + ".mca"; + RegionFile rf = regionFiles.get(regionFileName); + if(rf == null) { + rf = new RegionFile(new RandomAccessMemoryFile(new byte[65536], 0)); + regionFiles.put(regionFileName, rf); + } + try(DataOutputStream dos = rf.getChunkDataOutputStream(chunkX & 31, chunkZ & 31)) { + CompressedStreamTools.write(chunkNBT, dos); + }catch(IOException t) { + logger.error("Could not write chunk to {}: {}", regionFileName, chunkFile.getPath()); + logger.error(t); + continue; + } + prog += b.length; + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog); + } + } + if(regionFiles.isEmpty()) { + logger.info("No region files were generated"); + continue; + } + for(Entry etr : regionFiles.entrySet()) { + String regionPath = regionFolder + etr.getKey(); + logger.info("Writing region file: {}", regionPath); + zos.putNextEntry(new ZipEntry(regionPath)); + zos.write(etr.getValue().getFile().getByteArray()); + } + } + logger.info("Copying extra world data..."); + fileList = (new VFile2(worldFolder, "data")).listFiles(false); + for(VFile2 dataFile : fileList) { + zos.putNextEntry(new ZipEntry(folderName + "/data/" + dataFile.getName())); + b = dataFile.getAllBytes(); + zos.write(b); + prog += b.length; + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog); + } + } + fileList = (new VFile2(worldFolder, "players")).listFiles(false); + for(VFile2 dataFile : fileList) { + zos.putNextEntry(new ZipEntry(folderName + "/players/" + dataFile.getName())); + b = dataFile.getAllBytes(); + zos.write(b); + prog += b.length; + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog); + } + } + fileList = (new VFile2(worldFolder, "eagler/skulls")).listFiles(false); + for(VFile2 dataFile : fileList) { + zos.putNextEntry(new ZipEntry(folderName + "/eagler/skulls/" + dataFile.getName())); + b = dataFile.getAllBytes(); + zos.write(b); + prog += b.length; + if (prog - lastProgUpdate > 25000) { + lastProgUpdate = prog; + EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog); + } + } + zos.close(); + logger.info("World directory \"{}\" was successfully exported as MCA", worldFolder.getPath()); + return bao.toByteArray(); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/CustomSkullData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/CustomSkullData.java new file mode 100644 index 0000000..5a90a9e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/CustomSkullData.java @@ -0,0 +1,39 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.skins; + +/** + * 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 CustomSkullData { + + public String skinURL; + public long lastHit; + public byte[] skinData; + + public CustomSkullData(String skinURL, byte[] skinData) { + this.skinURL = skinURL; + this.lastHit = System.currentTimeMillis(); + this.skinData = skinData; + } + + public byte[] getFullSkin() { + if(skinData.length == 16384) { + return skinData; + } + byte[] ret = new byte[16384]; + System.arraycopy(skinData, 0, ret, 0, skinData.length > ret.length ? ret.length : skinData.length); + return ret; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/IntegratedSkinPackets.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/IntegratedSkinPackets.java new file mode 100644 index 0000000..d6fa9c0 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/IntegratedSkinPackets.java @@ -0,0 +1,251 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.skins; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; + +/** + * 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 IntegratedSkinPackets { + + public static final int PACKET_MY_SKIN_PRESET = 0x01; + public static final int PACKET_MY_SKIN_CUSTOM = 0x02; + public static final int PACKET_GET_OTHER_SKIN = 0x03; + public static final int PACKET_OTHER_SKIN_PRESET = 0x04; + public static final int PACKET_OTHER_SKIN_CUSTOM = 0x05; + public static final int PACKET_GET_SKIN_BY_URL = 0x06; + public static final int PACKET_INSTALL_NEW_SKIN = 0x07; + + public static void processPacket(byte[] data, EntityPlayerMP sender, IntegratedSkinService skinService) throws IOException { + if(data.length == 0) { + throw new IOException("Zero-length packet recieved"); + } + int packetId = (int)data[0] & 0xFF; + try { + switch(packetId) { + case PACKET_GET_OTHER_SKIN: + processGetOtherSkin(data, sender, skinService); + break; + case PACKET_GET_SKIN_BY_URL: + processGetOtherSkinByURL(data, sender, skinService); + break; + case PACKET_INSTALL_NEW_SKIN: + processInstallNewSkin(data, sender, skinService); + break; + default: + throw new IOException("Unknown packet type " + packetId); + } + }catch(IOException ex) { + throw ex; + }catch(Throwable t) { + throw new IOException("Unhandled exception handling packet type " + packetId, t); + } + } + + private static void processGetOtherSkin(byte[] data, EntityPlayerMP sender, IntegratedSkinService skinService) throws IOException { + if(data.length != 17) { + throw new IOException("Invalid length " + data.length + " for skin request packet"); + } + EaglercraftUUID searchUUID = bytesToUUID(data, 1); + skinService.processPacketGetOtherSkin(searchUUID, sender); + } + + private static void processGetOtherSkinByURL(byte[] data, EntityPlayerMP sender, IntegratedSkinService skinService) throws IOException { + if(data.length < 20) { + throw new IOException("Invalid length " + data.length + " for skin request packet"); + } + EaglercraftUUID searchUUID = bytesToUUID(data, 1); + int urlLength = (data[17] << 8) | data[18]; + if(data.length < 19 + urlLength) { + throw new IOException("Invalid length " + data.length + " for skin request packet with " + urlLength + " length URL"); + } + skinService.processPacketGetOtherSkin(searchUUID, bytesToAscii(data, 19, urlLength), sender); + } + + private static void processInstallNewSkin(byte[] data, EntityPlayerMP sender, IntegratedSkinService skinService) throws IOException { + if(data.length < 3) { + throw new IOException("Invalid length " + data.length + " for skin data packet"); + } + int dataLength = (data[1] << 8) | data[2]; + byte[] dataBmp = new byte[dataLength]; + if(data.length != dataLength + 3) { + throw new IOException("Invalid data length " + dataLength + " for " + data.length + " byte skin data packet"); + } + System.arraycopy(data, 3, dataBmp, 0, dataLength); + skinService.processPacketInstallNewSkin(dataBmp, sender); + } + + public static void registerEaglerPlayer(EaglercraftUUID clientUUID, byte[] bs, IntegratedSkinService skinService) throws IOException { + if(bs.length == 0) { + throw new IOException("Zero-length packet recieved"); + } + byte[] generatedPacket; + int skinModel = -1; + int packetType = (int)bs[0] & 0xFF; + switch(packetType) { + case PACKET_MY_SKIN_PRESET: + if(bs.length != 5) { + throw new IOException("Invalid length " + bs.length + " for preset skin packet"); + } + generatedPacket = makePresetResponse(clientUUID, (bs[1] << 24) | (bs[2] << 16) | (bs[3] << 8) | (bs[4] & 0xFF)); + break; + case PACKET_MY_SKIN_CUSTOM: + byte[] pixels = new byte[16384]; + if(bs.length != 2 + pixels.length) { + throw new IOException("Invalid length " + bs.length + " for custom skin packet"); + } + setAlphaForChest(pixels, (byte)255); + System.arraycopy(bs, 2, pixels, 0, pixels.length); + generatedPacket = makeCustomResponse(clientUUID, (skinModel = (int)bs[1] & 0xFF), pixels); + break; + default: + throw new IOException("Unknown skin packet type: " + packetType); + } + skinService.processPacketPlayerSkin(clientUUID, generatedPacket, skinModel); + } + + public static void registerEaglerPlayerFallback(EaglercraftUUID clientUUID, IntegratedSkinService skinService) throws IOException { + int skinModel = (clientUUID.hashCode() & 1) != 0 ? 1 : 0; + byte[] generatedPacket = makePresetResponse(clientUUID, skinModel); + skinService.processPacketPlayerSkin(clientUUID, generatedPacket, skinModel); + } + + public static void setAlphaForChest(byte[] skin64x64, byte alpha) { + if(skin64x64.length != 16384) { + throw new IllegalArgumentException("Skin is not 64x64!"); + } + for(int y = 20; y < 32; ++y) { + for(int x = 16; x < 40; ++x) { + skin64x64[(y << 8) | (x << 2)] = alpha; + } + } + } + + public static byte[] makePresetResponse(EaglercraftUUID uuid) { + return makePresetResponse(uuid, (uuid.hashCode() & 1) != 0 ? 1 : 0); + } + + public static byte[] makePresetResponse(EaglercraftUUID uuid, int presetId) { + byte[] ret = new byte[1 + 16 + 4]; + ret[0] = (byte)PACKET_OTHER_SKIN_PRESET; + UUIDToBytes(uuid, ret, 1); + ret[17] = (byte)(presetId >> 24); + ret[18] = (byte)(presetId >> 16); + ret[19] = (byte)(presetId >> 8); + ret[20] = (byte)(presetId & 0xFF); + return ret; + } + + public static byte[] makeCustomResponse(EaglercraftUUID uuid, int model, byte[] pixels) { + byte[] ret = new byte[1 + 16 + 1 + pixels.length]; + ret[0] = (byte)PACKET_OTHER_SKIN_CUSTOM; + UUIDToBytes(uuid, ret, 1); + ret[17] = (byte)model; + System.arraycopy(pixels, 0, ret, 18, pixels.length); + return ret; + } + + public static EaglercraftUUID bytesToUUID(byte[] bytes, int off) { + long msb = (((long) bytes[off] & 0xFFl) << 56l) | (((long) bytes[off + 1] & 0xFFl) << 48l) + | (((long) bytes[off + 2] & 0xFFl) << 40l) | (((long) bytes[off + 3] & 0xFFl) << 32l) + | (((long) bytes[off + 4] & 0xFFl) << 24l) | (((long) bytes[off + 5] & 0xFFl) << 16l) + | (((long) bytes[off + 6] & 0xFFl) << 8l) | ((long) bytes[off + 7] & 0xFFl); + long lsb = (((long) bytes[off + 8] & 0xFFl) << 56l) | (((long) bytes[off + 9] & 0xFFl) << 48l) + | (((long) bytes[off + 10] & 0xFFl) << 40l) | (((long) bytes[off + 11] & 0xFFl) << 32l) + | (((long) bytes[off + 12] & 0xFFl) << 24l) | (((long) bytes[off + 13] & 0xFFl) << 16l) + | (((long) bytes[off + 14] & 0xFFl) << 8l) | ((long) bytes[off + 15] & 0xFFl); + return new EaglercraftUUID(msb, lsb); + } + + private static final String hex = "0123456789abcdef"; + + public static String bytesToString(byte[] bytes, int off, int len) { + char[] ret = new char[len << 1]; + for(int i = 0; i < len; ++i) { + ret[i * 2] = hex.charAt((bytes[off + i] >> 4) & 0xF); + ret[i * 2 + 1] = hex.charAt(bytes[off + i] & 0xF); + } + return new String(ret); + } + + public static String bytesToAscii(byte[] bytes, int off, int len) { + char[] ret = new char[len]; + for(int i = 0; i < len; ++i) { + ret[i] = (char)((int)bytes[off + i] & 0xFF); + } + return new String(ret); + } + + public static String bytesToAscii(byte[] bytes) { + return bytesToAscii(bytes, 0, bytes.length); + } + + public static void UUIDToBytes(EaglercraftUUID uuid, byte[] bytes, int off) { + long msb = uuid.getMostSignificantBits(); + long lsb = uuid.getLeastSignificantBits(); + bytes[off] = (byte)(msb >> 56l); + bytes[off + 1] = (byte)(msb >> 48l); + bytes[off + 2] = (byte)(msb >> 40l); + bytes[off + 3] = (byte)(msb >> 32l); + bytes[off + 4] = (byte)(msb >> 24l); + bytes[off + 5] = (byte)(msb >> 16l); + bytes[off + 6] = (byte)(msb >> 8l); + bytes[off + 7] = (byte)(msb & 0xFFl); + bytes[off + 8] = (byte)(lsb >> 56l); + bytes[off + 9] = (byte)(lsb >> 48l); + bytes[off + 10] = (byte)(lsb >> 40l); + bytes[off + 11] = (byte)(lsb >> 32l); + bytes[off + 12] = (byte)(lsb >> 24l); + bytes[off + 13] = (byte)(lsb >> 16l); + bytes[off + 14] = (byte)(lsb >> 8l); + bytes[off + 15] = (byte)(lsb & 0xFFl); + } + + public static byte[] asciiString(String string) { + byte[] str = new byte[string.length()]; + for(int i = 0; i < str.length; ++i) { + str[i] = (byte)string.charAt(i); + } + return str; + } + + public static EaglercraftUUID createEaglerURLSkinUUID(String skinUrl) { + return EaglercraftUUID.nameUUIDFromBytes(asciiString("EaglercraftSkinURL:" + skinUrl)); + } + + public static int getModelId(String modelName) { + return "slim".equalsIgnoreCase(modelName) ? 1 : 0; + } + + public static byte[] rewriteUUID(EaglercraftUUID newUUID, byte[] pkt) { + byte[] ret = new byte[pkt.length]; + System.arraycopy(pkt, 0, ret, 0, pkt.length); + UUIDToBytes(newUUID, ret, 1); + return ret; + } + + public static byte[] rewriteUUIDModel(EaglercraftUUID newUUID, byte[] pkt, int model) { + byte[] ret = new byte[pkt.length]; + System.arraycopy(pkt, 0, ret, 0, pkt.length); + UUIDToBytes(newUUID, ret, 1); + if(ret[0] == (byte)PACKET_OTHER_SKIN_CUSTOM) { + ret[17] = (byte)model; + } + return ret; + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/IntegratedSkinService.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/IntegratedSkinService.java new file mode 100644 index 0000000..4c47b83 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/skins/IntegratedSkinService.java @@ -0,0 +1,216 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.skins; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.lax1dude.eaglercraft.v1_8.Base64; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.crypto.SHA1Digest; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayerMP; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.init.Items; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.item.ItemStack; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentTranslation; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; + +/** + * 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 IntegratedSkinService { + + public static final Logger logger = LogManager.getLogger("IntegratedSkinService"); + + public static final String CHANNEL = "EAG|Skins-1.8"; + + public static final byte[] skullNotFoundTexture = new byte[4096]; + + static { + for(int y = 0; y < 16; ++y) { + for(int x = 0; x < 64; ++x) { + int i = (y << 8) | (x << 2); + byte j = ((x + y) & 1) == 1 ? (byte)255 : 0; + skullNotFoundTexture[i] = (byte)255; + skullNotFoundTexture[i + 1] = j; + skullNotFoundTexture[i + 2] = 0; + skullNotFoundTexture[i + 3] = j; + } + } + } + + public final VFile2 skullsDirectory; + + public final Map playerSkins = new HashMap(); + public final Map customSkulls = new HashMap(); + + private long lastFlush = 0l; + + public IntegratedSkinService(VFile2 skullsDirectory) { + this.skullsDirectory = skullsDirectory; + } + + public void processPacket(byte[] packetData, EntityPlayerMP sender) { + try { + IntegratedSkinPackets.processPacket(packetData, sender, this); + } catch (IOException e) { + logger.error("Invalid skin request packet recieved from player {}!", sender.getName()); + logger.error(e); + sender.playerNetServerHandler.kickPlayerFromServer("Invalid skin request packet recieved!"); + } + } + + public void processLoginPacket(byte[] packetData, EntityPlayerMP sender) { + try { + IntegratedSkinPackets.registerEaglerPlayer(sender.getUniqueID(), packetData, this); + } catch (IOException e) { + logger.error("Invalid skin data packet recieved from player {}!", sender.getName()); + logger.error(e); + sender.playerNetServerHandler.kickPlayerFromServer("Invalid skin data packet recieved!"); + } + } + + public void processPacketGetOtherSkin(EaglercraftUUID searchUUID, EntityPlayerMP sender) { + byte[] playerSkin = playerSkins.get(searchUUID); + if(playerSkin == null) { + playerSkin = IntegratedSkinPackets.makePresetResponse(searchUUID); + } + sender.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload(CHANNEL, new PacketBuffer(Unpooled.buffer(playerSkin, playerSkin.length).writerIndex(playerSkin.length)))); + } + + public void processPacketGetOtherSkin(EaglercraftUUID searchUUID, String urlStr, EntityPlayerMP sender) { + urlStr = urlStr.toLowerCase(); + byte[] playerSkin; + if(!urlStr.startsWith("eagler://")) { + playerSkin = IntegratedSkinPackets.makePresetResponse(searchUUID, 0); + }else { + urlStr = urlStr.substring(9); + if(urlStr.contains(VFile2.pathSeperator)) { + playerSkin = IntegratedSkinPackets.makePresetResponse(searchUUID, 0); + }else { + CustomSkullData sk = customSkulls.get(urlStr); + if(sk == null) { + customSkulls.put(urlStr, sk = loadCustomSkull(urlStr)); + }else { + sk.lastHit = System.currentTimeMillis(); + } + playerSkin = IntegratedSkinPackets.makeCustomResponse(searchUUID, 0, sk.getFullSkin()); + } + } + sender.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload(CHANNEL, new PacketBuffer(Unpooled.buffer(playerSkin, playerSkin.length).writerIndex(playerSkin.length)))); + } + + public void processPacketPlayerSkin(EaglercraftUUID clientUUID, byte[] generatedPacket, int skinModel) { + playerSkins.put(clientUUID, generatedPacket); + } + + public void unregisterPlayer(EaglercraftUUID clientUUID) { + playerSkins.remove(clientUUID); + } + + public void processPacketInstallNewSkin(byte[] skullData, EntityPlayerMP sender) { + if(!sender.canCommandSenderUseCommand(2, "give")) { + ChatComponentTranslation cc = new ChatComponentTranslation("command.skull.nopermission"); + cc.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(cc); + return; + } + String fileName = "eagler://" + installNewSkull(skullData); + NBTTagCompound rootTagCompound = new NBTTagCompound(); + NBTTagCompound ownerTagCompound = new NBTTagCompound(); + ownerTagCompound.setString("Name", "Eagler"); + ownerTagCompound.setString("Id", EaglercraftUUID.nameUUIDFromBytes((("EaglerSkullUUID:" + fileName).getBytes(StandardCharsets.UTF_8))).toString()); + NBTTagCompound propertiesTagCompound = new NBTTagCompound(); + NBTTagList texturesTagList = new NBTTagList(); + NBTTagCompound texturesTagCompound = new NBTTagCompound(); + String texturesProp = "{\"textures\":{\"SKIN\":{\"url\":\"" + fileName + "\",\"metadata\":{\"model\":\"default\"}}}}"; + texturesTagCompound.setString("Value", Base64.encodeBase64String(texturesProp.getBytes(StandardCharsets.UTF_8))); + texturesTagList.appendTag(texturesTagCompound); + propertiesTagCompound.setTag("textures", texturesTagList); + ownerTagCompound.setTag("Properties", propertiesTagCompound); + rootTagCompound.setTag("SkullOwner", ownerTagCompound); + NBTTagCompound displayTagCompound = new NBTTagCompound(); + displayTagCompound.setString("Name", EnumChatFormatting.RESET + "Custom Eaglercraft Skull"); + NBTTagList loreList = new NBTTagList(); + loreList.appendTag(new NBTTagString(EnumChatFormatting.GRAY + (fileName.length() > 24 ? (fileName.substring(0, 22) + "...") : fileName))); + displayTagCompound.setTag("Lore", loreList); + rootTagCompound.setTag("display", displayTagCompound); + ItemStack stack = new ItemStack(Items.skull, 1, 3); + stack.setTagCompound(rootTagCompound); + boolean flag = sender.inventory.addItemStackToInventory(stack); + if (flag) { + sender.worldObj.playSoundAtEntity(sender, "random.pop", 0.2F, + ((sender.getRNG().nextFloat() - sender.getRNG().nextFloat()) * 0.7F + 1.0F) + * 2.0F); + sender.inventoryContainer.detectAndSendChanges(); + } + sender.addChatMessage(new ChatComponentTranslation("command.skull.feedback", fileName)); + } + + private static final String hex = "0123456789abcdef"; + + public String installNewSkull(byte[] skullData) { + // set to 16384 to save a full 64x64 skin + if(skullData.length > 4096) { + byte[] tmp = skullData; + skullData = new byte[4096]; + System.arraycopy(tmp, 0, skullData, 0, 4096); + } + SHA1Digest sha = new SHA1Digest(); + sha.update(skullData, 0, skullData.length); + byte[] hash = new byte[20]; + sha.doFinal(hash, 0); + char[] hashText = new char[40]; + for(int i = 0; i < 20; ++i) { + hashText[i << 1] = hex.charAt((hash[i] & 0xF0) >> 4); + hashText[(i << 1) + 1] = hex.charAt(hash[i] & 0x0F); + } + String str = "skin-" + new String(hashText) + ".bmp"; + customSkulls.put(str, new CustomSkullData(str, skullData)); + (new VFile2(skullsDirectory, str)).setAllBytes(skullData); + return str; + } + + private CustomSkullData loadCustomSkull(String urlStr) { + byte[] data = (new VFile2(skullsDirectory, urlStr)).getAllBytes(); + if(data == null) { + return new CustomSkullData(urlStr, skullNotFoundTexture); + }else { + return new CustomSkullData(urlStr, data); + } + } + + public void flushCache() { + long cur = System.currentTimeMillis(); + if(cur - lastFlush > 300000l) { + lastFlush = cur; + Iterator customSkullsItr = customSkulls.values().iterator(); + while(customSkullsItr.hasNext()) { + if(cur - customSkullsItr.next().lastHit > 900000l) { + customSkullsItr.remove(); + } + } + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java new file mode 100644 index 0000000..8863c2a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java @@ -0,0 +1,315 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.socket; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; +import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.socket.CompressionNotSupportedException; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.EnumConnectionState; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.EnumPacketDirection; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.INetHandler; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.Packet; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.PacketBuffer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatComponentText; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ITickable; +import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer; + +/** + * 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 IntegratedServerPlayerNetworkManager { + + private INetHandler nethandler = null; + public final String playerChannel; + private EnumConnectionState packetState = EnumConnectionState.HANDSHAKING; + private static PacketBuffer temporaryBuffer; + private static ByteArrayOutputStream temporaryOutputStream; + private int debugPacketCounter = 0; + private byte[][] recievedPacketBuffer = new byte[16384][]; + private int recievedPacketBufferCounter = 0; + private final boolean enableSendCompression; + + private boolean firstPacket = true; + + private List fragmentedPacket = new ArrayList(); + + public static final int fragmentSize = 0xFF00; + public static final int compressionThreshold = 1024; + + public static final Logger logger = LogManager.getLogger("NetworkManager"); + + public IntegratedServerPlayerNetworkManager(String playerChannel) { + if(temporaryBuffer == null) { + temporaryBuffer = new PacketBuffer(Unpooled.buffer(0x1FFFF)); + } + this.playerChannel = playerChannel; + this.enableSendCompression = !SingleplayerServerController.PLAYER_CHANNEL.equals(playerChannel); + if(this.enableSendCompression) { + if(temporaryOutputStream == null) { + temporaryOutputStream = new ByteArrayOutputStream(16386); + } + } + } + + public void connect() { + fragmentedPacket.clear(); + firstPacket = true; + } + + public EnumEaglerConnectionState getConnectStatus() { + return EaglerIntegratedServerWorker.getChannelExists(playerChannel) ? EnumEaglerConnectionState.CONNECTED : EnumEaglerConnectionState.CLOSED; + } + + public void closeChannel(IChatComponent reason) { + EaglerIntegratedServerWorker.closeChannel(playerChannel); + if(nethandler != null) { + nethandler.onDisconnect(reason); + } + } + + public void setConnectionState(EnumConnectionState state) { + packetState = state; + } + + public void addRecievedPacket(byte[] next) { + if(recievedPacketBufferCounter < recievedPacketBuffer.length - 1) { + recievedPacketBuffer[recievedPacketBufferCounter++] = next; + }else { + logger.error("Dropping packets on recievedPacketBuffer for channel \"{}\"! (overflow)", playerChannel); + } + } + + public void processReceivedPackets() { + if(nethandler == null) return; + + + for(int i = 0; i < recievedPacketBufferCounter; ++i) { + byte[] data = recievedPacketBuffer[i]; + byte[] fullData; + + if(enableSendCompression) { + if(firstPacket) { + if(data.length > 2 && data[0] == (byte)0x02 && data[1] == (byte)0x3D) { + ByteArrayOutputStream kickPacketBAO = new ByteArrayOutputStream(); + try { + DataOutputStream kickDAO = new DataOutputStream(kickPacketBAO); + kickDAO.write(0); + kickDAO.write(0xFF); + String msg = "This is an EaglercraftX 1.8 LAN world!"; + kickDAO.write(0x00); + kickDAO.write(msg.length()); + for(int j = 0, l = msg.length(); j < l; ++j) { + kickDAO.write(0); + kickDAO.write(msg.codePointAt(j)); + } + }catch(IOException ex) { + throw new RuntimeException(ex); + } + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(playerChannel, kickPacketBAO.toByteArray())); + closeChannel(new ChatComponentText("Recieved unsuppoorted connection from an Eaglercraft 1.5.2 client!")); + firstPacket = false; + recievedPacketBufferCounter = 0; + return; + } + firstPacket = false; + } + if (data[0] == 0) { + if(fragmentedPacket.isEmpty()) { + fullData = new byte[data.length - 1]; + System.arraycopy(data, 1, fullData, 0, fullData.length); + }else { + fragmentedPacket.add(data); + int len = 0; + int fragCount = fragmentedPacket.size(); + for(int j = 0; j < fragCount; ++j) { + len += fragmentedPacket.get(j).length - 1; + } + fullData = new byte[len]; + len = 0; + for(int j = 0; j < fragCount; ++j) { + byte[] f = fragmentedPacket.get(j); + System.arraycopy(f, 1, fullData, len, f.length - 1); + len += f.length - 1; + } + fragmentedPacket.clear(); + } + } else if (data[0] == 1) { + fragmentedPacket.add(data); + continue; + } else { + logger.error("Recieved {} byte fragment of unknown type: {}", data.length, ((int)data[0] & 0xFF)); + continue; + } + + }else { + fullData = data; + } + + recievedPacketBuffer[i] = null; + ++debugPacketCounter; + try { + ByteBuf nettyBuffer = Unpooled.buffer(fullData, fullData.length); + nettyBuffer.writerIndex(fullData.length); + PacketBuffer input = new PacketBuffer(nettyBuffer); + int pktId = input.readVarIntFromBuffer(); + + Packet pkt; + try { + pkt = packetState.getPacket(EnumPacketDirection.SERVERBOUND, pktId); + }catch(IllegalAccessException | InstantiationException ex) { + throw new IOException("Recieved a packet with type " + pktId + " which is invalid!"); + } + + if(pkt == null) { + throw new IOException("Recieved packet type " + pktId + " which is undefined in state " + packetState); + } + + try { + pkt.readPacketData(input); + }catch(Throwable t) { + throw new IOException("Failed to read packet type '" + pkt.getClass().getSimpleName() + "'", t); + } + + try { + pkt.processPacket(nethandler); + }catch(Throwable t) { + logger.error("Failed to process {}! It'll be skipped for debug purposes.", pkt.getClass().getSimpleName()); + logger.error(t); + } + + }catch(Throwable t) { + logger.error("Failed to process socket frame {}! It'll be skipped for debug purposes.", debugPacketCounter); + logger.error(t); + } + } + recievedPacketBufferCounter = 0; + } + + public void sendPacket(Packet pkt) { + if(!isChannelOpen()) { + return; + } + + int i; + try { + i = packetState.getPacketId(EnumPacketDirection.CLIENTBOUND, pkt); + }catch(Throwable t) { + logger.error("Incorrect packet for state: {}", pkt.getClass().getSimpleName()); + return; + } + + temporaryBuffer.clear(); + temporaryBuffer.writeVarIntToBuffer(i); + try { + pkt.writePacketData(temporaryBuffer); + }catch(IOException ex) { + logger.error("Failed to write packet {}!", pkt.getClass().getSimpleName()); + return; + } + + int len = temporaryBuffer.readableBytes(); + if(enableSendCompression) { + if(len > compressionThreshold) { + temporaryOutputStream.reset(); + byte[] compressedData; + try { + temporaryOutputStream.write(2); + temporaryOutputStream.write((len >> 24) & 0xFF); + temporaryOutputStream.write((len >> 16) & 0xFF); + temporaryOutputStream.write((len >> 8) & 0xFF); + temporaryOutputStream.write(len & 0xFF); + OutputStream os = EaglerZLIB.newDeflaterOutputStream(temporaryOutputStream); + temporaryBuffer.readBytes(os, len); + os.close(); + compressedData = temporaryOutputStream.toByteArray(); + }catch(IOException ex) { + logger.error("Failed to compress packet {}!", pkt.getClass().getSimpleName()); + return; + } + if(compressedData.length > fragmentSize) { + int fragmentSizeN1 = fragmentSize - 1; + for (int j = 1; j < compressedData.length; j += fragmentSizeN1) { + byte[] fragData = new byte[((j + fragmentSizeN1 > (compressedData.length - 1)) ? ((compressedData.length - 1) % fragmentSizeN1) : fragmentSizeN1) + 1]; + System.arraycopy(compressedData, j, fragData, 1, fragData.length - 1); + fragData[0] = (j + fragmentSizeN1 < compressedData.length) ? (byte) 1 : (byte) 2; + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(playerChannel, fragData)); + } + }else { + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(playerChannel, compressedData)); + } + }else { + int fragmentSizeN1 = fragmentSize - 1; + if(len > fragmentSizeN1) { + do { + int readLen = len > fragmentSizeN1 ? fragmentSizeN1 : len; + byte[] frag = new byte[readLen + 1]; + temporaryBuffer.readBytes(frag, 1, readLen); + frag[0] = temporaryBuffer.readableBytes() == 0 ? (byte)0 : (byte)1; + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(playerChannel, frag)); + }while((len = temporaryBuffer.readableBytes()) > 0); + }else { + byte[] bytes = new byte[len + 1]; + bytes[0] = 0; + temporaryBuffer.readBytes(bytes, 1, len); + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(playerChannel, bytes)); + } + } + }else { + byte[] bytes = new byte[len]; + temporaryBuffer.readBytes(bytes, 0, len); + ServerPlatformSingleplayer.sendPacket(new IPCPacketData(playerChannel, bytes)); + } + } + + public void setNetHandler(INetHandler nethandler) { + this.nethandler = nethandler; + } + + public boolean isLocalChannel() { + return false; + } + + public boolean isChannelOpen() { + return getConnectStatus() == EnumEaglerConnectionState.CONNECTED; + } + + public boolean getIsencrypted() { + return false; + } + + public void setCompressionTreshold(int compressionTreshold) { + throw new CompressionNotSupportedException(); + } + + public void tick() { + processReceivedPackets(); + if(nethandler instanceof ITickable) { + ((ITickable)nethandler).update(); + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/NetHandlerHandshakeEagler.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/NetHandlerHandshakeEagler.java new file mode 100644 index 0000000..88bb562 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/NetHandlerHandshakeEagler.java @@ -0,0 +1,45 @@ +package net.lax1dude.eaglercraft.v1_8.sp.server.socket; + +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.handshake.client.C00Handshake; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.network.NetHandlerLoginServer; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent; + +/** + * 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 NetHandlerHandshakeEagler implements INetHandlerHandshakeServer { + + private final EaglerMinecraftServer mcServer; + private final IntegratedServerPlayerNetworkManager networkManager; + + public NetHandlerHandshakeEagler(EaglerMinecraftServer parMinecraftServer, IntegratedServerPlayerNetworkManager parNetworkManager) { + this.mcServer = parMinecraftServer; + this.networkManager = parNetworkManager; + } + + @Override + public void onDisconnect(IChatComponent var1) { + + } + + @Override + public void processHandshake(C00Handshake var1) { + this.networkManager.setConnectionState(var1.getRequestedState()); + this.networkManager.setNetHandler(new NetHandlerLoginServer(this.mcServer, this.networkManager)); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java new file mode 100644 index 0000000..3039a42 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java @@ -0,0 +1,179 @@ +package net.lax1dude.eaglercraft.v1_8.sp.socket; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; +import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; +import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.EnumPacketDirection; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +/** + * 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 ClientIntegratedServerNetworkManager extends EaglercraftNetworkManager { + + private int debugPacketCounter = 0; + private byte[][] recievedPacketBuffer = new byte[16384][]; + private int recievedPacketBufferCounter = 0; + public boolean isPlayerChannelOpen = false; + + public ClientIntegratedServerNetworkManager(String channel) { + super(channel); + } + + @Override + public void connect() { + clearRecieveQueue(); + SingleplayerServerController.openLocalPlayerChannel(); + } + + @Override + public EnumEaglerConnectionState getConnectStatus() { + return isPlayerChannelOpen ? EnumEaglerConnectionState.CONNECTED : EnumEaglerConnectionState.CLOSED; + } + + @Override + public void closeChannel(IChatComponent reason) { + LANServerController.closeLAN(); + SingleplayerServerController.closeLocalPlayerChannel(); + if(nethandler != null) { + nethandler.onDisconnect(reason); + } + clearRecieveQueue(); + clientDisconnected = true; + } + + public void addRecievedPacket(byte[] next) { + if(recievedPacketBufferCounter < recievedPacketBuffer.length - 1) { + recievedPacketBuffer[recievedPacketBufferCounter++] = next; + }else { + logger.error("Dropping packets on recievedPacketBuffer for channel \"{}\"! (overflow)", address); + } + } + + @Override + public void processReceivedPackets() throws IOException { + if(nethandler == null) return; + + for(int i = 0; i < recievedPacketBufferCounter; ++i) { + byte[] next = recievedPacketBuffer[i]; + recievedPacketBuffer[i] = null; + ++debugPacketCounter; + try { + ByteBuf nettyBuffer = Unpooled.buffer(next, next.length); + nettyBuffer.writerIndex(next.length); + PacketBuffer input = new PacketBuffer(nettyBuffer); + int pktId = input.readVarIntFromBuffer(); + + Packet pkt; + try { + pkt = packetState.getPacket(EnumPacketDirection.CLIENTBOUND, pktId); + }catch(IllegalAccessException | InstantiationException ex) { + throw new IOException("Recieved a packet with type " + pktId + " which is invalid!"); + } + + if(pkt == null) { + throw new IOException("Recieved packet type " + pktId + " which is undefined in state " + packetState); + } + + try { + pkt.readPacketData(input); + }catch(Throwable t) { + throw new IOException("Failed to read packet type '" + pkt.getClass().getSimpleName() + "'", t); + } + + try { + pkt.processPacket(nethandler); + }catch(Throwable t) { + logger.error("Failed to process {}! It'll be skipped for debug purposes.", pkt.getClass().getSimpleName()); + logger.error(t); + } + + }catch(Throwable t) { + logger.error("Failed to process socket frame {}! It'll be skipped for debug purposes.", debugPacketCounter); + logger.error(t); + } + } + recievedPacketBufferCounter = 0; + } + + @Override + public void sendPacket(Packet pkt) { + if(!isChannelOpen()) { + logger.error("Packet was sent on a closed connection: {}", pkt.getClass().getSimpleName()); + return; + } + + int i; + try { + i = packetState.getPacketId(EnumPacketDirection.SERVERBOUND, pkt); + }catch(Throwable t) { + logger.error("Incorrect packet for state: {}", pkt.getClass().getSimpleName()); + return; + } + + temporaryBuffer.clear(); + temporaryBuffer.writeVarIntToBuffer(i); + try { + pkt.writePacketData(temporaryBuffer); + }catch(IOException ex) { + logger.error("Failed to write packet {}!", pkt.getClass().getSimpleName()); + return; + } + + int len = temporaryBuffer.writerIndex(); + byte[] bytes = new byte[len]; + temporaryBuffer.getBytes(0, bytes); + + ClientPlatformSingleplayer.sendPacket(new IPCPacketData(address, bytes)); + } + + @Override + public boolean checkDisconnected() { + if(!isPlayerChannelOpen) { + try { + processReceivedPackets(); // catch kick message + } catch (IOException e) { + } + clearRecieveQueue(); + doClientDisconnect(new ChatComponentTranslation("disconnect.endOfStream")); + return true; + }else { + return false; + } + } + + @Override + public boolean isLocalChannel() { + return true; + } + + public void clearRecieveQueue() { + for(int i = 0; i < recievedPacketBufferCounter; ++i) { + recievedPacketBuffer[i] = null; + } + recievedPacketBufferCounter = 0; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/NetHandlerSingleplayerLogin.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/NetHandlerSingleplayerLogin.java new file mode 100644 index 0000000..8bcc2f4 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/NetHandlerSingleplayerLogin.java @@ -0,0 +1,77 @@ +package net.lax1dude.eaglercraft.v1_8.sp.socket; + +import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.login.server.S03PacketEnableCompression; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.IChatComponent; + +/** + * 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 NetHandlerSingleplayerLogin implements INetHandlerLoginClient { + + private final Minecraft mc; + private final GuiScreen previousGuiScreen; + private final EaglercraftNetworkManager networkManager; + + public NetHandlerSingleplayerLogin(EaglercraftNetworkManager parNetworkManager, Minecraft mcIn, GuiScreen parGuiScreen) { + this.networkManager = parNetworkManager; + this.mc = mcIn; + this.previousGuiScreen = parGuiScreen; + } + + @Override + public void onDisconnect(IChatComponent var1) { + this.mc.displayGuiScreen(new GuiDisconnected(this.previousGuiScreen, "connect.failed", var1)); + } + + @Override + public void handleEncryptionRequest(S01PacketEncryptionRequest var1) { + + } + + @Override + public void handleLoginSuccess(S02PacketLoginSuccess var1) { + this.networkManager.setConnectionState(EnumConnectionState.PLAY); + this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, var1.getProfile())); + byte[] b = UpdateService.getClientSignatureData(); + if(b != null) { + this.networkManager.sendPacket(new C17PacketCustomPayload("EAG|MyUpdCert-1.8", new PacketBuffer(Unpooled.buffer(b, b.length).writerIndex(b.length)))); + } + } + + @Override + public void handleDisconnect(S00PacketDisconnect var1) { + networkManager.closeChannel(var1.func_149603_c()); + } + + @Override + public void handleEnableCompression(S03PacketEnableCompression var1) { + + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/CertificateInvalidException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/CertificateInvalidException.java new file mode 100644 index 0000000..acb3c25 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/CertificateInvalidException.java @@ -0,0 +1,35 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +/** + * 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 CertificateInvalidException extends RuntimeException { + + public CertificateInvalidException() { + } + + public CertificateInvalidException(String message, Throwable cause) { + super(message, cause); + } + + public CertificateInvalidException(String message) { + super(message); + } + + public CertificateInvalidException(Throwable cause) { + super(cause); + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java new file mode 100644 index 0000000..f967466 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java @@ -0,0 +1,235 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; + +import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; + +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +/** + * 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 GuiUpdateCheckerOverlay extends Gui { + + private static final ResourceLocation eaglerIcons = new ResourceLocation("eagler:gui/eagler_gui.png"); + + private Minecraft mc; + + private int width; + private int height; + + private boolean isIngame; + private GuiScreen backScreen; + + private GuiButton checkForUpdatesButton; + private GuiButton startDownloadButton; + private GuiButton viewAllUpdatesButton; + private GuiButton dismissUpdatesButton; + + public GuiUpdateCheckerOverlay(boolean isIngame, GuiScreen screen) { + this.isIngame = isIngame; + this.backScreen = screen; + } + + public void setResolution(Minecraft mc, int w, int h) { + this.mc = mc; + this.width = w; + this.height = h; + checkForUpdatesButton = new GuiButton(0, w - 150, 0, 150, 20, I18n.format("update.button") + " " + I18n.format(mc.gameSettings.enableUpdateSvc ? "gui.yes" : "gui.no")); + startDownloadButton = new GuiButton(1, w - 115, 0, 115, 20, I18n.format("update.startDownload")); + viewAllUpdatesButton = new GuiButton(2, w - 115, 0, 115, 20, I18n.format("update.viewAll", 0)); + dismissUpdatesButton = new GuiButton(3, w - 115, 0, 115, 20, I18n.format("update.dismiss")); + } + + public void drawScreen(int mx, int my, float partialTicks) { + UpdateProgressStruct progressState = UpdateService.getUpdatingStatus(); + if(progressState.isBusy) { + drawScreenBusy(mx, my, partialTicks, progressState); + return; + } + + checkForUpdatesButton.visible = isIngame; + startDownloadButton.visible = false; + viewAllUpdatesButton.visible = false; + dismissUpdatesButton.visible = false; + + int i = UpdateService.getAvailableUpdates().size(); + boolean shownSP = i > 0 || !mc.isSingleplayer() || LANServerController.isHostingLAN(); + checkForUpdatesButton.visible &= shownSP; + + if(mc.gameSettings.enableUpdateSvc) { + String str; + UpdateCertificate cert = UpdateService.getLatestUpdateFound(); + if(cert != null) { + startDownloadButton.visible = true; + viewAllUpdatesButton.visible = true; + dismissUpdatesButton.visible = true; + viewAllUpdatesButton.displayString = I18n.format("update.viewAll", i); + str = I18n.format("update.found"); + mc.fontRendererObj.drawStringWithShadow(str, width - mc.fontRendererObj.getStringWidth(str) - 3, 22, 0xFFFFAA); + + int embedY = 35; + int embedWidth = 115; + int embedWidth2 = (int)(embedWidth / 0.75f); + + List lst = cert.bundleVersionComment.length() == 0 ? null : mc.fontRendererObj.listFormattedStringToWidth(cert.bundleVersionComment, embedWidth2 - 14); + + int embedHeight = 44; + if(lst != null) { + embedHeight += 3 + lst.size() * 6; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(width - embedWidth - 1, embedY, 0.0f); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + + int embedHeight2 = (int)(embedHeight / 0.75f); + + drawGradientRect(1, 1, embedWidth2 - 1, embedHeight2 - 1, 0xFFFFFFAA, 0xFFFFFFAA); + drawGradientRect(0, 1, embedWidth2, 2, 0xFF000000, 0xFF000000); + drawGradientRect(0, embedHeight2 - 1, embedWidth2, embedHeight2, 0xFF000000, 0xFF000000); + drawGradientRect(0, 1, 1, embedHeight2 - 1, 0xFF000000, 0xFF000000); + drawGradientRect(embedWidth2 - 1, 1, embedWidth2, embedHeight2 - 1, 0xFF000000, 0xFF000000); + + mc.getTextureManager().bindTexture(eaglerIcons); + GlStateManager.pushMatrix(); + GlStateManager.scale(0.3f, 0.3f, 0.3f); + drawGradientRect(23, 23, 127, 127, 0xFF000000, 0xFF000000); + EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // rip + drawTexturedModalRect(25, 25, 156, 0, 100, 100); + EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + GlStateManager.popMatrix(); + + mc.fontRendererObj.drawString(EnumChatFormatting.UNDERLINE + cert.bundleDisplayName, 45, 11, 0x000000); + mc.fontRendererObj.drawString(I18n.format("update.update") + " " + EnumChatFormatting.DARK_RED + cert.bundleDisplayVersion, 45, 25, 0x000000); + + if(lst != null) { + for(int j = 0, l = lst.size(); j < l; ++j) { + mc.fontRendererObj.drawString(lst.get(j), 5, 42 + j * 8, 0x000000); + } + } + + mc.fontRendererObj.drawString(I18n.format("update.author") + " " + cert.bundleAuthorName, 5, 44 + (lst == null ? 0 : (3 + lst.size() * 8)), 0x777777); + + startDownloadButton.yPosition = embedHeight + embedY + 5; + viewAllUpdatesButton.yPosition = startDownloadButton.yPosition + 22; + dismissUpdatesButton.yPosition = viewAllUpdatesButton.yPosition + 22; + + GlStateManager.popMatrix(); + }else if(isIngame) { + if(shownSP) { + str = I18n.format("update.noneNew"); + mc.fontRendererObj.drawString(str, width - mc.fontRendererObj.getStringWidth(str) - 3, 22, 0xDDDDDD); + if(i > 0) { + viewAllUpdatesButton.yPosition = 40; + viewAllUpdatesButton.visible = true; + viewAllUpdatesButton.displayString = I18n.format("update.viewAll", i); + } + } + } + } + + checkForUpdatesButton.drawButton(mc, mx, my); + startDownloadButton.drawButton(mc, mx, my); + viewAllUpdatesButton.drawButton(mc, mx, my); + dismissUpdatesButton.drawButton(mc, mx, my); + } + + public void drawScreenBusy(int mx, int my, float partialTicks, UpdateProgressStruct progressState) { + checkForUpdatesButton.visible = false; + startDownloadButton.visible = false; + viewAllUpdatesButton.visible = false; + dismissUpdatesButton.visible = false; + GlStateManager.pushMatrix(); + GlStateManager.translate(width, isIngame ? 0.0f : 10.0f, 0.0f); + String str = I18n.format("update.downloading"); + mc.fontRendererObj.drawStringWithShadow(str, -mc.fontRendererObj.getStringWidth(str) - 2, 2, 0xFFFFAA); + GlStateManager.translate(0.0f, 14.0f, 0.0f); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + if(!StringUtils.isAllBlank(progressState.statusString1)) { + str = progressState.statusString1; + mc.fontRendererObj.drawStringWithShadow(str, -mc.fontRendererObj.getStringWidth(str) - 3, 0, 0xFFFFFF); + } + int cc = isIngame ? 0xBBBBBB : 0xFFFFFF; + if(!StringUtils.isAllBlank(progressState.statusString2)) { + str = progressState.statusString2; + mc.fontRendererObj.drawStringWithShadow(str, -mc.fontRendererObj.getStringWidth(str) - 3, 11, cc); + } + int progX1 = -135; + int progY1 = 22; + int progX2 = -3; + int progY2 = 32; + float prog = progressState.progressBar; + if(prog >= 0.0f) { + int bk = 0xFFBBBBBB; + int fg = 0xFFDD0000; + drawGradientRect(progX1 + 1, progY1 + 1, progX1 + (int)((progX2 - progX1 - 1) * prog), progY2 - 1, fg, fg); + drawGradientRect(progX1 + (int)((progX2 - progX1 - 1) * prog), progY1 + 1, progX2 - 1, progY2 - 1, bk, bk); + drawGradientRect(progX1, progY1, progX2, progY1 + 1, 0xFF000000, 0xFF000000); + drawGradientRect(progX1, progY2 - 1, progX2, progY2, 0xFF000000, 0xFF000000); + drawGradientRect(progX1, progY1 + 1, progX1 + 1, progY2 - 1, 0xFF000000, 0xFF000000); + drawGradientRect(progX2 - 1, progY1 + 1, progX2, progY2 - 1, 0xFF000000, 0xFF000000); + } + if(!StringUtils.isAllBlank(progressState.statusString3)) { + GlStateManager.translate(0.0f, progY2 + 2, 0.0f); + GlStateManager.scale(0.66f, 0.66f, 0.66f); + str = progressState.statusString3; + List wrappedURL = mc.fontRendererObj.listFormattedStringToWidth(str, (int)((progX2 - progX1) * 1.5f)); + for(int i = 0, l = wrappedURL.size(); i < l; ++i) { + str = wrappedURL.get(i); + mc.fontRendererObj.drawStringWithShadow(str, -mc.fontRendererObj.getStringWidth(str) - 5, i * 11, cc); + } + } + GlStateManager.popMatrix(); + } + + public void mouseClicked(int mx, int my, int btn) { + if (btn == 0) { + if(checkForUpdatesButton.mousePressed(mc, mx, my)) { + mc.gameSettings.enableUpdateSvc = !mc.gameSettings.enableUpdateSvc; + mc.gameSettings.saveOptions(); + checkForUpdatesButton.displayString = I18n.format("update.button") + " " + I18n.format(mc.gameSettings.enableUpdateSvc ? "gui.yes" : "gui.no"); + } + if(startDownloadButton.mousePressed(mc, mx, my)) { + if(!UpdateService.getUpdatingStatus().isBusy) { + UpdateCertificate cert = UpdateService.getLatestUpdateFound(); + if(cert != null) { + UpdateService.startClientUpdateFrom(cert); + } + } + } + if(viewAllUpdatesButton.mousePressed(mc, mx, my)) { + mc.displayGuiScreen(new GuiUpdateVersionList(backScreen)); + } + if(dismissUpdatesButton.mousePressed(mc, mx, my)) { + UpdateCertificate cert = UpdateService.getLatestUpdateFound(); + if(cert != null) { + UpdateService.dismiss(cert); + } + } + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java new file mode 100644 index 0000000..e19b29e --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java @@ -0,0 +1,93 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +import java.io.IOException; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * 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 GuiUpdateVersionList extends GuiScreen { + + final GuiScreen back; + GuiUpdateVersionSlot slots; + int selected; + GuiButton downloadButton; + int mx = 0; + int my = 0; + String tooltip = null; + + public GuiUpdateVersionList(GuiScreen back) { + this.back = back; + } + + public void initGui() { + selected = -1; + buttonList.clear(); + buttonList.add(new GuiButton(0, this.width / 2 + 54, this.height - 28, 100, 20, I18n.format("gui.done"))); + buttonList.add(downloadButton = new GuiButton(1, this.width / 2 - 50, this.height - 28, 100, 20, I18n.format("updateList.download"))); + buttonList.add(new GuiButton(2, this.width / 2 - 154, this.height - 28, 100, 20, I18n.format("updateList.refresh"))); + slots = new GuiUpdateVersionSlot(this); + updateButtons(); + } + + void updateButtons() { + downloadButton.enabled = selected != -1; + } + + static Minecraft getMinecraft(GuiUpdateVersionList screen) { + return screen.mc; + } + + public void actionPerformed(GuiButton btn) { + switch(btn.id) { + case 1: + if(selected != -1) { + UpdateService.startClientUpdateFrom(slots.certList.get(selected)); + } + case 0: + default: + mc.displayGuiScreen(back); + break; + case 2: + this.initGui(); + break; + } + } + + public void drawScreen(int par1, int par2, float par3) { + mx = par1; + my = par2; + slots.drawScreen(par1, par2, par3); + this.drawCenteredString(fontRendererObj, I18n.format("updateList.title"), this.width / 2, 16, 16777215); + this.drawCenteredString(fontRendererObj, I18n.format("updateList.note.0"), this.width / 2, this.height - 55, 0x888888); + this.drawCenteredString(fontRendererObj, I18n.format("updateList.note.1"), this.width / 2, this.height - 45, 0x888888); + super.drawScreen(par1, par2, par3); + if(tooltip != null) { + drawHoveringText(mc.fontRendererObj.listFormattedStringToWidth(tooltip, 180), par1, par2); + tooltip = null; + } + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + slots.handleMouseInput(); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionSlot.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionSlot.java new file mode 100644 index 0000000..669f24a --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionSlot.java @@ -0,0 +1,150 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.util.ResourceLocation; + +/** + * 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 GuiUpdateVersionSlot extends GuiSlot { + + private static final ResourceLocation eaglerGuiTex = new ResourceLocation("eagler:gui/eagler_gui.png"); + + final List certList = new ArrayList(); + + final GuiUpdateVersionList screen; + + public GuiUpdateVersionSlot(GuiUpdateVersionList screen) { + super(GuiUpdateVersionList.getMinecraft(screen), screen.width, screen.height, 32, screen.height - 64, 37); + this.screen = screen; + this.refresh(); + } + + public void refresh() { + certList.clear(); + Collection certs = UpdateService.getAvailableUpdates(); + synchronized(certs) { + certList.addAll(certs); + } + certList.sort((c1, c2) -> { + if(c1.bundleVersionInteger > c2.bundleVersionInteger) { + return -1; + }else if(c1.bundleVersionInteger == c2.bundleVersionInteger) { + if(c1.sigTimestamp > c2.sigTimestamp) { + return -1; + }else if(c1.sigTimestamp == c2.sigTimestamp) { + return 0; + } + } + return 1; + }); + } + + @Override + protected int getSize() { + return certList.size(); + } + + @Override + protected void elementClicked(int var1, boolean var2, int var3, int var4) { + screen.selected = var1; + screen.updateButtons(); + } + + @Override + protected boolean isSelected(int var1) { + return var1 == screen.selected; + } + + @Override + protected void drawBackground() { + screen.drawBackground(0); + } + + public static final SimpleDateFormat dateFmt = EagRuntime.fixDateFormat(new SimpleDateFormat("M/dd/yyyy")); + private static final char[] hexChars = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + @Override + protected void drawSlot(int id, int xx, int yy, int width, int height, int ii) { + if(id < certList.size()) { + this.mc.getTextureManager().bindTexture(eaglerGuiTex); + GlStateManager.pushMatrix(); + GlStateManager.translate(xx, yy, 0.0f); + GlStateManager.pushMatrix(); + int iconSize = 33; + GlStateManager.scale(iconSize * 0.01f, iconSize * 0.01f, iconSize * 0.01f); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // rip + screen.drawTexturedModalRect(0, 0, 156, 0, 100, 100); + EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + GlStateManager.popMatrix(); + GlStateManager.translate(iconSize + 1, 0.0f, 0.0f); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + UpdateCertificate cert = certList.get(id); + screen.drawString(mc.fontRendererObj, + EnumChatFormatting.WHITE + cert.bundleDisplayName + EnumChatFormatting.GRAY + " - " + + (cert.bundleVersionInteger > EaglercraftVersion.updateBundlePackageVersionInt + ? EnumChatFormatting.GREEN + : (cert.bundleVersionInteger < EaglercraftVersion.updateBundlePackageVersionInt + ? EnumChatFormatting.RED + : EnumChatFormatting.YELLOW)) + + cert.bundleDisplayVersion + EnumChatFormatting.DARK_GRAY + " " + + cert.bundleVersionInteger + " " + EnumChatFormatting.GRAY + + dateFmt.format(new Date(cert.sigTimestamp)) + EnumChatFormatting.WHITE + " " + (cert.bundleDataLength / 1024) + " kB", + 2, 2, 0xFFFFFF); + List strs = (List)mc.fontRendererObj.listFormattedStringToWidth(cert.bundleVersionComment, (int)((getListWidth() - iconSize - 6) * 1.25f)); + if(strs.size() > 0) { + screen.drawString(mc.fontRendererObj, strs.get(0), 2, 13, 0x888888); + } + if(strs.size() > 1) { + screen.drawString(mc.fontRendererObj, strs.get(1), 2, 24, 0x888888); + } + if(strs.size() > 2 && screen.mx > xx + iconSize && screen.my > yy + 8 && screen.mx < xx + getListWidth() - 5 && screen.my < yy + 25) { + screen.tooltip = cert.bundleVersionComment; + } + char[] hexStr1 = new char[] { hexChars[(cert.bundleDataHash[0] >> 4) & 0xF], + hexChars[cert.bundleDataHash[1] & 0xF], hexChars[(cert.bundleDataHash[1] >> 4) & 0xF], + hexChars[cert.bundleDataHash[1] & 0xF], hexChars[(cert.bundleDataHash[2] >> 4) & 0xF], + hexChars[cert.bundleDataHash[2] & 0xF] }; + char[] hexStr2 = new char[] { hexChars[(cert.bundleDataHash[29] >> 4) & 0xF], + hexChars[cert.bundleDataHash[29] & 0xF], hexChars[(cert.bundleDataHash[30] >> 4) & 0xF], + hexChars[cert.bundleDataHash[30] & 0xF], hexChars[(cert.bundleDataHash[31] >> 4) & 0xF], + hexChars[cert.bundleDataHash[31] & 0xF] }; + screen.drawString(mc.fontRendererObj, + "Author: " + EnumChatFormatting.GRAY + cert.bundleAuthorName + EnumChatFormatting.WHITE + " Hash: " + + EnumChatFormatting.GRAY + "0x" + (new String(hexStr1)) + "......" + (new String(hexStr2)), + 2, 35, 0xFFFFFF); + GlStateManager.popMatrix(); + } + } + + @Override + public int getListWidth() { + return 250; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java new file mode 100644 index 0000000..736d0ea --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java @@ -0,0 +1,140 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket00Handshake; +import net.minecraft.client.Minecraft; + +/** + * 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 RelayUpdateChecker { + + private static class RelayEntry { + + private final String uri; + private boolean queued; + private boolean handshake; + private RelayServerSocket currentSocket; + + private RelayEntry(String uri) { + this.uri = uri; + } + + } + + private static final List relaysList = new ArrayList(); + + private static long lastUpdateCheck = -1l; + private static boolean hasInit = false; + + private static final long updateCheckRate = 3l * 60l * 60l * 1000l; + + private static final String magic = "~!REQUEST_UPDATE_CERT"; + + public static void runTick() { + if(!EagRuntime.getConfiguration().isCheckRelaysForUpdates()) { + return; + } + if(!hasInit) { + hasInit = true; + for(net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry etr : EagRuntime.getConfiguration().getRelays()) { + relaysList.add(new RelayEntry(etr.address)); + } + byte[] b = PlatformApplication.getLocalStorage("lastRelayUpdate"); + if(b != null) { + try { + lastUpdateCheck = (new DataInputStream(new ByteArrayInputStream(b))).readLong(); + } catch (IOException e) { + } + } + } + long millis = System.currentTimeMillis(); + Minecraft mc = Minecraft.getMinecraft(); + if((mc.theWorld == null || mc.isSingleplayer()) && millis - lastUpdateCheck > updateCheckRate) { + lastUpdateCheck = millis; + try { + ByteArrayOutputStream bao = new ByteArrayOutputStream(8); + (new DataOutputStream(bao)).writeLong(lastUpdateCheck); + PlatformApplication.setLocalStorage("lastRelayUpdate", bao.toByteArray()); + } catch (IOException e) { + } + for (int i = 0, l = relaysList.size(); i < l; ++i) { + relaysList.get(i).queued = true; + } + } + for(int i = 0, l = relaysList.size(); i < l; ++i) { + RelayEntry etr = relaysList.get(i); + if(etr.currentSocket != null) { + updateRelay(etr); + if(etr.currentSocket != null) { + return; + } + } + } + for(int i = 0, l = relaysList.size(); i < l; ++i) { + RelayEntry etr = relaysList.get(i); + if(etr.queued) { + etr.queued = false; + connect(etr); + if(etr.currentSocket != null) { + return; + } + } + } + } + + private static void connect(RelayEntry socket) { + try { + socket.handshake = false; + socket.currentSocket = PlatformWebRTC.openRelayConnection(socket.uri, 10000); + if(socket.currentSocket.isClosed()) { + socket.currentSocket = null; + } + }catch(Throwable t) { + } + } + + private static void updateRelay(RelayEntry socket) { + try { + if(socket.currentSocket.isClosed()) { + socket.currentSocket = null; + }else if(socket.currentSocket.isOpen()) { + if(!socket.handshake) { + socket.handshake = true; + socket.currentSocket.writePacket(new IPacket00Handshake(0x02, RelayManager.preferredRelayVersion, magic)); + }else { + // close immediately + if(socket.currentSocket.nextPacket() != null) { + socket.currentSocket.close(); + socket.currentSocket = null; + } + } + } + }catch(Throwable t) { + } + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java new file mode 100644 index 0000000..71fc213 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java @@ -0,0 +1,226 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Objects; + +import com.google.common.collect.ListMultimap; +import com.google.common.collect.MultimapBuilder.ListMultimapBuilder; + +import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.crypto.SHA256Digest; + +/** + * 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 UpdateCertificate { + + public static class DLSource { + + public final String type; + public final String addr; + private DLSource(String type, String addr) { + this.type = type; + this.addr = addr; + } + + @Override + public int hashCode() { + return Objects.hash(addr, type); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + DLSource other = (DLSource) obj; + return Objects.equals(addr, other.addr) && Objects.equals(type, other.type); + } + + } + + public final byte[] rawCertData; + + public final int sigVersion; + public final long sigTimestamp; + + public final int bundleDataLength; + public final byte[] bundleDataHash; + + public final String bundlePackageName; + public final String bundleDisplayName; + public final String bundleAuthorName; + public final int bundleVersionInteger; + public final String bundleDisplayVersion; + public final String bundleVersionComment; + + public final DLSource[] bundleDataSources; + + public static UpdateCertificate parseAndVerifyCertificate(byte[] certData) throws IOException, CertificateInvalidException { + InputStream is = new ByteArrayInputStream(certData); + if(is.read() != 'E' || is.read() != 'A' || is.read() != 'G' || is.read() != 'S' || is.read() != 'I' || is.read() != 'G') { + throw new IOException("Data is not a certificate!"); + } + + int vers = is.read() << 8; + vers |= is.read(); + if(vers != 1) { + throw new IOException("Invalid certificate version: " + vers); + } + + byte[] rsa2048sum = new byte[256]; + is.read(rsa2048sum); + + byte[] rsa2048sumDec = (new BigInteger(rsa2048sum)).modPow(new BigInteger("65537"), EaglercraftVersion.updateSignatureModulus).toByteArray(); + + if(rsa2048sumDec.length > 256) { + throw new IOException("Invalid decrypted hash length: " + rsa2048sum.length); + } + + if(rsa2048sumDec.length < 256) { + byte[] tmp = rsa2048sumDec; + rsa2048sumDec = new byte[256]; + System.arraycopy(tmp, 0, rsa2048sumDec, 256 - tmp.length, tmp.length); + } + + int payloadLen = is.read() << 8; + payloadLen |= is.read(); + + byte[] signaturePayload = new byte[payloadLen]; + is.read(signaturePayload); + + SHA256Digest sha256 = new SHA256Digest(); + sha256.update(new byte[] { (byte) 170, (byte) 191, (byte) 203, (byte) 188, (byte) 47, (byte) 37, (byte) 17, + (byte) 187, (byte) 169, (byte) 225, (byte) 247, (byte) 193, (byte) 100, (byte) 101, (byte) 233, + (byte) 106, (byte) 80, (byte) 204, (byte) 192, (byte) 140, (byte) 19, (byte) 18, (byte) 165, (byte) 252, + (byte) 138, (byte) 187, (byte) 229, (byte) 148, (byte) 118, (byte) 208, (byte) 179, (byte) 233 }, 0, 32); + sha256.update(signaturePayload, 0, signaturePayload.length); + byte[] hash2048 = new byte[256]; + sha256.doFinal(hash2048, 0); + sha256.reset(); + sha256.update(new byte[] { (byte) 95, (byte) 222, (byte) 208, (byte) 153, (byte) 171, (byte) 133, (byte) 7, + (byte) 88, (byte) 111, (byte) 87, (byte) 37, (byte) 104, (byte) 98, (byte) 115, (byte) 185, (byte) 153, + (byte) 206, (byte) 188, (byte) 143, (byte) 18, (byte) 247, (byte) 28, (byte) 130, (byte) 87, (byte) 56, + (byte) 223, (byte) 45, (byte) 192, (byte) 108, (byte) 166, (byte) 254, (byte) 19 }, 0, 32); + sha256.update(signaturePayload, 0, signaturePayload.length); + sha256.doFinal(hash2048, 32); + sha256.reset(); + sha256.update(new byte[] { (byte) 101, (byte) 245, (byte) 91, (byte) 125, (byte) 50, (byte) 79, (byte) 71, + (byte) 52, (byte) 244, (byte) 249, (byte) 84, (byte) 5, (byte) 139, (byte) 21, (byte) 13, (byte) 200, + (byte) 75, (byte) 0, (byte) 103, (byte) 1, (byte) 14, (byte) 159, (byte) 199, (byte) 194, (byte) 56, + (byte) 161, (byte) 63, (byte) 248, (byte) 90, (byte) 134, (byte) 96, (byte) 160 }, 0, 32); + sha256.update(signaturePayload, 0, signaturePayload.length); + sha256.doFinal(hash2048, 64); + sha256.reset(); + sha256.update(new byte[] { (byte) 84, (byte) 208, (byte) 74, (byte) 114, (byte) 251, (byte) 86, (byte) 195, + (byte) 222, (byte) 90, (byte) 18, (byte) 194, (byte) 226, (byte) 20, (byte) 56, (byte) 191, (byte) 235, + (byte) 187, (byte) 93, (byte) 18, (byte) 122, (byte) 161, (byte) 40, (byte) 160, (byte) 88, (byte) 151, + (byte) 88, (byte) 215, (byte) 216, (byte) 253, (byte) 235, (byte) 7, (byte) 60 }, 0, 32); + sha256.update(signaturePayload, 0, signaturePayload.length); + sha256.doFinal(hash2048, 96); + + hash2048[0] = (byte)((signaturePayload.length >> 8) & 0xFF); + hash2048[1] = (byte)(signaturePayload.length & 0xFF); + + if(!Arrays.equals(hash2048, rsa2048sumDec)) { + throw new CertificateInvalidException("SHA256 checksum of signature payload is invalid!"); + } + + return new UpdateCertificate(certData, EaglerZLIB.newGZIPInputStream(new ByteArrayInputStream(signaturePayload)), vers); + } + + private UpdateCertificate(byte[] certData, InputStream is, int sigVers) throws IOException { + this.rawCertData = certData; + this.sigVersion = sigVers; + DataInputStream dis = new DataInputStream(is); + this.sigTimestamp = dis.readLong(); + this.bundleDataLength = dis.readInt(); + this.bundleDataHash = new byte[32]; + dis.read(bundleDataHash); + this.bundlePackageName = dis.readUTF(); + this.bundleDisplayName = dis.readUTF(); + this.bundleAuthorName = dis.readUTF(); + this.bundleVersionInteger = dis.readInt(); + this.bundleDisplayVersion = dis.readUTF(); + this.bundleVersionComment = dis.readUTF(); + dis.skip(dis.read()); + int sourceCount = dis.readInt(); + this.bundleDataSources = new DLSource[sourceCount]; + for(int i = 0; i < sourceCount; ++i) { + dis.skip(4); + bundleDataSources[i] = new DLSource(dis.readUTF(), dis.readUTF()); + } + } + + public boolean isBundleDataValid(byte[] bundleData) { + if(bundleData.length != bundleDataLength) { + return false; + } + SHA256Digest sha256 = new SHA256Digest(); + sha256.update(bundleData, 0, bundleData.length); + byte[] out = new byte[32]; + sha256.doFinal(out, 0); + return Arrays.equals(out, bundleDataHash); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Arrays.hashCode(bundleDataHash); + result = prime * result + Arrays.hashCode(bundleDataSources); + result = prime * result + + Objects.hash(bundleAuthorName, bundleDataLength, bundleDisplayName, bundleDisplayVersion, + bundlePackageName, bundleVersionComment, bundleVersionInteger, sigTimestamp, sigVersion); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof UpdateCertificate)) + return false; + UpdateCertificate other = (UpdateCertificate) obj; + return Objects.equals(bundleAuthorName, other.bundleAuthorName) + && Arrays.equals(bundleDataHash, other.bundleDataHash) && bundleDataLength == other.bundleDataLength + && Arrays.equals(bundleDataSources, other.bundleDataSources) + && Objects.equals(bundleDisplayName, other.bundleDisplayName) + && Objects.equals(bundleDisplayVersion, other.bundleDisplayVersion) + && Objects.equals(bundlePackageName, other.bundlePackageName) + && Objects.equals(bundleVersionComment, other.bundleVersionComment) + && bundleVersionInteger == other.bundleVersionInteger && sigTimestamp == other.sigTimestamp + && sigVersion == other.sigVersion; + } + + public ListMultimap getSourceMultimap() { + ListMultimap ret = ListMultimapBuilder.hashKeys().arrayListValues().build(); + for(int i = 0; i < bundleDataSources.length; ++i) { + ret.put(bundleDataSources[i].type, bundleDataSources[i].addr); + } + return ret; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateProgressStruct.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateProgressStruct.java new file mode 100644 index 0000000..73f9014 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateProgressStruct.java @@ -0,0 +1,33 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +/** + * 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 UpdateProgressStruct { + + public boolean isBusy = false; + public String statusString1 = null; + public String statusString2 = null; + public String statusString3 = null; + public float progressBar = -1.0f; + + public void clear() { + isBusy = false; + statusString1 = null; + statusString2 = null; + statusString3 = null; + progressBar = -1.0f; + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateService.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateService.java new file mode 100644 index 0000000..c9dde66 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateService.java @@ -0,0 +1,183 @@ +package net.lax1dude.eaglercraft.v1_8.update; + +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformUpdateSvc; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +/** + * 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 UpdateService { + + private static final Logger logger = LogManager.getLogger("UpdateService"); + + private static UpdateCertificate myUpdateCert = null; + private static boolean isBundleDataValid = false; + + private static UpdateCertificate latestUpdateFound = null; + private static final Set availableUpdates = new HashSet(); + private static final Set dismissedUpdates = new HashSet(); + + public static boolean supported() { + return EaglercraftVersion.enableUpdateService && EagRuntime.getConfiguration().allowUpdateSvc() && PlatformUpdateSvc.supported(); + } + + public static void initialize() { + if(!supported()) { + logger.info("Update service is not supported on this client"); + return; + } + PlatformUpdateSvc.initialize(); + if(PlatformUpdateSvc.getClientSignatureData() != null) { + logger.info("Testing client update certificate..."); + try { + myUpdateCert = UpdateCertificate.parseAndVerifyCertificate(PlatformUpdateSvc.getClientSignatureData()); + if(!EaglercraftVersion.updateBundlePackageName.equalsIgnoreCase(myUpdateCert.bundlePackageName)) { + throw new CertificateInvalidException("Certificate package name does not match current client package name!"); + } + if(EaglercraftVersion.updateBundlePackageVersionInt != myUpdateCert.bundleVersionInteger) { + throw new CertificateInvalidException("Certificate client version does not match current client version!"); + } + }catch(Throwable t) { + myUpdateCert = null; + logger.error("Client update certificate is invalid!"); + logger.error(t); + } + if(myUpdateCert != null && PlatformUpdateSvc.getClientBundleData() != null) { + isBundleDataValid = myUpdateCert.isBundleDataValid(PlatformUpdateSvc.getClientBundleData()); + if(!isBundleDataValid) { + logger.error("Client checksum does not match certificate! \"Download Offline\" button will download a fresh client"); + } + } + } + byte[] latestUpdate = PlatformApplication.getLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey); + if(latestUpdate != null) { + addCertificateToSet(latestUpdate, false); + } + } + + public static byte[] getClientSignatureData() { + if(myUpdateCert != null) { + return PlatformUpdateSvc.getClientSignatureData(); + } + return null; + } + + public static byte[] getClientBundleData() { + if(isBundleDataValid) { + return PlatformUpdateSvc.getClientBundleData(); + } + return null; + } + + public static UpdateCertificate getClientCertificate() { + return myUpdateCert; + } + + public static void addCertificateToSet(byte[] certificateData) { + addCertificateToSet(certificateData, true); + } + + private static void addCertificateToSet(byte[] certificateData, boolean saveLatest) { + if (EagRuntime.getConfiguration().allowUpdateDL()) { + synchronized(availableUpdates) { + try { + UpdateCertificate cert = UpdateCertificate.parseAndVerifyCertificate(certificateData); + if (EaglercraftVersion.updateBundlePackageName.equalsIgnoreCase(cert.bundlePackageName)) { + if (myUpdateCert == null || !Arrays.equals(cert.bundleDataHash, myUpdateCert.bundleDataHash)) { + if(availableUpdates.add(cert)) { + logger.info("Found new update: {} - {}", cert.bundleDisplayName, cert.bundleDisplayVersion); + if (cert.bundleVersionInteger > EaglercraftVersion.updateBundlePackageVersionInt + && (latestUpdateFound == null + || cert.bundleVersionInteger > latestUpdateFound.bundleVersionInteger + || (cert.bundleVersionInteger == latestUpdateFound.bundleVersionInteger + && cert.sigTimestamp > latestUpdateFound.sigTimestamp)) + && !dismissedUpdates.contains(cert)) { + latestUpdateFound = cert; + if (saveLatest) { + PlatformApplication.setLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey, + certificateData); + } + } + }else if(EagRuntime.getConfiguration().isLogInvalidCerts()) { + logger.info("Ignoring already indexed update: {} - {}", cert.bundleDisplayName, cert.bundleDisplayVersion); + } + } + } else { + if (EagRuntime.getConfiguration().isLogInvalidCerts()) { + logger.warn("Ignoring 3rd party update certificate: {} - {} ({})", cert.bundleDisplayName, + cert.bundleDisplayVersion, cert.bundlePackageName); + logger.warn("Note: the certificate still had a valid signature (leaked private key?!)"); + } + } + } catch (Throwable t) { + if (EagRuntime.getConfiguration().isLogInvalidCerts()) { + logger.error("Invalid update certificate recieved! The certificate may be from a different client"); + logger.error(t); + } + } + } + } + } + + public static void startClientUpdateFrom(UpdateCertificate clientUpdate) { + PlatformUpdateSvc.startClientUpdateFrom(clientUpdate); + } + + public static UpdateProgressStruct getUpdatingStatus() { + return PlatformUpdateSvc.getUpdatingStatus(); + } + + public static UpdateCertificate getLatestUpdateFound() { + return latestUpdateFound; + } + + public static Collection getAvailableUpdates() { + return availableUpdates; + } + + public static void dismiss(UpdateCertificate cert) { + if(latestUpdateFound == cert) { + latestUpdateFound = null; + } + dismissedUpdates.add(cert); + } + + public static void quine() { + if(myUpdateCert != null) { + byte[] data = getClientBundleData(); + if(data != null) { + logger.info("Generating signed offline download..."); + PlatformUpdateSvc.quine(myUpdateCert, data); + }else { + logger.error("Client checksum does not match certificate! Downloading a fresh client..."); + PlatformUpdateSvc.startClientUpdateFrom(myUpdateCert); + } + } + } + + public static boolean shouldDisableDownloadButton() { + return EagRuntime.getConfiguration().getDownloadOfflineButtonLink() == null && (myUpdateCert == null + || (getClientBundleData() == null && PlatformUpdateSvc.getUpdatingStatus().isBusy)); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java index 7f3ea48..f478d07 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java @@ -1,19 +1,20 @@ package net.lax1dude.eaglercraft.v1_8.vfs; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 FolderResourcePack extends net.lax1dude.eaglercraft.v1_8.internal.vfs.FolderResourcePack { public FolderResourcePack(String resourcePackFileIn, String prefix) { super(resourcePackFileIn, prefix); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java index fe0d193..a4a64d4 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java @@ -1,18 +1,19 @@ package net.lax1dude.eaglercraft.v1_8.vfs; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 SYS extends net.lax1dude.eaglercraft.v1_8.internal.vfs.SYS { } diff --git a/src/main/java/net/minecraft/block/Block.java b/src/main/java/net/minecraft/block/Block.java index e249894..f3108c7 100644 --- a/src/main/java/net/minecraft/block/Block.java +++ b/src/main/java/net/minecraft/block/Block.java @@ -38,16 +38,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Block { diff --git a/src/main/java/net/minecraft/block/BlockAir.java b/src/main/java/net/minecraft/block/BlockAir.java index c09cc7d..1fce39e 100644 --- a/src/main/java/net/minecraft/block/BlockAir.java +++ b/src/main/java/net/minecraft/block/BlockAir.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockAir extends Block { diff --git a/src/main/java/net/minecraft/block/BlockAnvil.java b/src/main/java/net/minecraft/block/BlockAnvil.java index aeade1a..4a2e448 100644 --- a/src/main/java/net/minecraft/block/BlockAnvil.java +++ b/src/main/java/net/minecraft/block/BlockAnvil.java @@ -32,16 +32,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockAnvil extends BlockFalling { diff --git a/src/main/java/net/minecraft/block/BlockBanner.java b/src/main/java/net/minecraft/block/BlockBanner.java index 937e1b3..98b881d 100644 --- a/src/main/java/net/minecraft/block/BlockBanner.java +++ b/src/main/java/net/minecraft/block/BlockBanner.java @@ -28,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBanner extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockBarrier.java b/src/main/java/net/minecraft/block/BlockBarrier.java index 3c49b83..a4671f6 100644 --- a/src/main/java/net/minecraft/block/BlockBarrier.java +++ b/src/main/java/net/minecraft/block/BlockBarrier.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBarrier extends Block { diff --git a/src/main/java/net/minecraft/block/BlockBasePressurePlate.java b/src/main/java/net/minecraft/block/BlockBasePressurePlate.java index 6a220af..9c4946d 100644 --- a/src/main/java/net/minecraft/block/BlockBasePressurePlate.java +++ b/src/main/java/net/minecraft/block/BlockBasePressurePlate.java @@ -12,6 +12,26 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockBasePressurePlate extends Block { protected BlockBasePressurePlate(Material materialIn) { this(materialIn, materialIn.getMaterialMapColor()); diff --git a/src/main/java/net/minecraft/block/BlockBeacon.java b/src/main/java/net/minecraft/block/BlockBeacon.java index 9eb2fce..8cfc1e6 100644 --- a/src/main/java/net/minecraft/block/BlockBeacon.java +++ b/src/main/java/net/minecraft/block/BlockBeacon.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBeacon extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockBed.java b/src/main/java/net/minecraft/block/BlockBed.java index 75c8141..1c1ca5b 100644 --- a/src/main/java/net/minecraft/block/BlockBed.java +++ b/src/main/java/net/minecraft/block/BlockBed.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBed extends BlockDirectional { diff --git a/src/main/java/net/minecraft/block/BlockBookshelf.java b/src/main/java/net/minecraft/block/BlockBookshelf.java index 67ee911..f9c8611 100644 --- a/src/main/java/net/minecraft/block/BlockBookshelf.java +++ b/src/main/java/net/minecraft/block/BlockBookshelf.java @@ -14,16 +14,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBookshelf extends Block { diff --git a/src/main/java/net/minecraft/block/BlockBreakable.java b/src/main/java/net/minecraft/block/BlockBreakable.java index 3f1a32d..6a2ee86 100644 --- a/src/main/java/net/minecraft/block/BlockBreakable.java +++ b/src/main/java/net/minecraft/block/BlockBreakable.java @@ -14,16 +14,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBreakable extends Block { diff --git a/src/main/java/net/minecraft/block/BlockBrewingStand.java b/src/main/java/net/minecraft/block/BlockBrewingStand.java index ca3759d..88886b1 100644 --- a/src/main/java/net/minecraft/block/BlockBrewingStand.java +++ b/src/main/java/net/minecraft/block/BlockBrewingStand.java @@ -32,16 +32,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBrewingStand extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockBush.java b/src/main/java/net/minecraft/block/BlockBush.java index dc895d5..77c396a 100644 --- a/src/main/java/net/minecraft/block/BlockBush.java +++ b/src/main/java/net/minecraft/block/BlockBush.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockBush extends Block { diff --git a/src/main/java/net/minecraft/block/BlockButton.java b/src/main/java/net/minecraft/block/BlockButton.java index 3883858..2d2bff1 100644 --- a/src/main/java/net/minecraft/block/BlockButton.java +++ b/src/main/java/net/minecraft/block/BlockButton.java @@ -15,6 +15,26 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockButton extends Block { public static final PropertyDirection FACING = PropertyDirection.create("facing"); public static final PropertyBool POWERED = PropertyBool.create("powered"); diff --git a/src/main/java/net/minecraft/block/BlockButtonStone.java b/src/main/java/net/minecraft/block/BlockButtonStone.java index 926de53..24b8efd 100644 --- a/src/main/java/net/minecraft/block/BlockButtonStone.java +++ b/src/main/java/net/minecraft/block/BlockButtonStone.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockButtonStone extends BlockButton { diff --git a/src/main/java/net/minecraft/block/BlockButtonWood.java b/src/main/java/net/minecraft/block/BlockButtonWood.java index 68883fb..5d8f7f1 100644 --- a/src/main/java/net/minecraft/block/BlockButtonWood.java +++ b/src/main/java/net/minecraft/block/BlockButtonWood.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockButtonWood extends BlockButton { diff --git a/src/main/java/net/minecraft/block/BlockCactus.java b/src/main/java/net/minecraft/block/BlockCactus.java index b70b73d..c05f327 100644 --- a/src/main/java/net/minecraft/block/BlockCactus.java +++ b/src/main/java/net/minecraft/block/BlockCactus.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCactus extends Block { diff --git a/src/main/java/net/minecraft/block/BlockCake.java b/src/main/java/net/minecraft/block/BlockCake.java index 16fa77a..a19e2dc 100644 --- a/src/main/java/net/minecraft/block/BlockCake.java +++ b/src/main/java/net/minecraft/block/BlockCake.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCake extends Block { diff --git a/src/main/java/net/minecraft/block/BlockCarpet.java b/src/main/java/net/minecraft/block/BlockCarpet.java index bc3974a..d742aca 100644 --- a/src/main/java/net/minecraft/block/BlockCarpet.java +++ b/src/main/java/net/minecraft/block/BlockCarpet.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCarpet extends Block { diff --git a/src/main/java/net/minecraft/block/BlockCarrot.java b/src/main/java/net/minecraft/block/BlockCarrot.java index b805fa7..1622be2 100644 --- a/src/main/java/net/minecraft/block/BlockCarrot.java +++ b/src/main/java/net/minecraft/block/BlockCarrot.java @@ -9,16 +9,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCarrot extends BlockCrops { diff --git a/src/main/java/net/minecraft/block/BlockCauldron.java b/src/main/java/net/minecraft/block/BlockCauldron.java index a28de17..b7dc001 100644 --- a/src/main/java/net/minecraft/block/BlockCauldron.java +++ b/src/main/java/net/minecraft/block/BlockCauldron.java @@ -25,16 +25,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCauldron extends Block { diff --git a/src/main/java/net/minecraft/block/BlockChest.java b/src/main/java/net/minecraft/block/BlockChest.java index c20b835..60f42b5 100644 --- a/src/main/java/net/minecraft/block/BlockChest.java +++ b/src/main/java/net/minecraft/block/BlockChest.java @@ -31,16 +31,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockChest extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockClay.java b/src/main/java/net/minecraft/block/BlockClay.java index b2817fb..52d113a 100644 --- a/src/main/java/net/minecraft/block/BlockClay.java +++ b/src/main/java/net/minecraft/block/BlockClay.java @@ -14,16 +14,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockClay extends Block { diff --git a/src/main/java/net/minecraft/block/BlockCocoa.java b/src/main/java/net/minecraft/block/BlockCocoa.java index fd83195..84cd5f7 100644 --- a/src/main/java/net/minecraft/block/BlockCocoa.java +++ b/src/main/java/net/minecraft/block/BlockCocoa.java @@ -26,16 +26,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCocoa extends BlockDirectional implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockColored.java b/src/main/java/net/minecraft/block/BlockColored.java index a9b64e0..9e4815a 100644 --- a/src/main/java/net/minecraft/block/BlockColored.java +++ b/src/main/java/net/minecraft/block/BlockColored.java @@ -19,16 +19,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockColored extends Block { diff --git a/src/main/java/net/minecraft/block/BlockCommandBlock.java b/src/main/java/net/minecraft/block/BlockCommandBlock.java index eca5740..f7ce9cd 100644 --- a/src/main/java/net/minecraft/block/BlockCommandBlock.java +++ b/src/main/java/net/minecraft/block/BlockCommandBlock.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCommandBlock extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockCompressedPowered.java b/src/main/java/net/minecraft/block/BlockCompressedPowered.java index 3f9fd65..f5632ec 100644 --- a/src/main/java/net/minecraft/block/BlockCompressedPowered.java +++ b/src/main/java/net/minecraft/block/BlockCompressedPowered.java @@ -13,16 +13,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCompressedPowered extends Block { diff --git a/src/main/java/net/minecraft/block/BlockContainer.java b/src/main/java/net/minecraft/block/BlockContainer.java index abd7e8c..26b95b8 100644 --- a/src/main/java/net/minecraft/block/BlockContainer.java +++ b/src/main/java/net/minecraft/block/BlockContainer.java @@ -8,6 +8,26 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockContainer extends Block implements ITileEntityProvider { protected BlockContainer(Material materialIn) { this(materialIn, materialIn.getMaterialMapColor()); diff --git a/src/main/java/net/minecraft/block/BlockCrops.java b/src/main/java/net/minecraft/block/BlockCrops.java index 28d1abf..699904b 100644 --- a/src/main/java/net/minecraft/block/BlockCrops.java +++ b/src/main/java/net/minecraft/block/BlockCrops.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockCrops extends BlockBush implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockDaylightDetector.java b/src/main/java/net/minecraft/block/BlockDaylightDetector.java index 8464d6d..abf2b03 100644 --- a/src/main/java/net/minecraft/block/BlockDaylightDetector.java +++ b/src/main/java/net/minecraft/block/BlockDaylightDetector.java @@ -28,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDaylightDetector extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockDeadBush.java b/src/main/java/net/minecraft/block/BlockDeadBush.java index bd47824..6c9b87f 100644 --- a/src/main/java/net/minecraft/block/BlockDeadBush.java +++ b/src/main/java/net/minecraft/block/BlockDeadBush.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDeadBush extends BlockBush { diff --git a/src/main/java/net/minecraft/block/BlockDirectional.java b/src/main/java/net/minecraft/block/BlockDirectional.java index 4d255f6..3e392e6 100644 --- a/src/main/java/net/minecraft/block/BlockDirectional.java +++ b/src/main/java/net/minecraft/block/BlockDirectional.java @@ -5,6 +5,26 @@ import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.util.EnumFacing; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockDirectional extends Block { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); diff --git a/src/main/java/net/minecraft/block/BlockDirt.java b/src/main/java/net/minecraft/block/BlockDirt.java index 982c1b3..87dfdb1 100644 --- a/src/main/java/net/minecraft/block/BlockDirt.java +++ b/src/main/java/net/minecraft/block/BlockDirt.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDirt extends Block { diff --git a/src/main/java/net/minecraft/block/BlockDispenser.java b/src/main/java/net/minecraft/block/BlockDispenser.java index 6206bfb..b7cbda7 100644 --- a/src/main/java/net/minecraft/block/BlockDispenser.java +++ b/src/main/java/net/minecraft/block/BlockDispenser.java @@ -33,16 +33,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDispenser extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockDoor.java b/src/main/java/net/minecraft/block/BlockDoor.java index 7b0bb24..c9522c5 100644 --- a/src/main/java/net/minecraft/block/BlockDoor.java +++ b/src/main/java/net/minecraft/block/BlockDoor.java @@ -30,16 +30,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDoor extends Block { diff --git a/src/main/java/net/minecraft/block/BlockDoublePlant.java b/src/main/java/net/minecraft/block/BlockDoublePlant.java index e0a20ef..c2d6c05 100644 --- a/src/main/java/net/minecraft/block/BlockDoublePlant.java +++ b/src/main/java/net/minecraft/block/BlockDoublePlant.java @@ -28,16 +28,18 @@ import net.minecraft.world.biome.BiomeColorHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDoublePlant extends BlockBush implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java b/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java index 3d95c6d..8a6be08 100644 --- a/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java +++ b/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDoubleStoneSlab extends BlockStoneSlab { diff --git a/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java b/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java index 22336a5..9d076e8 100644 --- a/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java +++ b/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDoubleStoneSlabNew extends BlockStoneSlabNew { diff --git a/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java b/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java index 699f6b0..a377afb 100644 --- a/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java +++ b/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDoubleWoodSlab extends BlockWoodSlab { diff --git a/src/main/java/net/minecraft/block/BlockDragonEgg.java b/src/main/java/net/minecraft/block/BlockDragonEgg.java index 83ba946..f692fdb 100644 --- a/src/main/java/net/minecraft/block/BlockDragonEgg.java +++ b/src/main/java/net/minecraft/block/BlockDragonEgg.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDragonEgg extends Block { diff --git a/src/main/java/net/minecraft/block/BlockDropper.java b/src/main/java/net/minecraft/block/BlockDropper.java index 6d5f8f2..01f7a6e 100644 --- a/src/main/java/net/minecraft/block/BlockDropper.java +++ b/src/main/java/net/minecraft/block/BlockDropper.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDropper extends BlockDispenser { diff --git a/src/main/java/net/minecraft/block/BlockDynamicLiquid.java b/src/main/java/net/minecraft/block/BlockDynamicLiquid.java index e55e583..02e418c 100644 --- a/src/main/java/net/minecraft/block/BlockDynamicLiquid.java +++ b/src/main/java/net/minecraft/block/BlockDynamicLiquid.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockDynamicLiquid extends BlockLiquid { diff --git a/src/main/java/net/minecraft/block/BlockEnchantmentTable.java b/src/main/java/net/minecraft/block/BlockEnchantmentTable.java index bcbb4ab..6482dcb 100644 --- a/src/main/java/net/minecraft/block/BlockEnchantmentTable.java +++ b/src/main/java/net/minecraft/block/BlockEnchantmentTable.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockEnchantmentTable extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockEndPortal.java b/src/main/java/net/minecraft/block/BlockEndPortal.java index cd188c4..dde3826 100644 --- a/src/main/java/net/minecraft/block/BlockEndPortal.java +++ b/src/main/java/net/minecraft/block/BlockEndPortal.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockEndPortal extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockEndPortalFrame.java b/src/main/java/net/minecraft/block/BlockEndPortalFrame.java index ab54f9e..2ff8c99 100644 --- a/src/main/java/net/minecraft/block/BlockEndPortalFrame.java +++ b/src/main/java/net/minecraft/block/BlockEndPortalFrame.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockEndPortalFrame extends Block { diff --git a/src/main/java/net/minecraft/block/BlockEnderChest.java b/src/main/java/net/minecraft/block/BlockEnderChest.java index ab98104..dcb4359 100644 --- a/src/main/java/net/minecraft/block/BlockEnderChest.java +++ b/src/main/java/net/minecraft/block/BlockEnderChest.java @@ -26,16 +26,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockEnderChest extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockEventData.java b/src/main/java/net/minecraft/block/BlockEventData.java index afde9bf..2d7e449 100644 --- a/src/main/java/net/minecraft/block/BlockEventData.java +++ b/src/main/java/net/minecraft/block/BlockEventData.java @@ -8,16 +8,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockEventData { diff --git a/src/main/java/net/minecraft/block/BlockFalling.java b/src/main/java/net/minecraft/block/BlockFalling.java index 90d155e..206c78d 100644 --- a/src/main/java/net/minecraft/block/BlockFalling.java +++ b/src/main/java/net/minecraft/block/BlockFalling.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFalling extends Block { diff --git a/src/main/java/net/minecraft/block/BlockFarmland.java b/src/main/java/net/minecraft/block/BlockFarmland.java index beefbd9..9965bc0 100644 --- a/src/main/java/net/minecraft/block/BlockFarmland.java +++ b/src/main/java/net/minecraft/block/BlockFarmland.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFarmland extends Block { diff --git a/src/main/java/net/minecraft/block/BlockFence.java b/src/main/java/net/minecraft/block/BlockFence.java index 7a4e782..953a932 100644 --- a/src/main/java/net/minecraft/block/BlockFence.java +++ b/src/main/java/net/minecraft/block/BlockFence.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFence extends Block { diff --git a/src/main/java/net/minecraft/block/BlockFenceGate.java b/src/main/java/net/minecraft/block/BlockFenceGate.java index 131f978..318418e 100644 --- a/src/main/java/net/minecraft/block/BlockFenceGate.java +++ b/src/main/java/net/minecraft/block/BlockFenceGate.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFenceGate extends BlockDirectional { diff --git a/src/main/java/net/minecraft/block/BlockFire.java b/src/main/java/net/minecraft/block/BlockFire.java index 5caf343..b6d0e8f 100644 --- a/src/main/java/net/minecraft/block/BlockFire.java +++ b/src/main/java/net/minecraft/block/BlockFire.java @@ -28,16 +28,18 @@ import net.minecraft.world.WorldProviderEnd; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFire extends Block { diff --git a/src/main/java/net/minecraft/block/BlockFlower.java b/src/main/java/net/minecraft/block/BlockFlower.java index 31b4855..cd76fcd 100644 --- a/src/main/java/net/minecraft/block/BlockFlower.java +++ b/src/main/java/net/minecraft/block/BlockFlower.java @@ -17,6 +17,26 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IStringSerializable; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockFlower extends BlockBush { protected PropertyEnum type; diff --git a/src/main/java/net/minecraft/block/BlockFlowerPot.java b/src/main/java/net/minecraft/block/BlockFlowerPot.java index 5edb632..d7d7466 100644 --- a/src/main/java/net/minecraft/block/BlockFlowerPot.java +++ b/src/main/java/net/minecraft/block/BlockFlowerPot.java @@ -31,16 +31,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFlowerPot extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockFurnace.java b/src/main/java/net/minecraft/block/BlockFurnace.java index 2b5a412..9166fff 100644 --- a/src/main/java/net/minecraft/block/BlockFurnace.java +++ b/src/main/java/net/minecraft/block/BlockFurnace.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFurnace extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockGlass.java b/src/main/java/net/minecraft/block/BlockGlass.java index 5e87bcf..1051a2d 100644 --- a/src/main/java/net/minecraft/block/BlockGlass.java +++ b/src/main/java/net/minecraft/block/BlockGlass.java @@ -12,16 +12,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockGlass extends BlockBreakable { diff --git a/src/main/java/net/minecraft/block/BlockGlowstone.java b/src/main/java/net/minecraft/block/BlockGlowstone.java index f643a09..61d7b1e 100644 --- a/src/main/java/net/minecraft/block/BlockGlowstone.java +++ b/src/main/java/net/minecraft/block/BlockGlowstone.java @@ -16,16 +16,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockGlowstone extends Block { diff --git a/src/main/java/net/minecraft/block/BlockGrass.java b/src/main/java/net/minecraft/block/BlockGrass.java index f7affb1..a5485e4 100644 --- a/src/main/java/net/minecraft/block/BlockGrass.java +++ b/src/main/java/net/minecraft/block/BlockGrass.java @@ -23,16 +23,18 @@ import net.minecraft.world.biome.BiomeColorHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockGrass extends Block implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockGravel.java b/src/main/java/net/minecraft/block/BlockGravel.java index 1837002..8cf5c07 100644 --- a/src/main/java/net/minecraft/block/BlockGravel.java +++ b/src/main/java/net/minecraft/block/BlockGravel.java @@ -13,16 +13,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockGravel extends BlockFalling { diff --git a/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java b/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java index 0abdd3b..c91efa7 100644 --- a/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java +++ b/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHalfStoneSlab extends BlockStoneSlab { diff --git a/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java b/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java index 5441cbe..f371f10 100644 --- a/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java +++ b/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHalfStoneSlabNew extends BlockStoneSlabNew { diff --git a/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java b/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java index c70adf9..f9984a1 100644 --- a/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java +++ b/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHalfWoodSlab extends BlockWoodSlab { diff --git a/src/main/java/net/minecraft/block/BlockHardenedClay.java b/src/main/java/net/minecraft/block/BlockHardenedClay.java index 65b7558..f722375 100644 --- a/src/main/java/net/minecraft/block/BlockHardenedClay.java +++ b/src/main/java/net/minecraft/block/BlockHardenedClay.java @@ -11,16 +11,18 @@ import net.minecraft.creativetab.CreativeTabs; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHardenedClay extends Block { diff --git a/src/main/java/net/minecraft/block/BlockHay.java b/src/main/java/net/minecraft/block/BlockHay.java index 503156c..a62365d 100644 --- a/src/main/java/net/minecraft/block/BlockHay.java +++ b/src/main/java/net/minecraft/block/BlockHay.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHay extends BlockRotatedPillar { diff --git a/src/main/java/net/minecraft/block/BlockHopper.java b/src/main/java/net/minecraft/block/BlockHopper.java index 99005fd..de76c89 100644 --- a/src/main/java/net/minecraft/block/BlockHopper.java +++ b/src/main/java/net/minecraft/block/BlockHopper.java @@ -33,16 +33,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHopper extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockHugeMushroom.java b/src/main/java/net/minecraft/block/BlockHugeMushroom.java index 332ba54..8dcb5d3 100644 --- a/src/main/java/net/minecraft/block/BlockHugeMushroom.java +++ b/src/main/java/net/minecraft/block/BlockHugeMushroom.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHugeMushroom extends Block { diff --git a/src/main/java/net/minecraft/block/BlockIce.java b/src/main/java/net/minecraft/block/BlockIce.java index d0a5d7a..1c467ad 100644 --- a/src/main/java/net/minecraft/block/BlockIce.java +++ b/src/main/java/net/minecraft/block/BlockIce.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockIce extends BlockBreakable { diff --git a/src/main/java/net/minecraft/block/BlockJukebox.java b/src/main/java/net/minecraft/block/BlockJukebox.java index 69c4c9e..4e026d4 100644 --- a/src/main/java/net/minecraft/block/BlockJukebox.java +++ b/src/main/java/net/minecraft/block/BlockJukebox.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockJukebox extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockLadder.java b/src/main/java/net/minecraft/block/BlockLadder.java index 9a1a694..1357bc7 100644 --- a/src/main/java/net/minecraft/block/BlockLadder.java +++ b/src/main/java/net/minecraft/block/BlockLadder.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockLadder extends Block { diff --git a/src/main/java/net/minecraft/block/BlockLeaves.java b/src/main/java/net/minecraft/block/BlockLeaves.java index 3802c3b..b13c343 100644 --- a/src/main/java/net/minecraft/block/BlockLeaves.java +++ b/src/main/java/net/minecraft/block/BlockLeaves.java @@ -16,6 +16,26 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeColorHelper; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockLeaves extends BlockLeavesBase { public static final PropertyBool DECAYABLE = PropertyBool.create("decayable"); public static final PropertyBool CHECK_DECAY = PropertyBool.create("check_decay"); diff --git a/src/main/java/net/minecraft/block/BlockLeavesBase.java b/src/main/java/net/minecraft/block/BlockLeavesBase.java index 5ab113a..5ceccd5 100644 --- a/src/main/java/net/minecraft/block/BlockLeavesBase.java +++ b/src/main/java/net/minecraft/block/BlockLeavesBase.java @@ -15,16 +15,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockLeavesBase extends Block { @@ -44,15 +46,24 @@ public class BlockLeavesBase extends Block { return false; } - public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { return Config.isCullFacesLeaves() && worldIn.getBlockState(pos).getBlock() == this ? false : super.shouldSideBeRendered(worldIn, pos, side); } - public static void setLightOpacity(Block p_setLightOpacity_0_, int p_setLightOpacity_1_) { + public static void setLightOpacity(Block p_setLightOpacity_0_, int p_setLightOpacity_1_) { if (!mapOriginalOpacity.containsKey(p_setLightOpacity_0_)) { mapOriginalOpacity.put(p_setLightOpacity_0_, Integer.valueOf(p_setLightOpacity_0_.getLightOpacity())); } p_setLightOpacity_0_.setLightOpacity(p_setLightOpacity_1_); } + + public static void restoreLightOpacity(Block p_restoreLightOpacity_0_) + { + if (mapOriginalOpacity.containsKey(p_restoreLightOpacity_0_)) { + int i = ((Integer)mapOriginalOpacity.get(p_restoreLightOpacity_0_)).intValue(); + setLightOpacity(p_restoreLightOpacity_0_, i); + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/block/BlockLever.java b/src/main/java/net/minecraft/block/BlockLever.java index 6b93300..ee79833 100644 --- a/src/main/java/net/minecraft/block/BlockLever.java +++ b/src/main/java/net/minecraft/block/BlockLever.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockLever extends Block { diff --git a/src/main/java/net/minecraft/block/BlockLilyPad.java b/src/main/java/net/minecraft/block/BlockLilyPad.java index 4b4e7e2..3eaa543 100644 --- a/src/main/java/net/minecraft/block/BlockLilyPad.java +++ b/src/main/java/net/minecraft/block/BlockLilyPad.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockLilyPad extends BlockBush { diff --git a/src/main/java/net/minecraft/block/BlockLiquid.java b/src/main/java/net/minecraft/block/BlockLiquid.java index d7db394..dd4f5cf 100644 --- a/src/main/java/net/minecraft/block/BlockLiquid.java +++ b/src/main/java/net/minecraft/block/BlockLiquid.java @@ -21,6 +21,26 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeColorHelper; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockLiquid extends Block { public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 15); diff --git a/src/main/java/net/minecraft/block/BlockLog.java b/src/main/java/net/minecraft/block/BlockLog.java index b12aa58..b9dac1e 100644 --- a/src/main/java/net/minecraft/block/BlockLog.java +++ b/src/main/java/net/minecraft/block/BlockLog.java @@ -10,6 +10,26 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.IStringSerializable; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockLog extends BlockRotatedPillar { public static PropertyEnum LOG_AXIS = null; diff --git a/src/main/java/net/minecraft/block/BlockMelon.java b/src/main/java/net/minecraft/block/BlockMelon.java index e6c046d..1ee61f7 100644 --- a/src/main/java/net/minecraft/block/BlockMelon.java +++ b/src/main/java/net/minecraft/block/BlockMelon.java @@ -15,16 +15,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockMelon extends Block { diff --git a/src/main/java/net/minecraft/block/BlockMobSpawner.java b/src/main/java/net/minecraft/block/BlockMobSpawner.java index 6ac996a..9871d94 100644 --- a/src/main/java/net/minecraft/block/BlockMobSpawner.java +++ b/src/main/java/net/minecraft/block/BlockMobSpawner.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockMobSpawner extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockMushroom.java b/src/main/java/net/minecraft/block/BlockMushroom.java index 0705668..2900cac 100644 --- a/src/main/java/net/minecraft/block/BlockMushroom.java +++ b/src/main/java/net/minecraft/block/BlockMushroom.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockMushroom extends BlockBush implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockMycelium.java b/src/main/java/net/minecraft/block/BlockMycelium.java index b7366b6..12a8673 100644 --- a/src/main/java/net/minecraft/block/BlockMycelium.java +++ b/src/main/java/net/minecraft/block/BlockMycelium.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockMycelium extends Block { diff --git a/src/main/java/net/minecraft/block/BlockNetherBrick.java b/src/main/java/net/minecraft/block/BlockNetherBrick.java index 549e1ae..8b7cbe8 100644 --- a/src/main/java/net/minecraft/block/BlockNetherBrick.java +++ b/src/main/java/net/minecraft/block/BlockNetherBrick.java @@ -11,16 +11,18 @@ import net.minecraft.creativetab.CreativeTabs; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockNetherBrick extends Block { diff --git a/src/main/java/net/minecraft/block/BlockNetherWart.java b/src/main/java/net/minecraft/block/BlockNetherWart.java index cc34565..a1f78a9 100644 --- a/src/main/java/net/minecraft/block/BlockNetherWart.java +++ b/src/main/java/net/minecraft/block/BlockNetherWart.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockNetherWart extends BlockBush { diff --git a/src/main/java/net/minecraft/block/BlockNetherrack.java b/src/main/java/net/minecraft/block/BlockNetherrack.java index 3c61fd0..fe9f1f0 100644 --- a/src/main/java/net/minecraft/block/BlockNetherrack.java +++ b/src/main/java/net/minecraft/block/BlockNetherrack.java @@ -11,16 +11,18 @@ import net.minecraft.creativetab.CreativeTabs; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockNetherrack extends Block { diff --git a/src/main/java/net/minecraft/block/BlockNewLeaf.java b/src/main/java/net/minecraft/block/BlockNewLeaf.java index fd9992c..6d5f937 100644 --- a/src/main/java/net/minecraft/block/BlockNewLeaf.java +++ b/src/main/java/net/minecraft/block/BlockNewLeaf.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockNewLeaf extends BlockLeaves { diff --git a/src/main/java/net/minecraft/block/BlockNewLog.java b/src/main/java/net/minecraft/block/BlockNewLog.java index 247459b..a2bfce4 100644 --- a/src/main/java/net/minecraft/block/BlockNewLog.java +++ b/src/main/java/net/minecraft/block/BlockNewLog.java @@ -19,16 +19,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockNewLog extends BlockLog { diff --git a/src/main/java/net/minecraft/block/BlockNote.java b/src/main/java/net/minecraft/block/BlockNote.java index 32471b3..f2809b1 100644 --- a/src/main/java/net/minecraft/block/BlockNote.java +++ b/src/main/java/net/minecraft/block/BlockNote.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockNote extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockObsidian.java b/src/main/java/net/minecraft/block/BlockObsidian.java index c3f7fa1..a26536c 100644 --- a/src/main/java/net/minecraft/block/BlockObsidian.java +++ b/src/main/java/net/minecraft/block/BlockObsidian.java @@ -15,16 +15,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockObsidian extends Block { diff --git a/src/main/java/net/minecraft/block/BlockOldLeaf.java b/src/main/java/net/minecraft/block/BlockOldLeaf.java index 6dd3b6b..1932b9e 100644 --- a/src/main/java/net/minecraft/block/BlockOldLeaf.java +++ b/src/main/java/net/minecraft/block/BlockOldLeaf.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockOldLeaf extends BlockLeaves { diff --git a/src/main/java/net/minecraft/block/BlockOldLog.java b/src/main/java/net/minecraft/block/BlockOldLog.java index 6499bd2..711aec5 100644 --- a/src/main/java/net/minecraft/block/BlockOldLog.java +++ b/src/main/java/net/minecraft/block/BlockOldLog.java @@ -19,16 +19,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockOldLog extends BlockLog { diff --git a/src/main/java/net/minecraft/block/BlockOre.java b/src/main/java/net/minecraft/block/BlockOre.java index b4c6f12..03f6153 100644 --- a/src/main/java/net/minecraft/block/BlockOre.java +++ b/src/main/java/net/minecraft/block/BlockOre.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockOre extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPackedIce.java b/src/main/java/net/minecraft/block/BlockPackedIce.java index b4c6470..9e4cc7b 100644 --- a/src/main/java/net/minecraft/block/BlockPackedIce.java +++ b/src/main/java/net/minecraft/block/BlockPackedIce.java @@ -11,16 +11,18 @@ import net.minecraft.creativetab.CreativeTabs; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPackedIce extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPane.java b/src/main/java/net/minecraft/block/BlockPane.java index 1b25375..f60ea49 100644 --- a/src/main/java/net/minecraft/block/BlockPane.java +++ b/src/main/java/net/minecraft/block/BlockPane.java @@ -25,16 +25,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPane extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPistonBase.java b/src/main/java/net/minecraft/block/BlockPistonBase.java index 44ef354..2b913f9 100644 --- a/src/main/java/net/minecraft/block/BlockPistonBase.java +++ b/src/main/java/net/minecraft/block/BlockPistonBase.java @@ -29,16 +29,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPistonBase extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPistonExtension.java b/src/main/java/net/minecraft/block/BlockPistonExtension.java index 506752e..c1ba5df 100644 --- a/src/main/java/net/minecraft/block/BlockPistonExtension.java +++ b/src/main/java/net/minecraft/block/BlockPistonExtension.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPistonExtension extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPistonMoving.java b/src/main/java/net/minecraft/block/BlockPistonMoving.java index a8ae228..a239f6f 100644 --- a/src/main/java/net/minecraft/block/BlockPistonMoving.java +++ b/src/main/java/net/minecraft/block/BlockPistonMoving.java @@ -26,16 +26,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPistonMoving extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockPlanks.java b/src/main/java/net/minecraft/block/BlockPlanks.java index b57ef69..49a0449 100644 --- a/src/main/java/net/minecraft/block/BlockPlanks.java +++ b/src/main/java/net/minecraft/block/BlockPlanks.java @@ -19,16 +19,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPlanks extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPortal.java b/src/main/java/net/minecraft/block/BlockPortal.java index 7693b32..6d0c34b 100644 --- a/src/main/java/net/minecraft/block/BlockPortal.java +++ b/src/main/java/net/minecraft/block/BlockPortal.java @@ -28,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPortal extends BlockBreakable { diff --git a/src/main/java/net/minecraft/block/BlockPotato.java b/src/main/java/net/minecraft/block/BlockPotato.java index 9e829d4..992d295 100644 --- a/src/main/java/net/minecraft/block/BlockPotato.java +++ b/src/main/java/net/minecraft/block/BlockPotato.java @@ -9,16 +9,18 @@ import net.minecraft.item.Item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPotato extends BlockCrops { diff --git a/src/main/java/net/minecraft/block/BlockPressurePlate.java b/src/main/java/net/minecraft/block/BlockPressurePlate.java index 246a3bb..8f6f719 100644 --- a/src/main/java/net/minecraft/block/BlockPressurePlate.java +++ b/src/main/java/net/minecraft/block/BlockPressurePlate.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPressurePlate extends BlockBasePressurePlate { diff --git a/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java b/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java index e05dfc9..8bfbe81 100644 --- a/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java +++ b/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPressurePlateWeighted extends BlockBasePressurePlate { diff --git a/src/main/java/net/minecraft/block/BlockPrismarine.java b/src/main/java/net/minecraft/block/BlockPrismarine.java index f755c2c..96e02eb 100644 --- a/src/main/java/net/minecraft/block/BlockPrismarine.java +++ b/src/main/java/net/minecraft/block/BlockPrismarine.java @@ -20,16 +20,18 @@ import net.minecraft.util.StatCollector; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPrismarine extends Block { diff --git a/src/main/java/net/minecraft/block/BlockPumpkin.java b/src/main/java/net/minecraft/block/BlockPumpkin.java index a6da09e..7d2b192 100644 --- a/src/main/java/net/minecraft/block/BlockPumpkin.java +++ b/src/main/java/net/minecraft/block/BlockPumpkin.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPumpkin extends BlockDirectional { diff --git a/src/main/java/net/minecraft/block/BlockQuartz.java b/src/main/java/net/minecraft/block/BlockQuartz.java index 2385e90..80e60a8 100644 --- a/src/main/java/net/minecraft/block/BlockQuartz.java +++ b/src/main/java/net/minecraft/block/BlockQuartz.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockQuartz extends Block { diff --git a/src/main/java/net/minecraft/block/BlockRail.java b/src/main/java/net/minecraft/block/BlockRail.java index 33f9ef4..24054af 100644 --- a/src/main/java/net/minecraft/block/BlockRail.java +++ b/src/main/java/net/minecraft/block/BlockRail.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRail extends BlockRailBase { diff --git a/src/main/java/net/minecraft/block/BlockRailBase.java b/src/main/java/net/minecraft/block/BlockRailBase.java index 8116989..113a3c7 100644 --- a/src/main/java/net/minecraft/block/BlockRailBase.java +++ b/src/main/java/net/minecraft/block/BlockRailBase.java @@ -19,6 +19,26 @@ import net.minecraft.util.Vec3; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockRailBase extends Block { protected final boolean isPowered; diff --git a/src/main/java/net/minecraft/block/BlockRailDetector.java b/src/main/java/net/minecraft/block/BlockRailDetector.java index 4c4c038..9e22f8b 100644 --- a/src/main/java/net/minecraft/block/BlockRailDetector.java +++ b/src/main/java/net/minecraft/block/BlockRailDetector.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRailDetector extends BlockRailBase { diff --git a/src/main/java/net/minecraft/block/BlockRailPowered.java b/src/main/java/net/minecraft/block/BlockRailPowered.java index 6bdf300..8892b7d 100644 --- a/src/main/java/net/minecraft/block/BlockRailPowered.java +++ b/src/main/java/net/minecraft/block/BlockRailPowered.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRailPowered extends BlockRailBase { diff --git a/src/main/java/net/minecraft/block/BlockRedFlower.java b/src/main/java/net/minecraft/block/BlockRedFlower.java index e0702f0..dcddf28 100644 --- a/src/main/java/net/minecraft/block/BlockRedFlower.java +++ b/src/main/java/net/minecraft/block/BlockRedFlower.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedFlower extends BlockFlower { diff --git a/src/main/java/net/minecraft/block/BlockRedSandstone.java b/src/main/java/net/minecraft/block/BlockRedSandstone.java index b452e5e..06eb7b4 100644 --- a/src/main/java/net/minecraft/block/BlockRedSandstone.java +++ b/src/main/java/net/minecraft/block/BlockRedSandstone.java @@ -18,16 +18,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedSandstone extends Block { diff --git a/src/main/java/net/minecraft/block/BlockRedstoneComparator.java b/src/main/java/net/minecraft/block/BlockRedstoneComparator.java index 0a25c14..5a4fe87 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneComparator.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneComparator.java @@ -34,16 +34,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider { diff --git a/src/main/java/net/minecraft/block/BlockRedstoneDiode.java b/src/main/java/net/minecraft/block/BlockRedstoneDiode.java index ff956ce..6a98a0a 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneDiode.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneDiode.java @@ -13,6 +13,26 @@ import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockRedstoneDiode extends BlockDirectional { protected final boolean isRepeaterPowered; diff --git a/src/main/java/net/minecraft/block/BlockRedstoneLight.java b/src/main/java/net/minecraft/block/BlockRedstoneLight.java index 5d2f8f2..5252426 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneLight.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneLight.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedstoneLight extends Block { diff --git a/src/main/java/net/minecraft/block/BlockRedstoneOre.java b/src/main/java/net/minecraft/block/BlockRedstoneOre.java index 45ae49a..80d426f 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneOre.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneOre.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedstoneOre extends Block { diff --git a/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java b/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java index 69e25b1..92f498b 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedstoneRepeater extends BlockRedstoneDiode { diff --git a/src/main/java/net/minecraft/block/BlockRedstoneTorch.java b/src/main/java/net/minecraft/block/BlockRedstoneTorch.java index 90ee505..23c8822 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneTorch.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedstoneTorch extends BlockTorch { diff --git a/src/main/java/net/minecraft/block/BlockRedstoneWire.java b/src/main/java/net/minecraft/block/BlockRedstoneWire.java index b822702..069c131 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneWire.java @@ -33,16 +33,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRedstoneWire extends Block { diff --git a/src/main/java/net/minecraft/block/BlockReed.java b/src/main/java/net/minecraft/block/BlockReed.java index d4d835e..acfd920 100644 --- a/src/main/java/net/minecraft/block/BlockReed.java +++ b/src/main/java/net/minecraft/block/BlockReed.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockReed extends Block { diff --git a/src/main/java/net/minecraft/block/BlockRotatedPillar.java b/src/main/java/net/minecraft/block/BlockRotatedPillar.java index 2fe8201..414860c 100644 --- a/src/main/java/net/minecraft/block/BlockRotatedPillar.java +++ b/src/main/java/net/minecraft/block/BlockRotatedPillar.java @@ -5,6 +5,26 @@ import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.util.EnumFacing; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockRotatedPillar extends Block { public static final PropertyEnum AXIS = PropertyEnum.create("axis", EnumFacing.Axis.class); diff --git a/src/main/java/net/minecraft/block/BlockSand.java b/src/main/java/net/minecraft/block/BlockSand.java index 1ebb708..4e93f65 100644 --- a/src/main/java/net/minecraft/block/BlockSand.java +++ b/src/main/java/net/minecraft/block/BlockSand.java @@ -18,16 +18,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSand extends BlockFalling { diff --git a/src/main/java/net/minecraft/block/BlockSandStone.java b/src/main/java/net/minecraft/block/BlockSandStone.java index a4d74d3..9f2d32d 100644 --- a/src/main/java/net/minecraft/block/BlockSandStone.java +++ b/src/main/java/net/minecraft/block/BlockSandStone.java @@ -19,16 +19,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSandStone extends Block { diff --git a/src/main/java/net/minecraft/block/BlockSapling.java b/src/main/java/net/minecraft/block/BlockSapling.java index 263c28a..9161320 100644 --- a/src/main/java/net/minecraft/block/BlockSapling.java +++ b/src/main/java/net/minecraft/block/BlockSapling.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSapling extends BlockBush implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockSeaLantern.java b/src/main/java/net/minecraft/block/BlockSeaLantern.java index 525ebd0..9fa6cc7 100644 --- a/src/main/java/net/minecraft/block/BlockSeaLantern.java +++ b/src/main/java/net/minecraft/block/BlockSeaLantern.java @@ -16,16 +16,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSeaLantern extends Block { diff --git a/src/main/java/net/minecraft/block/BlockSign.java b/src/main/java/net/minecraft/block/BlockSign.java index 2f22fb9..a762052 100644 --- a/src/main/java/net/minecraft/block/BlockSign.java +++ b/src/main/java/net/minecraft/block/BlockSign.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSign extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockSilverfish.java b/src/main/java/net/minecraft/block/BlockSilverfish.java index a557233..b47c147 100644 --- a/src/main/java/net/minecraft/block/BlockSilverfish.java +++ b/src/main/java/net/minecraft/block/BlockSilverfish.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSilverfish extends Block { diff --git a/src/main/java/net/minecraft/block/BlockSkull.java b/src/main/java/net/minecraft/block/BlockSkull.java index ca0b188..5b6866a 100644 --- a/src/main/java/net/minecraft/block/BlockSkull.java +++ b/src/main/java/net/minecraft/block/BlockSkull.java @@ -35,16 +35,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSkull extends BlockContainer { diff --git a/src/main/java/net/minecraft/block/BlockSlab.java b/src/main/java/net/minecraft/block/BlockSlab.java index b768b7c..9a58af4 100644 --- a/src/main/java/net/minecraft/block/BlockSlab.java +++ b/src/main/java/net/minecraft/block/BlockSlab.java @@ -18,6 +18,26 @@ import net.minecraft.util.IStringSerializable; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockSlab extends Block { public static PropertyEnum HALF; diff --git a/src/main/java/net/minecraft/block/BlockSlime.java b/src/main/java/net/minecraft/block/BlockSlime.java index b9ed5c0..9c0a3f2 100644 --- a/src/main/java/net/minecraft/block/BlockSlime.java +++ b/src/main/java/net/minecraft/block/BlockSlime.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSlime extends BlockBreakable { diff --git a/src/main/java/net/minecraft/block/BlockSnow.java b/src/main/java/net/minecraft/block/BlockSnow.java index 5f0e3ea..191b887 100644 --- a/src/main/java/net/minecraft/block/BlockSnow.java +++ b/src/main/java/net/minecraft/block/BlockSnow.java @@ -28,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSnow extends Block { diff --git a/src/main/java/net/minecraft/block/BlockSnowBlock.java b/src/main/java/net/minecraft/block/BlockSnowBlock.java index deaafd1..c5395aa 100644 --- a/src/main/java/net/minecraft/block/BlockSnowBlock.java +++ b/src/main/java/net/minecraft/block/BlockSnowBlock.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSnowBlock extends Block { diff --git a/src/main/java/net/minecraft/block/BlockSoulSand.java b/src/main/java/net/minecraft/block/BlockSoulSand.java index 0400aa6..1b98590 100644 --- a/src/main/java/net/minecraft/block/BlockSoulSand.java +++ b/src/main/java/net/minecraft/block/BlockSoulSand.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSoulSand extends Block { diff --git a/src/main/java/net/minecraft/block/BlockSourceImpl.java b/src/main/java/net/minecraft/block/BlockSourceImpl.java index 660aeab..45c794f 100644 --- a/src/main/java/net/minecraft/block/BlockSourceImpl.java +++ b/src/main/java/net/minecraft/block/BlockSourceImpl.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSourceImpl implements IBlockSource { diff --git a/src/main/java/net/minecraft/block/BlockSponge.java b/src/main/java/net/minecraft/block/BlockSponge.java index 869911d..4433f00 100644 --- a/src/main/java/net/minecraft/block/BlockSponge.java +++ b/src/main/java/net/minecraft/block/BlockSponge.java @@ -29,16 +29,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockSponge extends Block { diff --git a/src/main/java/net/minecraft/block/BlockStainedGlass.java b/src/main/java/net/minecraft/block/BlockStainedGlass.java index fa9a433..23c6c48 100644 --- a/src/main/java/net/minecraft/block/BlockStainedGlass.java +++ b/src/main/java/net/minecraft/block/BlockStainedGlass.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStainedGlass extends BlockBreakable { diff --git a/src/main/java/net/minecraft/block/BlockStainedGlassPane.java b/src/main/java/net/minecraft/block/BlockStainedGlassPane.java index 2edef9a..1f88bd5 100644 --- a/src/main/java/net/minecraft/block/BlockStainedGlassPane.java +++ b/src/main/java/net/minecraft/block/BlockStainedGlassPane.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStainedGlassPane extends BlockPane { diff --git a/src/main/java/net/minecraft/block/BlockStairs.java b/src/main/java/net/minecraft/block/BlockStairs.java index b85c13b..e729359 100644 --- a/src/main/java/net/minecraft/block/BlockStairs.java +++ b/src/main/java/net/minecraft/block/BlockStairs.java @@ -32,16 +32,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStairs extends Block { diff --git a/src/main/java/net/minecraft/block/BlockStandingSign.java b/src/main/java/net/minecraft/block/BlockStandingSign.java index dd34bc9..bdb4d2f 100644 --- a/src/main/java/net/minecraft/block/BlockStandingSign.java +++ b/src/main/java/net/minecraft/block/BlockStandingSign.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStandingSign extends BlockSign { diff --git a/src/main/java/net/minecraft/block/BlockStaticLiquid.java b/src/main/java/net/minecraft/block/BlockStaticLiquid.java index b41bac9..9a6dc42 100644 --- a/src/main/java/net/minecraft/block/BlockStaticLiquid.java +++ b/src/main/java/net/minecraft/block/BlockStaticLiquid.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStaticLiquid extends BlockLiquid { diff --git a/src/main/java/net/minecraft/block/BlockStem.java b/src/main/java/net/minecraft/block/BlockStem.java index 9983d47..050c31d 100644 --- a/src/main/java/net/minecraft/block/BlockStem.java +++ b/src/main/java/net/minecraft/block/BlockStem.java @@ -26,16 +26,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStem extends BlockBush implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockStone.java b/src/main/java/net/minecraft/block/BlockStone.java index 5185f3b..daa5aa2 100644 --- a/src/main/java/net/minecraft/block/BlockStone.java +++ b/src/main/java/net/minecraft/block/BlockStone.java @@ -22,16 +22,18 @@ import net.minecraft.util.StatCollector; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStone extends Block { diff --git a/src/main/java/net/minecraft/block/BlockStoneBrick.java b/src/main/java/net/minecraft/block/BlockStoneBrick.java index b6c13ca..9e3fd52 100644 --- a/src/main/java/net/minecraft/block/BlockStoneBrick.java +++ b/src/main/java/net/minecraft/block/BlockStoneBrick.java @@ -18,16 +18,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStoneBrick extends Block { diff --git a/src/main/java/net/minecraft/block/BlockStoneSlab.java b/src/main/java/net/minecraft/block/BlockStoneSlab.java index eec4b87..08a937e 100644 --- a/src/main/java/net/minecraft/block/BlockStoneSlab.java +++ b/src/main/java/net/minecraft/block/BlockStoneSlab.java @@ -18,6 +18,26 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.IStringSerializable; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockStoneSlab extends BlockSlab { public static final PropertyBool SEAMLESS = PropertyBool.create("seamless"); public static PropertyEnum VARIANT; diff --git a/src/main/java/net/minecraft/block/BlockStoneSlabNew.java b/src/main/java/net/minecraft/block/BlockStoneSlabNew.java index 2300143..59a3bb8 100644 --- a/src/main/java/net/minecraft/block/BlockStoneSlabNew.java +++ b/src/main/java/net/minecraft/block/BlockStoneSlabNew.java @@ -19,6 +19,26 @@ import net.minecraft.util.IStringSerializable; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockStoneSlabNew extends BlockSlab { public static final PropertyBool SEAMLESS = PropertyBool.create("seamless"); public static PropertyEnum VARIANT; diff --git a/src/main/java/net/minecraft/block/BlockTNT.java b/src/main/java/net/minecraft/block/BlockTNT.java index 00d9125..a9bafa3 100644 --- a/src/main/java/net/minecraft/block/BlockTNT.java +++ b/src/main/java/net/minecraft/block/BlockTNT.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockTNT extends Block { diff --git a/src/main/java/net/minecraft/block/BlockTallGrass.java b/src/main/java/net/minecraft/block/BlockTallGrass.java index e81d4ca..7d6775b 100644 --- a/src/main/java/net/minecraft/block/BlockTallGrass.java +++ b/src/main/java/net/minecraft/block/BlockTallGrass.java @@ -25,16 +25,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockTallGrass extends BlockBush implements IGrowable { diff --git a/src/main/java/net/minecraft/block/BlockTorch.java b/src/main/java/net/minecraft/block/BlockTorch.java index 00eaf34..38729aa 100644 --- a/src/main/java/net/minecraft/block/BlockTorch.java +++ b/src/main/java/net/minecraft/block/BlockTorch.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockTorch extends Block { diff --git a/src/main/java/net/minecraft/block/BlockTrapDoor.java b/src/main/java/net/minecraft/block/BlockTrapDoor.java index 73dab50..ddb91ef 100644 --- a/src/main/java/net/minecraft/block/BlockTrapDoor.java +++ b/src/main/java/net/minecraft/block/BlockTrapDoor.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockTrapDoor extends Block { diff --git a/src/main/java/net/minecraft/block/BlockTripWire.java b/src/main/java/net/minecraft/block/BlockTripWire.java index ba532e3..b390871 100644 --- a/src/main/java/net/minecraft/block/BlockTripWire.java +++ b/src/main/java/net/minecraft/block/BlockTripWire.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockTripWire extends Block { diff --git a/src/main/java/net/minecraft/block/BlockTripWireHook.java b/src/main/java/net/minecraft/block/BlockTripWireHook.java index cdf42e0..6342565 100644 --- a/src/main/java/net/minecraft/block/BlockTripWireHook.java +++ b/src/main/java/net/minecraft/block/BlockTripWireHook.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockTripWireHook extends Block { diff --git a/src/main/java/net/minecraft/block/BlockVine.java b/src/main/java/net/minecraft/block/BlockVine.java index 2122498..8e533f0 100644 --- a/src/main/java/net/minecraft/block/BlockVine.java +++ b/src/main/java/net/minecraft/block/BlockVine.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockVine extends Block { diff --git a/src/main/java/net/minecraft/block/BlockWall.java b/src/main/java/net/minecraft/block/BlockWall.java index 772a223..b92077f 100644 --- a/src/main/java/net/minecraft/block/BlockWall.java +++ b/src/main/java/net/minecraft/block/BlockWall.java @@ -26,16 +26,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockWall extends Block { diff --git a/src/main/java/net/minecraft/block/BlockWallSign.java b/src/main/java/net/minecraft/block/BlockWallSign.java index 3641cd1..e8be00c 100644 --- a/src/main/java/net/minecraft/block/BlockWallSign.java +++ b/src/main/java/net/minecraft/block/BlockWallSign.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockWallSign extends BlockSign { diff --git a/src/main/java/net/minecraft/block/BlockWeb.java b/src/main/java/net/minecraft/block/BlockWeb.java index 443b7d4..0712767 100644 --- a/src/main/java/net/minecraft/block/BlockWeb.java +++ b/src/main/java/net/minecraft/block/BlockWeb.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockWeb extends Block { diff --git a/src/main/java/net/minecraft/block/BlockWoodSlab.java b/src/main/java/net/minecraft/block/BlockWoodSlab.java index 4ec305d..8db4896 100644 --- a/src/main/java/net/minecraft/block/BlockWoodSlab.java +++ b/src/main/java/net/minecraft/block/BlockWoodSlab.java @@ -16,6 +16,26 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockWoodSlab extends BlockSlab { public static PropertyEnum VARIANT; diff --git a/src/main/java/net/minecraft/block/BlockWorkbench.java b/src/main/java/net/minecraft/block/BlockWorkbench.java index ce07daf..651559c 100644 --- a/src/main/java/net/minecraft/block/BlockWorkbench.java +++ b/src/main/java/net/minecraft/block/BlockWorkbench.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockWorkbench extends Block { diff --git a/src/main/java/net/minecraft/block/BlockYellowFlower.java b/src/main/java/net/minecraft/block/BlockYellowFlower.java index c188909..7198738 100644 --- a/src/main/java/net/minecraft/block/BlockYellowFlower.java +++ b/src/main/java/net/minecraft/block/BlockYellowFlower.java @@ -6,16 +6,18 @@ package net.minecraft.block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockYellowFlower extends BlockFlower { diff --git a/src/main/java/net/minecraft/block/IGrowable.java b/src/main/java/net/minecraft/block/IGrowable.java index 60e0759..31c5363 100644 --- a/src/main/java/net/minecraft/block/IGrowable.java +++ b/src/main/java/net/minecraft/block/IGrowable.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IGrowable { diff --git a/src/main/java/net/minecraft/block/ITileEntityProvider.java b/src/main/java/net/minecraft/block/ITileEntityProvider.java index 266e6ff..a0bf384 100644 --- a/src/main/java/net/minecraft/block/ITileEntityProvider.java +++ b/src/main/java/net/minecraft/block/ITileEntityProvider.java @@ -9,16 +9,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITileEntityProvider { diff --git a/src/main/java/net/minecraft/block/material/MapColor.java b/src/main/java/net/minecraft/block/material/MapColor.java index 6bd1063..3e58ee3 100644 --- a/src/main/java/net/minecraft/block/material/MapColor.java +++ b/src/main/java/net/minecraft/block/material/MapColor.java @@ -6,16 +6,18 @@ package net.minecraft.block.material; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MapColor { diff --git a/src/main/java/net/minecraft/block/material/Material.java b/src/main/java/net/minecraft/block/material/Material.java index 84ef10e..8a0b0f7 100644 --- a/src/main/java/net/minecraft/block/material/Material.java +++ b/src/main/java/net/minecraft/block/material/Material.java @@ -6,16 +6,18 @@ package net.minecraft.block.material; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Material { diff --git a/src/main/java/net/minecraft/block/material/MaterialLiquid.java b/src/main/java/net/minecraft/block/material/MaterialLiquid.java index 1011ed4..7394a22 100644 --- a/src/main/java/net/minecraft/block/material/MaterialLiquid.java +++ b/src/main/java/net/minecraft/block/material/MaterialLiquid.java @@ -6,16 +6,18 @@ package net.minecraft.block.material; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MaterialLiquid extends Material { diff --git a/src/main/java/net/minecraft/block/material/MaterialLogic.java b/src/main/java/net/minecraft/block/material/MaterialLogic.java index 76c4872..cd10838 100644 --- a/src/main/java/net/minecraft/block/material/MaterialLogic.java +++ b/src/main/java/net/minecraft/block/material/MaterialLogic.java @@ -6,16 +6,18 @@ package net.minecraft.block.material; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MaterialLogic extends Material { diff --git a/src/main/java/net/minecraft/block/material/MaterialPortal.java b/src/main/java/net/minecraft/block/material/MaterialPortal.java index 061d45b..4815092 100644 --- a/src/main/java/net/minecraft/block/material/MaterialPortal.java +++ b/src/main/java/net/minecraft/block/material/MaterialPortal.java @@ -6,16 +6,18 @@ package net.minecraft.block.material; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MaterialPortal extends Material { diff --git a/src/main/java/net/minecraft/block/material/MaterialTransparent.java b/src/main/java/net/minecraft/block/material/MaterialTransparent.java index a30a2cd..85b5982 100644 --- a/src/main/java/net/minecraft/block/material/MaterialTransparent.java +++ b/src/main/java/net/minecraft/block/material/MaterialTransparent.java @@ -6,16 +6,18 @@ package net.minecraft.block.material; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MaterialTransparent extends Material { diff --git a/src/main/java/net/minecraft/block/properties/IProperty.java b/src/main/java/net/minecraft/block/properties/IProperty.java index a4de6a9..c0dcc89 100644 --- a/src/main/java/net/minecraft/block/properties/IProperty.java +++ b/src/main/java/net/minecraft/block/properties/IProperty.java @@ -8,16 +8,18 @@ import java.util.Collection; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IProperty> { diff --git a/src/main/java/net/minecraft/block/properties/PropertyBool.java b/src/main/java/net/minecraft/block/properties/PropertyBool.java index 64a1a18..462a4ad 100644 --- a/src/main/java/net/minecraft/block/properties/PropertyBool.java +++ b/src/main/java/net/minecraft/block/properties/PropertyBool.java @@ -10,16 +10,18 @@ import com.google.common.collect.ImmutableSet; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PropertyBool extends PropertyHelper { diff --git a/src/main/java/net/minecraft/block/properties/PropertyDirection.java b/src/main/java/net/minecraft/block/properties/PropertyDirection.java index bc2d6f3..aa6ebf0 100644 --- a/src/main/java/net/minecraft/block/properties/PropertyDirection.java +++ b/src/main/java/net/minecraft/block/properties/PropertyDirection.java @@ -15,16 +15,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PropertyDirection extends PropertyEnum { diff --git a/src/main/java/net/minecraft/block/properties/PropertyEnum.java b/src/main/java/net/minecraft/block/properties/PropertyEnum.java index 19fe1de..4877a82 100644 --- a/src/main/java/net/minecraft/block/properties/PropertyEnum.java +++ b/src/main/java/net/minecraft/block/properties/PropertyEnum.java @@ -18,16 +18,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PropertyEnum & IStringSerializable> extends PropertyHelper { diff --git a/src/main/java/net/minecraft/block/properties/PropertyHelper.java b/src/main/java/net/minecraft/block/properties/PropertyHelper.java index 9537ba2..161dec6 100644 --- a/src/main/java/net/minecraft/block/properties/PropertyHelper.java +++ b/src/main/java/net/minecraft/block/properties/PropertyHelper.java @@ -2,6 +2,26 @@ package net.minecraft.block.properties; import com.google.common.base.Objects; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class PropertyHelper> implements IProperty { private final Class valueClass; private final String name; diff --git a/src/main/java/net/minecraft/block/properties/PropertyInteger.java b/src/main/java/net/minecraft/block/properties/PropertyInteger.java index c655051..b79b7bc 100644 --- a/src/main/java/net/minecraft/block/properties/PropertyInteger.java +++ b/src/main/java/net/minecraft/block/properties/PropertyInteger.java @@ -12,16 +12,18 @@ import com.google.common.collect.Sets; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PropertyInteger extends PropertyHelper { diff --git a/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java b/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java index ddf035f..0657ad0 100644 --- a/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java +++ b/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPistonStructureHelper { diff --git a/src/main/java/net/minecraft/block/state/BlockState.java b/src/main/java/net/minecraft/block/state/BlockState.java index 0ddb125..8568532 100644 --- a/src/main/java/net/minecraft/block/state/BlockState.java +++ b/src/main/java/net/minecraft/block/state/BlockState.java @@ -32,16 +32,18 @@ import net.minecraft.util.MapPopulator; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockState { diff --git a/src/main/java/net/minecraft/block/state/BlockStateBase.java b/src/main/java/net/minecraft/block/state/BlockStateBase.java index 55b063b..3eeca5a 100644 --- a/src/main/java/net/minecraft/block/state/BlockStateBase.java +++ b/src/main/java/net/minecraft/block/state/BlockStateBase.java @@ -11,6 +11,26 @@ import com.google.common.collect.Iterables; import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BlockStateBase implements IBlockState { private static final Joiner COMMA_JOINER = Joiner.on(','); private static final Function, String> MAP_ENTRY_TO_STRING = new Function, String>() { diff --git a/src/main/java/net/minecraft/block/state/BlockWorldState.java b/src/main/java/net/minecraft/block/state/BlockWorldState.java index 556a7c4..8346ed3 100644 --- a/src/main/java/net/minecraft/block/state/BlockWorldState.java +++ b/src/main/java/net/minecraft/block/state/BlockWorldState.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockWorldState { diff --git a/src/main/java/net/minecraft/block/state/IBlockState.java b/src/main/java/net/minecraft/block/state/IBlockState.java index deb1bd3..dcd5263 100644 --- a/src/main/java/net/minecraft/block/state/IBlockState.java +++ b/src/main/java/net/minecraft/block/state/IBlockState.java @@ -13,16 +13,18 @@ import net.minecraft.block.properties.IProperty; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBlockState { diff --git a/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java b/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java index b4f448b..5be9326 100644 --- a/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java +++ b/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java @@ -11,16 +11,18 @@ import net.minecraft.block.state.IBlockState; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockHelper implements Predicate { diff --git a/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java b/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java index a98e466..34e2600 100644 --- a/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java +++ b/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPattern { diff --git a/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java b/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java index ee5ac41..98619bb 100644 --- a/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java +++ b/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java @@ -17,16 +17,18 @@ import net.minecraft.block.state.IBlockState; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStateHelper implements Predicate { diff --git a/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java b/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java index ddfed1e..309de81 100644 --- a/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java +++ b/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java @@ -22,16 +22,18 @@ import net.minecraft.block.state.BlockWorldState; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FactoryBlockPattern { diff --git a/src/main/java/net/minecraft/client/AnvilConverterException.java b/src/main/java/net/minecraft/client/AnvilConverterException.java deleted file mode 100644 index 965917e..0000000 --- a/src/main/java/net/minecraft/client/AnvilConverterException.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.minecraft.client; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * - */ -public class AnvilConverterException extends Exception { - public AnvilConverterException(String exceptionMessage) { - super(exceptionMessage); - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/ClientBrandRetriever.java b/src/main/java/net/minecraft/client/ClientBrandRetriever.java index d37f8c6..b93a7e1 100644 --- a/src/main/java/net/minecraft/client/ClientBrandRetriever.java +++ b/src/main/java/net/minecraft/client/ClientBrandRetriever.java @@ -6,16 +6,18 @@ package net.minecraft.client; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ClientBrandRetriever { diff --git a/src/main/java/net/minecraft/client/LoadingScreenRenderer.java b/src/main/java/net/minecraft/client/LoadingScreenRenderer.java index 19d2c50..f7f22f6 100644 --- a/src/main/java/net/minecraft/client/LoadingScreenRenderer.java +++ b/src/main/java/net/minecraft/client/LoadingScreenRenderer.java @@ -18,16 +18,18 @@ import net.minecraft.util.MinecraftError; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LoadingScreenRenderer implements IProgressUpdate { diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index c4f45d3..4635de3 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -14,18 +14,15 @@ import java.util.List; import java.util.concurrent.Callable; import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput; + import org.apache.commons.lang3.Validate; import com.google.common.collect.Lists; -import net.FatalCodes.shadow.Shadow; import net.PeytonPlayz585.shadow.Config; -import net.PeytonPlayz585.shadow.chunk.ChunkBorders; -import net.PeytonPlayz585.shadow.gui.GuiSecretMainMenu; -import net.PeytonPlayz585.shadow.input.Controller; import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EaglerXBungeeVersion; import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.IOUtils; import net.lax1dude.eaglercraft.v1_8.Keyboard; @@ -58,6 +55,14 @@ import net.lax1dude.eaglercraft.v1_8.profile.SkinPreviewRenderer; import net.lax1dude.eaglercraft.v1_8.socket.AddressResolver; import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; import net.lax1dude.eaglercraft.v1_8.socket.RateLimitTracker; +import net.lax1dude.eaglercraft.v1_8.sp.IntegratedServerState; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.SkullCommand; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenDemoIntegratedServerStartup; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenSingleplayerConnecting; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.lax1dude.eaglercraft.v1_8.update.RelayUpdateChecker; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.audio.MusicTicker; @@ -134,6 +139,7 @@ import net.minecraft.entity.item.EntityMinecart; import net.minecraft.entity.item.EntityPainting; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.event.ClickEvent; import net.minecraft.init.Bootstrap; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -150,6 +156,8 @@ import net.minecraft.stats.StatFileWriter; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.FrameTimer; import net.minecraft.util.IThreadListener; @@ -169,6 +177,7 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.WorldProviderEnd; import net.minecraft.world.WorldProviderHell; import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveFormat; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -176,16 +185,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Minecraft implements IThreadListener { @@ -215,6 +226,7 @@ public class Minecraft implements IThreadListener { public EffectRenderer effectRenderer; private final Session session; private boolean isGamePaused; + private boolean wasPaused; public FontRenderer fontRendererObj; public FontRenderer standardGalacticFontRenderer; public GuiScreen currentScreen; @@ -240,7 +252,6 @@ public class Minecraft implements IThreadListener { public final FrameTimer field_181542_y = new FrameTimer(); long field_181543_z = System.nanoTime(); private final boolean jvm64bit; - private final boolean isDemo; private EaglercraftNetworkManager myNetworkManager; private boolean integratedServerIsRunning; /**+ @@ -290,7 +301,9 @@ public class Minecraft implements IThreadListener { public int joinWorldTickCounter = 0; private int dontPauseTimer = 0; public int bungeeOutdatedMsgTimer = 0; - public String bungeeOutdatedMsgVer = null; + private boolean isLANOpen = false; + + public SkullCommand eagskullCommand; public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; @@ -299,7 +312,6 @@ public class Minecraft implements IThreadListener { this.mcDefaultResourcePack = new DefaultResourcePack(); this.session = gameConfig.userInfo.session; logger.info("Setting user: " + this.session.getProfile().getName()); - this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; this.tempDisplayWidth = gameConfig.displayInfo.width; @@ -335,13 +347,7 @@ public class Minecraft implements IThreadListener { } if (!this.hasCrashed || this.crashReporter == null) { - try { - this.runGameLoop(); - } catch (OutOfMemoryError var10) { - this.freeMemory(); - this.displayGuiScreen(new GuiMemoryErrorScreen()); - System.gc(); - } + this.runGameLoop(); continue; } @@ -351,13 +357,11 @@ public class Minecraft implements IThreadListener { // ?? } catch (ReportedException reportedexception) { this.addGraphicsAndWorldToCrashReport(reportedexception.getCrashReport()); - this.freeMemory(); logger.fatal("Reported exception thrown!", reportedexception); this.displayCrashReport(reportedexception.getCrashReport()); } catch (Throwable throwable1) { CrashReport crashreport1 = this .addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1)); - this.freeMemory(); logger.fatal("Unreported exception thrown!", throwable1); this.displayCrashReport(crashreport1); } finally { @@ -461,31 +465,24 @@ public class Minecraft implements IThreadListener { SkinPreviewRenderer.initialize(); this.checkGLError("Post startup"); this.ingameGUI = new GuiIngame(this); - Shadow.ShadowClientStartup(); + this.eagskullCommand = new SkullCommand(this); ServerList.initServerList(this); EaglerProfile.read(); - if(!this.gameSettings.secret) { - if (this.serverName != null) { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort))); - } else { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu())); - } - } else { - if (this.serverName != null) { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiConnecting(new GuiSecretMainMenu(), this, this.serverName, this.serverPort))); - } else { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiSecretMainMenu())); - } + GuiScreen mainMenu = new GuiMainMenu(); + if (isDemo()) { + mainMenu = new GuiScreenDemoIntegratedServerStartup(mainMenu); } + if (this.serverName != null) { + mainMenu = new GuiConnecting(mainMenu, this, this.serverName, this.serverPort); + } + + this.displayGuiScreen(new GuiScreenEditProfile(mainMenu)); this.renderEngine.deleteTexture(this.mojangLogo); this.mojangLogo = null; this.loadingScreen = new LoadingScreenRenderer(this); - - PlatformRuntime.die(); - EagUtils.sleep(400l); } private void registerMetadataSerializers() { @@ -666,37 +663,19 @@ public class Minecraft implements IThreadListener { * screen. */ public void displayGuiScreen(GuiScreen guiScreenIn) { - - if(guiScreenIn instanceof GuiMainMenu && this.gameSettings.secret) { - guiScreenIn = new GuiSecretMainMenu(); - } else if(guiScreenIn instanceof GuiSecretMainMenu && !this.gameSettings.secret) { - guiScreenIn = new GuiMainMenu(); - } - if (this.currentScreen != null) { this.currentScreen.onGuiClosed(); } if (guiScreenIn == null && this.theWorld == null) { - if(!this.gameSettings.secret) { - guiScreenIn = new GuiMainMenu(); - } else { - guiScreenIn = new GuiSecretMainMenu(); - } + guiScreenIn = new GuiMainMenu(); } else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F) { guiScreenIn = new GuiGameOver(); } - if(!this.gameSettings.secret) { - if (guiScreenIn instanceof GuiMainMenu) { - this.gameSettings.showDebugInfo = false; - this.ingameGUI.getChatGUI().clearChatMessages(); - } - } else { - if (guiScreenIn instanceof GuiSecretMainMenu) { - this.gameSettings.showDebugInfo = false; - this.ingameGUI.getChatGUI().clearChatMessages(); - } + if (guiScreenIn instanceof GuiMainMenu) { + this.gameSettings.showDebugInfo = false; + this.ingameGUI.getChatGUI().clearChatMessages(); } this.currentScreen = (GuiScreen) guiScreenIn; @@ -714,6 +693,16 @@ public class Minecraft implements IThreadListener { } + public void shutdownIntegratedServer(GuiScreen cont) { + if (SingleplayerServerController.shutdownEaglercraftServer() + || SingleplayerServerController.getStatusState() == IntegratedServerState.WORLD_UNLOADING) { + displayGuiScreen(new GuiScreenIntegratedServerBusy(cont, "singleplayer.busy.stoppingIntegratedServer", + "singleplayer.failed.stoppingIntegratedServer", () -> SingleplayerServerController.isReady())); + } else { + displayGuiScreen(cont); + } + } + /**+ * Checks for an OpenGL error. If there is one, prints the error * ID and error string. @@ -747,6 +736,7 @@ public class Minecraft implements IThreadListener { } this.mcSoundHandler.unloadSounds(); + SingleplayerServerController.shutdownEaglercraftServer(); } finally { EagRuntime.destroy(); if (!this.hasCrashed) { @@ -842,7 +832,6 @@ public class Minecraft implements IThreadListener { this.checkGLError("Post render"); ++this.fpsCounter; - this.isGamePaused = false; long k = System.nanoTime(); this.field_181542_y.func_181747_a(k - this.field_181543_z); this.field_181543_z = k; @@ -868,6 +857,7 @@ public class Minecraft implements IThreadListener { this.mcProfiler.endSection(); } + Mouse.tickCursorShape(); this.mcProfiler.endSection(); } @@ -907,17 +897,6 @@ public class Minecraft implements IThreadListener { return (float) this.getLimitFramerate() < GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); } - public void freeMemory() { - try { - System.gc(); - this.loadWorld((WorldClient) null); - } catch (Throwable var2) { - ; - } - - System.gc(); - } - /**+ * Update debugProfilerName in response to number keys in debug * screen @@ -1252,6 +1231,23 @@ public class Minecraft implements IThreadListener { RateLimitTracker.tick(); + boolean isHostingLAN = LANServerController.isHostingLAN(); + this.isGamePaused = !isHostingLAN && this.isSingleplayer() && this.theWorld != null && this.thePlayer != null + && this.currentScreen != null && this.currentScreen.doesGuiPauseGame(); + + if (isLANOpen && !isHostingLAN) { + ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("lanServer.relayDisconnected")); + } + isLANOpen = isHostingLAN; + + if (wasPaused != isGamePaused) { + SingleplayerServerController.setPaused(this.isGamePaused); + wasPaused = isGamePaused; + } + + SingleplayerServerController.runTick(); + RelayUpdateChecker.runTick(); + this.mcProfiler.startSection("gui"); if (!this.isGamePaused) { this.ingameGUI.updateTick(); @@ -1267,7 +1263,7 @@ public class Minecraft implements IThreadListener { this.mcProfiler.endStartSection("textures"); if (!this.isGamePaused) { this.renderEngine.tick(); - //GlStateManager.viewport(0, 0, displayWidth, displayHeight); // to be safe + GlStateManager.viewport(0, 0, displayWidth, displayHeight); // to be safe } if (this.currentScreen == null && this.thePlayer != null) { @@ -1342,7 +1338,7 @@ public class Minecraft implements IThreadListener { long i1 = getSystemTime() - this.systemTime; if (i1 <= 200L) { - int j = Mouse.getEventDWheel() + Controller.getEventDWheel(); + int j = Mouse.getEventDWheel(); if (j != 0) { if (this.thePlayer.isSpectator()) { j = j < 0 ? -1 : 1; @@ -1412,7 +1408,6 @@ public class Minecraft implements IThreadListener { if (this.currentScreen != null) { this.currentScreen.handleKeyboardInput(); } else { - Shadow.moduleManager.onKey(k); if (k == 1 || (k > -1 && k == this.gameSettings.keyBindClose.getKeyCode())) { this.displayInGameMenu(); } @@ -1479,11 +1474,11 @@ public class Minecraft implements IThreadListener { this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; this.gameSettings.saveOptions(); } - + if(Keyboard.isKeyDown(34)) { this.gameSettings.chunkBorders = !this.gameSettings.chunkBorders; } - + if (k == 59) { this.gameSettings.hideGUI = !this.gameSettings.hideGUI; } @@ -1630,6 +1625,7 @@ public class Minecraft implements IThreadListener { this.theWorld.updateEntities(); } + this.eagskullCommand.tick(); } else if (this.entityRenderer.isShaderActive()) { this.entityRenderer.func_181022_b(); } @@ -1673,36 +1669,49 @@ public class Minecraft implements IThreadListener { this.myNetworkManager.processReceivedPackets(); } - if (this.theWorld != null) { ++joinWorldTickCounter; if (bungeeOutdatedMsgTimer > 0) { - if (--bungeeOutdatedMsgTimer == 0) { - String pfx = EnumChatFormatting.GOLD + "[EagX]" + EnumChatFormatting.AQUA; - ingameGUI.getChatGUI() - .printChatMessage(new ChatComponentText(pfx + " ---------------------------------------")); - ingameGUI.getChatGUI().printChatMessage(new ChatComponentText( - pfx + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " MESSAGE FROM LAX:")); - ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(pfx)); - ingameGUI.getChatGUI() - .printChatMessage(new ChatComponentText( - pfx + " This server appears to be using version " + EnumChatFormatting.YELLOW - + bungeeOutdatedMsgVer + EnumChatFormatting.AQUA + " of")); - ingameGUI.getChatGUI().printChatMessage( - new ChatComponentText(pfx + " the EaglerXBungee plugin which has memory leaks")); - ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(pfx)); - ingameGUI.getChatGUI() - .printChatMessage(new ChatComponentText(pfx + " If you are the admin update to " - + EnumChatFormatting.YELLOW + "1.0.6" + EnumChatFormatting.AQUA + " or newer")); - ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(pfx)); - ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(pfx + EnumChatFormatting.GREEN - + " https://ftp.deev.is/EaglerXBungee-1.0.6-MemleakFix.jar")); - ingameGUI.getChatGUI() - .printChatMessage(new ChatComponentText(pfx + " ---------------------------------------")); + if (--bungeeOutdatedMsgTimer == 0 && this.thePlayer.sendQueue != null) { + String pluginBrand = this.thePlayer.sendQueue.getNetworkManager().getPluginBrand(); + String pluginVersion = this.thePlayer.sendQueue.getNetworkManager().getPluginVersion(); + if (pluginBrand != null && pluginVersion != null + && EaglerXBungeeVersion.isUpdateToPluginAvailable(pluginBrand, pluginVersion)) { + String pfx = EnumChatFormatting.GOLD + "[EagX]" + EnumChatFormatting.AQUA; + ingameGUI.getChatGUI().printChatMessage( + new ChatComponentText(pfx + " ---------------------------------------")); + ingameGUI.getChatGUI().printChatMessage( + new ChatComponentText(pfx + " This server appears to be using version " + + EnumChatFormatting.YELLOW + pluginVersion)); + ingameGUI.getChatGUI().printChatMessage( + new ChatComponentText(pfx + " of the EaglerXBungee plugin which is outdated")); + ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(pfx)); + ingameGUI.getChatGUI() + .printChatMessage(new ChatComponentText(pfx + " If you are the admin update to " + + EnumChatFormatting.YELLOW + EaglerXBungeeVersion.getPluginVersion() + + EnumChatFormatting.AQUA + " or newer")); + ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(pfx)); + ingameGUI.getChatGUI().printChatMessage((new ChatComponentText(pfx + " Click: ")) + .appendSibling((new ChatComponentText("" + EnumChatFormatting.GREEN + + EnumChatFormatting.UNDERLINE + EaglerXBungeeVersion.getPluginButton())) + .setChatStyle((new ChatStyle()).setChatClickEvent( + new ClickEvent(ClickEvent.Action.EAGLER_PLUGIN_DOWNLOAD, + "plugin_download.zip"))))); + ingameGUI.getChatGUI().printChatMessage( + new ChatComponentText(pfx + " ---------------------------------------")); + } } } } else { joinWorldTickCounter = 0; + if (currentScreen != null && currentScreen.shouldHangupIntegratedServer()) { + if (SingleplayerServerController.hangupEaglercraftServer()) { + this.displayGuiScreen(new GuiScreenIntegratedServerBusy(currentScreen, + "singleplayer.busy.stoppingIntegratedServer", + "singleplayer.failed.stoppingIntegratedServer", + () -> SingleplayerServerController.isReady())); + } + } } this.mcProfiler.endSection(); @@ -1713,7 +1722,17 @@ public class Minecraft implements IThreadListener { * Arguments: World foldername, World ingame name, WorldSettings */ public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) { - throw new UnsupportedOperationException("singleplayer has been removed"); + this.loadWorld((WorldClient) null); + session.reset(); + SingleplayerServerController.launchEaglercraftServer(folderName, gameSettings.difficulty.getDifficultyId(), + Math.max(gameSettings.renderDistanceChunks, 2), worldSettingsIn); + this.displayGuiScreen(new GuiScreenIntegratedServerBusy( + new GuiScreenSingleplayerConnecting(new GuiMainMenu(), "Connecting to " + folderName), + "singleplayer.busy.startingIntegratedServer", "singleplayer.failed.startingIntegratedServer", + () -> SingleplayerServerController.isWorldReady(), (t, u) -> { + Minecraft.this.displayGuiScreen(GuiScreenIntegratedServerBusy.createException(new GuiMainMenu(), + ((GuiScreenIntegratedServerBusy) t).failMessage, u)); + })); } /**+ @@ -1817,7 +1836,7 @@ public class Minecraft implements IThreadListener { * Gets whether this is a demo or not. */ public final boolean isDemo() { - return this.isDemo; + return EagRuntime.getConfiguration().isDemo(); } public NetHandlerPlayClient getNetHandler() { @@ -2073,7 +2092,7 @@ public class Minecraft implements IThreadListener { } public boolean isIntegratedServerRunning() { - return this.integratedServerIsRunning; + return SingleplayerServerController.isWorldRunning(); } /**+ @@ -2081,7 +2100,7 @@ public class Minecraft implements IThreadListener { * current server is the integrated one. */ public boolean isSingleplayer() { - return false; + return SingleplayerServerController.isWorldRunning(); } public static void stopIntegratedServer() { @@ -2139,11 +2158,15 @@ public class Minecraft implements IThreadListener { } public MusicTicker.MusicType getAmbientMusicType() { - if(!this.gameSettings.secret) { - return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; - } else { - return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU_SECRET; - } + return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell + ? MusicTicker.MusicType.NETHER + : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd + ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS + : MusicTicker.MusicType.END) + : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying + ? MusicTicker.MusicType.CREATIVE + : MusicTicker.MusicType.GAME))) + : MusicTicker.MusicType.MENU; } public void dispatchKeypresses() { @@ -2229,4 +2252,15 @@ public class Minecraft implements IThreadListener { public ModelManager getModelManager() { return modelManager; } + + /**+ + * Returns the save loader that is currently being used + */ + public ISaveFormat getSaveLoader() { + return SingleplayerServerController.instance; + } + + public void clearTitles() { + ingameGUI.displayTitle(null, null, -1, -1, -1); + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/audio/GuardianSound.java b/src/main/java/net/minecraft/client/audio/GuardianSound.java index fe4a80b..74a3e07 100644 --- a/src/main/java/net/minecraft/client/audio/GuardianSound.java +++ b/src/main/java/net/minecraft/client/audio/GuardianSound.java @@ -9,16 +9,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuardianSound extends MovingSound { diff --git a/src/main/java/net/minecraft/client/audio/ISound.java b/src/main/java/net/minecraft/client/audio/ISound.java index 2712dc0..240b47e 100644 --- a/src/main/java/net/minecraft/client/audio/ISound.java +++ b/src/main/java/net/minecraft/client/audio/ISound.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISound { diff --git a/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java b/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java index 82107db..9b1b7f3 100644 --- a/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java +++ b/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java @@ -6,16 +6,18 @@ package net.minecraft.client.audio; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISoundEventAccessor { diff --git a/src/main/java/net/minecraft/client/audio/ITickableSound.java b/src/main/java/net/minecraft/client/audio/ITickableSound.java index deb4f9b..feb4ca2 100644 --- a/src/main/java/net/minecraft/client/audio/ITickableSound.java +++ b/src/main/java/net/minecraft/client/audio/ITickableSound.java @@ -8,16 +8,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITickableSound extends ISound, ITickable { diff --git a/src/main/java/net/minecraft/client/audio/MovingSound.java b/src/main/java/net/minecraft/client/audio/MovingSound.java index ff33d5c..0c7e83a 100644 --- a/src/main/java/net/minecraft/client/audio/MovingSound.java +++ b/src/main/java/net/minecraft/client/audio/MovingSound.java @@ -2,6 +2,26 @@ package net.minecraft.client.audio; import net.minecraft.util.ResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class MovingSound extends PositionedSound implements ITickableSound { protected boolean donePlaying = false; diff --git a/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java b/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java index f787b72..5e2f98b 100644 --- a/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java +++ b/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MovingSoundMinecart extends MovingSound { diff --git a/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java b/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java index 3bd2cd6..28514aa 100644 --- a/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java +++ b/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MovingSoundMinecartRiding extends MovingSound { diff --git a/src/main/java/net/minecraft/client/audio/MusicTicker.java b/src/main/java/net/minecraft/client/audio/MusicTicker.java index 458e1fc..fafa0b4 100644 --- a/src/main/java/net/minecraft/client/audio/MusicTicker.java +++ b/src/main/java/net/minecraft/client/audio/MusicTicker.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MusicTicker implements ITickable { @@ -78,7 +80,6 @@ public class MusicTicker implements ITickable { public static enum MusicType { MENU(new ResourceLocation("minecraft:music.menu"), 20, 600), - MENU_SECRET(new ResourceLocation("minecraft:music.menu.secret"), 0, 0), GAME(new ResourceLocation("minecraft:music.game"), 12000, 24000), CREATIVE(new ResourceLocation("minecraft:music.game.creative"), 1200, 3600), CREDITS(new ResourceLocation("minecraft:music.game.end.credits"), Integer.MAX_VALUE, Integer.MAX_VALUE), diff --git a/src/main/java/net/minecraft/client/audio/PositionedSound.java b/src/main/java/net/minecraft/client/audio/PositionedSound.java index ce0854e..7a9f464 100644 --- a/src/main/java/net/minecraft/client/audio/PositionedSound.java +++ b/src/main/java/net/minecraft/client/audio/PositionedSound.java @@ -2,6 +2,26 @@ package net.minecraft.client.audio; import net.minecraft.util.ResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class PositionedSound implements ISound { protected final ResourceLocation positionedSoundLocation; protected float volume = 1.0F; diff --git a/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java b/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java index 99d1e3e..4d1e55b 100644 --- a/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java +++ b/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PositionedSoundRecord extends PositionedSound { diff --git a/src/main/java/net/minecraft/client/audio/SoundCategory.java b/src/main/java/net/minecraft/client/audio/SoundCategory.java index 56912c9..220be8d 100644 --- a/src/main/java/net/minecraft/client/audio/SoundCategory.java +++ b/src/main/java/net/minecraft/client/audio/SoundCategory.java @@ -10,16 +10,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundCategory { diff --git a/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java b/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java index 7e47ee0..ee0fc88 100644 --- a/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java +++ b/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java @@ -6,16 +6,18 @@ package net.minecraft.client.audio; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundEventAccessor implements ISoundEventAccessor { diff --git a/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java b/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java index e0a2242..f0e3287 100644 --- a/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java +++ b/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundEventAccessorComposite implements ISoundEventAccessor { diff --git a/src/main/java/net/minecraft/client/audio/SoundHandler.java b/src/main/java/net/minecraft/client/audio/SoundHandler.java index 3eaba56..789e420 100644 --- a/src/main/java/net/minecraft/client/audio/SoundHandler.java +++ b/src/main/java/net/minecraft/client/audio/SoundHandler.java @@ -3,8 +3,6 @@ package net.minecraft.client.audio; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Map; @@ -36,34 +34,22 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundHandler implements IResourceManagerReloadListener, ITickable { private static final Logger logger = LogManager.getLogger(); - - private static final ParameterizedType TYPE = new ParameterizedType() { - public Type[] getActualTypeArguments() { - return new Type[] { String.class, SoundList.class }; - } - - public Type getRawType() { - return Map.class; - } - - public Type getOwnerType() { - return null; - } - }; public static final SoundPoolEntry missing_sound = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"), 0.0D, 0.0D, false); private final SoundRegistry sndRegistry = new SoundRegistry(); diff --git a/src/main/java/net/minecraft/client/audio/SoundList.java b/src/main/java/net/minecraft/client/audio/SoundList.java index 4321c52..943ef15 100644 --- a/src/main/java/net/minecraft/client/audio/SoundList.java +++ b/src/main/java/net/minecraft/client/audio/SoundList.java @@ -10,16 +10,18 @@ import com.google.common.collect.Lists; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundList { diff --git a/src/main/java/net/minecraft/client/audio/SoundListSerializer.java b/src/main/java/net/minecraft/client/audio/SoundListSerializer.java index 1ad18f4..bb7664a 100644 --- a/src/main/java/net/minecraft/client/audio/SoundListSerializer.java +++ b/src/main/java/net/minecraft/client/audio/SoundListSerializer.java @@ -13,16 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeDeserializer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundListSerializer implements JSONTypeDeserializer { diff --git a/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java b/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java index c662a17..4b033bd 100644 --- a/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java +++ b/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundPoolEntry { diff --git a/src/main/java/net/minecraft/client/audio/SoundRegistry.java b/src/main/java/net/minecraft/client/audio/SoundRegistry.java index 5ac487e..cee11d1 100644 --- a/src/main/java/net/minecraft/client/audio/SoundRegistry.java +++ b/src/main/java/net/minecraft/client/audio/SoundRegistry.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SoundRegistry extends RegistrySimple { diff --git a/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java b/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java index 91189e5..f6e0b38 100644 --- a/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java +++ b/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java @@ -13,6 +13,26 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraft.world.WorldSettings; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class AbstractClientPlayer extends EntityPlayer { private NetworkPlayerInfo playerInfo; private ResourceLocation locationOfCape = null; @@ -74,6 +94,7 @@ public abstract class AbstractClientPlayer extends EntityPlayer { } } + public String getSkinType() { NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo(); return networkplayerinfo == null ? DefaultPlayerSkin.getSkinType(this.getUniqueID()) diff --git a/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java b/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java index aa7c576..080077a 100644 --- a/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java +++ b/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityOtherPlayerMP extends AbstractClientPlayer { diff --git a/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java b/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java index 8aaec67..b4d18c9 100644 --- a/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java +++ b/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java @@ -1,7 +1,9 @@ package net.minecraft.client.entity; -import net.FatalCodes.shadow.Shadow; -import net.minecraft.client.settings.GameSettings; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.MovingSoundMinecartRiding; import net.minecraft.client.audio.PositionedSoundRecord; @@ -21,6 +23,7 @@ import net.minecraft.client.gui.inventory.GuiEditSign; import net.minecraft.client.gui.inventory.GuiFurnace; import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.settings.GameSettings; import net.minecraft.command.server.CommandBlockLogic; import net.minecraft.entity.Entity; import net.minecraft.entity.IMerchant; @@ -60,16 +63,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPlayerSP extends AbstractClientPlayer { @@ -247,7 +252,13 @@ public class EntityPlayerSP extends AbstractClientPlayer { * Sends a chat message from the player. Args: chatMessage */ public void sendChatMessage(String message) { - this.sendQueue.addToSendQueue(new C01PacketChatMessage(message)); + if (((sendQueue.getNetworkManager() instanceof ClientIntegratedServerNetworkManager) + || (sendQueue.getNetworkManager() instanceof LANClientNetworkManager)) + && message.startsWith("/eagskull")) { + this.mc.eagskullCommand.openFileChooser(); + } else { + this.sendQueue.addToSendQueue(new C01PacketChatMessage(message)); + } } /**+ @@ -596,7 +607,6 @@ public class EntityPlayerSP extends AbstractClientPlayer { * to react to sunlight and start to burn. */ public void onLivingUpdate() { - Shadow.moduleManager.onUpdate(); if (this.sprintingTicksLeft > 0) { --this.sprintingTicksLeft; if (this.sprintingTicksLeft == 0) { @@ -753,9 +763,5 @@ public class EntityPlayerSP extends AbstractClientPlayer { this.capabilities.isFlying = false; this.sendPlayerAbilities(); } - - if(Minecraft.getMinecraft().gameSettings.keyBindSprint.isPressed() && Minecraft.getMinecraft().gameSettings.toggleSprint) { - GameSettings.toggleSprintEnabled = !GameSettings.toggleSprintEnabled; - } } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/ChatLine.java b/src/main/java/net/minecraft/client/gui/ChatLine.java index 66bef1b..31e3158 100644 --- a/src/main/java/net/minecraft/client/gui/ChatLine.java +++ b/src/main/java/net/minecraft/client/gui/ChatLine.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatLine { diff --git a/src/main/java/net/minecraft/client/gui/FontRenderer.java b/src/main/java/net/minecraft/client/gui/FontRenderer.java index 6eecb31..273f720 100644 --- a/src/main/java/net/minecraft/client/gui/FontRenderer.java +++ b/src/main/java/net/minecraft/client/gui/FontRenderer.java @@ -142,7 +142,7 @@ public class FontRenderer implements IResourceManagerReloadListener { Properties properties = FontUtils.readFontProperties(this.locationFontTexture); int i = bufferedimage.width; int j = bufferedimage.height; - int[] aint = bufferedimage.getPixels(); + int[] aint = bufferedimage.pixels; int k = j / 16; int l = i / 16; byte b0 = 1; diff --git a/src/main/java/net/minecraft/client/gui/Gui.java b/src/main/java/net/minecraft/client/gui/Gui.java index bd8a005..48d1d72 100644 --- a/src/main/java/net/minecraft/client/gui/Gui.java +++ b/src/main/java/net/minecraft/client/gui/Gui.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Gui { @@ -64,15 +66,15 @@ public class Gui { * Draws a solid color rectangle with the specified coordinates * and color (ARGB format). Args: x1, y1, x2, y2, color */ - public static void drawRect(double left, double top, double right, double bottom, int color) { + public static void drawRect(int left, int top, int right, int bottom, int color) { if (left < right) { - double i = left; + int i = left; left = right; right = i; } if (top < bottom) { - double j = top; + int j = top; top = bottom; bottom = j; } diff --git a/src/main/java/net/minecraft/client/gui/GuiButton.java b/src/main/java/net/minecraft/client/gui/GuiButton.java index b91c2ac..39e831f 100644 --- a/src/main/java/net/minecraft/client/gui/GuiButton.java +++ b/src/main/java/net/minecraft/client/gui/GuiButton.java @@ -2,6 +2,8 @@ package net.minecraft.client.gui; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; @@ -14,16 +16,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiButton extends Gui { @@ -82,6 +86,9 @@ public class GuiButton extends Gui { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + if (this.enabled && this.hovered) { + Mouse.showCursor(EnumCursorType.HAND); + } int i = this.getHoverState(this.hovered); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); diff --git a/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java b/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java index 32f9d1f..8d87bfb 100644 --- a/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java +++ b/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java @@ -1,5 +1,7 @@ package net.minecraft.client.gui; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.Minecraft; @@ -9,16 +11,18 @@ import net.minecraft.client.Minecraft; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiButtonLanguage extends GuiButton { @@ -38,6 +42,7 @@ public class GuiButtonLanguage extends GuiButton { int k = 106; if (flag) { k += this.height; + Mouse.showCursor(EnumCursorType.HAND); } this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, k, this.width, this.height); diff --git a/src/main/java/net/minecraft/client/gui/GuiChat.java b/src/main/java/net/minecraft/client/gui/GuiChat.java index 102d75a..3b7c872 100644 --- a/src/main/java/net/minecraft/client/gui/GuiChat.java +++ b/src/main/java/net/minecraft/client/gui/GuiChat.java @@ -27,16 +27,18 @@ import net.minecraft.util.MovingObjectPosition; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiChat extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java b/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java index 983f27c..f6813d0 100644 --- a/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java +++ b/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java @@ -16,16 +16,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiCommandBlock extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java b/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java index 552ad2d..11f1ee7 100644 --- a/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java +++ b/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java @@ -8,16 +8,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiConfirmOpenLink extends GuiYesNo { diff --git a/src/main/java/net/minecraft/client/gui/GuiControls.java b/src/main/java/net/minecraft/client/gui/GuiControls.java index dc0b953..5a6ed5a 100644 --- a/src/main/java/net/minecraft/client/gui/GuiControls.java +++ b/src/main/java/net/minecraft/client/gui/GuiControls.java @@ -13,20 +13,23 @@ import net.minecraft.client.settings.KeyBinding; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiControls extends GuiScreen { - private static final GameSettings.Options[] optionsArr = new GameSettings.Options[] {GameSettings.Options.INVERT_MOUSE, GameSettings.Options.SENSITIVITY, GameSettings.Options.TOUCHSCREEN, GameSettings.Options.TOGGLE_SPRINT }; + private static final GameSettings.Options[] optionsArr = new GameSettings.Options[] { + GameSettings.Options.INVERT_MOUSE, GameSettings.Options.SENSITIVITY, GameSettings.Options.TOUCHSCREEN, GameSettings.Options.TOGGLE_SPRINT }; private GuiScreen parentScreen; protected String screenTitle = "Controls"; private GameSettings options; diff --git a/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java b/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java new file mode 100644 index 0000000..b4e6df9 --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java @@ -0,0 +1,269 @@ +package net.minecraft.client.gui; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiFlatPresets; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiCreateFlatWorld extends GuiScreen { + private final GuiCreateWorld createWorldGui; + private FlatGeneratorInfo theFlatGeneratorInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); + private String flatWorldTitle; + private String field_146394_i; + private String field_146391_r; + private GuiCreateFlatWorld.Details createFlatWorldListSlotGui; + private GuiButton field_146389_t; + private GuiButton field_146388_u; + private GuiButton field_146386_v; + + public GuiCreateFlatWorld(GuiCreateWorld createWorldGuiIn, String parString1) { + this.createWorldGui = createWorldGuiIn; + this.func_146383_a(parString1); + } + + public String func_146384_e() { + return this.theFlatGeneratorInfo.toString(); + } + + public void func_146383_a(String parString1) { + this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(parString1); + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + this.buttonList.clear(); + this.flatWorldTitle = I18n.format("createWorld.customize.flat.title", new Object[0]); + this.field_146394_i = I18n.format("createWorld.customize.flat.tile", new Object[0]); + this.field_146391_r = I18n.format("createWorld.customize.flat.height", new Object[0]); + this.createFlatWorldListSlotGui = new GuiCreateFlatWorld.Details(); + this.buttonList.add(this.field_146389_t = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, + I18n.format("createWorld.customize.flat.addLayer", new Object[0]) + " (NYI)")); + this.buttonList.add(this.field_146388_u = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, + I18n.format("createWorld.customize.flat.editLayer", new Object[0]) + " (NYI)")); + this.buttonList.add(this.field_146386_v = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, + I18n.format("createWorld.customize.flat.removeLayer", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, + I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, + I18n.format("createWorld.customize.presets", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, + I18n.format("gui.cancel", new Object[0]))); + this.field_146389_t.visible = this.field_146388_u.visible = false; + this.theFlatGeneratorInfo.func_82645_d(); + this.func_146375_g(); + } + + /**+ + * Handles mouse input. + */ + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.createFlatWorldListSlotGui.handleMouseInput(); + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + int i = this.theFlatGeneratorInfo.getFlatLayers().size() - this.createFlatWorldListSlotGui.field_148228_k - 1; + if (parGuiButton.id == 1) { + this.mc.displayGuiScreen(this.createWorldGui); + } else if (parGuiButton.id == 0) { + this.createWorldGui.chunkProviderSettingsJson = this.func_146384_e(); + this.mc.displayGuiScreen(this.createWorldGui); + } else if (parGuiButton.id == 5) { + this.mc.displayGuiScreen(new GuiFlatPresets(this)); + } else if (parGuiButton.id == 4 && this.func_146382_i()) { + this.theFlatGeneratorInfo.getFlatLayers().remove(i); + this.createFlatWorldListSlotGui.field_148228_k = Math.min(this.createFlatWorldListSlotGui.field_148228_k, + this.theFlatGeneratorInfo.getFlatLayers().size() - 1); + } + + this.theFlatGeneratorInfo.func_82645_d(); + this.func_146375_g(); + } + + public void func_146375_g() { + boolean flag = this.func_146382_i(); + this.field_146386_v.enabled = flag; + this.field_146388_u.enabled = flag; + this.field_146388_u.enabled = false; + this.field_146389_t.enabled = false; + } + + private boolean func_146382_i() { + return this.createFlatWorldListSlotGui.field_148228_k > -1 + && this.createFlatWorldListSlotGui.field_148228_k < this.theFlatGeneratorInfo.getFlatLayers().size(); + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.drawDefaultBackground(); + this.createFlatWorldListSlotGui.drawScreen(i, j, f); + this.drawCenteredString(this.fontRendererObj, this.flatWorldTitle, this.width / 2, 8, 16777215); + int k = this.width / 2 - 92 - 16; + this.drawString(this.fontRendererObj, this.field_146394_i, k, 32, 16777215); + this.drawString(this.fontRendererObj, this.field_146391_r, + k + 2 + 213 - this.fontRendererObj.getStringWidth(this.field_146391_r), 32, 16777215); + super.drawScreen(i, j, f); + } + + class Details extends GuiSlot { + public int field_148228_k = -1; + + public Details() { + super(GuiCreateFlatWorld.this.mc, GuiCreateFlatWorld.this.width, GuiCreateFlatWorld.this.height, 43, + GuiCreateFlatWorld.this.height - 60, 24); + } + + private void func_148225_a(int parInt1, int parInt2, ItemStack parItemStack) { + this.func_148226_e(parInt1 + 1, parInt2 + 1); + GlStateManager.enableRescaleNormal(); + if (parItemStack != null && parItemStack.getItem() != null) { + RenderHelper.enableGUIStandardItemLighting(); + GuiCreateFlatWorld.this.itemRender.renderItemIntoGUI(parItemStack, parInt1 + 2, parInt2 + 2); + RenderHelper.disableStandardItemLighting(); + } + + GlStateManager.disableRescaleNormal(); + } + + private void func_148226_e(int parInt1, int parInt2) { + this.func_148224_c(parInt1, parInt2, 0, 0); + } + + private void func_148224_c(int parInt1, int parInt2, int parInt3, int parInt4) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + boolean flag = true; + boolean flag1 = true; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (parInt1 + 0), (double) (parInt2 + 18), (double) GuiCreateFlatWorld.this.zLevel) + .tex((double) ((float) (parInt3 + 0) * 0.0078125F), (double) ((float) (parInt4 + 18) * 0.0078125F)) + .endVertex(); + worldrenderer.pos((double) (parInt1 + 18), (double) (parInt2 + 18), (double) GuiCreateFlatWorld.this.zLevel) + .tex((double) ((float) (parInt3 + 18) * 0.0078125F), (double) ((float) (parInt4 + 18) * 0.0078125F)) + .endVertex(); + worldrenderer.pos((double) (parInt1 + 18), (double) (parInt2 + 0), (double) GuiCreateFlatWorld.this.zLevel) + .tex((double) ((float) (parInt3 + 18) * 0.0078125F), (double) ((float) (parInt4 + 0) * 0.0078125F)) + .endVertex(); + worldrenderer.pos((double) (parInt1 + 0), (double) (parInt2 + 0), (double) GuiCreateFlatWorld.this.zLevel) + .tex((double) ((float) (parInt3 + 0) * 0.0078125F), (double) ((float) (parInt4 + 0) * 0.0078125F)) + .endVertex(); + tessellator.draw(); + } + + protected int getSize() { + return GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size(); + } + + protected void elementClicked(int i, boolean var2, int var3, int var4) { + this.field_148228_k = i; + GuiCreateFlatWorld.this.func_146375_g(); + } + + protected boolean isSelected(int i) { + return i == this.field_148228_k; + } + + protected void drawBackground() { + } + + protected void drawSlot(int i, int j, int k, int var4, int var5, int var6) { + FlatLayerInfo flatlayerinfo = (FlatLayerInfo) GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers() + .get(GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - i - 1); + IBlockState iblockstate = flatlayerinfo.func_175900_c(); + Block block = iblockstate.getBlock(); + Item item = Item.getItemFromBlock(block); + ItemStack itemstack = block != Blocks.air && item != null + ? new ItemStack(item, 1, block.getMetaFromState(iblockstate)) + : null; + String s = itemstack == null ? "Air" : item.getItemStackDisplayName(itemstack); + if (item == null) { + if (block != Blocks.water && block != Blocks.flowing_water) { + if (block == Blocks.lava || block == Blocks.flowing_lava) { + item = Items.lava_bucket; + } + } else { + item = Items.water_bucket; + } + + if (item != null) { + itemstack = new ItemStack(item, 1, block.getMetaFromState(iblockstate)); + s = block.getLocalizedName(); + } + } + + this.func_148225_a(j, k, itemstack); + GuiCreateFlatWorld.this.fontRendererObj.drawString(s, j + 18 + 5, k + 3, 16777215); + String s1; + if (i == 0) { + s1 = I18n.format("createWorld.customize.flat.layer.top", + new Object[] { Integer.valueOf(flatlayerinfo.getLayerCount()) }); + } else if (i == GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - 1) { + s1 = I18n.format("createWorld.customize.flat.layer.bottom", + new Object[] { Integer.valueOf(flatlayerinfo.getLayerCount()) }); + } else { + s1 = I18n.format("createWorld.customize.flat.layer", + new Object[] { Integer.valueOf(flatlayerinfo.getLayerCount()) }); + } + + GuiCreateFlatWorld.this.fontRendererObj.drawString(s1, + j + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(s1), k + 3, 16777215); + } + + protected int getScrollBarX() { + return this.width - 70; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java b/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java new file mode 100644 index 0000000..7276804 --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java @@ -0,0 +1,472 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import java.util.Random; + +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateFlatWorld; +import net.minecraft.client.gui.GuiCustomizeWorldScreen; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.StringUtils; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiCreateWorld extends GuiScreen { + private GuiScreen parentScreen; + private GuiTextField field_146333_g; + private GuiTextField field_146335_h; + private String field_146336_i; + private String gameMode = "survival"; + private String field_175300_s; + private boolean field_146341_s = true; + private boolean allowCheats; + private boolean field_146339_u; + private boolean field_146338_v; + private boolean field_146337_w; + private boolean field_146345_x; + private boolean field_146344_y; + private GuiButton btnGameMode; + private GuiButton btnMoreOptions; + private GuiButton btnMapFeatures; + private GuiButton btnBonusItems; + private GuiButton btnMapType; + private GuiButton btnAllowCommands; + private GuiButton btnCustomizeType; + private String field_146323_G; + private String field_146328_H; + private String field_146329_I; + private String field_146330_J; + private int selectedIndex; + public String chunkProviderSettingsJson = ""; + /**+ + * These filenames are known to be restricted on one or more + * OS's. + */ + private static final String[] disallowedFilenames = new String[] { "CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", + "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", + "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" }; + + public GuiCreateWorld(GuiScreen parGuiScreen) { + this.parentScreen = parGuiScreen; + this.field_146329_I = ""; + this.field_146330_J = I18n.format("selectWorld.newWorld", new Object[0]); + } + + /**+ + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146333_g.updateCursorCounter(); + this.field_146335_h.updateCursorCounter(); + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, + I18n.format("selectWorld.create", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, + I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.btnGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, + I18n.format("selectWorld.gameMode", new Object[0]))); + this.buttonList.add(this.btnMoreOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, + I18n.format("selectWorld.moreWorldOptions", new Object[0]))); + this.buttonList.add(this.btnMapFeatures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, + I18n.format("selectWorld.mapFeatures", new Object[0]))); + this.btnMapFeatures.visible = false; + this.buttonList.add(this.btnBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, + I18n.format("selectWorld.bonusItems", new Object[0]))); + this.btnBonusItems.visible = false; + this.buttonList.add(this.btnMapType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, + I18n.format("selectWorld.mapType", new Object[0]))); + this.btnMapType.visible = false; + this.buttonList.add(this.btnAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, + I18n.format("selectWorld.allowCommands", new Object[0]))); + this.btnAllowCommands.visible = false; + this.buttonList.add(this.btnCustomizeType = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, + I18n.format("selectWorld.customizeType", new Object[0]))); + this.btnCustomizeType.visible = false; + this.field_146333_g = new GuiTextField(9, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146333_g.setFocused(true); + this.field_146333_g.setText(this.field_146330_J); + this.field_146335_h = new GuiTextField(10, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146335_h.setText(this.field_146329_I); + this.func_146316_a(this.field_146344_y); + this.func_146314_g(); + this.func_146319_h(); + } + + private void func_146314_g() { + this.field_146336_i = this.field_146333_g.getText().trim(); + + for (char c0 : ChatAllowedCharacters.allowedCharactersArray) { + this.field_146336_i = this.field_146336_i.replace(c0, '_'); + } + + if (StringUtils.isEmpty(this.field_146336_i)) { + this.field_146336_i = "World"; + } + + this.field_146336_i = func_146317_a(this.mc.getSaveLoader(), this.field_146336_i); + } + + private void func_146319_h() { + this.btnGameMode.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + ": " + + I18n.format("selectWorld.gameMode." + this.gameMode, new Object[0]); + this.field_146323_G = I18n.format("selectWorld.gameMode." + this.gameMode + ".line1", new Object[0]); + this.field_146328_H = I18n.format("selectWorld.gameMode." + this.gameMode + ".line2", new Object[0]); + this.btnMapFeatures.displayString = I18n.format("selectWorld.mapFeatures", new Object[0]) + " "; + if (this.field_146341_s) { + this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + + I18n.format("options.on", new Object[0]); + } else { + this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + + I18n.format("options.off", new Object[0]); + } + + this.btnBonusItems.displayString = I18n.format("selectWorld.bonusItems", new Object[0]) + " "; + if (this.field_146338_v && !this.field_146337_w) { + this.btnBonusItems.displayString = this.btnBonusItems.displayString + + I18n.format("options.on", new Object[0]); + } else { + this.btnBonusItems.displayString = this.btnBonusItems.displayString + + I18n.format("options.off", new Object[0]); + } + + this.btnMapType.displayString = I18n.format("selectWorld.mapType", new Object[0]) + " " + + I18n.format(WorldType.worldTypes[this.selectedIndex].getTranslateName(), new Object[0]); + this.btnAllowCommands.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " "; + if (this.allowCheats && !this.field_146337_w) { + this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + + I18n.format("options.on", new Object[0]); + } else { + this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + + I18n.format("options.off", new Object[0]); + } + + } + + public static String func_146317_a(ISaveFormat parISaveFormat, String parString1) { + parString1 = parString1.replaceAll("[\\./\"]", "_"); + + for (String s : disallowedFilenames) { + if (parString1.equalsIgnoreCase(s)) { + parString1 = "_" + parString1 + "_"; + } + } + + while (parISaveFormat.getWorldInfo(parString1) != null) { + parString1 = parString1 + "-"; + } + + return parString1; + } + + /**+ + * Called when the screen is unloaded. Used to disable keyboard + * repeat events + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + if (parGuiButton.enabled) { + if (parGuiButton.id == 1) { + this.mc.displayGuiScreen(this.parentScreen); + } else if (parGuiButton.id == 0) { + this.mc.displayGuiScreen((GuiScreen) null); + if (this.field_146345_x) { + return; + } + + this.field_146345_x = true; + long i = (new Random()).nextLong(); + String s = this.field_146335_h.getText(); + if (!StringUtils.isEmpty(s)) { + try { + long j = Long.parseLong(s); + if (j != 0L) { + i = j; + } + } catch (NumberFormatException var7) { + i = (long) s.hashCode(); + } + } + + WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.getByName(this.gameMode); + WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, + this.field_146337_w, WorldType.worldTypes[this.selectedIndex]); + worldsettings.setWorldName(this.chunkProviderSettingsJson); + if (this.field_146338_v && !this.field_146337_w) { + worldsettings.enableBonusChest(); + } + + if (this.allowCheats && !this.field_146337_w) { + worldsettings.enableCommands(); + } + + this.mc.launchIntegratedServer(this.field_146336_i, this.field_146333_g.getText().trim(), + worldsettings); + } else if (parGuiButton.id == 3) { + this.func_146315_i(); + } else if (parGuiButton.id == 2) { + if (this.gameMode.equals("survival")) { + if (!this.field_146339_u) { + this.allowCheats = false; + } + + this.field_146337_w = false; + this.gameMode = "hardcore"; + this.field_146337_w = true; + this.btnAllowCommands.enabled = false; + this.btnBonusItems.enabled = false; + this.func_146319_h(); + } else if (this.gameMode.equals("hardcore")) { + if (!this.field_146339_u) { + this.allowCheats = true; + } + + this.field_146337_w = false; + this.gameMode = "creative"; + this.func_146319_h(); + this.field_146337_w = false; + this.btnAllowCommands.enabled = true; + this.btnBonusItems.enabled = true; + } else { + if (!this.field_146339_u) { + this.allowCheats = false; + } + + this.gameMode = "survival"; + this.func_146319_h(); + this.btnAllowCommands.enabled = true; + this.btnBonusItems.enabled = true; + this.field_146337_w = false; + } + + this.func_146319_h(); + } else if (parGuiButton.id == 4) { + this.field_146341_s = !this.field_146341_s; + this.func_146319_h(); + } else if (parGuiButton.id == 7) { + this.field_146338_v = !this.field_146338_v; + this.func_146319_h(); + } else if (parGuiButton.id == 5) { + ++this.selectedIndex; + if (this.selectedIndex >= WorldType.worldTypes.length) { + this.selectedIndex = 0; + } + + while (!this.func_175299_g()) { + ++this.selectedIndex; + if (this.selectedIndex >= WorldType.worldTypes.length) { + this.selectedIndex = 0; + } + } + + this.chunkProviderSettingsJson = ""; + this.func_146319_h(); + this.func_146316_a(this.field_146344_y); + } else if (parGuiButton.id == 6) { + this.field_146339_u = true; + this.allowCheats = !this.allowCheats; + this.func_146319_h(); + } else if (parGuiButton.id == 8) { + if (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT) { + this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.chunkProviderSettingsJson)); + } else { + this.mc.displayGuiScreen(new GuiCustomizeWorldScreen(this, this.chunkProviderSettingsJson)); + } + } + + } + } + + private boolean func_175299_g() { + WorldType worldtype = WorldType.worldTypes[this.selectedIndex]; + return worldtype != null && worldtype.getCanBeCreated() + ? (worldtype == WorldType.DEBUG_WORLD ? isShiftKeyDown() : true) + : false; + } + + private void func_146315_i() { + this.func_146316_a(!this.field_146344_y); + } + + private void func_146316_a(boolean parFlag) { + this.field_146344_y = parFlag; + if (WorldType.worldTypes[this.selectedIndex] == WorldType.DEBUG_WORLD) { + this.btnGameMode.visible = !this.field_146344_y; + this.btnGameMode.enabled = false; + if (this.field_175300_s == null) { + this.field_175300_s = this.gameMode; + } + + this.gameMode = "spectator"; + this.btnMapFeatures.visible = false; + this.btnBonusItems.visible = false; + this.btnMapType.visible = this.field_146344_y; + this.btnAllowCommands.visible = false; + this.btnCustomizeType.visible = false; + } else { + this.btnGameMode.visible = !this.field_146344_y; + this.btnGameMode.enabled = true; + if (this.field_175300_s != null) { + this.gameMode = this.field_175300_s; + this.field_175300_s = null; + } + + this.btnMapFeatures.visible = this.field_146344_y + && WorldType.worldTypes[this.selectedIndex] != WorldType.CUSTOMIZED; + this.btnBonusItems.visible = this.field_146344_y; + this.btnMapType.visible = this.field_146344_y; + this.btnAllowCommands.visible = this.field_146344_y; + this.btnCustomizeType.visible = this.field_146344_y + && (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT + || WorldType.worldTypes[this.selectedIndex] == WorldType.CUSTOMIZED); + } + + this.func_146319_h(); + if (this.field_146344_y) { + this.btnMoreOptions.displayString = I18n.format("gui.done", new Object[0]); + } else { + this.btnMoreOptions.displayString = I18n.format("selectWorld.moreWorldOptions", new Object[0]); + } + + } + + /**+ + * Fired when a key is typed (except F11 which toggles full + * screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character + * on the key), keyCode (lwjgl Keyboard key code) + */ + protected void keyTyped(char parChar1, int parInt1) { + if (this.field_146333_g.isFocused() && !this.field_146344_y) { + this.field_146333_g.textboxKeyTyped(parChar1, parInt1); + this.field_146330_J = this.field_146333_g.getText(); + } else if (this.field_146335_h.isFocused() && this.field_146344_y) { + this.field_146335_h.textboxKeyTyped(parChar1, parInt1); + this.field_146329_I = this.field_146335_h.getText(); + } + + if (parInt1 == 28 || parInt1 == 156) { + this.actionPerformed((GuiButton) this.buttonList.get(0)); + } + + ((GuiButton) this.buttonList.get(0)).enabled = this.field_146333_g.getText().length() > 0; + this.func_146314_g(); + } + + /**+ + * Called when the mouse is clicked. Args : mouseX, mouseY, + * clickedButton + */ + protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + super.mouseClicked(parInt1, parInt2, parInt3); + if (this.field_146344_y) { + this.field_146335_h.mouseClicked(parInt1, parInt2, parInt3); + } else { + this.field_146333_g.mouseClicked(parInt1, parInt2, parInt3); + } + + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.create", new Object[0]), this.width / 2, + 20, -1); + if (this.field_146344_y) { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterSeed", new Object[0]), + this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format( + StringUtils.isNotEmpty(field_146335_h.text) ? "createWorld.seedNote" : "selectWorld.seedInfo", + new Object[0]), this.width / 2 - 100, 85, -6250336); + if (this.btnMapFeatures.visible) { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.mapFeatures.info", new Object[0]), + this.width / 2 - 150, 122, -6250336); + } + + if (this.btnAllowCommands.visible) { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.allowCommands.info", new Object[0]), + this.width / 2 - 150, 172, -6250336); + } + + this.field_146335_h.drawTextBox(); + if (WorldType.worldTypes[this.selectedIndex].showWorldInfoNotice()) { + this.fontRendererObj.drawSplitString( + I18n.format(WorldType.worldTypes[this.selectedIndex].func_151359_c(), new Object[0]), + this.btnMapType.xPosition + 2, this.btnMapType.yPosition + 22, this.btnMapType.getButtonWidth(), + 10526880); + } + } else { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), + this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, + I18n.format("selectWorld.resultFolder", new Object[0]) + " " + this.field_146336_i, + this.width / 2 - 100, 85, -6250336); + this.field_146333_g.drawTextBox(); + this.drawString(this.fontRendererObj, this.field_146323_G, this.width / 2 - 100, 137, -6250336); + this.drawString(this.fontRendererObj, this.field_146328_H, this.width / 2 - 100, 149, -6250336); + } + + super.drawScreen(i, j, f); + } + + public void func_146318_a(WorldInfo parWorldInfo) { + this.field_146330_J = I18n.format("selectWorld.newWorld.copyOf", new Object[] { parWorldInfo.getWorldName() }); + this.field_146329_I = parWorldInfo.getSeed() + ""; + this.selectedIndex = parWorldInfo.getTerrainType().getWorldTypeID(); + this.chunkProviderSettingsJson = parWorldInfo.getGeneratorOptions(); + this.field_146341_s = parWorldInfo.isMapFeaturesEnabled(); + this.allowCheats = parWorldInfo.areCommandsAllowed(); + if (parWorldInfo.isHardcoreModeEnabled()) { + this.gameMode = "hardcore"; + } else if (parWorldInfo.getGameType().isSurvivalOrAdventure()) { + this.gameMode = "survival"; + } else if (parWorldInfo.getGameType().isCreative()) { + this.gameMode = "creative"; + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java b/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java index 562872d..3355e29 100644 --- a/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java +++ b/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java @@ -3,24 +3,24 @@ package net.minecraft.client.gui; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EnumPlayerModelParts; -import net.minecraft.client.settings.GameSettings; - /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiCustomizeSkin extends GuiScreen { @@ -41,12 +41,12 @@ public class GuiCustomizeSkin extends GuiScreen { this.title = I18n.format("options.skinCustomisation.title", new Object[0]); for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) { - this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, enumplayermodelparts)); + this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), + this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, + enumplayermodelparts)); ++i; } - this.buttonList.add(new GuiOptionButton(201, this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), GameSettings.Options.LEFT_HAND, "Main Hand")); - if (i % 2 == 1) { ++i; } @@ -68,9 +68,6 @@ public class GuiCustomizeSkin extends GuiScreen { EnumPlayerModelParts enumplayermodelparts = ((GuiCustomizeSkin.ButtonPart) parGuiButton).playerModelParts; this.mc.gameSettings.switchModelPartEnabled(enumplayermodelparts); parGuiButton.displayString = this.func_175358_a(enumplayermodelparts); - } else { - mc.gameSettings.setOptionValue(((GuiOptionButton)parGuiButton).returnEnumOptions(), 1); - parGuiButton.displayString = mc.gameSettings.getKeyBinding(GameSettings.Options.LEFT_HAND); } } diff --git a/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java b/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java new file mode 100644 index 0000000..c06ba47 --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java @@ -0,0 +1,1205 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Predicate; +import com.google.common.primitives.Floats; +import java.io.IOException; +import java.util.Random; + +import net.lax1dude.eaglercraft.v1_8.HString; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiListButton; +import net.minecraft.client.gui.GuiPageButtonList; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiScreenCustomizePresets; +import net.minecraft.client.gui.GuiSlider; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.MathHelper; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiCustomizeWorldScreen extends GuiScreen + implements GuiSlider.FormatHelper, GuiPageButtonList.GuiResponder { + private GuiCreateWorld field_175343_i; + protected String field_175341_a = "Customize World Settings"; + protected String field_175333_f = "Page 1 of 3"; + protected String field_175335_g = "Basic Settings"; + protected String[] field_175342_h = new String[4]; + private GuiPageButtonList field_175349_r; + private GuiButton field_175348_s; + private GuiButton field_175347_t; + private GuiButton field_175346_u; + private GuiButton field_175345_v; + private GuiButton field_175344_w; + private GuiButton field_175352_x; + private GuiButton field_175351_y; + private GuiButton field_175350_z; + private boolean field_175338_A = false; + private int field_175339_B = 0; + private boolean field_175340_C = false; + private Predicate field_175332_D = new Predicate() { + public boolean apply(String s) { + Float f = Floats.tryParse(s); + return s.length() == 0 || f != null && Floats.isFinite(f.floatValue()) && f.floatValue() >= 0.0F; + } + }; + private ChunkProviderSettings.Factory field_175334_E = new ChunkProviderSettings.Factory(); + private ChunkProviderSettings.Factory field_175336_F; + /**+ + * A Random instance for this world customization + */ + private Random random = new Random(); + + public GuiCustomizeWorldScreen(GuiScreen parGuiScreen, String parString1) { + this.field_175343_i = (GuiCreateWorld) parGuiScreen; + this.func_175324_a(parString1); + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + int i = 0; + int j = 0; + if (this.field_175349_r != null) { + i = this.field_175349_r.func_178059_e(); + j = this.field_175349_r.getAmountScrolled(); + } + + this.field_175341_a = I18n.format("options.customizeTitle", new Object[0]); + this.buttonList.clear(); + this.buttonList.add(this.field_175345_v = new GuiButton(302, 20, 5, 80, 20, + I18n.format("createWorld.customize.custom.prev", new Object[0]))); + this.buttonList.add(this.field_175344_w = new GuiButton(303, this.width - 100, 5, 80, 20, + I18n.format("createWorld.customize.custom.next", new Object[0]))); + this.buttonList.add(this.field_175346_u = new GuiButton(304, this.width / 2 - 187, this.height - 27, 90, 20, + I18n.format("createWorld.customize.custom.defaults", new Object[0]))); + this.buttonList.add(this.field_175347_t = new GuiButton(301, this.width / 2 - 92, this.height - 27, 90, 20, + I18n.format("createWorld.customize.custom.randomize", new Object[0]))); + this.buttonList.add(this.field_175350_z = new GuiButton(305, this.width / 2 + 3, this.height - 27, 90, 20, + I18n.format("createWorld.customize.custom.presets", new Object[0]))); + this.buttonList.add(this.field_175348_s = new GuiButton(300, this.width / 2 + 98, this.height - 27, 90, 20, + I18n.format("gui.done", new Object[0]))); + this.field_175346_u.enabled = this.field_175338_A; + this.field_175352_x = new GuiButton(306, this.width / 2 - 55, 160, 50, 20, + I18n.format("gui.yes", new Object[0])); + this.field_175352_x.visible = false; + this.buttonList.add(this.field_175352_x); + this.field_175351_y = new GuiButton(307, this.width / 2 + 5, 160, 50, 20, I18n.format("gui.no", new Object[0])); + this.field_175351_y.visible = false; + this.buttonList.add(this.field_175351_y); + if (this.field_175339_B != 0) { + this.field_175352_x.visible = true; + this.field_175351_y.visible = true; + } + + this.func_175325_f(); + if (i != 0) { + this.field_175349_r.func_181156_c(i); + this.field_175349_r.scrollBy(j); + this.func_175328_i(); + } + + } + + /**+ + * Handles mouse input. + */ + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.field_175349_r.handleMouseInput(); + } + + private void func_175325_f() { + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry = new GuiPageButtonList.GuiListEntry[] { + new GuiPageButtonList.GuiSlideEntry(160, + I18n.format("createWorld.customize.custom.seaLevel", new Object[0]), true, this, 1.0F, 255.0F, + (float) this.field_175336_F.seaLevel), + new GuiPageButtonList.GuiButtonEntry(148, + I18n.format("createWorld.customize.custom.useCaves", new Object[0]), true, + this.field_175336_F.useCaves), + new GuiPageButtonList.GuiButtonEntry(150, + I18n.format("createWorld.customize.custom.useStrongholds", new Object[0]), true, + this.field_175336_F.useStrongholds), + new GuiPageButtonList.GuiButtonEntry(151, + I18n.format("createWorld.customize.custom.useVillages", new Object[0]), true, + this.field_175336_F.useVillages), + new GuiPageButtonList.GuiButtonEntry(152, + I18n.format("createWorld.customize.custom.useMineShafts", new Object[0]), true, + this.field_175336_F.useMineShafts), + new GuiPageButtonList.GuiButtonEntry(153, + I18n.format("createWorld.customize.custom.useTemples", new Object[0]), true, + this.field_175336_F.useTemples), + new GuiPageButtonList.GuiButtonEntry(210, + I18n.format("createWorld.customize.custom.useMonuments", new Object[0]), true, + this.field_175336_F.useMonuments), + new GuiPageButtonList.GuiButtonEntry(154, + I18n.format("createWorld.customize.custom.useRavines", new Object[0]), true, + this.field_175336_F.useRavines), + new GuiPageButtonList.GuiButtonEntry(149, + I18n.format("createWorld.customize.custom.useDungeons", new Object[0]), true, + this.field_175336_F.useDungeons), + new GuiPageButtonList.GuiSlideEntry(157, + I18n.format("createWorld.customize.custom.dungeonChance", new Object[0]), true, this, 1.0F, + 100.0F, (float) this.field_175336_F.dungeonChance), + new GuiPageButtonList.GuiButtonEntry(155, + I18n.format("createWorld.customize.custom.useWaterLakes", new Object[0]), true, + this.field_175336_F.useWaterLakes), + new GuiPageButtonList.GuiSlideEntry(158, + I18n.format("createWorld.customize.custom.waterLakeChance", new Object[0]), true, this, 1.0F, + 100.0F, (float) this.field_175336_F.waterLakeChance), + new GuiPageButtonList.GuiButtonEntry(156, + I18n.format("createWorld.customize.custom.useLavaLakes", new Object[0]), true, + this.field_175336_F.useLavaLakes), + new GuiPageButtonList.GuiSlideEntry(159, + I18n.format("createWorld.customize.custom.lavaLakeChance", new Object[0]), true, this, 10.0F, + 100.0F, (float) this.field_175336_F.lavaLakeChance), + new GuiPageButtonList.GuiButtonEntry(161, + I18n.format("createWorld.customize.custom.useLavaOceans", new Object[0]), true, + this.field_175336_F.useLavaOceans), + new GuiPageButtonList.GuiSlideEntry(162, + I18n.format("createWorld.customize.custom.fixedBiome", new Object[0]), true, this, -1.0F, 37.0F, + (float) this.field_175336_F.fixedBiome), + new GuiPageButtonList.GuiSlideEntry(163, + I18n.format("createWorld.customize.custom.biomeSize", new Object[0]), true, this, 1.0F, 8.0F, + (float) this.field_175336_F.biomeSize), + new GuiPageButtonList.GuiSlideEntry(164, + I18n.format("createWorld.customize.custom.riverSize", new Object[0]), true, this, 1.0F, 5.0F, + (float) this.field_175336_F.riverSize) }; + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry1 = new GuiPageButtonList.GuiListEntry[] { + new GuiPageButtonList.GuiLabelEntry(416, I18n.format("tile.dirt.name", new Object[0]), false), null, + new GuiPageButtonList.GuiSlideEntry(165, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.dirtSize), + new GuiPageButtonList.GuiSlideEntry(166, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.dirtCount), + new GuiPageButtonList.GuiSlideEntry(167, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.dirtMinHeight), + new GuiPageButtonList.GuiSlideEntry(168, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.dirtMaxHeight), + new GuiPageButtonList.GuiLabelEntry(417, I18n.format("tile.gravel.name", new Object[0]), false), null, + new GuiPageButtonList.GuiSlideEntry(169, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.gravelSize), + new GuiPageButtonList.GuiSlideEntry(170, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.gravelCount), + new GuiPageButtonList.GuiSlideEntry(171, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.gravelMinHeight), + new GuiPageButtonList.GuiSlideEntry(172, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.gravelMaxHeight), + new GuiPageButtonList.GuiLabelEntry(418, I18n.format("tile.stone.granite.name", new Object[0]), false), + null, + new GuiPageButtonList.GuiSlideEntry(173, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.graniteSize), + new GuiPageButtonList.GuiSlideEntry(174, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.graniteCount), + new GuiPageButtonList.GuiSlideEntry(175, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.graniteMinHeight), + new GuiPageButtonList.GuiSlideEntry(176, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.graniteMaxHeight), + new GuiPageButtonList.GuiLabelEntry(419, I18n.format("tile.stone.diorite.name", new Object[0]), false), + null, + new GuiPageButtonList.GuiSlideEntry(177, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.dioriteSize), + new GuiPageButtonList.GuiSlideEntry(178, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.dioriteCount), + new GuiPageButtonList.GuiSlideEntry(179, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.dioriteMinHeight), + new GuiPageButtonList.GuiSlideEntry(180, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.dioriteMaxHeight), + new GuiPageButtonList.GuiLabelEntry(420, I18n.format("tile.stone.andesite.name", new Object[0]), false), + null, + new GuiPageButtonList.GuiSlideEntry(181, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.andesiteSize), + new GuiPageButtonList.GuiSlideEntry(182, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.andesiteCount), + new GuiPageButtonList.GuiSlideEntry(183, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.andesiteMinHeight), + new GuiPageButtonList.GuiSlideEntry(184, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.andesiteMaxHeight), + new GuiPageButtonList.GuiLabelEntry(421, I18n.format("tile.oreCoal.name", new Object[0]), false), null, + new GuiPageButtonList.GuiSlideEntry(185, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.coalSize), + new GuiPageButtonList.GuiSlideEntry(186, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.coalCount), + new GuiPageButtonList.GuiSlideEntry(187, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.coalMinHeight), + new GuiPageButtonList.GuiSlideEntry(189, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.coalMaxHeight), + new GuiPageButtonList.GuiLabelEntry(422, I18n.format("tile.oreIron.name", new Object[0]), false), null, + new GuiPageButtonList.GuiSlideEntry(190, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.ironSize), + new GuiPageButtonList.GuiSlideEntry(191, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.ironCount), + new GuiPageButtonList.GuiSlideEntry(192, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.ironMinHeight), + new GuiPageButtonList.GuiSlideEntry(193, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.ironMaxHeight), + new GuiPageButtonList.GuiLabelEntry(423, I18n.format("tile.oreGold.name", new Object[0]), false), null, + new GuiPageButtonList.GuiSlideEntry(194, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.goldSize), + new GuiPageButtonList.GuiSlideEntry(195, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.goldCount), + new GuiPageButtonList.GuiSlideEntry(196, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.goldMinHeight), + new GuiPageButtonList.GuiSlideEntry(197, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.goldMaxHeight), + new GuiPageButtonList.GuiLabelEntry(424, I18n.format("tile.oreRedstone.name", new Object[0]), false), + null, + new GuiPageButtonList.GuiSlideEntry(198, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.redstoneSize), + new GuiPageButtonList.GuiSlideEntry(199, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.redstoneCount), + new GuiPageButtonList.GuiSlideEntry(200, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.redstoneMinHeight), + new GuiPageButtonList.GuiSlideEntry(201, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.redstoneMaxHeight), + new GuiPageButtonList.GuiLabelEntry(425, I18n.format("tile.oreDiamond.name", new Object[0]), false), + null, + new GuiPageButtonList.GuiSlideEntry(202, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.diamondSize), + new GuiPageButtonList.GuiSlideEntry(203, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.diamondCount), + new GuiPageButtonList.GuiSlideEntry(204, + I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.diamondMinHeight), + new GuiPageButtonList.GuiSlideEntry(205, + I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.diamondMaxHeight), + new GuiPageButtonList.GuiLabelEntry(426, I18n.format("tile.oreLapis.name", new Object[0]), false), null, + new GuiPageButtonList.GuiSlideEntry(206, + I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, + (float) this.field_175336_F.lapisSize), + new GuiPageButtonList.GuiSlideEntry(207, + I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, + (float) this.field_175336_F.lapisCount), + new GuiPageButtonList.GuiSlideEntry(208, + I18n.format("createWorld.customize.custom.center", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.lapisCenterHeight), + new GuiPageButtonList.GuiSlideEntry(209, + I18n.format("createWorld.customize.custom.spread", new Object[0]), false, this, 0.0F, 255.0F, + (float) this.field_175336_F.lapisSpread) }; + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry2 = new GuiPageButtonList.GuiListEntry[] { + new GuiPageButtonList.GuiSlideEntry(100, + I18n.format("createWorld.customize.custom.mainNoiseScaleX", new Object[0]), false, this, 1.0F, + 5000.0F, this.field_175336_F.mainNoiseScaleX), + new GuiPageButtonList.GuiSlideEntry(101, + I18n.format("createWorld.customize.custom.mainNoiseScaleY", new Object[0]), false, this, 1.0F, + 5000.0F, this.field_175336_F.mainNoiseScaleY), + new GuiPageButtonList.GuiSlideEntry(102, + I18n.format("createWorld.customize.custom.mainNoiseScaleZ", new Object[0]), false, this, 1.0F, + 5000.0F, this.field_175336_F.mainNoiseScaleZ), + new GuiPageButtonList.GuiSlideEntry(103, + I18n.format("createWorld.customize.custom.depthNoiseScaleX", new Object[0]), false, this, 1.0F, + 2000.0F, this.field_175336_F.depthNoiseScaleX), + new GuiPageButtonList.GuiSlideEntry(104, + I18n.format("createWorld.customize.custom.depthNoiseScaleZ", new Object[0]), false, this, 1.0F, + 2000.0F, this.field_175336_F.depthNoiseScaleZ), + new GuiPageButtonList.GuiSlideEntry(105, + I18n.format("createWorld.customize.custom.depthNoiseScaleExponent", new Object[0]), false, this, + 0.01F, 20.0F, this.field_175336_F.depthNoiseScaleExponent), + new GuiPageButtonList.GuiSlideEntry(106, + I18n.format("createWorld.customize.custom.baseSize", new Object[0]), false, this, 1.0F, 25.0F, + this.field_175336_F.baseSize), + new GuiPageButtonList.GuiSlideEntry(107, + I18n.format("createWorld.customize.custom.coordinateScale", new Object[0]), false, this, 1.0F, + 6000.0F, this.field_175336_F.coordinateScale), + new GuiPageButtonList.GuiSlideEntry(108, + I18n.format("createWorld.customize.custom.heightScale", new Object[0]), false, this, 1.0F, + 6000.0F, this.field_175336_F.heightScale), + new GuiPageButtonList.GuiSlideEntry(109, + I18n.format("createWorld.customize.custom.stretchY", new Object[0]), false, this, 0.01F, 50.0F, + this.field_175336_F.stretchY), + new GuiPageButtonList.GuiSlideEntry(110, + I18n.format("createWorld.customize.custom.upperLimitScale", new Object[0]), false, this, 1.0F, + 5000.0F, this.field_175336_F.upperLimitScale), + new GuiPageButtonList.GuiSlideEntry(111, + I18n.format("createWorld.customize.custom.lowerLimitScale", new Object[0]), false, this, 1.0F, + 5000.0F, this.field_175336_F.lowerLimitScale), + new GuiPageButtonList.GuiSlideEntry(112, + I18n.format("createWorld.customize.custom.biomeDepthWeight", new Object[0]), false, this, 1.0F, + 20.0F, this.field_175336_F.biomeDepthWeight), + new GuiPageButtonList.GuiSlideEntry(113, + I18n.format("createWorld.customize.custom.biomeDepthOffset", new Object[0]), false, this, 0.0F, + 20.0F, this.field_175336_F.biomeDepthOffset), + new GuiPageButtonList.GuiSlideEntry(114, + I18n.format("createWorld.customize.custom.biomeScaleWeight", new Object[0]), false, this, 1.0F, + 20.0F, this.field_175336_F.biomeScaleWeight), + new GuiPageButtonList.GuiSlideEntry(115, + I18n.format("createWorld.customize.custom.biomeScaleOffset", new Object[0]), false, this, 0.0F, + 20.0F, this.field_175336_F.biomeScaleOffset) }; + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry3 = new GuiPageButtonList.GuiListEntry[] { + new GuiPageButtonList.GuiLabelEntry(400, + I18n.format("createWorld.customize.custom.mainNoiseScaleX", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(132, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.mainNoiseScaleX) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(401, + I18n.format("createWorld.customize.custom.mainNoiseScaleY", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(133, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.mainNoiseScaleY) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(402, + I18n.format("createWorld.customize.custom.mainNoiseScaleZ", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(134, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.mainNoiseScaleZ) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(403, + I18n.format("createWorld.customize.custom.depthNoiseScaleX", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(135, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.depthNoiseScaleX) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(404, + I18n.format("createWorld.customize.custom.depthNoiseScaleZ", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(136, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.depthNoiseScaleZ) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(405, + I18n.format("createWorld.customize.custom.depthNoiseScaleExponent", new Object[0]) + ":", + false), + new GuiPageButtonList.EditBoxEntry(137, + HString.format("%2.3f", + new Object[] { Float.valueOf(this.field_175336_F.depthNoiseScaleExponent) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(406, + I18n.format("createWorld.customize.custom.baseSize", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(138, + HString.format("%2.3f", new Object[] { Float.valueOf(this.field_175336_F.baseSize) }), false, + this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(407, + I18n.format("createWorld.customize.custom.coordinateScale", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(139, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.coordinateScale) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(408, + I18n.format("createWorld.customize.custom.heightScale", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(140, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.heightScale) }), false, + this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(409, + I18n.format("createWorld.customize.custom.stretchY", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(141, + HString.format("%2.3f", new Object[] { Float.valueOf(this.field_175336_F.stretchY) }), false, + this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(410, + I18n.format("createWorld.customize.custom.upperLimitScale", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(142, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.upperLimitScale) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(411, + I18n.format("createWorld.customize.custom.lowerLimitScale", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(143, + HString.format("%5.3f", new Object[] { Float.valueOf(this.field_175336_F.lowerLimitScale) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(412, + I18n.format("createWorld.customize.custom.biomeDepthWeight", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(144, + HString.format("%2.3f", new Object[] { Float.valueOf(this.field_175336_F.biomeDepthWeight) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(413, + I18n.format("createWorld.customize.custom.biomeDepthOffset", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(145, + HString.format("%2.3f", new Object[] { Float.valueOf(this.field_175336_F.biomeDepthOffset) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(414, + I18n.format("createWorld.customize.custom.biomeScaleWeight", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(146, + HString.format("%2.3f", new Object[] { Float.valueOf(this.field_175336_F.biomeScaleWeight) }), + false, this.field_175332_D), + new GuiPageButtonList.GuiLabelEntry(415, + I18n.format("createWorld.customize.custom.biomeScaleOffset", new Object[0]) + ":", false), + new GuiPageButtonList.EditBoxEntry(147, + HString.format("%2.3f", new Object[] { Float.valueOf(this.field_175336_F.biomeScaleOffset) }), + false, this.field_175332_D) }; + this.field_175349_r = new GuiPageButtonList(this.mc, this.width, this.height, 32, this.height - 32, 25, this, + new GuiPageButtonList.GuiListEntry[][] { aguipagebuttonlist$guilistentry, + aguipagebuttonlist$guilistentry1, aguipagebuttonlist$guilistentry2, + aguipagebuttonlist$guilistentry3 }); + + for (int i = 0; i < 4; ++i) { + this.field_175342_h[i] = I18n.format("createWorld.customize.custom.page" + i, new Object[0]); + } + + this.func_175328_i(); + } + + public String func_175323_a() { + return this.field_175336_F.toString().replace("\n", ""); + } + + public void func_175324_a(String parString1) { + if (parString1 != null && parString1.length() != 0) { + this.field_175336_F = ChunkProviderSettings.Factory.jsonToFactory(parString1); + } else { + this.field_175336_F = new ChunkProviderSettings.Factory(); + } + + } + + public void func_175319_a(int i, String s) { + float f = 0.0F; + + try { + f = Float.parseFloat(s); + } catch (NumberFormatException var5) { + ; + } + + float f1 = 0.0F; + switch (i) { + case 132: + f1 = this.field_175336_F.mainNoiseScaleX = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + case 133: + f1 = this.field_175336_F.mainNoiseScaleY = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + case 134: + f1 = this.field_175336_F.mainNoiseScaleZ = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + case 135: + f1 = this.field_175336_F.depthNoiseScaleX = MathHelper.clamp_float(f, 1.0F, 2000.0F); + break; + case 136: + f1 = this.field_175336_F.depthNoiseScaleZ = MathHelper.clamp_float(f, 1.0F, 2000.0F); + break; + case 137: + f1 = this.field_175336_F.depthNoiseScaleExponent = MathHelper.clamp_float(f, 0.01F, 20.0F); + break; + case 138: + f1 = this.field_175336_F.baseSize = MathHelper.clamp_float(f, 1.0F, 25.0F); + break; + case 139: + f1 = this.field_175336_F.coordinateScale = MathHelper.clamp_float(f, 1.0F, 6000.0F); + break; + case 140: + f1 = this.field_175336_F.heightScale = MathHelper.clamp_float(f, 1.0F, 6000.0F); + break; + case 141: + f1 = this.field_175336_F.stretchY = MathHelper.clamp_float(f, 0.01F, 50.0F); + break; + case 142: + f1 = this.field_175336_F.upperLimitScale = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + case 143: + f1 = this.field_175336_F.lowerLimitScale = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + case 144: + f1 = this.field_175336_F.biomeDepthWeight = MathHelper.clamp_float(f, 1.0F, 20.0F); + break; + case 145: + f1 = this.field_175336_F.biomeDepthOffset = MathHelper.clamp_float(f, 0.0F, 20.0F); + break; + case 146: + f1 = this.field_175336_F.biomeScaleWeight = MathHelper.clamp_float(f, 1.0F, 20.0F); + break; + case 147: + f1 = this.field_175336_F.biomeScaleOffset = MathHelper.clamp_float(f, 0.0F, 20.0F); + } + + if (f1 != f && f != 0.0F) { + ((GuiTextField) this.field_175349_r.func_178061_c(i)).setText(this.func_175330_b(i, f1)); + } + + ((GuiSlider) this.field_175349_r.func_178061_c(i - 132 + 100)).func_175218_a(f1, false); + if (!this.field_175336_F.equals(this.field_175334_E)) { + this.func_181031_a(true); + } + + } + + private void func_181031_a(boolean parFlag) { + this.field_175338_A = parFlag; + this.field_175346_u.enabled = parFlag; + } + + public String getText(int i, String s, float f) { + return s + ": " + this.func_175330_b(i, f); + } + + private String func_175330_b(int parInt1, float parFloat1) { + switch (parInt1) { + case 100: + case 101: + case 102: + case 103: + case 104: + case 107: + case 108: + case 110: + case 111: + case 132: + case 133: + case 134: + case 135: + case 136: + case 139: + case 140: + case 142: + case 143: + return HString.format("%5.3f", new Object[] { Float.valueOf(parFloat1) }); + case 105: + case 106: + case 109: + case 112: + case 113: + case 114: + case 115: + case 137: + case 138: + case 141: + case 144: + case 145: + case 146: + case 147: + return HString.format("%2.3f", new Object[] { Float.valueOf(parFloat1) }); + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 148: + case 149: + case 150: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 157: + case 158: + case 159: + case 160: + case 161: + default: + return HString.format("%d", new Object[] { Integer.valueOf((int) parFloat1) }); + case 162: + if (parFloat1 < 0.0F) { + return I18n.format("gui.all", new Object[0]); + } else if ((int) parFloat1 >= BiomeGenBase.hell.biomeID) { + BiomeGenBase biomegenbase1 = BiomeGenBase.getBiomeGenArray()[(int) parFloat1 + 2]; + return biomegenbase1 != null ? biomegenbase1.biomeName : "?"; + } else { + BiomeGenBase biomegenbase = BiomeGenBase.getBiomeGenArray()[(int) parFloat1]; + return biomegenbase != null ? biomegenbase.biomeName : "?"; + } + } + } + + public void func_175321_a(int i, boolean flag) { + switch (i) { + case 148: + this.field_175336_F.useCaves = flag; + break; + case 149: + this.field_175336_F.useDungeons = flag; + break; + case 150: + this.field_175336_F.useStrongholds = flag; + break; + case 151: + this.field_175336_F.useVillages = flag; + break; + case 152: + this.field_175336_F.useMineShafts = flag; + break; + case 153: + this.field_175336_F.useTemples = flag; + break; + case 154: + this.field_175336_F.useRavines = flag; + break; + case 155: + this.field_175336_F.useWaterLakes = flag; + break; + case 156: + this.field_175336_F.useLavaLakes = flag; + break; + case 161: + this.field_175336_F.useLavaOceans = flag; + break; + case 210: + this.field_175336_F.useMonuments = flag; + } + + if (!this.field_175336_F.equals(this.field_175334_E)) { + this.func_181031_a(true); + } + + } + + public void onTick(int i, float f) { + switch (i) { + case 100: + this.field_175336_F.mainNoiseScaleX = f; + break; + case 101: + this.field_175336_F.mainNoiseScaleY = f; + break; + case 102: + this.field_175336_F.mainNoiseScaleZ = f; + break; + case 103: + this.field_175336_F.depthNoiseScaleX = f; + break; + case 104: + this.field_175336_F.depthNoiseScaleZ = f; + break; + case 105: + this.field_175336_F.depthNoiseScaleExponent = f; + break; + case 106: + this.field_175336_F.baseSize = f; + break; + case 107: + this.field_175336_F.coordinateScale = f; + break; + case 108: + this.field_175336_F.heightScale = f; + break; + case 109: + this.field_175336_F.stretchY = f; + break; + case 110: + this.field_175336_F.upperLimitScale = f; + break; + case 111: + this.field_175336_F.lowerLimitScale = f; + break; + case 112: + this.field_175336_F.biomeDepthWeight = f; + break; + case 113: + this.field_175336_F.biomeDepthOffset = f; + break; + case 114: + this.field_175336_F.biomeScaleWeight = f; + break; + case 115: + this.field_175336_F.biomeScaleOffset = f; + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 132: + case 133: + case 134: + case 135: + case 136: + case 137: + case 138: + case 139: + case 140: + case 141: + case 142: + case 143: + case 144: + case 145: + case 146: + case 147: + case 148: + case 149: + case 150: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 161: + case 188: + default: + break; + case 157: + this.field_175336_F.dungeonChance = (int) f; + break; + case 158: + this.field_175336_F.waterLakeChance = (int) f; + break; + case 159: + this.field_175336_F.lavaLakeChance = (int) f; + break; + case 160: + this.field_175336_F.seaLevel = (int) f; + break; + case 162: + this.field_175336_F.fixedBiome = (int) f; + break; + case 163: + this.field_175336_F.biomeSize = (int) f; + break; + case 164: + this.field_175336_F.riverSize = (int) f; + break; + case 165: + this.field_175336_F.dirtSize = (int) f; + break; + case 166: + this.field_175336_F.dirtCount = (int) f; + break; + case 167: + this.field_175336_F.dirtMinHeight = (int) f; + break; + case 168: + this.field_175336_F.dirtMaxHeight = (int) f; + break; + case 169: + this.field_175336_F.gravelSize = (int) f; + break; + case 170: + this.field_175336_F.gravelCount = (int) f; + break; + case 171: + this.field_175336_F.gravelMinHeight = (int) f; + break; + case 172: + this.field_175336_F.gravelMaxHeight = (int) f; + break; + case 173: + this.field_175336_F.graniteSize = (int) f; + break; + case 174: + this.field_175336_F.graniteCount = (int) f; + break; + case 175: + this.field_175336_F.graniteMinHeight = (int) f; + break; + case 176: + this.field_175336_F.graniteMaxHeight = (int) f; + break; + case 177: + this.field_175336_F.dioriteSize = (int) f; + break; + case 178: + this.field_175336_F.dioriteCount = (int) f; + break; + case 179: + this.field_175336_F.dioriteMinHeight = (int) f; + break; + case 180: + this.field_175336_F.dioriteMaxHeight = (int) f; + break; + case 181: + this.field_175336_F.andesiteSize = (int) f; + break; + case 182: + this.field_175336_F.andesiteCount = (int) f; + break; + case 183: + this.field_175336_F.andesiteMinHeight = (int) f; + break; + case 184: + this.field_175336_F.andesiteMaxHeight = (int) f; + break; + case 185: + this.field_175336_F.coalSize = (int) f; + break; + case 186: + this.field_175336_F.coalCount = (int) f; + break; + case 187: + this.field_175336_F.coalMinHeight = (int) f; + break; + case 189: + this.field_175336_F.coalMaxHeight = (int) f; + break; + case 190: + this.field_175336_F.ironSize = (int) f; + break; + case 191: + this.field_175336_F.ironCount = (int) f; + break; + case 192: + this.field_175336_F.ironMinHeight = (int) f; + break; + case 193: + this.field_175336_F.ironMaxHeight = (int) f; + break; + case 194: + this.field_175336_F.goldSize = (int) f; + break; + case 195: + this.field_175336_F.goldCount = (int) f; + break; + case 196: + this.field_175336_F.goldMinHeight = (int) f; + break; + case 197: + this.field_175336_F.goldMaxHeight = (int) f; + break; + case 198: + this.field_175336_F.redstoneSize = (int) f; + break; + case 199: + this.field_175336_F.redstoneCount = (int) f; + break; + case 200: + this.field_175336_F.redstoneMinHeight = (int) f; + break; + case 201: + this.field_175336_F.redstoneMaxHeight = (int) f; + break; + case 202: + this.field_175336_F.diamondSize = (int) f; + break; + case 203: + this.field_175336_F.diamondCount = (int) f; + break; + case 204: + this.field_175336_F.diamondMinHeight = (int) f; + break; + case 205: + this.field_175336_F.diamondMaxHeight = (int) f; + break; + case 206: + this.field_175336_F.lapisSize = (int) f; + break; + case 207: + this.field_175336_F.lapisCount = (int) f; + break; + case 208: + this.field_175336_F.lapisCenterHeight = (int) f; + break; + case 209: + this.field_175336_F.lapisSpread = (int) f; + } + + if (i >= 100 && i < 116) { + Gui gui = this.field_175349_r.func_178061_c(i - 100 + 132); + if (gui != null) { + ((GuiTextField) gui).setText(this.func_175330_b(i, f)); + } + } + + if (!this.field_175336_F.equals(this.field_175334_E)) { + this.func_181031_a(true); + } + + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + if (parGuiButton.enabled) { + switch (parGuiButton.id) { + case 300: + this.field_175343_i.chunkProviderSettingsJson = this.field_175336_F.toString(); + this.mc.displayGuiScreen(this.field_175343_i); + break; + case 301: + for (int i = 0; i < this.field_175349_r.getSize(); ++i) { + GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.field_175349_r.getListEntry(i); + Gui gui = guipagebuttonlist$guientry.func_178022_a(); + if (gui instanceof GuiButton) { + GuiButton guibutton = (GuiButton) gui; + if (guibutton instanceof GuiSlider) { + float f = ((GuiSlider) guibutton).func_175217_d() * (0.75F + this.random.nextFloat() * 0.5F) + + (this.random.nextFloat() * 0.1F - 0.05F); + ((GuiSlider) guibutton).func_175219_a(MathHelper.clamp_float(f, 0.0F, 1.0F)); + } else if (guibutton instanceof GuiListButton) { + ((GuiListButton) guibutton).func_175212_b(this.random.nextBoolean()); + } + } + + Gui gui1 = guipagebuttonlist$guientry.func_178021_b(); + if (gui1 instanceof GuiButton) { + GuiButton guibutton1 = (GuiButton) gui1; + if (guibutton1 instanceof GuiSlider) { + float f1 = ((GuiSlider) guibutton1).func_175217_d() + * (0.75F + this.random.nextFloat() * 0.5F) + + (this.random.nextFloat() * 0.1F - 0.05F); + ((GuiSlider) guibutton1).func_175219_a(MathHelper.clamp_float(f1, 0.0F, 1.0F)); + } else if (guibutton1 instanceof GuiListButton) { + ((GuiListButton) guibutton1).func_175212_b(this.random.nextBoolean()); + } + } + } + + return; + case 302: + this.field_175349_r.func_178071_h(); + this.func_175328_i(); + break; + case 303: + this.field_175349_r.func_178064_i(); + this.func_175328_i(); + break; + case 304: + if (this.field_175338_A) { + this.func_175322_b(304); + } + break; + case 305: + this.mc.displayGuiScreen(new GuiScreenCustomizePresets(this)); + break; + case 306: + this.func_175331_h(); + break; + case 307: + this.field_175339_B = 0; + this.func_175331_h(); + } + + } + } + + private void func_175326_g() { + this.field_175336_F.func_177863_a(); + this.func_175325_f(); + this.func_181031_a(false); + } + + private void func_175322_b(int parInt1) { + this.field_175339_B = parInt1; + this.func_175329_a(true); + } + + private void func_175331_h() { + switch (this.field_175339_B) { + case 300: + this.actionPerformed((GuiListButton) this.field_175349_r.func_178061_c(300)); + break; + case 304: + this.func_175326_g(); + } + + this.field_175339_B = 0; + this.field_175340_C = true; + this.func_175329_a(false); + } + + private void func_175329_a(boolean parFlag) { + this.field_175352_x.visible = parFlag; + this.field_175351_y.visible = parFlag; + this.field_175347_t.enabled = !parFlag; + this.field_175348_s.enabled = !parFlag; + this.field_175345_v.enabled = !parFlag; + this.field_175344_w.enabled = !parFlag; + this.field_175346_u.enabled = this.field_175338_A && !parFlag; + this.field_175350_z.enabled = !parFlag; + this.field_175349_r.func_181155_a(!parFlag); + } + + private void func_175328_i() { + this.field_175345_v.enabled = this.field_175349_r.func_178059_e() != 0; + this.field_175344_w.enabled = this.field_175349_r.func_178059_e() != this.field_175349_r.func_178057_f() - 1; + this.field_175333_f = I18n.format("book.pageIndicator", + new Object[] { Integer.valueOf(this.field_175349_r.func_178059_e() + 1), + Integer.valueOf(this.field_175349_r.func_178057_f()) }); + this.field_175335_g = this.field_175342_h[this.field_175349_r.func_178059_e()]; + this.field_175347_t.enabled = this.field_175349_r.func_178059_e() != this.field_175349_r.func_178057_f() - 1; + } + + /**+ + * Fired when a key is typed (except F11 which toggles full + * screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character + * on the key), keyCode (lwjgl Keyboard key code) + */ + protected void keyTyped(char parChar1, int parInt1) { + super.keyTyped(parChar1, parInt1); + if (this.field_175339_B == 0) { + switch (parInt1) { + case 200: + this.func_175327_a(1.0F); + break; + case 208: + this.func_175327_a(-1.0F); + break; + default: + this.field_175349_r.func_178062_a(parChar1, parInt1); + } + + } + } + + private void func_175327_a(float parFloat1) { + Gui gui = this.field_175349_r.func_178056_g(); + if (gui instanceof GuiTextField) { + float f = parFloat1; + if (GuiScreen.isShiftKeyDown()) { + f = parFloat1 * 0.1F; + if (GuiScreen.isCtrlKeyDown()) { + f *= 0.1F; + } + } else if (GuiScreen.isCtrlKeyDown()) { + f = parFloat1 * 10.0F; + if (GuiScreen.isAltKeyDown()) { + f *= 10.0F; + } + } + + GuiTextField guitextfield = (GuiTextField) gui; + Float f1 = Floats.tryParse(guitextfield.getText()); + if (f1 != null) { + f1 = Float.valueOf(f1.floatValue() + f); + int i = guitextfield.getId(); + String s = this.func_175330_b(guitextfield.getId(), f1.floatValue()); + guitextfield.setText(s); + this.func_175319_a(i, s); + } + } + } + + /**+ + * Called when the mouse is clicked. Args : mouseX, mouseY, + * clickedButton + */ + protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + super.mouseClicked(parInt1, parInt2, parInt3); + if (this.field_175339_B == 0 && !this.field_175340_C) { + this.field_175349_r.mouseClicked(parInt1, parInt2, parInt3); + } + } + + /**+ + * Called when a mouse button is released. Args : mouseX, + * mouseY, releaseButton + */ + protected void mouseReleased(int i, int j, int k) { + super.mouseReleased(i, j, k); + if (this.field_175340_C) { + this.field_175340_C = false; + } else if (this.field_175339_B == 0) { + this.field_175349_r.mouseReleased(i, j, k); + } + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.drawDefaultBackground(); + this.field_175349_r.drawScreen(i, j, f); + this.drawCenteredString(this.fontRendererObj, this.field_175341_a, this.width / 2, 2, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_175333_f, this.width / 2, 12, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_175335_g, this.width / 2, 22, 16777215); + super.drawScreen(i, j, f); + if (this.field_175339_B != 0) { + drawRect(0, 0, this.width, this.height, Integer.MIN_VALUE); + this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 99, -2039584); + this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 185, -6250336); + this.drawVerticalLine(this.width / 2 - 91, 99, 185, -2039584); + this.drawVerticalLine(this.width / 2 + 90, 99, 185, -6250336); + float f1 = 85.0F; + float f2 = 180.0F; + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(optionsBackground); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f3 = 32.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double) (this.width / 2 - 90), 185.0D, 0.0D).tex(0.0D, 2.65625D).color(64, 64, 64, 64) + .endVertex(); + worldrenderer.pos((double) (this.width / 2 + 90), 185.0D, 0.0D).tex(5.625D, 2.65625D).color(64, 64, 64, 64) + .endVertex(); + worldrenderer.pos((double) (this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64) + .endVertex(); + worldrenderer.pos((double) (this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64) + .endVertex(); + tessellator.draw(); + this.drawCenteredString(this.fontRendererObj, + I18n.format("createWorld.customize.custom.confirmTitle", new Object[0]), this.width / 2, 105, + 16777215); + this.drawCenteredString(this.fontRendererObj, + I18n.format("createWorld.customize.custom.confirm1", new Object[0]), this.width / 2, 125, 16777215); + this.drawCenteredString(this.fontRendererObj, + I18n.format("createWorld.customize.custom.confirm2", new Object[0]), this.width / 2, 135, 16777215); + this.field_175352_x.drawButton(this.mc, i, j); + this.field_175351_y.drawButton(this.mc, i, j); + } + + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiDisconnected.java b/src/main/java/net/minecraft/client/gui/GuiDisconnected.java index 390d635..d12ae2b 100644 --- a/src/main/java/net/minecraft/client/gui/GuiDisconnected.java +++ b/src/main/java/net/minecraft/client/gui/GuiDisconnected.java @@ -2,6 +2,9 @@ package net.minecraft.client.gui; import java.util.List; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy; +import net.lax1dude.eaglercraft.v1_8.sp.ipc.IPCPacket15Crashed; import net.minecraft.client.resources.I18n; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IChatComponent; @@ -12,16 +15,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiDisconnected extends GuiScreen { @@ -91,6 +96,14 @@ public class GuiDisconnected extends GuiScreen { super.drawScreen(i, j, f); } + public void updateScreen() { + IPCPacket15Crashed[] pkt = SingleplayerServerController.worldStatusErrors(); + if (pkt != null && pkt.length > 0) { + mc.displayGuiScreen( + GuiScreenIntegratedServerBusy.createException(this, "singleplayer.failed.serverCrash", pkt)); + } + } + public static GuiScreen createRateLimitKick(GuiScreen prev) { return new GuiDisconnected(prev, "connect.failed", new ChatComponentTranslation("disconnect.tooManyRequests")); } diff --git a/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java b/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java index 66abf55..d774427 100644 --- a/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java +++ b/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java @@ -10,16 +10,18 @@ import net.minecraft.network.play.client.C00PacketKeepAlive; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiDownloadTerrain extends GuiScreen { @@ -77,4 +79,8 @@ public class GuiDownloadTerrain extends GuiScreen { public boolean doesGuiPauseGame() { return false; } + + public boolean shouldHangupIntegratedServer() { + return false; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiEnchantment.java b/src/main/java/net/minecraft/client/gui/GuiEnchantment.java index e8e90e5..521009b 100644 --- a/src/main/java/net/minecraft/client/gui/GuiEnchantment.java +++ b/src/main/java/net/minecraft/client/gui/GuiEnchantment.java @@ -4,6 +4,8 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import java.util.ArrayList; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import com.google.common.collect.Lists; @@ -30,16 +32,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiEnchantment extends GuiContainer { @@ -134,8 +138,8 @@ public class GuiEnchantment extends GuiContainer { GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); ScaledResolution scaledresolution = new ScaledResolution(this.mc); - GlStateManager.viewport((scaledresolution.getScaledWidth() - 290 - 110) / 2 * scaledresolution.getScaleFactor(), - (scaledresolution.getScaledHeight() - 220 + 60) / 2 * scaledresolution.getScaleFactor(), + GlStateManager.viewport((scaledresolution.getScaledWidth() - 290 - 12) / 2 * scaledresolution.getScaleFactor(), + (scaledresolution.getScaledHeight() - 220 + 10) / 2 * scaledresolution.getScaleFactor(), 290 * scaledresolution.getScaleFactor(), 220 * scaledresolution.getScaleFactor()); GlStateManager.translate(-0.34F, 0.23F, 0.0F); GlStateManager.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); @@ -287,6 +291,7 @@ public class GuiEnchantment extends GuiContainer { } } + Mouse.showCursor(EnumCursorType.HAND); this.drawHoveringText(arraylist, i, j); break; } diff --git a/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java b/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java index 68cf9a9..b0ac40f 100644 --- a/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java +++ b/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java @@ -8,16 +8,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiErrorScreen extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java b/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java new file mode 100644 index 0000000..372eb5e --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java @@ -0,0 +1,326 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateFlatWorld; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiFlatPresets extends GuiScreen { + private static final List FLAT_WORLD_PRESETS = Lists.newArrayList(); + private final GuiCreateFlatWorld parentScreen; + private String presetsTitle; + private String presetsShare; + private String field_146436_r; + private GuiFlatPresets.ListSlot field_146435_s; + private GuiButton field_146434_t; + private GuiTextField field_146433_u; + + public GuiFlatPresets(GuiCreateFlatWorld parGuiCreateFlatWorld) { + this.parentScreen = parGuiCreateFlatWorld; + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.presetsTitle = I18n.format("createWorld.customize.presets.title", new Object[0]); + this.presetsShare = I18n.format("createWorld.customize.presets.share", new Object[0]); + this.field_146436_r = I18n.format("createWorld.customize.presets.list", new Object[0]); + this.field_146433_u = new GuiTextField(2, this.fontRendererObj, 50, 40, this.width - 100, 20); + this.field_146435_s = new GuiFlatPresets.ListSlot(); + this.field_146433_u.setMaxStringLength(1230); + this.field_146433_u.setText(this.parentScreen.func_146384_e()); + this.buttonList.add(this.field_146434_t = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, + I18n.format("createWorld.customize.presets.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, + I18n.format("gui.cancel", new Object[0]))); + this.func_146426_g(); + } + + /**+ + * Handles mouse input. + */ + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.field_146435_s.handleMouseInput(); + } + + /**+ + * Called when the screen is unloaded. Used to disable keyboard + * repeat events + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /**+ + * Called when the mouse is clicked. Args : mouseX, mouseY, + * clickedButton + */ + protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + this.field_146433_u.mouseClicked(parInt1, parInt2, parInt3); + super.mouseClicked(parInt1, parInt2, parInt3); + } + + /**+ + * Fired when a key is typed (except F11 which toggles full + * screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character + * on the key), keyCode (lwjgl Keyboard key code) + */ + protected void keyTyped(char parChar1, int parInt1) { + if (!this.field_146433_u.textboxKeyTyped(parChar1, parInt1)) { + super.keyTyped(parChar1, parInt1); + } + + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + if (parGuiButton.id == 0 && this.func_146430_p()) { + this.parentScreen.func_146383_a(this.field_146433_u.getText()); + this.mc.displayGuiScreen(this.parentScreen); + } else if (parGuiButton.id == 1) { + this.mc.displayGuiScreen(this.parentScreen); + } + + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.drawDefaultBackground(); + this.field_146435_s.drawScreen(i, j, f); + this.drawCenteredString(this.fontRendererObj, this.presetsTitle, this.width / 2, 8, 16777215); + this.drawString(this.fontRendererObj, this.presetsShare, 50, 30, 10526880); + this.drawString(this.fontRendererObj, this.field_146436_r, 50, 70, 10526880); + this.field_146433_u.drawTextBox(); + super.drawScreen(i, j, f); + } + + /**+ + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146433_u.updateCursorCounter(); + super.updateScreen(); + } + + public void func_146426_g() { + boolean flag = this.func_146430_p(); + this.field_146434_t.enabled = flag; + } + + private boolean func_146430_p() { + return this.field_146435_s.field_148175_k > -1 && this.field_146435_s.field_148175_k < FLAT_WORLD_PRESETS.size() + || this.field_146433_u.getText().length() > 1; + } + + private static void func_146425_a(String parString1, Item parItem, BiomeGenBase parBiomeGenBase, + FlatLayerInfo... parArrayOfFlatLayerInfo) { + func_175354_a(parString1, parItem, 0, parBiomeGenBase, (List) null, parArrayOfFlatLayerInfo); + } + + private static void func_146421_a(String parString1, Item parItem, BiomeGenBase parBiomeGenBase, + List parList, FlatLayerInfo... parArrayOfFlatLayerInfo) { + func_175354_a(parString1, parItem, 0, parBiomeGenBase, parList, parArrayOfFlatLayerInfo); + } + + private static void func_175354_a(String parString1, Item parItem, int parInt1, BiomeGenBase parBiomeGenBase, + List parList, FlatLayerInfo... parArrayOfFlatLayerInfo) { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + + for (int i = parArrayOfFlatLayerInfo.length - 1; i >= 0; --i) { + flatgeneratorinfo.getFlatLayers().add(parArrayOfFlatLayerInfo[i]); + } + + flatgeneratorinfo.setBiome(parBiomeGenBase.biomeID); + flatgeneratorinfo.func_82645_d(); + if (parList != null) { + for (String s : parList) { + flatgeneratorinfo.getWorldFeatures().put(s, Maps.newHashMap()); + } + } + + FLAT_WORLD_PRESETS + .add(new GuiFlatPresets.LayerItem(parItem, parInt1, parString1, flatgeneratorinfo.toString())); + } + + static { + func_146421_a("Classic Flat", Item.getItemFromBlock(Blocks.grass), BiomeGenBase.plains, + Arrays.asList(new String[] { "village" }), new FlatLayerInfo[] { new FlatLayerInfo(1, Blocks.grass), + new FlatLayerInfo(2, Blocks.dirt), new FlatLayerInfo(1, Blocks.bedrock) }); + func_146421_a("Tunnelers\' Dream", Item.getItemFromBlock(Blocks.stone), BiomeGenBase.extremeHills, + Arrays.asList(new String[] { "biome_1", "dungeon", "decoration", "stronghold", "mineshaft" }), + new FlatLayerInfo[] { new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(5, Blocks.dirt), + new FlatLayerInfo(230, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock) }); + func_146421_a("Water World", Items.water_bucket, BiomeGenBase.deepOcean, + Arrays.asList(new String[] { "biome_1", "oceanmonument" }), + new FlatLayerInfo[] { new FlatLayerInfo(90, Blocks.water), new FlatLayerInfo(5, Blocks.sand), + new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(5, Blocks.stone), + new FlatLayerInfo(1, Blocks.bedrock) }); + func_175354_a("Overworld", Item.getItemFromBlock(Blocks.tallgrass), BlockTallGrass.EnumType.GRASS.getMeta(), + BiomeGenBase.plains, + Arrays.asList(new String[] { "village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", + "lake", "lava_lake" }), + new FlatLayerInfo[] { new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), + new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock) }); + func_146421_a("Snowy Kingdom", Item.getItemFromBlock(Blocks.snow_layer), BiomeGenBase.icePlains, + Arrays.asList(new String[] { "village", "biome_1" }), + new FlatLayerInfo[] { new FlatLayerInfo(1, Blocks.snow_layer), new FlatLayerInfo(1, Blocks.grass), + new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), + new FlatLayerInfo(1, Blocks.bedrock) }); + func_146421_a("Bottomless Pit", Items.feather, BiomeGenBase.plains, + Arrays.asList(new String[] { "village", "biome_1" }), + new FlatLayerInfo[] { new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), + new FlatLayerInfo(2, Blocks.cobblestone) }); + func_146421_a("Desert", Item.getItemFromBlock(Blocks.sand), BiomeGenBase.desert, + Arrays.asList( + new String[] { "village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon" }), + new FlatLayerInfo[] { new FlatLayerInfo(8, Blocks.sand), new FlatLayerInfo(52, Blocks.sandstone), + new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock) }); + func_146425_a("Redstone Ready", Items.redstone, BiomeGenBase.desert, + new FlatLayerInfo[] { new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), + new FlatLayerInfo(1, Blocks.bedrock) }); + } + + static class LayerItem { + public Item field_148234_a; + public int field_179037_b; + public String field_148232_b; + public String field_148233_c; + + public LayerItem(Item parItem, int parInt1, String parString1, String parString2) { + this.field_148234_a = parItem; + this.field_179037_b = parInt1; + this.field_148232_b = parString1; + this.field_148233_c = parString2; + } + } + + class ListSlot extends GuiSlot { + public int field_148175_k = -1; + + public ListSlot() { + super(GuiFlatPresets.this.mc, GuiFlatPresets.this.width, GuiFlatPresets.this.height, 80, + GuiFlatPresets.this.height - 37, 24); + } + + private void func_178054_a(int parInt1, int parInt2, Item parItem, int parInt3) { + this.func_148173_e(parInt1 + 1, parInt2 + 1); + GlStateManager.enableRescaleNormal(); + RenderHelper.enableGUIStandardItemLighting(); + GuiFlatPresets.this.itemRender.renderItemIntoGUI(new ItemStack(parItem, 1, parInt3), parInt1 + 2, + parInt2 + 2); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + } + + private void func_148173_e(int parInt1, int parInt2) { + this.func_148171_c(parInt1, parInt2, 0, 0); + } + + private void func_148171_c(int parInt1, int parInt2, int parInt3, int parInt4) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + boolean flag = true; + boolean flag1 = true; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (parInt1 + 0), (double) (parInt2 + 18), (double) GuiFlatPresets.this.zLevel) + .tex((double) ((float) (parInt3 + 0) * 0.0078125F), (double) ((float) (parInt4 + 18) * 0.0078125F)) + .endVertex(); + worldrenderer.pos((double) (parInt1 + 18), (double) (parInt2 + 18), (double) GuiFlatPresets.this.zLevel) + .tex((double) ((float) (parInt3 + 18) * 0.0078125F), (double) ((float) (parInt4 + 18) * 0.0078125F)) + .endVertex(); + worldrenderer.pos((double) (parInt1 + 18), (double) (parInt2 + 0), (double) GuiFlatPresets.this.zLevel) + .tex((double) ((float) (parInt3 + 18) * 0.0078125F), (double) ((float) (parInt4 + 0) * 0.0078125F)) + .endVertex(); + worldrenderer.pos((double) (parInt1 + 0), (double) (parInt2 + 0), (double) GuiFlatPresets.this.zLevel) + .tex((double) ((float) (parInt3 + 0) * 0.0078125F), (double) ((float) (parInt4 + 0) * 0.0078125F)) + .endVertex(); + tessellator.draw(); + } + + protected int getSize() { + return GuiFlatPresets.FLAT_WORLD_PRESETS.size(); + } + + protected void elementClicked(int i, boolean var2, int var3, int var4) { + this.field_148175_k = i; + GuiFlatPresets.this.func_146426_g(); + GuiFlatPresets.this.field_146433_u.setText(((GuiFlatPresets.LayerItem) GuiFlatPresets.FLAT_WORLD_PRESETS + .get(GuiFlatPresets.this.field_146435_s.field_148175_k)).field_148233_c); + } + + protected boolean isSelected(int i) { + return i == this.field_148175_k; + } + + protected void drawBackground() { + } + + protected void drawSlot(int i, int j, int k, int var4, int var5, int var6) { + GuiFlatPresets.LayerItem guiflatpresets$layeritem = (GuiFlatPresets.LayerItem) GuiFlatPresets.FLAT_WORLD_PRESETS + .get(i); + this.func_178054_a(j, k, guiflatpresets$layeritem.field_148234_a, guiflatpresets$layeritem.field_179037_b); + GuiFlatPresets.this.fontRendererObj.drawString(guiflatpresets$layeritem.field_148232_b, j + 18 + 5, k + 6, + 16777215); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiGameOver.java b/src/main/java/net/minecraft/client/gui/GuiGameOver.java index 2e6f896..f82c1be 100644 --- a/src/main/java/net/minecraft/client/gui/GuiGameOver.java +++ b/src/main/java/net/minecraft/client/gui/GuiGameOver.java @@ -1,6 +1,5 @@ package net.minecraft.client.gui; -import net.PeytonPlayz585.shadow.gui.GuiSecretMainMenu; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.resources.I18n; @@ -12,16 +11,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiGameOver extends GuiScreen implements GuiYesNoCallback { @@ -80,12 +81,13 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback { break; case 1: if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { - this.mc.theWorld.sendQuittingDisconnectingPacket(); - this.mc.loadWorld((WorldClient) null); - if(!this.mc.gameSettings.secret) { - this.mc.displayGuiScreen(new GuiMainMenu()); + if (this.mc.isIntegratedServerRunning()) { + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen((GuiScreen) null); } else { - this.mc.displayGuiScreen(new GuiSecretMainMenu()); + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld((WorldClient) null); + this.mc.shutdownIntegratedServer(new GuiMainMenu()); } } else { GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("deathScreen.quit.confirm", new Object[0]), "", @@ -102,11 +104,7 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback { if (flag) { this.mc.theWorld.sendQuittingDisconnectingPacket(); this.mc.loadWorld((WorldClient) null); - if(!this.mc.gameSettings.secret) { - this.mc.displayGuiScreen(new GuiMainMenu()); - } else { - this.mc.displayGuiScreen(new GuiSecretMainMenu()); - } + this.mc.shutdownIntegratedServer(new GuiMainMenu()); } else { this.mc.thePlayer.respawnPlayer(); this.mc.displayGuiScreen((GuiScreen) null); diff --git a/src/main/java/net/minecraft/client/gui/GuiHopper.java b/src/main/java/net/minecraft/client/gui/GuiHopper.java index 6bf4f2c..fd61483 100644 --- a/src/main/java/net/minecraft/client/gui/GuiHopper.java +++ b/src/main/java/net/minecraft/client/gui/GuiHopper.java @@ -14,16 +14,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiHopper extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/GuiIngame.java b/src/main/java/net/minecraft/client/gui/GuiIngame.java index b492363..75a633f 100644 --- a/src/main/java/net/minecraft/client/gui/GuiIngame.java +++ b/src/main/java/net/minecraft/client/gui/GuiIngame.java @@ -6,8 +6,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import net.FatalCodes.shadow.Shadow; -import net.FatalCodes.shadow.module.RenderModule; import net.PeytonPlayz585.shadow.Config; import net.PeytonPlayz585.shadow.CustomColors; import net.PeytonPlayz585.shadow.gui.ArmorGui; @@ -54,7 +52,6 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StringUtils; import net.minecraft.world.border.WorldBorder; -import net.FatalCodes.shadow.module.Module; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -62,16 +59,18 @@ import net.FatalCodes.shadow.module.Module; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiIngame extends Gui { @@ -80,7 +79,7 @@ public class GuiIngame extends Gui { private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); private final EaglercraftRandom rand = new EaglercraftRandom(); private final Minecraft mc; - public static RenderItem itemRenderer; + public static RenderItem itemRenderer = null; private final GuiNewChat persistantChatGUI; private int updateCounter; /**+ @@ -96,7 +95,7 @@ public class GuiIngame extends Gui { public float prevVignetteBrightness = 1.0F; private int remainingHighlightTicks; private ItemStack highlightingItemStack; - private final GuiOverlayDebug overlayDebug; + public final GuiOverlayDebug overlayDebug; private final GuiSpectator spectatorGui; private final GuiPlayerTabOverlay overlayPlayerList; private int field_175195_w; @@ -118,7 +117,7 @@ public class GuiIngame extends Gui { public GuiIngame(Minecraft mcIn) { this.mc = mcIn; - this.itemRenderer = mcIn.getRenderItem(); + itemRenderer = mcIn.getRenderItem(); this.overlayDebug = new GuiOverlayDebug(mcIn); this.spectatorGui = new GuiSpectator(mcIn); this.persistantChatGUI = new GuiNewChat(mcIn); @@ -317,12 +316,6 @@ public class GuiIngame extends Gui { this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1); } - for(Module m : Shadow.moduleManager.mods) { - if(m.isToggled() && m instanceof RenderModule) { - ((RenderModule)m).draw(); - } - } - ArmorGui.draw(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableLighting(); diff --git a/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java b/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java index 0c270f2..ea6cc90 100644 --- a/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java +++ b/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java @@ -1,11 +1,21 @@ package net.minecraft.client.gui; -import net.PeytonPlayz585.shadow.gui.GuiSecretMainMenu; import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANInfo; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANNotSupported; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiShareToLan; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.lax1dude.eaglercraft.v1_8.update.GuiUpdateCheckerOverlay; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.achievement.GuiAchievements; import net.minecraft.client.gui.achievement.GuiStats; import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -13,20 +23,32 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiIngameMenu extends GuiScreen { + private GuiButton lanButton; + + boolean hasSentAutoSave = !SingleplayerServerController.isWorldRunning(); + + private GuiUpdateCheckerOverlay updateCheckerOverlay; + + public GuiIngameMenu() { + updateCheckerOverlay = new GuiUpdateCheckerOverlay(true, this); + } + /**+ * Adds the buttons (and other controls) to the screen in * question. Called when the GUI is displayed and when the @@ -34,6 +56,7 @@ public class GuiIngameMenu extends GuiScreen { */ public void initGui() { this.buttonList.clear(); + this.updateCheckerOverlay.setResolution(mc, width, height); byte b0 = -16; boolean flag = true; this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + b0, @@ -46,14 +69,17 @@ public class GuiIngameMenu extends GuiScreen { I18n.format("menu.returnToGame", new Object[0]))); this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + b0, 98, 20, I18n.format("menu.options", new Object[0]))); - GuiButton guibutton; - this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, - I18n.format("menu.shareToLan", new Object[0]))); + this.buttonList.add(lanButton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, + I18n.format(LANServerController.isLANOpen() ? "menu.closeLan" : "menu.openToLan", new Object[0]))); this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.achievements", new Object[0]))); this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.stats", new Object[0]))); - guibutton.enabled = false; + lanButton.enabled = SingleplayerServerController.isWorldRunning(); + if (!hasSentAutoSave) { + hasSentAutoSave = true; + SingleplayerServerController.autoSave(); + } } /**+ @@ -66,22 +92,14 @@ public class GuiIngameMenu extends GuiScreen { this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); break; case 1: - boolean flag = this.mc.isIntegratedServerRunning(); + boolean flag = this.mc.isIntegratedServerRunning() || this.mc.isDemo(); parGuiButton.enabled = false; this.mc.theWorld.sendQuittingDisconnectingPacket(); this.mc.loadWorld((WorldClient) null); - if(!this.mc.gameSettings.secret) { - if (flag) { - this.mc.displayGuiScreen(new GuiMainMenu()); - } else { - this.mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu())); - } + if (flag) { + this.mc.shutdownIntegratedServer(new GuiMainMenu()); } else { - if (flag) { - this.mc.displayGuiScreen(new GuiSecretMainMenu()); - } else { - this.mc.displayGuiScreen(new GuiMultiplayer(new GuiSecretMainMenu())); - } + this.mc.shutdownIntegratedServer(new GuiMultiplayer(new GuiMainMenu())); } case 2: case 3: @@ -98,6 +116,19 @@ public class GuiIngameMenu extends GuiScreen { this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); break; case 7: + if (!LANServerController.supported()) { + mc.displayGuiScreen(new GuiScreenLANNotSupported(this)); + } else if (LANServerController.isLANOpen()) { + if (LANServerController.hasPeers()) { + mc.displayGuiScreen(new GuiYesNo(this, I18n.format("networkSettings.delete"), + I18n.format("lanServer.wouldYouLikeToKick"), 0)); + } else { + confirmClicked(false, 0); + } + } else { + this.mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen( + new GuiShareToLan(this, this.mc.playerController.getCurrentGameType().getName()))); + } break; } @@ -119,8 +150,82 @@ public class GuiIngameMenu extends GuiScreen { */ public void drawScreen(int i, int j, float f) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRendererObj, I18n.format("menu.game", new Object[0]), this.width / 2, 40, + this.drawCenteredString(this.fontRendererObj, I18n.format("menu.game", new Object[0]), this.width / 2, 20, 16777215); + + this.updateCheckerOverlay.drawScreen(i, j, f); + + if (LANServerController.isLANOpen()) { + String str = I18n.format("lanServer.pauseMenu0"); + drawString(fontRendererObj, str, 6, 32, 0xFFFF55); + + if (mc.gameSettings.hideJoinCode) { + GlStateManager.pushMatrix(); + GlStateManager.translate(7.0f, 47.0f, 0.0f); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + str = I18n.format("lanServer.showCode"); + int w = fontRendererObj.getStringWidth(str); + boolean hover = i > 6 && i < 8 + w * 3 / 4 && j > 46 && j < 47 + 8; + drawString(fontRendererObj, EnumChatFormatting.UNDERLINE + str, 0, 0, hover ? 0xEEEEAA : 0xCCCC55); + GlStateManager.popMatrix(); + } else { + int w = fontRendererObj.getStringWidth(str); + GlStateManager.pushMatrix(); + GlStateManager.translate(6 + w + 3, 33, 0.0f); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + str = I18n.format("lanServer.hideCode"); + int w2 = fontRendererObj.getStringWidth(str); + boolean hover = i > 6 + w + 2 && i < 6 + w + 3 + w2 * 3 / 4 && j > 33 - 1 && j < 33 + 6; + drawString(fontRendererObj, EnumChatFormatting.UNDERLINE + str, 0, 0, hover ? 0xEEEEAA : 0xCCCC55); + GlStateManager.popMatrix(); + + drawString(fontRendererObj, EnumChatFormatting.GRAY + I18n.format("lanServer.pauseMenu1") + " " + + EnumChatFormatting.RESET + LANServerController.getCurrentURI(), 6, 47, 0xFFFFFF); + drawString(fontRendererObj, EnumChatFormatting.GRAY + I18n.format("lanServer.pauseMenu2") + " " + + EnumChatFormatting.RESET + LANServerController.getCurrentCode(), 6, 57, 0xFFFFFF); + } + } + super.drawScreen(i, j, f); } + + public void confirmClicked(boolean par1, int par2) { + mc.displayGuiScreen(this); + LANServerController.closeLANNoKick(); + if (par1) { + LANServerController.cleanupLAN(); + SingleplayerServerController.configureLAN(this.mc.theWorld.getWorldInfo().getGameType(), false); + } + this.mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(I18n.format("lanServer.closed"))); + this.lanButton.displayString = I18n.format("menu.openToLan"); + } + + protected void mouseClicked(int par1, int par2, int par3) { + if (par3 == 0) { + if (mc.gameSettings.hideJoinCode) { + String str = I18n.format("lanServer.showCode"); + int w = fontRendererObj.getStringWidth(str); + if (par1 > 6 && par1 < 8 + w * 3 / 4 && par2 > 46 && par2 < 47 + 8) { + mc.gameSettings.hideJoinCode = false; + this.mc.getSoundHandler() + .playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + mc.gameSettings.saveOptions(); + } + } else { + String str = I18n.format("lanServer.pauseMenu0"); + int w = fontRendererObj.getStringWidth(str); + str = I18n.format("lanServer.hideCode"); + int w2 = fontRendererObj.getStringWidth(str); + if (par1 > 6 + w + 2 && par1 < 6 + w + 3 + w2 * 3 / 4 && par2 > 33 - 1 && par2 < 33 + 6) { + mc.gameSettings.hideJoinCode = true; + this.mc.getSoundHandler() + .playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + mc.gameSettings.saveOptions(); + } + } + + } + this.updateCheckerOverlay.mouseClicked(par1, par2, par3); + super.mouseClicked(par1, par2, par3); + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java b/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java index 6a1990c..ff22e13 100644 --- a/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java +++ b/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java @@ -15,16 +15,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiKeyBindingList extends GuiListExtended { diff --git a/src/main/java/net/minecraft/client/gui/GuiLabel.java b/src/main/java/net/minecraft/client/gui/GuiLabel.java index 344c05b..c3122d3 100644 --- a/src/main/java/net/minecraft/client/gui/GuiLabel.java +++ b/src/main/java/net/minecraft/client/gui/GuiLabel.java @@ -16,16 +16,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiLabel extends Gui { diff --git a/src/main/java/net/minecraft/client/gui/GuiLanguage.java b/src/main/java/net/minecraft/client/gui/GuiLanguage.java index b48a9df..539cc35 100644 --- a/src/main/java/net/minecraft/client/gui/GuiLanguage.java +++ b/src/main/java/net/minecraft/client/gui/GuiLanguage.java @@ -18,16 +18,18 @@ import net.minecraft.client.settings.GameSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiLanguage extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiListButton.java b/src/main/java/net/minecraft/client/gui/GuiListButton.java index b1c0ff7..a3e7fa7 100644 --- a/src/main/java/net/minecraft/client/gui/GuiListButton.java +++ b/src/main/java/net/minecraft/client/gui/GuiListButton.java @@ -9,16 +9,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiListButton extends GuiButton { diff --git a/src/main/java/net/minecraft/client/gui/GuiListExtended.java b/src/main/java/net/minecraft/client/gui/GuiListExtended.java index 8602cd3..19d70ff 100644 --- a/src/main/java/net/minecraft/client/gui/GuiListExtended.java +++ b/src/main/java/net/minecraft/client/gui/GuiListExtended.java @@ -2,6 +2,26 @@ package net.minecraft.client.gui; import net.minecraft.client.Minecraft; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class GuiListExtended extends GuiSlot { public GuiListExtended(Minecraft mcIn, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn) { super(mcIn, widthIn, heightIn, topIn, bottomIn, slotHeightIn); diff --git a/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java b/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java index 58930c4..0cc12ca 100644 --- a/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java +++ b/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java @@ -9,16 +9,18 @@ import net.minecraft.client.Minecraft; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiLockIconButton extends GuiButton { diff --git a/src/main/java/net/minecraft/client/gui/GuiMainMenu.java b/src/main/java/net/minecraft/client/gui/GuiMainMenu.java index 081cbbe..80d9872 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMainMenu.java +++ b/src/main/java/net/minecraft/client/gui/GuiMainMenu.java @@ -11,25 +11,34 @@ import java.util.Calendar; import java.util.Date; import net.PeytonPlayz585.shadow.gui.GuiCredits; -import net.PeytonPlayz585.shadow.gui.button.MainButton; import net.PeytonPlayz585.shadow.gui.button.ImageButton; -import net.PeytonPlayz585.shadow.gui.GuiSecretMainMenu; +import net.PeytonPlayz585.shadow.gui.button.MainButton; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.Mouse; import com.google.common.base.Charsets; import com.google.common.collect.Lists; import net.lax1dude.eaglercraft.v1_8.crypto.MD5Digest; import net.lax1dude.eaglercraft.v1_8.crypto.SHA1Digest; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; import net.lax1dude.eaglercraft.v1_8.profile.GuiScreenEditProfile; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenDemoPlayWorldSelection; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerStartup; +import net.lax1dude.eaglercraft.v1_8.update.GuiUpdateCheckerOverlay; +import net.lax1dude.eaglercraft.v1_8.update.GuiUpdateVersionSlot; +import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.renderer.Tessellator; @@ -38,6 +47,8 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.resources.I18n; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -45,16 +56,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiMainMenu extends GuiScreen implements GuiYesNoCallback { @@ -81,6 +94,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); private static final ResourceLocation minecraftTitleTextures = new ResourceLocation( "textures/gui/title/minecraft.png"); + private static final ResourceLocation eaglerGuiTextures = new ResourceLocation("eagler:gui/eagler_gui.png"); /**+ * An array of all the paths to the panorama pictures. */ @@ -98,14 +112,12 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { private int field_92020_v; private int field_92019_w; private static ResourceLocation backgroundTexture = null; + private GuiUpdateCheckerOverlay updateCheckerOverlay; + private GuiButton downloadOfflineButton; public GuiMainMenu() { - if(Minecraft.getMinecraft().gameSettings.secret) { - this.mc.displayGuiScreen(new GuiSecretMainMenu()); - return; - } - this.splashText = "missingno"; + updateCheckerOverlay = new GuiUpdateCheckerOverlay(false, this); BufferedReader bufferedreader = null; try { @@ -145,25 +157,29 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { this.updateCounter = RANDOM.nextFloat(); - MD5Digest md5 = new MD5Digest(); - SHA1Digest sha1 = new SHA1Digest(); - byte[] md5out = new byte[16]; - byte[] sha1out = new byte[20]; - try { - byte[] bytes = EaglerInputStream.inputStreamToBytesQuiet( - Minecraft.getMinecraft().getResourceManager().getResource(minecraftTitleTextures).getInputStream()); - if (bytes != null) { - md5.update(bytes, 0, bytes.length); - sha1.update(bytes, 0, bytes.length); - md5.doFinal(md5out, 0); - sha1.doFinal(sha1out, 0); - this.isDefault = bytes.length == lendef && Arrays.equals(md5out, md5def) - && Arrays.equals(sha1out, sha1def); - } else { + if (Minecraft.getMinecraft().isDemo()) { + this.isDefault = false; + } else { + MD5Digest md5 = new MD5Digest(); + SHA1Digest sha1 = new SHA1Digest(); + byte[] md5out = new byte[16]; + byte[] sha1out = new byte[20]; + try { + byte[] bytes = EaglerInputStream.inputStreamToBytesQuiet(Minecraft.getMinecraft().getResourceManager() + .getResource(minecraftTitleTextures).getInputStream()); + if (bytes != null) { + md5.update(bytes, 0, bytes.length); + sha1.update(bytes, 0, bytes.length); + md5.doFinal(md5out, 0); + sha1.doFinal(sha1out, 0); + this.isDefault = bytes.length == lendef && Arrays.equals(md5out, md5def) + && Arrays.equals(sha1out, sha1def); + } else { + this.isDefault = false; + } + } catch (IOException e) { this.isDefault = false; } - } catch (IOException e) { - this.isDefault = false; } } @@ -172,6 +188,9 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { */ public void updateScreen() { ++this.panoramaTimer; + if (downloadOfflineButton != null) { + downloadOfflineButton.enabled = !UpdateService.shouldDisableDownloadButton(); + } } /**+ @@ -201,7 +220,8 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { viewportTexture = new DynamicTexture(256, 256); backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", viewportTexture); } - Calendar calendar = Calendar.getInstance(); + this.updateCheckerOverlay.setResolution(mc, width, height); + Calendar calendar = EagRuntime.getLocaleCalendar(); calendar.setTime(new Date()); if (calendar.get(2) + 1 == 12 && calendar.get(5) == 24) { this.splashText = "Merry X-mas!"; @@ -209,8 +229,6 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { this.splashText = "Happy new year!"; } else if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31) { this.splashText = "OOoooOOOoooo! Spooky!"; - } else if (calendar.get(2) + 1 == 11 && calendar.get(5) == 12) { - this.splashText = "Happy Birthday, PeytonPlayz585!"; } int i = this.height / 4 + 48; @@ -221,7 +239,11 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { i += 11; } - this.addSingleplayerMultiplayerButtons(i, 24); + if (this.mc.isDemo()) { + this.addDemoButtons(i, 24); + } else { + this.addSingleplayerMultiplayerButtons(i, 24); + } int yPos = height - 20; this.buttonList.add(new ImageButton(0, width / 2 - 15, yPos, "MINECRAFT SETTINGS", new ResourceLocation("textures/shadow/icons/settings.png"))); @@ -250,12 +272,38 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { * players who have bought the game. */ private void addSingleplayerMultiplayerButtons(int parInt1, int parInt2) { - // this.buttonList - // .add(new GuiButton(1, this.width / 2 - 100, parInt1, - // I18n.format("menu.singleplayer", new Object[0]))); - this.buttonList.add(new MainButton(2, width / 2 - 66, height / 2, "MULTIPLAYER")); - this.buttonList.add(new MainButton(3, width / 2 - 66, height / 2 + 30, "CREDITS")); - this.buttonList.add(new MainButton(14, width / 2 - 66, height / 2 + 15, "DISCORD")); +// this.buttonList +// .add(new GuiButton(1, this.width / 2 - 100, parInt1, I18n.format("menu.singleplayer", new Object[0]))); +// this.buttonList.add(new GuiButton(2, this.width / 2 - 100, parInt1 + parInt2 * 1, +// I18n.format("menu.multiplayer", new Object[0]))); +// if (EaglercraftVersion.mainMenuEnableGithubButton) { +// this.buttonList.add( +// new GuiButton(14, this.width / 2 - 100, parInt1 + parInt2 * 2, I18n.format("menu.forkOnGitlab"))); +// } else { +// if (EagRuntime.getConfiguration().isEnableDownloadOfflineButton() +// && (EagRuntime.getConfiguration().getDownloadOfflineButtonLink() != null +// || (!EagRuntime.isOfflineDownloadURL() && UpdateService.supported() +// && UpdateService.getClientSignatureData() != null))) { +// this.buttonList.add(downloadOfflineButton = new GuiButton(15, this.width / 2 - 100, +// parInt1 + parInt2 * 2, I18n.format("update.downloadOffline"))); +// downloadOfflineButton.enabled = !UpdateService.shouldDisableDownloadButton(); +// } +// } + this.buttonList.add(new MainButton(1, width / 2 - 66, height / 2, "SINGLEPLAYER")); + this.buttonList.add(new MainButton(2, width / 2 - 66, height / 2 + 30, "MULTIPLAYER")); + this.buttonList.add(new MainButton(14, width / 2 - 66, height / 2 + 15, "CREDITS")); + } + + /**+ + * Adds Demo buttons on Main Menu for players who are playing + * Demo. + */ + private void addDemoButtons(int parInt1, int parInt2) { + this.buttonList + .add(new GuiButton(11, this.width / 2 - 100, parInt1, I18n.format("menu.playdemo", new Object[0]))); + this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, parInt1 + parInt2 * 1, + I18n.format("menu.resetdemo", new Object[0]))); + this.buttonResetDemo.enabled = this.mc.gameSettings.hasCreatedDemoWorld; } /**+ @@ -272,25 +320,53 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { } if (parGuiButton.id == 1) { - logger.error("Singleplayer was removed dumbass"); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerStartup(this)); } if (parGuiButton.id == 2) { this.mc.displayGuiScreen(new GuiMultiplayer(this)); } - if (parGuiButton.id == 3) { - this.mc.displayGuiScreen(new GuiCredits()); - } - if (parGuiButton.id == 4) { this.mc.displayGuiScreen(new GuiScreenEditProfile(this)); } if (parGuiButton.id == 14) { - EagRuntime.openLink("https://discord.com/invite/wQ8ynJ6A93"); + this.mc.displayGuiScreen(new GuiCredits()); } + if (parGuiButton.id == 11) { + this.mc.displayGuiScreen(new GuiScreenDemoPlayWorldSelection(this)); + } + + if (parGuiButton.id == 12) { + GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, "Demo World", 12); + this.mc.displayGuiScreen(guiyesno); + } + + if (parGuiButton.id == 15) { + if (EagRuntime.getConfiguration().isEnableDownloadOfflineButton()) { + String link = EagRuntime.getConfiguration().getDownloadOfflineButtonLink(); + if (link != null) { + EagRuntime.openLink(link); + } else { + UpdateService.quine(); + } + } + } + } + + public void confirmClicked(boolean flag, int i) { + if (flag && i == 12) { + this.mc.gameSettings.hasCreatedDemoWorld = false; + this.mc.gameSettings.saveOptions(); + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.deleteWorldDirectory("Demo World"); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting", + "singleplayer.failed.deleting", () -> SingleplayerServerController.isReady())); + } else { + this.mc.displayGuiScreen(this); + } } /**+ @@ -568,10 +644,12 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { if (resStr != null) { EagRuntime.openCreditsPopup(resStr); } - mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + mc.getSoundHandler() + .playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); return; } } + this.updateCheckerOverlay.mouseClicked(par1, par2, par3); super.mouseClicked(par1, par2, par3); } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java b/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java index 3a186d9..910fc54 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java +++ b/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java @@ -1,6 +1,5 @@ package net.minecraft.client.gui; -import net.PeytonPlayz585.shadow.gui.GuiSecretMainMenu; import net.minecraft.client.resources.I18n; /**+ @@ -9,16 +8,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiMemoryErrorScreen extends GuiScreen { @@ -41,11 +42,7 @@ public class GuiMemoryErrorScreen extends GuiScreen { */ protected void actionPerformed(GuiButton parGuiButton) { if (parGuiButton.id == 0) { - if(!this.mc.gameSettings.secret) { - this.mc.displayGuiScreen(new GuiMainMenu()); - } else { - this.mc.displayGuiScreen(new GuiSecretMainMenu()); - } + this.mc.displayGuiScreen(new GuiMainMenu()); } else if (parGuiButton.id == 1) { this.mc.shutdown(); } diff --git a/src/main/java/net/minecraft/client/gui/GuiMerchant.java b/src/main/java/net/minecraft/client/gui/GuiMerchant.java index b4b4d7c..b791ac0 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMerchant.java +++ b/src/main/java/net/minecraft/client/gui/GuiMerchant.java @@ -1,6 +1,8 @@ package net.minecraft.client.gui; import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -26,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiMerchant extends GuiContainer { @@ -226,6 +230,9 @@ public class GuiMerchant extends GuiContainer { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); boolean flag = i >= this.xPosition && j >= this.yPosition && i < this.xPosition + this.width && j < this.yPosition + this.height; + if (flag && this.enabled) { + Mouse.showCursor(EnumCursorType.HAND); + } int k = 0; int l = 176; if (!this.enabled) { diff --git a/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java b/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java index 4f04f07..9f5a48b 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java +++ b/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java @@ -5,13 +5,25 @@ import java.io.IOException; import com.google.common.base.Splitter; import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.EaglerXBungeeVersion; import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiNetworkSettingsButton; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenConnectOption; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANConnecting; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerList; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.multiplayer.GuiConnecting; import net.minecraft.client.multiplayer.ServerData; import net.minecraft.client.multiplayer.ServerList; import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -19,16 +31,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { @@ -44,12 +58,27 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { private boolean editingServer; private boolean directConnect; private String hoveringText; + + public ServerData getSelectedServer() { + return selectedServer; + } + private ServerData selectedServer; private boolean initialized; private static long lastRefreshCommit = 0l; + private static LANServerList lanServerList = null; + + public int ticksOpened; + + private final GuiNetworkSettingsButton relaysButton; + public GuiMultiplayer(GuiScreen parentScreen) { this.parentScreen = parentScreen; + this.relaysButton = new GuiNetworkSettingsButton(this); + if (lanServerList != null) { + lanServerList.forceRefresh(); + } } /**+ @@ -67,6 +96,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { this.serverListSelector = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36); this.serverListSelector.func_148195_a(this.savedServerList); + if (lanServerList == null) { + lanServerList = new LANServerList(); + } else { + lanServerList.forceRefresh(); + } } else { this.serverListSelector.setDimensions(this.width, this.height, 32, this.height - 64); } @@ -106,6 +140,10 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { public void updateScreen() { super.updateScreen(); this.savedServerList.updateServerPing(); + if (lanServerList.update()) { + this.selectServer(-1); + } + ++ticksOpened; } /**+ @@ -140,9 +178,8 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { this.connectToSelected(); } else if (parGuiButton.id == 4) { this.directConnect = true; - this.mc.displayGuiScreen(new GuiScreenServerList(this, - this.selectedServer = new ServerData(I18n.format("selectServer.defaultName", new Object[0]), "", - false))); + this.selectedServer = new ServerData(I18n.format("selectServer.defaultName", new Object[0]), "", false); + this.mc.displayGuiScreen(new GuiScreenConnectOption(this)); } else if (parGuiButton.id == 3) { this.addingServer = true; this.mc.displayGuiScreen(new GuiScreenAddServer(this, @@ -151,9 +188,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { } else if (parGuiButton.id == 7 && guilistextended$iguilistentry instanceof ServerListEntryNormal) { this.editingServer = true; ServerData serverdata = ((ServerListEntryNormal) guilistextended$iguilistentry).getServerData(); - this.selectedServer = new ServerData(serverdata.serverName, serverdata.serverIP, false); - this.selectedServer.copyFrom(serverdata); - this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer)); + if (serverdata != null) { + this.selectedServer = new ServerData(serverdata.serverName, serverdata.serverIP, false); + this.selectedServer.copyFrom(serverdata); + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer)); + } } else if (parGuiButton.id == 0) { this.mc.displayGuiScreen(this.parentScreen); } else if (parGuiButton.id == 8) { @@ -293,14 +332,44 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { if (this.hoveringText != null) { this.drawHoveringText(Lists.newArrayList(Splitter.on("\n").split(this.hoveringText)), i, j); } + relaysButton.drawScreen(i, j); + drawPluginDownloadLink(i, j); + } + private void drawPluginDownloadLink(int xx, int yy) { + GlStateManager.pushMatrix(); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + + String text = EaglerXBungeeVersion.getPluginButton(); + int w = mc.fontRendererObj.getStringWidth(text); + boolean hover = xx > width - 5 - (w + 5) * 3 / 4 && yy > 1 && xx < width - 2 && yy < 12; + if (hover) { + Mouse.showCursor(EnumCursorType.HAND); + } + + drawString(mc.fontRendererObj, EnumChatFormatting.UNDERLINE + text, (width - 1) * 4 / 3 - w - 5, 5, + hover ? 0xFFEEEE22 : 0xFFCCCCCC); + + GlStateManager.popMatrix(); } public void connectToSelected() { - GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.func_148193_k() < 0 ? null - : this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()); - if (guilistextended$iguilistentry instanceof ServerListEntryNormal) { - this.connectToServer(((ServerListEntryNormal) guilistextended$iguilistentry).getServerData()); + if (this.serverListSelector.func_148193_k() < this.serverListSelector.getOrigSize()) { + GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.func_148193_k() < 0 + ? null + : this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()); + if (guilistextended$iguilistentry instanceof ServerListEntryNormal) { + this.connectToServer(((ServerListEntryNormal) guilistextended$iguilistentry).getServerData()); + } + } else { + int par1 = this.serverListSelector.func_148193_k() - this.serverListSelector.getOrigSize(); + + if (par1 < lanServerList.countServers()) { + LANServerList.LanServer var2 = lanServerList.getServer(par1); + connectToLAN("Connecting to '" + var2.getLanServerMotd() + "'...", var2.getLanServerCode(), + var2.getLanServerRelay()); + } } } @@ -308,6 +377,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server)); } + private void connectToLAN(String text, String code, RelayServer uri) { + this.mc.loadingScreen.resetProgressAndMessage(text); + this.mc.displayGuiScreen(new GuiScreenLANConnecting(this, code, uri)); + } + public void selectServer(int index) { this.serverListSelector.setSelectedSlotIndex(index); GuiListExtended.IGuiListEntry guilistextended$iguilistentry = index < 0 ? null @@ -317,7 +391,8 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { this.btnDeleteServer.enabled = false; if (guilistextended$iguilistentry != null) { this.btnSelectServer.enabled = true; - if (guilistextended$iguilistentry instanceof ServerListEntryNormal) { + if (guilistextended$iguilistentry instanceof ServerListEntryNormal + && ((ServerListEntryNormal) guilistextended$iguilistentry).getServerData() != null) { this.btnEditServer.enabled = true; this.btnDeleteServer.enabled = true; } @@ -333,8 +408,16 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { * clickedButton */ protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + relaysButton.mouseClicked(parInt1, parInt2, parInt3); super.mouseClicked(parInt1, parInt2, parInt3); this.serverListSelector.mouseClicked(parInt1, parInt2, parInt3); + String text = EaglerXBungeeVersion.getPluginButton(); + int w = mc.fontRendererObj.getStringWidth(text); + if (parInt1 > width - 5 - (w + 5) * 3 / 4 && parInt2 > 1 && parInt1 < width - 2 && parInt2 < 12) { + this.mc.getSoundHandler() + .playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + EaglerXBungeeVersion.startPluginDownload(); + } } /**+ @@ -350,12 +433,16 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { return this.savedServerList; } + static LANServerList getLanServerList() { + return lanServerList; + } + public boolean func_175392_a(ServerListEntryNormal parServerListEntryNormal, int parInt1) { return parInt1 > 0; } public boolean func_175394_b(ServerListEntryNormal parServerListEntryNormal, int parInt1) { - return parInt1 < this.savedServerList.countServers() - 1; + return parInt1 < this.savedServerList.countServers(); } public void func_175391_a(ServerListEntryNormal parServerListEntryNormal, int parInt1, boolean parFlag) { diff --git a/src/main/java/net/minecraft/client/gui/GuiNewChat.java b/src/main/java/net/minecraft/client/gui/GuiNewChat.java index a5682b9..4c62a25 100644 --- a/src/main/java/net/minecraft/client/gui/GuiNewChat.java +++ b/src/main/java/net/minecraft/client/gui/GuiNewChat.java @@ -20,16 +20,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiNewChat extends Gui { diff --git a/src/main/java/net/minecraft/client/gui/GuiOptionButton.java b/src/main/java/net/minecraft/client/gui/GuiOptionButton.java index 8cbf5e1..7bc5c63 100644 --- a/src/main/java/net/minecraft/client/gui/GuiOptionButton.java +++ b/src/main/java/net/minecraft/client/gui/GuiOptionButton.java @@ -8,16 +8,18 @@ import net.minecraft.client.settings.GameSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiOptionButton extends GuiButton { diff --git a/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java b/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java index 7991622..1de996f 100644 --- a/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java +++ b/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java @@ -11,16 +11,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiOptionSlider extends GuiButton { diff --git a/src/main/java/net/minecraft/client/gui/GuiOptions.java b/src/main/java/net/minecraft/client/gui/GuiOptions.java index df6df21..69d4612 100644 --- a/src/main/java/net/minecraft/client/gui/GuiOptions.java +++ b/src/main/java/net/minecraft/client/gui/GuiOptions.java @@ -1,10 +1,11 @@ package net.minecraft.client.gui; import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredPipeline; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShaderConfig; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShadersNotSupported; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; import net.lax1dude.eaglercraft.v1_8.vfs.SYS; import net.minecraft.client.resources.I18n; import net.minecraft.client.settings.GameSettings; @@ -18,16 +19,18 @@ import net.minecraft.world.EnumDifficulty; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiOptions extends GuiScreen implements GuiYesNoCallback { @@ -39,15 +42,10 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback { private GuiLockIconButton field_175356_r; protected String field_146442_a = "Options"; private GuiButton broadcastSettings; - private boolean secret; public GuiOptions(GuiScreen parGuiScreen, GameSettings parGameSettings) { - secret = false; this.field_146441_g = parGuiScreen; this.game_settings_1 = parGameSettings; - if(Keyboard.isKeyDown(42)) { - secret = true; - } } /**+ @@ -95,11 +93,8 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback { this.buttonList.add(new GuiButton(110, this.width / 2 - 155, this.height / 6 + 48 - 6, 150, 20, I18n.format("options.skinCustomisation", new Object[0]))); - GuiButton button; - this.buttonList.add(button = new GuiButton(8675309, this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, "Super Secret Settings")); - if(!secret) { - button.enabled = false; - } + this.buttonList.add(new GuiButton(8675309, this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, + I18n.format("shaders.gui.optionsButton"))); this.buttonList.add(new GuiButton(106, this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.sounds", new Object[0]))); this.buttonList.add(broadcastSettings = new GuiButton(107, this.width / 2 + 5, this.height / 6 + 72 - 6, 150, @@ -116,10 +111,10 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback { GuiButton rp; this.buttonList.add(rp = new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20, I18n.format("options.resourcepack", new Object[0]))); - GuiButton b; - this.buttonList.add(b = new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20, - I18n.format("options.snooper.view", new Object[0]))); - b.enabled = false; + GuiButton dbg; + this.buttonList.add(dbg = new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20, + I18n.format("options.debugConsoleButton", new Object[0]))); + dbg.enabled = EagRuntime.getPlatformType() != EnumPlatformType.DESKTOP; this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); @@ -162,6 +157,8 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback { if (parGuiButton.id == 108) { this.mc.theWorld.getWorldInfo().setDifficulty( EnumDifficulty.getDifficultyEnum(this.mc.theWorld.getDifficulty().getDifficultyId() + 1)); + SingleplayerServerController + .setDifficulty(this.mc.theWorld.getWorldInfo().getDifficulty().getDifficultyId()); this.field_175357_i.displayString = this.func_175355_a(this.mc.theWorld.getDifficulty()); } @@ -183,14 +180,12 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback { } if (parGuiButton.id == 8675309) { -// if (EaglerDeferredPipeline.isSupported()) { -// this.mc.displayGuiScreen(new GuiShaderConfig(this)); -// } else { -// this.mc.displayGuiScreen(new GuiShadersNotSupported(this, -// I18n.format(EaglerDeferredPipeline.getReasonUnsupported()))); -// } - mc.gameSettings.secret = !mc.gameSettings.secret; - mc.gameSettings.saveOptions(); + if (EaglerDeferredPipeline.isSupported()) { + this.mc.displayGuiScreen(new GuiShaderConfig(this)); + } else { + this.mc.displayGuiScreen(new GuiShadersNotSupported(this, + I18n.format(EaglerDeferredPipeline.getReasonUnsupported()))); + } } if (parGuiButton.id == 101) { @@ -232,6 +227,10 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback { EagRuntime.toggleRec(); broadcastSettings.displayString = I18n.format(EagRuntime.getRecText(), new Object[0]); } + + if (parGuiButton.id == 104) { + EagRuntime.showDebugConsole(); + } } } diff --git a/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java b/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java index ec7216d..12cd7d1 100644 --- a/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java +++ b/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java @@ -13,16 +13,18 @@ import net.minecraft.client.settings.GameSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiOptionsRowList extends GuiListExtended { diff --git a/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java b/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java index f791b7f..5f3050a 100644 --- a/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java +++ b/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java @@ -21,6 +21,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; @@ -49,21 +50,24 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiOverlayDebug extends Gui { private final Minecraft mc; private final FontRenderer fontRenderer; + public int playerOffset = 0; public GuiOverlayDebug(Minecraft mc) { this.mc = mc; @@ -71,6 +75,7 @@ public class GuiOverlayDebug extends Gui { } public void renderDebugInfo(ScaledResolution scaledResolutionIn) { + playerOffset = 0; int ww = scaledResolutionIn.getScaledWidth(); int hh = scaledResolutionIn.getScaledHeight(); this.mc.mcProfiler.startSection("debug"); @@ -87,12 +92,14 @@ public class GuiOverlayDebug extends Gui { if (this.mc.gameSettings.hudFps) { drawFPS(2, i); + playerOffset = drawSingleplayerStats(scaledResolutionIn); i += 9; } if (this.mc.gameSettings.hudCoords) { drawXYZ(2, i); } + } if (this.mc.currentScreen == null || !(this.mc.currentScreen instanceof GuiChat)) { @@ -265,6 +272,38 @@ public class GuiOverlayDebug extends Gui { return this.mc.thePlayer.hasReducedDebug() || this.mc.gameSettings.reducedDebugInfo; } + private int drawSingleplayerStats(ScaledResolution parScaledResolution) { + if (mc.isDemo()) { + return 13; + } + int i = 0; + if (SingleplayerServerController.isWorldRunning()) { + long tpsAge = SingleplayerServerController.getTPSAge(); + if (tpsAge < 20000l) { + int color = tpsAge > 2000l ? 0x777777 : 0xFFFFFF; + List strs = SingleplayerServerController.getTPS(); + int l; + boolean first = true; + for (String str : strs) { + l = (int) (this.fontRenderer.getStringWidth(str) * (!first ? 0.5f : 1.0f)); + GlStateManager.pushMatrix(); + GlStateManager.translate(parScaledResolution.getScaledWidth() - 2 - l, i + 2, 0.0f); + if (!first) { + GlStateManager.scale(0.5f, 0.5f, 0.5f); + } + this.fontRenderer.drawStringWithShadow(str, 0, 0, color); + GlStateManager.popMatrix(); + i += (int) (this.fontRenderer.FONT_HEIGHT * (!first ? 0.5f : 1.0f)); + first = false; + if (color == 0xFFFFFF) { + color = 14737632; + } + } + } + } + return i > 0 ? i + 2 : i; + } + protected void renderDebugInfoLeft() { List list = this.call(); diff --git a/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java b/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java index 215bf86..2e3b876 100644 --- a/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java +++ b/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java @@ -16,16 +16,18 @@ import net.minecraft.util.IntHashMap; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiPageButtonList extends GuiListExtended { diff --git a/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java b/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java index 802500e..ca84dfe 100644 --- a/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java +++ b/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java @@ -30,16 +30,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiPlayerTabOverlay extends Gui { diff --git a/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java b/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java new file mode 100644 index 0000000..bcf1912 --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java @@ -0,0 +1,154 @@ +package net.minecraft.client.gui; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiRenameWorld extends GuiScreen { + private GuiScreen parentScreen; + private GuiTextField field_146583_f; + private final String saveName; + private final boolean duplicate; + + public GuiRenameWorld(GuiScreen parentScreenIn, String saveNameIn) { + this.parentScreen = parentScreenIn; + this.saveName = saveNameIn; + this.duplicate = false; + } + + public GuiRenameWorld(GuiScreen parentScreenIn, String saveNameIn, boolean duplicate) { + this.parentScreen = parentScreenIn; + this.saveName = saveNameIn; + this.duplicate = duplicate; + } + + /**+ + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146583_f.updateCursorCounter(); + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, + I18n.format(duplicate ? "selectWorld.duplicateButton" : "selectWorld.renameButton", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, + I18n.format("gui.cancel", new Object[0]))); + ISaveFormat isaveformat = this.mc.getSaveLoader(); + WorldInfo worldinfo = isaveformat.getWorldInfo(this.saveName); + String s = worldinfo.getWorldName(); + if (duplicate) { + s += " copy"; + } + this.field_146583_f = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146583_f.setFocused(true); + this.field_146583_f.setText(s); + } + + /**+ + * Called when the screen is unloaded. Used to disable keyboard + * repeat events + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + if (parGuiButton.enabled) { + if (parGuiButton.id == 1) { + this.mc.displayGuiScreen(this.parentScreen); + } else if (parGuiButton.id == 0) { + if (duplicate) { + SingleplayerServerController.duplicateWorld(this.saveName, this.field_146583_f.getText().trim()); + this.mc.displayGuiScreen( + new GuiScreenIntegratedServerBusy(this.parentScreen, "singleplayer.busy.duplicating", + "singleplayer.failed.duplicating", () -> SingleplayerServerController.isReady())); + } else { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.renameWorld(this.saveName, this.field_146583_f.getText().trim()); + this.mc.displayGuiScreen( + new GuiScreenIntegratedServerBusy(this.parentScreen, "singleplayer.busy.renaming", + "singleplayer.failed.renaming", () -> SingleplayerServerController.isReady())); + } + } + } + } + + /**+ + * Fired when a key is typed (except F11 which toggles full + * screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character + * on the key), keyCode (lwjgl Keyboard key code) + */ + protected void keyTyped(char parChar1, int parInt1) { + this.field_146583_f.textboxKeyTyped(parChar1, parInt1); + ((GuiButton) this.buttonList.get(0)).enabled = this.field_146583_f.getText().trim().length() > 0; + if (parInt1 == 28 || parInt1 == 156) { + this.actionPerformed((GuiButton) this.buttonList.get(0)); + } + + } + + /**+ + * Called when the mouse is clicked. Args : mouseX, mouseY, + * clickedButton + */ + protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + super.mouseClicked(parInt1, parInt2, parInt3); + this.field_146583_f.mouseClicked(parInt1, parInt2, parInt3); + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, + I18n.format(duplicate ? "selectWorld.duplicate" : "selectWorld.renameTitle", new Object[0]), + this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, + 47, 10526880); + this.field_146583_f.drawTextBox(); + super.drawScreen(i, j, f); + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiRepair.java b/src/main/java/net/minecraft/client/gui/GuiRepair.java index 73cccb2..a10a1e0 100644 --- a/src/main/java/net/minecraft/client/gui/GuiRepair.java +++ b/src/main/java/net/minecraft/client/gui/GuiRepair.java @@ -26,16 +26,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiRepair extends GuiContainer implements ICrafting { diff --git a/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java b/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java index 0af1713..a20c086 100644 --- a/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java +++ b/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java @@ -12,16 +12,18 @@ import net.minecraft.client.resources.ResourcePackListEntry; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiResourcePackAvailable extends GuiResourcePackList { diff --git a/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java b/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java index 60c3d84..ada6071 100644 --- a/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java +++ b/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java @@ -7,6 +7,26 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.resources.ResourcePackListEntry; import net.minecraft.util.EnumChatFormatting; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class GuiResourcePackList extends GuiListExtended { protected final Minecraft mc; protected final List field_148204_l; diff --git a/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java b/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java index 2ba9962..de460b7 100644 --- a/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java +++ b/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java @@ -12,16 +12,18 @@ import net.minecraft.client.resources.ResourcePackListEntry; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiResourcePackSelected extends GuiResourcePackList { diff --git a/src/main/java/net/minecraft/client/gui/GuiScreen.java b/src/main/java/net/minecraft/client/gui/GuiScreen.java index 10c9b59..ed09ce9 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreen.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreen.java @@ -13,6 +13,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglerXBungeeVersion; import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants; @@ -41,14 +42,34 @@ import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class GuiScreen extends Gui implements GuiYesNoCallback { private static final Logger LOGGER = LogManager.getLogger(); private static final Set PROTOCOLS = Sets.newHashSet(new String[] { "http", "https" }); private static final Splitter NEWLINE_SPLITTER = Splitter.on('\n'); protected Minecraft mc; protected RenderItem itemRender; - public static int width; - public static int height; + public int width; + public int height; /**+ * A list of all the buttons in this container. */ @@ -370,6 +391,13 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback { * GuiTwitchUserMode(this.mc.getTwitchStream(), chatuserinfo)); } else { } */ LOGGER.error("Tried to handle twitch user but couldn\'t find them!"); + } else if (clickevent.getAction() == ClickEvent.Action.EAGLER_PLUGIN_DOWNLOAD) { + if (EaglerXBungeeVersion.pluginFileEPK.equals(clickevent.getValue())) { + EaglerXBungeeVersion.startPluginDownload(); + } else { + LOGGER.error("Invalid plugin download from EPK was blocked: {}", + EaglerXBungeeVersion.pluginFileEPK); + } } else { LOGGER.error("Don\'t know how to handle " + clickevent); } @@ -641,4 +669,8 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback { public void onResize(Minecraft mcIn, int parInt1, int parInt2) { this.setWorldAndResolution(mcIn, parInt1, parInt2); } + + public boolean shouldHangupIntegratedServer() { + return true; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java b/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java index 5670ffd..1abd237 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java @@ -11,16 +11,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenAddServer extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenBook.java b/src/main/java/net/minecraft/client/gui/GuiScreenBook.java index b0aa70c..39f1564 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenBook.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenBook.java @@ -35,16 +35,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenBook extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java b/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java new file mode 100644 index 0000000..cad2844 --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java @@ -0,0 +1,275 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCustomizeWorldScreen; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.gen.ChunkProviderSettings; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiScreenCustomizePresets extends GuiScreen { + private static final List field_175310_f = Lists.newArrayList(); + private GuiScreenCustomizePresets.ListPreset field_175311_g; + private GuiButton field_175316_h; + private GuiTextField field_175317_i; + private GuiCustomizeWorldScreen field_175314_r; + protected String field_175315_a = "Customize World Presets"; + private String field_175313_s; + private String field_175312_t; + + public GuiScreenCustomizePresets(GuiCustomizeWorldScreen parGuiCustomizeWorldScreen) { + this.field_175314_r = parGuiCustomizeWorldScreen; + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.field_175315_a = I18n.format("createWorld.customize.custom.presets.title", new Object[0]); + this.field_175313_s = I18n.format("createWorld.customize.presets.share", new Object[0]); + this.field_175312_t = I18n.format("createWorld.customize.presets.list", new Object[0]); + this.field_175317_i = new GuiTextField(2, this.fontRendererObj, 50, 40, this.width - 100, 20); + this.field_175311_g = new GuiScreenCustomizePresets.ListPreset(); + this.field_175317_i.setMaxStringLength(2000); + this.field_175317_i.setText(this.field_175314_r.func_175323_a()); + this.buttonList.add(this.field_175316_h = new GuiButton(0, this.width / 2 - 102, this.height - 27, 100, 20, + I18n.format("createWorld.customize.presets.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 3, this.height - 27, 100, 20, + I18n.format("gui.cancel", new Object[0]))); + this.func_175304_a(); + } + + /**+ + * Handles mouse input. + */ + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.field_175311_g.handleMouseInput(); + } + + /**+ + * Called when the screen is unloaded. Used to disable keyboard + * repeat events + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /**+ + * Called when the mouse is clicked. Args : mouseX, mouseY, + * clickedButton + */ + protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + this.field_175317_i.mouseClicked(parInt1, parInt2, parInt3); + super.mouseClicked(parInt1, parInt2, parInt3); + } + + /**+ + * Fired when a key is typed (except F11 which toggles full + * screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character + * on the key), keyCode (lwjgl Keyboard key code) + */ + protected void keyTyped(char parChar1, int parInt1) { + if (!this.field_175317_i.textboxKeyTyped(parChar1, parInt1)) { + super.keyTyped(parChar1, parInt1); + } + + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + switch (parGuiButton.id) { + case 0: + this.field_175314_r.func_175324_a(this.field_175317_i.getText()); + this.mc.displayGuiScreen(this.field_175314_r); + break; + case 1: + this.mc.displayGuiScreen(this.field_175314_r); + } + + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.drawDefaultBackground(); + this.field_175311_g.drawScreen(i, j, f); + this.drawCenteredString(this.fontRendererObj, this.field_175315_a, this.width / 2, 8, 16777215); + this.drawString(this.fontRendererObj, this.field_175313_s, 50, 30, 10526880); + this.drawString(this.fontRendererObj, this.field_175312_t, 50, 70, 10526880); + this.field_175317_i.drawTextBox(); + super.drawScreen(i, j, f); + } + + /**+ + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_175317_i.updateCursorCounter(); + super.updateScreen(); + } + + public void func_175304_a() { + this.field_175316_h.enabled = this.func_175305_g(); + } + + private boolean func_175305_g() { + return this.field_175311_g.field_178053_u > -1 && this.field_175311_g.field_178053_u < field_175310_f.size() + || this.field_175317_i.getText().length() > 1; + } + + static { + ChunkProviderSettings.Factory chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{ \"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":5000.0, \"mainNoiseScaleY\":1000.0, \"mainNoiseScaleZ\":5000.0, \"baseSize\":8.5, \"stretchY\":8.0, \"biomeDepthWeight\":2.0, \"biomeDepthOffset\":0.5, \"biomeScaleWeight\":2.0, \"biomeScaleOffset\":0.375, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":255 }"); + ResourceLocation resourcelocation = new ResourceLocation("textures/gui/presets/water.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.waterWorld", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{\"coordinateScale\":3000.0, \"heightScale\":6000.0, \"upperLimitScale\":250.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":80.0, \"mainNoiseScaleY\":160.0, \"mainNoiseScaleZ\":80.0, \"baseSize\":8.5, \"stretchY\":10.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":63 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/isles.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.isleLand", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":5000.0, \"mainNoiseScaleY\":1000.0, \"mainNoiseScaleZ\":5000.0, \"baseSize\":8.5, \"stretchY\":5.0, \"biomeDepthWeight\":2.0, \"biomeDepthOffset\":1.0, \"biomeScaleWeight\":4.0, \"biomeScaleOffset\":1.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":63 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/delight.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.caveDelight", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{\"coordinateScale\":738.41864, \"heightScale\":157.69133, \"upperLimitScale\":801.4267, \"lowerLimitScale\":1254.1643, \"depthNoiseScaleX\":374.93652, \"depthNoiseScaleZ\":288.65228, \"depthNoiseScaleExponent\":1.2092624, \"mainNoiseScaleX\":1355.9908, \"mainNoiseScaleY\":745.5343, \"mainNoiseScaleZ\":1183.464, \"baseSize\":1.8758626, \"stretchY\":1.7137525, \"biomeDepthWeight\":1.7553768, \"biomeDepthOffset\":3.4701107, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":2.535211, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":63 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/madness.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.mountains", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":1000.0, \"mainNoiseScaleY\":3000.0, \"mainNoiseScaleZ\":1000.0, \"baseSize\":8.5, \"stretchY\":10.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":20 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/drought.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.drought", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":2.0, \"lowerLimitScale\":64.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":80.0, \"mainNoiseScaleY\":160.0, \"mainNoiseScaleZ\":80.0, \"baseSize\":8.5, \"stretchY\":12.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":6 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/chaos.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.caveChaos", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory( + "{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":80.0, \"mainNoiseScaleY\":160.0, \"mainNoiseScaleZ\":80.0, \"baseSize\":8.5, \"stretchY\":12.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":true, \"seaLevel\":40 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/luck.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info( + I18n.format("createWorld.customize.custom.preset.goodLuck", new Object[0]), resourcelocation, + chunkprovidersettings$factory)); + } + + static class Info { + public String field_178955_a; + public ResourceLocation field_178953_b; + public ChunkProviderSettings.Factory field_178954_c; + + public Info(String parString1, ResourceLocation parResourceLocation, ChunkProviderSettings.Factory parFactory) { + this.field_178955_a = parString1; + this.field_178953_b = parResourceLocation; + this.field_178954_c = parFactory; + } + } + + class ListPreset extends GuiSlot { + public int field_178053_u = -1; + + public ListPreset() { + super(GuiScreenCustomizePresets.this.mc, GuiScreenCustomizePresets.this.width, + GuiScreenCustomizePresets.this.height, 80, GuiScreenCustomizePresets.this.height - 32, 38); + } + + protected int getSize() { + return GuiScreenCustomizePresets.field_175310_f.size(); + } + + protected void elementClicked(int i, boolean var2, int var3, int var4) { + this.field_178053_u = i; + GuiScreenCustomizePresets.this.func_175304_a(); + GuiScreenCustomizePresets.this.field_175317_i + .setText(((GuiScreenCustomizePresets.Info) GuiScreenCustomizePresets.field_175310_f + .get(GuiScreenCustomizePresets.this.field_175311_g.field_178053_u)).field_178954_c + .toString()); + } + + protected boolean isSelected(int i) { + return i == this.field_178053_u; + } + + protected void drawBackground() { + } + + private void func_178051_a(int parInt1, int parInt2, ResourceLocation parResourceLocation) { + int i = parInt1 + 5; + GuiScreenCustomizePresets.this.drawHorizontalLine(i - 1, i + 32, parInt2 - 1, -2039584); + GuiScreenCustomizePresets.this.drawHorizontalLine(i - 1, i + 32, parInt2 + 32, -6250336); + GuiScreenCustomizePresets.this.drawVerticalLine(i - 1, parInt2 - 1, parInt2 + 32, -2039584); + GuiScreenCustomizePresets.this.drawVerticalLine(i + 32, parInt2 - 1, parInt2 + 32, -6250336); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(parResourceLocation); + boolean flag = true; + boolean flag1 = true; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (i + 0), (double) (parInt2 + 32), 0.0D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos((double) (i + 32), (double) (parInt2 + 32), 0.0D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos((double) (i + 32), (double) (parInt2 + 0), 0.0D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos((double) (i + 0), (double) (parInt2 + 0), 0.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + } + + protected void drawSlot(int i, int j, int k, int var4, int var5, int var6) { + GuiScreenCustomizePresets.Info guiscreencustomizepresets$info = (GuiScreenCustomizePresets.Info) GuiScreenCustomizePresets.field_175310_f + .get(i); + this.func_178051_a(j, k, guiscreencustomizepresets$info.field_178953_b); + GuiScreenCustomizePresets.this.fontRendererObj.drawString(guiscreencustomizepresets$info.field_178955_a, + j + 32 + 10, k + 14, 16777215); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java b/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java index 7ee8ed3..0bd5c17 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java @@ -16,16 +16,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenOptionsSounds extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java b/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java index ea8e945..c66aef6 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java @@ -25,16 +25,18 @@ import net.minecraft.client.resources.ResourcePackRepository; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenResourcePacks extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java b/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java index a2a94fc..abf4469 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java @@ -11,16 +11,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenServerList extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java b/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java index 5e1ceda..c4d5875 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java @@ -8,16 +8,18 @@ import net.minecraft.util.IProgressUpdate; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenWorking extends GuiScreen implements IProgressUpdate { diff --git a/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java b/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java new file mode 100644 index 0000000..0a4dde3 --- /dev/null +++ b/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java @@ -0,0 +1,360 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; + +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANConnect; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANNotSupported; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.client.gui.GuiErrorScreen; +import net.minecraft.client.gui.GuiRenameWorld; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.SaveFormatComparator; +import org.apache.commons.lang3.StringUtils; + +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenBackupWorldSelection; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenCreateWorldSelection; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy; +import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 GuiSelectWorld extends GuiScreen implements GuiYesNoCallback { + private static final Logger logger = LogManager.getLogger(); + private final DateFormat field_146633_h = new SimpleDateFormat(); + protected GuiScreen parentScreen; + protected String field_146628_f = "Select world"; + private boolean field_146634_i; + private int field_146640_r; + private java.util.List field_146639_s; + private GuiSelectWorld.List field_146638_t; + private String field_146637_u; + private String field_146636_v; + private String[] field_146635_w = new String[4]; + private boolean field_146643_x; + private GuiButton deleteButton; + private GuiButton selectButton; + private GuiButton renameButton; + private GuiButton recreateButton; + private boolean hasRequestedWorlds = false; + private boolean waitingForWorlds = false; + + public GuiSelectWorld(GuiScreen parentScreenIn) { + this.parentScreen = parentScreenIn; + this.field_146639_s = new ArrayList(); + } + + /**+ + * Adds the buttons (and other controls) to the screen in + * question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + this.field_146628_f = I18n.format("selectWorld.title", new Object[0]); + this.field_146637_u = I18n.format("selectWorld.world", new Object[0]); + this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]); + this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]); + this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]); + this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", + new Object[0]); + this.field_146635_w[WorldSettings.GameType.SPECTATOR.getID()] = I18n.format("gameMode.spectator", + new Object[0]); + this.field_146638_t = new GuiSelectWorld.List(this.mc); + this.field_146638_t.registerScrollButtons(4, 5); + this.func_146618_g(); + } + + public void updateScreen() { + if (!hasRequestedWorlds && SingleplayerServerController.isReady()) { + hasRequestedWorlds = true; + waitingForWorlds = true; + this.mc.getSaveLoader().flushCache(); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.listingworlds", + "singleplayer.failed.listingworlds", () -> SingleplayerServerController.isReady(), (t, u) -> { + GuiScreenIntegratedServerBusy tt = (GuiScreenIntegratedServerBusy) t; + Minecraft.getMinecraft().displayGuiScreen( + GuiScreenIntegratedServerBusy.createException(parentScreen, tt.failMessage, u)); + })); + } else if (waitingForWorlds && SingleplayerServerController.isReady()) { + waitingForWorlds = false; + this.func_146627_h(); + } + } + + /**+ + * Handles mouse input. + */ + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.field_146638_t.handleMouseInput(); + } + + private void func_146627_h() { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + this.field_146639_s = isaveformat.getSaveList(); + Collections.sort(this.field_146639_s); + this.field_146640_r = -1; + } + + protected String func_146621_a(int parInt1) { + return ((SaveFormatComparator) this.field_146639_s.get(parInt1)).getFileName(); + } + + protected String func_146614_d(int parInt1) { + String s = ((SaveFormatComparator) this.field_146639_s.get(parInt1)).getDisplayName(); + if (StringUtils.isEmpty(s)) { + s = I18n.format("selectWorld.world", new Object[0]) + " " + (parInt1 + 1); + } + + return s; + } + + public void func_146618_g() { + this.buttonList.add(this.selectButton = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, + I18n.format("selectWorld.select", new Object[0]))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, + I18n.format("selectWorld.create", new Object[0]))); + this.buttonList.add(this.renameButton = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, + I18n.format("selectWorld.rename", new Object[0]))); + this.buttonList.add(this.deleteButton = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, + I18n.format("selectWorld.delete", new Object[0]))); + this.buttonList.add(this.recreateButton = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, + I18n.format("selectWorld.backup", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, + I18n.format("gui.cancel", new Object[0]))); + this.selectButton.enabled = false; + this.deleteButton.enabled = false; + this.renameButton.enabled = false; + this.recreateButton.enabled = false; + } + + /**+ + * Called by the controls from the buttonList when activated. + * (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton parGuiButton) { + if (parGuiButton.enabled) { + if (parGuiButton.id == 2) { + String s = this.func_146614_d(this.field_146640_r); + if (s != null) { + this.field_146643_x = true; + GuiYesNo guiyesno = func_152129_a(this, s, this.field_146640_r); + this.mc.displayGuiScreen(guiyesno); + } + } else if (parGuiButton.id == 1) { + this.func_146615_e(this.field_146640_r); + } else if (parGuiButton.id == 3) { + hasRequestedWorlds = false; // force refresh + this.mc.displayGuiScreen(new GuiScreenCreateWorldSelection(this)); + } else if (parGuiButton.id == 6) { + hasRequestedWorlds = false; // force refresh + this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.field_146640_r))); + } else if (parGuiButton.id == 0) { + this.mc.displayGuiScreen(this.parentScreen); + } else if (parGuiButton.id == 7) { + hasRequestedWorlds = false; // force refresh + this.mc.displayGuiScreen( + new GuiScreenBackupWorldSelection(this, this.func_146621_a(this.field_146640_r), + ((SaveFormatComparator) field_146639_s.get(this.field_146640_r)).levelDat)); + } else { + this.field_146638_t.actionPerformed(parGuiButton); + } + + } + } + + public void func_146615_e(int parInt1) { + this.mc.displayGuiScreen((GuiScreen) null); + if (!this.field_146634_i) { + this.field_146634_i = true; + String s = this.func_146621_a(parInt1); + if (s == null) { + s = "World" + parInt1; + } + + String s1 = this.func_146614_d(parInt1); + if (s1 == null) { + s1 = "World" + parInt1; + } + + if (this.mc.getSaveLoader().canLoadWorld(s)) { + this.mc.launchIntegratedServer(s, s1, (WorldSettings) null); + } + + } + } + + public void confirmClicked(boolean flag, int i) { + if (this.field_146643_x) { + this.field_146643_x = false; + if (flag) { + hasRequestedWorlds = false; // force refresh + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.deleteWorldDirectory(this.func_146621_a(i)); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting", + "singleplayer.failed.deleting", () -> SingleplayerServerController.isReady())); + } else { + this.mc.displayGuiScreen(this); + } + } + + } + + /**+ + * Draws the screen and all the components in it. Args : mouseX, + * mouseY, renderPartialTicks + */ + public void drawScreen(int i, int j, float f) { + this.field_146638_t.drawScreen(i, j, f); + this.drawCenteredString(this.fontRendererObj, this.field_146628_f, this.width / 2, 20, 16777215); + + GlStateManager.pushMatrix(); + GlStateManager.scale(0.75f, 0.75f, 0.75f); + + String text = I18n.format("directConnect.lanWorld"); + int w = mc.fontRendererObj.getStringWidth(text); + boolean hover = i > 1 && j > 1 && i < (w * 3 / 4) + 7 && j < 12; + if (hover) { + Mouse.showCursor(EnumCursorType.HAND); + } + + drawString(mc.fontRendererObj, EnumChatFormatting.UNDERLINE + text, 5, 5, hover ? 0xFFEEEE22 : 0xFFCCCCCC); + + GlStateManager.popMatrix(); + + super.drawScreen(i, j, f); + } + + @Override + public void mouseClicked(int xx, int yy, int btn) { + String text = I18n.format("directConnect.lanWorld"); + int w = mc.fontRendererObj.getStringWidth(text); + if (xx > 2 && yy > 2 && xx < (w * 3 / 4) + 5 && yy < 12) { + if (LANServerController.supported()) { + mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenLANConnect(this))); + } else { + mc.displayGuiScreen(new GuiScreenLANNotSupported(this)); + } + mc.getSoundHandler() + .playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } + super.mouseClicked(xx, yy, btn); + } + + public static GuiYesNo func_152129_a(GuiYesNoCallback parGuiYesNoCallback, String parString1, int parInt1) { + String s = I18n.format("selectWorld.deleteQuestion", new Object[0]); + String s1 = "\'" + parString1 + "\' " + I18n.format("selectWorld.deleteWarning", new Object[0]); + String s2 = I18n.format("selectWorld.deleteButton", new Object[0]); + String s3 = I18n.format("gui.cancel", new Object[0]); + GuiYesNo guiyesno = new GuiYesNo(parGuiYesNoCallback, s, s1, s2, s3, parInt1); + return guiyesno; + } + + class List extends GuiSlot { + public List(Minecraft mcIn) { + super(mcIn, GuiSelectWorld.this.width, GuiSelectWorld.this.height, 32, GuiSelectWorld.this.height - 64, 36); + } + + protected int getSize() { + return GuiSelectWorld.this.field_146639_s.size(); + } + + protected void elementClicked(int i, boolean flag, int var3, int var4) { + GuiSelectWorld.this.field_146640_r = i; + boolean flag1 = GuiSelectWorld.this.field_146640_r >= 0 + && GuiSelectWorld.this.field_146640_r < this.getSize(); + GuiSelectWorld.this.selectButton.enabled = flag1; + GuiSelectWorld.this.deleteButton.enabled = flag1; + GuiSelectWorld.this.renameButton.enabled = flag1; + GuiSelectWorld.this.recreateButton.enabled = flag1; + if (flag && flag1) { + GuiSelectWorld.this.func_146615_e(i); + } + + } + + protected boolean isSelected(int i) { + return i == GuiSelectWorld.this.field_146640_r; + } + + protected int getContentHeight() { + return GuiSelectWorld.this.field_146639_s.size() * 36; + } + + protected void drawBackground() { + GuiSelectWorld.this.drawDefaultBackground(); + } + + protected void drawSlot(int i, int j, int k, int var4, int var5, int var6) { + SaveFormatComparator saveformatcomparator = (SaveFormatComparator) GuiSelectWorld.this.field_146639_s + .get(i); + String s = saveformatcomparator.getDisplayName(); + if (StringUtils.isEmpty(s)) { + s = GuiSelectWorld.this.field_146637_u + " " + (i + 1); + } + + String s1 = saveformatcomparator.getFileName(); + s1 = s1 + " (" + + GuiSelectWorld.this.field_146633_h.format(new Date(saveformatcomparator.getLastTimePlayed())); + s1 = s1 + ")"; + String s2 = ""; + if (saveformatcomparator.requiresConversion()) { + s2 = GuiSelectWorld.this.field_146636_v + " " + s2; + } else { + s2 = GuiSelectWorld.this.field_146635_w[saveformatcomparator.getEnumGameType().getID()]; + if (saveformatcomparator.isHardcoreModeEnabled()) { + s2 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + + EnumChatFormatting.RESET; + } + + if (saveformatcomparator.getCheatsEnabled()) { + s2 = s2 + ", " + I18n.format("selectWorld.cheats", new Object[0]); + } + } + + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s, j + 2, k + 1, 16777215); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s1, j + 2, k + 12, 8421504); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s2, j + 2, k + 12 + 10, 8421504); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/GuiSleepMP.java b/src/main/java/net/minecraft/client/gui/GuiSleepMP.java index ca8d538..8481ec9 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSleepMP.java +++ b/src/main/java/net/minecraft/client/gui/GuiSleepMP.java @@ -10,16 +10,18 @@ import net.minecraft.network.play.client.C0BPacketEntityAction; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiSleepMP extends GuiChat { diff --git a/src/main/java/net/minecraft/client/gui/GuiSlider.java b/src/main/java/net/minecraft/client/gui/GuiSlider.java index 93ed525..452a947 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSlider.java +++ b/src/main/java/net/minecraft/client/gui/GuiSlider.java @@ -10,16 +10,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiSlider extends GuiButton { diff --git a/src/main/java/net/minecraft/client/gui/GuiSlot.java b/src/main/java/net/minecraft/client/gui/GuiSlot.java index 8f1a246..9661910 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSlot.java +++ b/src/main/java/net/minecraft/client/gui/GuiSlot.java @@ -3,6 +3,7 @@ package net.minecraft.client.gui; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -12,6 +13,26 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.MathHelper; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class GuiSlot { private static final Logger excLogger = LogManager.getLogger("GuiSlotRenderer"); @@ -99,7 +120,7 @@ public abstract class GuiSlot { * Return the height of the content being scrolled */ protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.headerPadding; + return (this.getSize() + 1) * this.slotHeight + this.headerPadding; } protected abstract void drawBackground(); @@ -226,7 +247,7 @@ public abstract class GuiSlot { this.drawListHeader(k, l, tessellator); } - this.drawSelectionBox(k, l, mouseXIn, mouseYIn); + this.drawSelectionBox(k, l, mouseXIn, mouseYIn, this.getSize()); GlStateManager.disableDepth(); byte b0 = 4; this.overlayBackground(0, this.top, 255, 255); @@ -401,11 +422,13 @@ public abstract class GuiSlot { /**+ * Draws the selection box around the selected slot element. */ - protected void drawSelectionBox(int mouseXIn, int mouseYIn, int parInt3, int parInt4) { - int i = this.getSize(); + protected void drawSelectionBox(int mouseXIn, int mouseYIn, int parInt3, int parInt4, int i) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int mx = Mouse.getX(); + int my = Mouse.getY(); + for (int j = 0; j < i; ++j) { int k = mouseYIn + j * this.slotHeight + this.headerPadding; int l = this.slotHeight - 4; @@ -437,6 +460,9 @@ public abstract class GuiSlot { .endVertex(); tessellator.draw(); GlStateManager.enableTexture2D(); + if (parInt3 >= i1 && parInt3 <= j1 && parInt4 >= k - 2 && parInt4 <= k + l + 1) { + Mouse.showCursor(EnumCursorType.HAND); + } } try { diff --git a/src/main/java/net/minecraft/client/gui/GuiSpectator.java b/src/main/java/net/minecraft/client/gui/GuiSpectator.java index c2d2a9d..7d46ce1 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSpectator.java +++ b/src/main/java/net/minecraft/client/gui/GuiSpectator.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiSpectator extends Gui implements ISpectatorMenuRecipient { diff --git a/src/main/java/net/minecraft/client/gui/GuiTextField.java b/src/main/java/net/minecraft/client/gui/GuiTextField.java index 3bdd549..3188810 100644 --- a/src/main/java/net/minecraft/client/gui/GuiTextField.java +++ b/src/main/java/net/minecraft/client/gui/GuiTextField.java @@ -19,16 +19,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiTextField extends Gui { @@ -67,7 +69,7 @@ public class GuiTextField extends Gui { private boolean visible = true; private GuiPageButtonList.GuiResponder field_175210_x; private Predicate field_175209_y = Predicates.alwaysTrue(); - + public boolean isTypingPassword = false; public GuiTextField(int componentId, FontRenderer fontrendererObj, int x, int y, int par5Width, int par6Height) { diff --git a/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java b/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java index 4305cab..cfee588 100644 --- a/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java +++ b/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java @@ -16,16 +16,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiUtilRenderComponents { diff --git a/src/main/java/net/minecraft/client/gui/GuiWinGame.java b/src/main/java/net/minecraft/client/gui/GuiWinGame.java index 533ec84..466a23d 100644 --- a/src/main/java/net/minecraft/client/gui/GuiWinGame.java +++ b/src/main/java/net/minecraft/client/gui/GuiWinGame.java @@ -30,16 +30,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiWinGame extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiYesNo.java b/src/main/java/net/minecraft/client/gui/GuiYesNo.java index 81fe161..265da66 100644 --- a/src/main/java/net/minecraft/client/gui/GuiYesNo.java +++ b/src/main/java/net/minecraft/client/gui/GuiYesNo.java @@ -12,16 +12,18 @@ import net.minecraft.client.resources.I18n; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiYesNo extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java b/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java index efe61a4..2eba26d 100644 --- a/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java +++ b/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java @@ -6,16 +6,18 @@ package net.minecraft.client.gui; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface GuiYesNoCallback { diff --git a/src/main/java/net/minecraft/client/gui/IProgressMeter.java b/src/main/java/net/minecraft/client/gui/IProgressMeter.java index 918c147..ec40c97 100644 --- a/src/main/java/net/minecraft/client/gui/IProgressMeter.java +++ b/src/main/java/net/minecraft/client/gui/IProgressMeter.java @@ -6,16 +6,18 @@ package net.minecraft.client.gui; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IProgressMeter { diff --git a/src/main/java/net/minecraft/client/gui/MapItemRenderer.java b/src/main/java/net/minecraft/client/gui/MapItemRenderer.java index 13a0c68..e94dfb2 100644 --- a/src/main/java/net/minecraft/client/gui/MapItemRenderer.java +++ b/src/main/java/net/minecraft/client/gui/MapItemRenderer.java @@ -23,16 +23,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MapItemRenderer { diff --git a/src/main/java/net/minecraft/client/gui/ScaledResolution.java b/src/main/java/net/minecraft/client/gui/ScaledResolution.java index 8c0bf62..b59333e 100644 --- a/src/main/java/net/minecraft/client/gui/ScaledResolution.java +++ b/src/main/java/net/minecraft/client/gui/ScaledResolution.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScaledResolution { diff --git a/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java b/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java index f278bdf..d53da9b 100644 --- a/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java +++ b/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java @@ -9,16 +9,18 @@ import net.minecraft.client.settings.GameSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScreenChatOptions extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java b/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java index 1bd01c3..809016c 100644 --- a/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java +++ b/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerListEntryNormal implements GuiListExtended.IGuiListEntry { @@ -40,7 +42,7 @@ public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry { private final Minecraft mc; private final ServerData field_148301_e; private String field_148299_g; - private long field_148298_f; + long field_148298_f; protected ServerListEntryNormal(GuiMultiplayer parGuiMultiplayer, ServerData parServerData) { this.field_148303_c = parGuiMultiplayer; diff --git a/src/main/java/net/minecraft/client/gui/ServerSelectionList.java b/src/main/java/net/minecraft/client/gui/ServerSelectionList.java index 246c2de..af520c5 100644 --- a/src/main/java/net/minecraft/client/gui/ServerSelectionList.java +++ b/src/main/java/net/minecraft/client/gui/ServerSelectionList.java @@ -4,8 +4,12 @@ import java.util.List; import com.google.common.collect.Lists; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerList; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.resources.I18n; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -13,16 +17,18 @@ import net.minecraft.client.multiplayer.ServerList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerSelectionList extends GuiListExtended { @@ -30,21 +36,44 @@ public class ServerSelectionList extends GuiListExtended { private final List field_148198_l = Lists.newArrayList(); private int selectedSlotIndex = -1; + private final ServerListEntryNormal serverListEntryLAN; + public ServerSelectionList(GuiMultiplayer ownerIn, Minecraft mcIn, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn) { super(mcIn, widthIn, heightIn, topIn, bottomIn, slotHeightIn); this.owner = ownerIn; + this.serverListEntryLAN = new ServerListEntryNormal(owner, null) { + @Override + public void drawEntry(int i, int j, int k, int l, int var5, int i1, int j1, boolean flag) { + // + } + + @Override + public boolean mousePressed(int i, int var2, int var3, int var4, int j, int k) { + if (ServerSelectionList.this.selectedSlotIndex != i) { + super.field_148298_f = 0; + } + return super.mousePressed(i, var2, var3, var4, Math.max(j, 32), k); + } + }; } /**+ * Gets the IGuiListEntry object for the given index */ public GuiListExtended.IGuiListEntry getListEntry(int i) { - return (GuiListExtended.IGuiListEntry) this.field_148198_l.get(i); + if (i < getOrigSize()) { + return (GuiListExtended.IGuiListEntry) this.field_148198_l.get(i); + } + return serverListEntryLAN; + } + + protected int getOrigSize() { + return this.field_148198_l.size(); } protected int getSize() { - return this.field_148198_l.size(); + return this.field_148198_l.size() + GuiMultiplayer.getLanServerList().countServers(); } public void setSelectedSlotIndex(int selectedSlotIndexIn) { @@ -81,4 +110,66 @@ public class ServerSelectionList extends GuiListExtended { public int getListWidth() { return super.getListWidth() + 85; } + + @Override + protected void drawSelectionBox(int mouseXIn, int mouseYIn, int parInt3, int parInt4, int i) { + super.drawSelectionBox(mouseXIn, mouseYIn, parInt3, parInt4, i + 1); + } + + @Override + protected void drawSlot(int entryID, int mouseXIn, int mouseYIn, int parInt4, int parInt5, int parInt6) { + if (entryID < getOrigSize()) { + super.drawSlot(entryID, mouseXIn, mouseYIn, parInt4, parInt5, parInt6); + } else if (entryID < getSize()) { + this.func_77248_b(entryID, mouseXIn, mouseYIn, parInt4); + } else { + this.func_77249_c(entryID, mouseXIn, mouseYIn, parInt4); + } + } + + private void func_77248_b(int par1, int par2, int par3, int par4) { + LANServerList.LanServer var6 = GuiMultiplayer.getLanServerList().getServer(par1 - getOrigSize()); + this.owner.drawString(this.owner.fontRendererObj, I18n.format("lanServer.title"), par2 + 2, par3 + 1, 16777215); + this.owner.drawString(this.owner.fontRendererObj, var6.getLanServerMotd(), par2 + 2, par3 + 12, 8421504); + + if (this.owner.mc.gameSettings.hideServerAddress) { + this.owner.drawString(this.owner.fontRendererObj, I18n.format("selectServer.hiddenAddress"), par2 + 2, + par3 + 12 + 11, 3158064); + } else { + this.owner.drawString(this.owner.fontRendererObj, var6.getLanServerCode(), par2 + 2, par3 + 12 + 11, + 0x558822); + } + } + + private void func_77249_c(int par1, int par2, int par3, int par4) { + if (!LANServerController.supported()) + return; + if (RelayManager.relayManager.count() == 0) { + this.owner.drawCenteredString(this.owner.fontRendererObj, I18n.format("noRelay.noRelay1"), + this.owner.width / 2, par3 + 6, 16777215); + this.owner.drawCenteredString(this.owner.fontRendererObj, I18n.format("noRelay.noRelay2"), + this.owner.width / 2, par3 + 18, 0xFFAAAAAA); + } else { + this.owner.drawCenteredString(this.owner.fontRendererObj, I18n.format("lanServer.scanning"), + this.owner.width / 2, par3 + 6, 16777215); + String var6; + + switch (this.owner.ticksOpened / 3 % 4) { + case 0: + default: + var6 = "O o o"; + break; + + case 1: + case 3: + var6 = "o O o"; + break; + + case 2: + var6 = "o o O"; + } + + this.owner.drawCenteredString(this.owner.fontRendererObj, var6, this.owner.width / 2, par3 + 18, 8421504); + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java b/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java index aa23c8b..e7c2014 100644 --- a/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java +++ b/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java @@ -18,16 +18,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiAchievement extends Gui { diff --git a/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java b/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java index 06ad0b2..980625f 100644 --- a/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java +++ b/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java @@ -31,16 +31,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiAchievements extends GuiScreen implements IProgressMeter { diff --git a/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java b/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java index eac927d..fced65a 100644 --- a/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java +++ b/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java @@ -36,16 +36,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiStats extends GuiScreen implements IProgressMeter { diff --git a/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java b/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java index 24cbc4b..51260b5 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java +++ b/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java @@ -14,16 +14,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CreativeCrafting implements ICrafting { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java b/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java index a563e02..ccd1e88 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java @@ -1,6 +1,8 @@ package net.minecraft.client.gui.inventory; import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; +import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -26,16 +28,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiBeacon extends GuiContainer { @@ -253,6 +257,8 @@ public class GuiBeacon extends GuiContainer { } public void drawButtonForegroundLayer(int i, int j) { + if (this.enabled) + Mouse.showCursor(EnumCursorType.HAND); GuiBeacon.this.drawCreativeTabHoveringText(I18n.format("gui.cancel", new Object[0]), i, j); } } @@ -263,6 +269,8 @@ public class GuiBeacon extends GuiContainer { } public void drawButtonForegroundLayer(int i, int j) { + if (this.enabled) + Mouse.showCursor(EnumCursorType.HAND); GuiBeacon.this.drawCreativeTabHoveringText(I18n.format("gui.done", new Object[0]), i, j); } } @@ -280,6 +288,8 @@ public class GuiBeacon extends GuiContainer { } public void drawButtonForegroundLayer(int i, int j) { + if (this.enabled) + Mouse.showCursor(EnumCursorType.HAND); String s = I18n.format(Potion.potionTypes[this.field_146149_p].getName(), new Object[0]); if (this.field_146148_q >= 3 && this.field_146149_p != Potion.regeneration.id) { s = s + " II"; diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java b/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java index 67af14d..c32a491 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiBrewingStand extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java b/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java index 94dfc4a..0cbc13a 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiChest extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java b/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java index 41eba29..110e7bd 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java @@ -21,6 +21,26 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class GuiContainer extends GuiScreen { /**+ * The location of the inventory background texture diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java b/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java index 4c36895..ea2d3af 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java @@ -9,6 +9,7 @@ import com.google.common.collect.Lists; import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; @@ -40,16 +41,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiContainerCreative extends InventoryEffectRenderer { @@ -519,6 +522,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer { for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) { if (this.renderCreativeInventoryHoveringText(creativetabs, i, j)) { + Mouse.showCursor(EnumCursorType.HAND); break; } } diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java b/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java index 1f923ac..adafe9c 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiCrafting extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java b/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java index 1bb4209..2ec59da 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiDispenser extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java b/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java index 72f3da2..e4d0f13 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java @@ -20,16 +20,18 @@ import net.minecraft.util.ChatComponentText; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiEditSign extends GuiScreen { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java b/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java index c441381..893879e 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiFurnace extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java b/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java index 8410934..fbe6958 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java @@ -19,16 +19,18 @@ import net.minecraft.entity.player.EntityPlayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiInventory extends InventoryEffectRenderer { diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java b/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java index 9c99f6c..497462e 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiScreenHorseInventory extends GuiContainer { diff --git a/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java b/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java index cc0d25e..2289222 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java +++ b/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java @@ -15,16 +15,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BaseSpectatorGroup implements ISpectatorMenuView { diff --git a/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java b/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java index cd5a117..fff4a51 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java +++ b/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISpectatorMenuObject { diff --git a/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java b/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java index 12392c5..f5363a6 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java +++ b/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java @@ -6,16 +6,18 @@ package net.minecraft.client.gui.spectator; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISpectatorMenuRecipient { diff --git a/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java b/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java index 27baffb..18e3f9e 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java +++ b/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java @@ -10,16 +10,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISpectatorMenuView { diff --git a/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java b/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java index 64fec93..74799a3 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java +++ b/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java @@ -16,16 +16,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlayerMenuObject implements ISpectatorMenuObject { diff --git a/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java b/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java index 8619067..5a2bd1c 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java +++ b/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java @@ -19,16 +19,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SpectatorMenu { diff --git a/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java b/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java index e49a0b0..07ea062 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java +++ b/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java @@ -14,16 +14,18 @@ import net.minecraft.client.gui.spectator.SpectatorMenu; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SpectatorDetails { diff --git a/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java b/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java index 0d42777..af39aaa 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java +++ b/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java @@ -26,16 +26,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TeleportToPlayer implements ISpectatorMenuView, ISpectatorMenuObject { diff --git a/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java b/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java index 35ccda3..f9fd619 100644 --- a/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java +++ b/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java @@ -28,16 +28,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TeleportToTeam implements ISpectatorMenuView, ISpectatorMenuObject { diff --git a/src/main/java/net/minecraft/client/main/GameConfiguration.java b/src/main/java/net/minecraft/client/main/GameConfiguration.java index 39d6941..0c04496 100644 --- a/src/main/java/net/minecraft/client/main/GameConfiguration.java +++ b/src/main/java/net/minecraft/client/main/GameConfiguration.java @@ -8,16 +8,18 @@ import net.minecraft.util.Session; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GameConfiguration { diff --git a/src/main/java/net/minecraft/client/main/Main.java b/src/main/java/net/minecraft/client/main/Main.java index e097a2f..746875d 100644 --- a/src/main/java/net/minecraft/client/main/Main.java +++ b/src/main/java/net/minecraft/client/main/Main.java @@ -10,16 +10,18 @@ import net.minecraft.util.Session; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Main { diff --git a/src/main/java/net/minecraft/client/model/ModelArmorStand.java b/src/main/java/net/minecraft/client/model/ModelArmorStand.java index a75a95f..6ace0e6 100644 --- a/src/main/java/net/minecraft/client/model/ModelArmorStand.java +++ b/src/main/java/net/minecraft/client/model/ModelArmorStand.java @@ -10,16 +10,18 @@ import net.minecraft.entity.item.EntityArmorStand; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelArmorStand extends ModelArmorStandArmor { diff --git a/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java b/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java index bf63666..00bfd91 100644 --- a/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java +++ b/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java @@ -9,16 +9,18 @@ import net.minecraft.entity.item.EntityArmorStand; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelArmorStandArmor extends ModelBiped { diff --git a/src/main/java/net/minecraft/client/model/ModelBanner.java b/src/main/java/net/minecraft/client/model/ModelBanner.java index 047d8f7..c0e0276 100644 --- a/src/main/java/net/minecraft/client/model/ModelBanner.java +++ b/src/main/java/net/minecraft/client/model/ModelBanner.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBanner extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelBase.java b/src/main/java/net/minecraft/client/model/ModelBase.java index a3453d8..7879f6b 100644 --- a/src/main/java/net/minecraft/client/model/ModelBase.java +++ b/src/main/java/net/minecraft/client/model/ModelBase.java @@ -10,6 +10,26 @@ import com.google.common.collect.Maps; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class ModelBase { public float swingProgress; public boolean isRiding; diff --git a/src/main/java/net/minecraft/client/model/ModelBat.java b/src/main/java/net/minecraft/client/model/ModelBat.java index 76b497f..f88fecb 100644 --- a/src/main/java/net/minecraft/client/model/ModelBat.java +++ b/src/main/java/net/minecraft/client/model/ModelBat.java @@ -10,16 +10,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBat extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelBiped.java b/src/main/java/net/minecraft/client/model/ModelBiped.java index c7d4ee6..ef86417 100644 --- a/src/main/java/net/minecraft/client/model/ModelBiped.java +++ b/src/main/java/net/minecraft/client/model/ModelBiped.java @@ -10,16 +10,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBiped extends ModelBase { @@ -34,7 +36,6 @@ public class ModelBiped extends ModelBase { public int heldItemRight; public boolean isSneak; public boolean aimedBow; - public ModelRenderer bipedCloak; public ModelBiped() { this(0.0F); @@ -47,8 +48,6 @@ public class ModelBiped extends ModelBase { public ModelBiped(float modelSize, float parFloat1, int textureWidthIn, int textureHeightIn) { this.textureWidth = textureWidthIn; this.textureHeight = textureHeightIn; - this.bipedCloak = new ModelRenderer(this, 0, 0); - this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, modelSize); this.bipedHead = new ModelRenderer(this, 0, 0); this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, modelSize); this.bipedHead.setRotationPoint(0.0F, 0.0F + parFloat1, 0.0F); @@ -252,11 +251,4 @@ public class ModelBiped extends ModelBase { public void postRenderArm(float f) { this.bipedRightArm.postRender(f); } - - /** - * Renders the cloak of the current biped (in most cases, it's a player) - */ - public void renderCloak(float par1) { - this.bipedCloak.render(par1); - } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/model/ModelBlaze.java b/src/main/java/net/minecraft/client/model/ModelBlaze.java index 11e242a..d923a37 100644 --- a/src/main/java/net/minecraft/client/model/ModelBlaze.java +++ b/src/main/java/net/minecraft/client/model/ModelBlaze.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBlaze extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelBoat.java b/src/main/java/net/minecraft/client/model/ModelBoat.java index 81d0f86..912d6e4 100644 --- a/src/main/java/net/minecraft/client/model/ModelBoat.java +++ b/src/main/java/net/minecraft/client/model/ModelBoat.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBoat extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelBook.java b/src/main/java/net/minecraft/client/model/ModelBook.java index 4457fce..97a6414 100644 --- a/src/main/java/net/minecraft/client/model/ModelBook.java +++ b/src/main/java/net/minecraft/client/model/ModelBook.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBook extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelBox.java b/src/main/java/net/minecraft/client/model/ModelBox.java index fae3404..61849ed 100644 --- a/src/main/java/net/minecraft/client/model/ModelBox.java +++ b/src/main/java/net/minecraft/client/model/ModelBox.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBox { diff --git a/src/main/java/net/minecraft/client/model/ModelChest.java b/src/main/java/net/minecraft/client/model/ModelChest.java index 62bc825..7dc1ac4 100644 --- a/src/main/java/net/minecraft/client/model/ModelChest.java +++ b/src/main/java/net/minecraft/client/model/ModelChest.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelChest extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelChicken.java b/src/main/java/net/minecraft/client/model/ModelChicken.java index 33a8c42..230d12d 100644 --- a/src/main/java/net/minecraft/client/model/ModelChicken.java +++ b/src/main/java/net/minecraft/client/model/ModelChicken.java @@ -10,16 +10,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelChicken extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelCow.java b/src/main/java/net/minecraft/client/model/ModelCow.java index 8762d9d..a4b6b1a 100644 --- a/src/main/java/net/minecraft/client/model/ModelCow.java +++ b/src/main/java/net/minecraft/client/model/ModelCow.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelCow extends ModelQuadruped { diff --git a/src/main/java/net/minecraft/client/model/ModelCreeper.java b/src/main/java/net/minecraft/client/model/ModelCreeper.java index 3336447..3a8ceca 100644 --- a/src/main/java/net/minecraft/client/model/ModelCreeper.java +++ b/src/main/java/net/minecraft/client/model/ModelCreeper.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelCreeper extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelDragon.java b/src/main/java/net/minecraft/client/model/ModelDragon.java index 5b4f3d9..428805b 100644 --- a/src/main/java/net/minecraft/client/model/ModelDragon.java +++ b/src/main/java/net/minecraft/client/model/ModelDragon.java @@ -14,16 +14,18 @@ import net.minecraft.entity.boss.EntityDragon; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelDragon extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java b/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java index 549fa3d..c66ecc4 100644 --- a/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java +++ b/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java @@ -9,16 +9,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelEnderCrystal extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelEnderMite.java b/src/main/java/net/minecraft/client/model/ModelEnderMite.java index cf803b3..382151e 100644 --- a/src/main/java/net/minecraft/client/model/ModelEnderMite.java +++ b/src/main/java/net/minecraft/client/model/ModelEnderMite.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelEnderMite extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelEnderman.java b/src/main/java/net/minecraft/client/model/ModelEnderman.java index 028ac04..638d8cc 100644 --- a/src/main/java/net/minecraft/client/model/ModelEnderman.java +++ b/src/main/java/net/minecraft/client/model/ModelEnderman.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelEnderman extends ModelBiped { diff --git a/src/main/java/net/minecraft/client/model/ModelGhast.java b/src/main/java/net/minecraft/client/model/ModelGhast.java index 513190e..ca4af99 100644 --- a/src/main/java/net/minecraft/client/model/ModelGhast.java +++ b/src/main/java/net/minecraft/client/model/ModelGhast.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelGhast extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelGuardian.java b/src/main/java/net/minecraft/client/model/ModelGuardian.java index 10918c8..6d3ac9d 100644 --- a/src/main/java/net/minecraft/client/model/ModelGuardian.java +++ b/src/main/java/net/minecraft/client/model/ModelGuardian.java @@ -12,16 +12,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelGuardian extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelHorse.java b/src/main/java/net/minecraft/client/model/ModelHorse.java index a746ad0..ea1e68f 100644 --- a/src/main/java/net/minecraft/client/model/ModelHorse.java +++ b/src/main/java/net/minecraft/client/model/ModelHorse.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelHorse extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java b/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java index b168d5e..a352e61 100644 --- a/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java +++ b/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelHumanoidHead extends ModelSkeletonHead { diff --git a/src/main/java/net/minecraft/client/model/ModelIronGolem.java b/src/main/java/net/minecraft/client/model/ModelIronGolem.java index 0f708dd..4d71f43 100644 --- a/src/main/java/net/minecraft/client/model/ModelIronGolem.java +++ b/src/main/java/net/minecraft/client/model/ModelIronGolem.java @@ -10,16 +10,18 @@ import net.minecraft.entity.monster.EntityIronGolem; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelIronGolem extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelLargeChest.java b/src/main/java/net/minecraft/client/model/ModelLargeChest.java index 40cf296..c522654 100644 --- a/src/main/java/net/minecraft/client/model/ModelLargeChest.java +++ b/src/main/java/net/minecraft/client/model/ModelLargeChest.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelLargeChest extends ModelChest { diff --git a/src/main/java/net/minecraft/client/model/ModelLeashKnot.java b/src/main/java/net/minecraft/client/model/ModelLeashKnot.java index bcf083e..717155d 100644 --- a/src/main/java/net/minecraft/client/model/ModelLeashKnot.java +++ b/src/main/java/net/minecraft/client/model/ModelLeashKnot.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelLeashKnot extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelMagmaCube.java b/src/main/java/net/minecraft/client/model/ModelMagmaCube.java index 7197a72..94afee3 100644 --- a/src/main/java/net/minecraft/client/model/ModelMagmaCube.java +++ b/src/main/java/net/minecraft/client/model/ModelMagmaCube.java @@ -10,16 +10,18 @@ import net.minecraft.entity.monster.EntityMagmaCube; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelMagmaCube extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelMinecart.java b/src/main/java/net/minecraft/client/model/ModelMinecart.java index 0d38fb3..3d4676c 100644 --- a/src/main/java/net/minecraft/client/model/ModelMinecart.java +++ b/src/main/java/net/minecraft/client/model/ModelMinecart.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelMinecart extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelOcelot.java b/src/main/java/net/minecraft/client/model/ModelOcelot.java index 5170894..a479453 100644 --- a/src/main/java/net/minecraft/client/model/ModelOcelot.java +++ b/src/main/java/net/minecraft/client/model/ModelOcelot.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelOcelot extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelPig.java b/src/main/java/net/minecraft/client/model/ModelPig.java index bd1bda0..a3f4e26 100644 --- a/src/main/java/net/minecraft/client/model/ModelPig.java +++ b/src/main/java/net/minecraft/client/model/ModelPig.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelPig extends ModelQuadruped { diff --git a/src/main/java/net/minecraft/client/model/ModelPlayer.java b/src/main/java/net/minecraft/client/model/ModelPlayer.java index 3763910..7be4264 100644 --- a/src/main/java/net/minecraft/client/model/ModelPlayer.java +++ b/src/main/java/net/minecraft/client/model/ModelPlayer.java @@ -9,16 +9,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelPlayer extends ModelBiped { diff --git a/src/main/java/net/minecraft/client/model/ModelQuadruped.java b/src/main/java/net/minecraft/client/model/ModelQuadruped.java index 555e02f..f785c78 100644 --- a/src/main/java/net/minecraft/client/model/ModelQuadruped.java +++ b/src/main/java/net/minecraft/client/model/ModelQuadruped.java @@ -10,16 +10,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelQuadruped extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelRabbit.java b/src/main/java/net/minecraft/client/model/ModelRabbit.java index 7499d97..67d394f 100644 --- a/src/main/java/net/minecraft/client/model/ModelRabbit.java +++ b/src/main/java/net/minecraft/client/model/ModelRabbit.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelRabbit extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelRenderer.java b/src/main/java/net/minecraft/client/model/ModelRenderer.java index 73e2900..c8981fc 100644 --- a/src/main/java/net/minecraft/client/model/ModelRenderer.java +++ b/src/main/java/net/minecraft/client/model/ModelRenderer.java @@ -18,16 +18,18 @@ import net.minecraft.client.renderer.Tessellator; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelRenderer { diff --git a/src/main/java/net/minecraft/client/model/ModelSheep1.java b/src/main/java/net/minecraft/client/model/ModelSheep1.java index ca17233..2ec77df 100644 --- a/src/main/java/net/minecraft/client/model/ModelSheep1.java +++ b/src/main/java/net/minecraft/client/model/ModelSheep1.java @@ -10,16 +10,18 @@ import net.minecraft.entity.passive.EntitySheep; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSheep1 extends ModelQuadruped { diff --git a/src/main/java/net/minecraft/client/model/ModelSheep2.java b/src/main/java/net/minecraft/client/model/ModelSheep2.java index 9ee0f5b..e7a7e90 100644 --- a/src/main/java/net/minecraft/client/model/ModelSheep2.java +++ b/src/main/java/net/minecraft/client/model/ModelSheep2.java @@ -10,16 +10,18 @@ import net.minecraft.entity.passive.EntitySheep; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSheep2 extends ModelQuadruped { diff --git a/src/main/java/net/minecraft/client/model/ModelSign.java b/src/main/java/net/minecraft/client/model/ModelSign.java index 683a9c6..fd6ebfc 100644 --- a/src/main/java/net/minecraft/client/model/ModelSign.java +++ b/src/main/java/net/minecraft/client/model/ModelSign.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSign extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelSilverfish.java b/src/main/java/net/minecraft/client/model/ModelSilverfish.java index ca47d58..5fc9233 100644 --- a/src/main/java/net/minecraft/client/model/ModelSilverfish.java +++ b/src/main/java/net/minecraft/client/model/ModelSilverfish.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSilverfish extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelSkeleton.java b/src/main/java/net/minecraft/client/model/ModelSkeleton.java index bd9ad66..e1d16ae 100644 --- a/src/main/java/net/minecraft/client/model/ModelSkeleton.java +++ b/src/main/java/net/minecraft/client/model/ModelSkeleton.java @@ -10,16 +10,18 @@ import net.minecraft.entity.monster.EntitySkeleton; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSkeleton extends ModelZombie { diff --git a/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java b/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java index 7e9b16b..ba1aec6 100644 --- a/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java +++ b/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSkeletonHead extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelSlime.java b/src/main/java/net/minecraft/client/model/ModelSlime.java index c531a61..d1e64cb 100644 --- a/src/main/java/net/minecraft/client/model/ModelSlime.java +++ b/src/main/java/net/minecraft/client/model/ModelSlime.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSlime extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelSnowMan.java b/src/main/java/net/minecraft/client/model/ModelSnowMan.java index 7d293c3..f91f405 100644 --- a/src/main/java/net/minecraft/client/model/ModelSnowMan.java +++ b/src/main/java/net/minecraft/client/model/ModelSnowMan.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSnowMan extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelSpider.java b/src/main/java/net/minecraft/client/model/ModelSpider.java index dc8efa6..b04aec8 100644 --- a/src/main/java/net/minecraft/client/model/ModelSpider.java +++ b/src/main/java/net/minecraft/client/model/ModelSpider.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSpider extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelSquid.java b/src/main/java/net/minecraft/client/model/ModelSquid.java index fac4464..81071c8 100644 --- a/src/main/java/net/minecraft/client/model/ModelSquid.java +++ b/src/main/java/net/minecraft/client/model/ModelSquid.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelSquid extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelVillager.java b/src/main/java/net/minecraft/client/model/ModelVillager.java index f822263..e6b70aa 100644 --- a/src/main/java/net/minecraft/client/model/ModelVillager.java +++ b/src/main/java/net/minecraft/client/model/ModelVillager.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelVillager extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelWitch.java b/src/main/java/net/minecraft/client/model/ModelWitch.java index 25f595b..f7defc4 100644 --- a/src/main/java/net/minecraft/client/model/ModelWitch.java +++ b/src/main/java/net/minecraft/client/model/ModelWitch.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelWitch extends ModelVillager { diff --git a/src/main/java/net/minecraft/client/model/ModelWither.java b/src/main/java/net/minecraft/client/model/ModelWither.java index f016d45..178f65a 100644 --- a/src/main/java/net/minecraft/client/model/ModelWither.java +++ b/src/main/java/net/minecraft/client/model/ModelWither.java @@ -11,16 +11,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelWither extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelWolf.java b/src/main/java/net/minecraft/client/model/ModelWolf.java index 4399249..ff4fff3 100644 --- a/src/main/java/net/minecraft/client/model/ModelWolf.java +++ b/src/main/java/net/minecraft/client/model/ModelWolf.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelWolf extends ModelBase { diff --git a/src/main/java/net/minecraft/client/model/ModelZombie.java b/src/main/java/net/minecraft/client/model/ModelZombie.java index 4ceba8d..b8e8ff8 100644 --- a/src/main/java/net/minecraft/client/model/ModelZombie.java +++ b/src/main/java/net/minecraft/client/model/ModelZombie.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelZombie extends ModelBiped { diff --git a/src/main/java/net/minecraft/client/model/ModelZombieVillager.java b/src/main/java/net/minecraft/client/model/ModelZombieVillager.java index 5e5155a..0a81507 100644 --- a/src/main/java/net/minecraft/client/model/ModelZombieVillager.java +++ b/src/main/java/net/minecraft/client/model/ModelZombieVillager.java @@ -9,16 +9,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelZombieVillager extends ModelBiped { diff --git a/src/main/java/net/minecraft/client/model/PositionTextureVertex.java b/src/main/java/net/minecraft/client/model/PositionTextureVertex.java index a45d69b..b15f64a 100644 --- a/src/main/java/net/minecraft/client/model/PositionTextureVertex.java +++ b/src/main/java/net/minecraft/client/model/PositionTextureVertex.java @@ -8,16 +8,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PositionTextureVertex { diff --git a/src/main/java/net/minecraft/client/model/TextureOffset.java b/src/main/java/net/minecraft/client/model/TextureOffset.java index 885dd73..0ce0bae 100644 --- a/src/main/java/net/minecraft/client/model/TextureOffset.java +++ b/src/main/java/net/minecraft/client/model/TextureOffset.java @@ -6,16 +6,18 @@ package net.minecraft.client.model; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureOffset { diff --git a/src/main/java/net/minecraft/client/model/TexturedQuad.java b/src/main/java/net/minecraft/client/model/TexturedQuad.java index 796c842..3c7c9c8 100644 --- a/src/main/java/net/minecraft/client/model/TexturedQuad.java +++ b/src/main/java/net/minecraft/client/model/TexturedQuad.java @@ -11,16 +11,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TexturedQuad { diff --git a/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java b/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java index 6b52615..ab6bf8d 100644 --- a/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ b/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java @@ -24,16 +24,18 @@ import net.minecraft.world.chunk.IChunkProvider; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChunkProviderClient implements IChunkProvider { diff --git a/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java b/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java index cf90e3a..bed1938 100644 --- a/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java +++ b/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java @@ -26,16 +26,18 @@ import net.minecraft.util.ChatComponentText; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GuiConnecting extends GuiScreen { @@ -131,6 +133,10 @@ public class GuiConnecting extends GuiScreen { if (ConnectionHandshake.attemptHandshake(this.mc, this, previousGuiScreen, currentPassword, allowPlaintext)) { logger.info("Handshake Success"); + this.networkManager.setPluginInfo(ConnectionHandshake.pluginBrand, + ConnectionHandshake.pluginVersion); + mc.bungeeOutdatedMsgTimer = 80; + mc.clearTitles(); this.networkManager.setConnectionState(EnumConnectionState.PLAY); this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, previousGuiScreen, this.networkManager, this.mc.getSession().getProfile())); diff --git a/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java b/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java index c477cfe..2d73c1f 100644 --- a/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java +++ b/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -39,16 +39,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlayerControllerMP { diff --git a/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java b/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java index 7994d01..528ff6b 100644 --- a/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java +++ b/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java @@ -6,16 +6,18 @@ package net.minecraft.client.multiplayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerAddress { diff --git a/src/main/java/net/minecraft/client/multiplayer/ServerData.java b/src/main/java/net/minecraft/client/multiplayer/ServerData.java index 5a33431..08ece32 100644 --- a/src/main/java/net/minecraft/client/multiplayer/ServerData.java +++ b/src/main/java/net/minecraft/client/multiplayer/ServerData.java @@ -22,16 +22,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerData { diff --git a/src/main/java/net/minecraft/client/multiplayer/ServerList.java b/src/main/java/net/minecraft/client/multiplayer/ServerList.java index 7666832..89195c3 100644 --- a/src/main/java/net/minecraft/client/multiplayer/ServerList.java +++ b/src/main/java/net/minecraft/client/multiplayer/ServerList.java @@ -16,6 +16,7 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.socket.AddressResolver; import net.lax1dude.eaglercraft.v1_8.socket.RateLimitTracker; import net.lax1dude.eaglercraft.v1_8.socket.ServerQueryDispatch; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.nbt.CompressedStreamTools; @@ -29,16 +30,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerList { diff --git a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java index 306c203..4595ccd 100644 --- a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java +++ b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import net.PeytonPlayz585.shadow.gui.GuiSecretMainMenu; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; @@ -16,6 +16,7 @@ import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; import net.lax1dude.eaglercraft.v1_8.profile.ServerSkinCache; import net.lax1dude.eaglercraft.v1_8.profile.SkinPackets; import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; @@ -213,16 +214,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NetHandlerPlayClient implements INetHandlerPlayClient { @@ -714,14 +717,11 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient { this.gameController.loadWorld((WorldClient) null); } if (this.guiScreenServer != null) { - this.gameController - .displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", ichatcomponent)); + this.gameController.shutdownIntegratedServer( + new GuiDisconnected(this.guiScreenServer, "disconnect.lost", ichatcomponent)); } else { - if(!Minecraft.getMinecraft().gameSettings.secret) { - this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", ichatcomponent)); - } else { - this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiSecretMainMenu()), "disconnect.lost", ichatcomponent)); - } + this.gameController.shutdownIntegratedServer( + new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", ichatcomponent)); } } @@ -1535,6 +1535,18 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient { logger.error("Couldn't read EAG|Skins-1.8 packet!"); logger.error(e); } + } else if ("EAG|UpdateCert-1.8".equals(packetIn.getChannelName())) { + if (EagRuntime.getConfiguration().allowUpdateSvc()) { + try { + PacketBuffer pb = packetIn.getBufferData(); + byte[] c = new byte[pb.readableBytes()]; + pb.readBytes(c); + UpdateService.addCertificateToSet(c); + } catch (Throwable e) { + logger.error("Couldn't process EAG|UpdateCert-1.8 packet!"); + logger.error(e); + } + } } } diff --git a/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java b/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java index 0b84126..bf5d0dd 100644 --- a/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java +++ b/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java @@ -18,16 +18,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NetworkPlayerInfo { diff --git a/src/main/java/net/minecraft/client/particle/Barrier.java b/src/main/java/net/minecraft/client/particle/Barrier.java index 88bee31..ce860d6 100644 --- a/src/main/java/net/minecraft/client/particle/Barrier.java +++ b/src/main/java/net/minecraft/client/particle/Barrier.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Barrier extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EffectRenderer.java b/src/main/java/net/minecraft/client/particle/EffectRenderer.java index 723b606..2584ab1 100644 --- a/src/main/java/net/minecraft/client/particle/EffectRenderer.java +++ b/src/main/java/net/minecraft/client/particle/EffectRenderer.java @@ -43,16 +43,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EffectRenderer { diff --git a/src/main/java/net/minecraft/client/particle/EntityAuraFX.java b/src/main/java/net/minecraft/client/particle/EntityAuraFX.java index 638c94c..2b40790 100644 --- a/src/main/java/net/minecraft/client/particle/EntityAuraFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityAuraFX.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityAuraFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java b/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java index ca3c7d3..32a52ce 100644 --- a/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBlockDustFX extends EntityDiggingFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java b/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java index d14349e..9d1d921 100644 --- a/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBreakingFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java b/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java index f383975..cf904c5 100644 --- a/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBubbleFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityCloudFX.java b/src/main/java/net/minecraft/client/particle/EntityCloudFX.java index 49cfeb3..1ef9601 100644 --- a/src/main/java/net/minecraft/client/particle/EntityCloudFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityCloudFX.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityCloudFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java b/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java index 908714e..e619ed0 100644 --- a/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java +++ b/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityCrit2FX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityCritFX.java b/src/main/java/net/minecraft/client/particle/EntityCritFX.java index ee2b444..51e5dff 100644 --- a/src/main/java/net/minecraft/client/particle/EntityCritFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityCritFX.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityCritFX extends EntitySmokeFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java b/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java index a844449..cef3d9e 100644 --- a/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityDiggingFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java b/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java index c670970..0587617 100644 --- a/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityDropParticleFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java b/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java index fb81fa6..5e862e0 100644 --- a/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEnchantmentTableParticleFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java b/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java index d6bac6a..22f59cf 100644 --- a/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityExplodeFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityFX.java b/src/main/java/net/minecraft/client/particle/EntityFX.java index b6487db..4c70932 100644 --- a/src/main/java/net/minecraft/client/particle/EntityFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityFX.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFX extends Entity { diff --git a/src/main/java/net/minecraft/client/particle/EntityFirework.java b/src/main/java/net/minecraft/client/particle/EntityFirework.java index c1852c1..5f5cc47 100644 --- a/src/main/java/net/minecraft/client/particle/EntityFirework.java +++ b/src/main/java/net/minecraft/client/particle/EntityFirework.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFirework { diff --git a/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java b/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java index 3647999..bec833e 100644 --- a/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFishWakeFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityFlameFX.java b/src/main/java/net/minecraft/client/particle/EntityFlameFX.java index b63dd77..8f1d4a6 100644 --- a/src/main/java/net/minecraft/client/particle/EntityFlameFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityFlameFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFlameFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java b/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java index 77914f9..554be45 100644 --- a/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFootStepFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityHeartFX.java b/src/main/java/net/minecraft/client/particle/EntityHeartFX.java index e6ef068..af8a5fb 100644 --- a/src/main/java/net/minecraft/client/particle/EntityHeartFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityHeartFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityHeartFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java b/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java index 4ade4db..3b90692 100644 --- a/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityHugeExplodeFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java b/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java index d00211b..7226f9e 100644 --- a/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityLargeExplodeFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityLavaFX.java b/src/main/java/net/minecraft/client/particle/EntityLavaFX.java index 2d80435..fc2b19a 100644 --- a/src/main/java/net/minecraft/client/particle/EntityLavaFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityLavaFX.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityLavaFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityNoteFX.java b/src/main/java/net/minecraft/client/particle/EntityNoteFX.java index e783ac9..c879412 100644 --- a/src/main/java/net/minecraft/client/particle/EntityNoteFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityNoteFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityNoteFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java b/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java index bfda274..adf8f47 100644 --- a/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java +++ b/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityParticleEmitter extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityPickupFX.java b/src/main/java/net/minecraft/client/particle/EntityPickupFX.java index df3499a..ae313d6 100644 --- a/src/main/java/net/minecraft/client/particle/EntityPickupFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityPickupFX.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPickupFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityPortalFX.java b/src/main/java/net/minecraft/client/particle/EntityPortalFX.java index f008556..52d12e2 100644 --- a/src/main/java/net/minecraft/client/particle/EntityPortalFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityPortalFX.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPortalFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityRainFX.java b/src/main/java/net/minecraft/client/particle/EntityRainFX.java index 051625c..be59814 100644 --- a/src/main/java/net/minecraft/client/particle/EntityRainFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityRainFX.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityRainFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntityReddustFX.java b/src/main/java/net/minecraft/client/particle/EntityReddustFX.java index 634ffba..9f1ce0a 100644 --- a/src/main/java/net/minecraft/client/particle/EntityReddustFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityReddustFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityReddustFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java b/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java index 404137c..48f0ebf 100644 --- a/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java +++ b/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySmokeFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java b/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java index 092f33d..7eae99f 100644 --- a/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java +++ b/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySnowShovelFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java b/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java index 87247ba..5e8f978 100644 --- a/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java +++ b/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySpellParticleFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/EntitySplashFX.java b/src/main/java/net/minecraft/client/particle/EntitySplashFX.java index 32b6275..5f6c11f 100644 --- a/src/main/java/net/minecraft/client/particle/EntitySplashFX.java +++ b/src/main/java/net/minecraft/client/particle/EntitySplashFX.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySplashFX extends EntityRainFX { diff --git a/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java b/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java index c018563..61c7da5 100644 --- a/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java +++ b/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySuspendFX extends EntityFX { diff --git a/src/main/java/net/minecraft/client/particle/IParticleFactory.java b/src/main/java/net/minecraft/client/particle/IParticleFactory.java index 732898b..bbe3aa1 100644 --- a/src/main/java/net/minecraft/client/particle/IParticleFactory.java +++ b/src/main/java/net/minecraft/client/particle/IParticleFactory.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IParticleFactory { diff --git a/src/main/java/net/minecraft/client/particle/MobAppearance.java b/src/main/java/net/minecraft/client/particle/MobAppearance.java index b1ea8fc..b6eb958 100644 --- a/src/main/java/net/minecraft/client/particle/MobAppearance.java +++ b/src/main/java/net/minecraft/client/particle/MobAppearance.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MobAppearance extends EntityFX { diff --git a/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java b/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java index 0750cd2..f4a029f 100644 --- a/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java +++ b/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java @@ -18,16 +18,18 @@ import net.minecraft.world.LockCode; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerLocalMenu extends InventoryBasic implements ILockableContainer { diff --git a/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java b/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java index 44279b9..d18cdba 100644 --- a/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java +++ b/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java @@ -12,16 +12,18 @@ import net.minecraft.world.IInteractionObject; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LocalBlockIntercommunication implements IInteractionObject { diff --git a/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java b/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java index 7676c33..b977eb2 100644 --- a/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java +++ b/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ActiveRenderInfo { diff --git a/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java b/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java index 9ac5f54..ecba920 100644 --- a/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java @@ -24,16 +24,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFluidRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java b/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java index ae658d5..f347043 100644 --- a/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java @@ -3,7 +3,12 @@ package net.minecraft.client.renderer; import java.util.BitSet; import java.util.List; -import net.PeytonPlayz585.shadow.*; +import net.PeytonPlayz585.shadow.BetterGrass; +import net.PeytonPlayz585.shadow.BetterSnow; +import net.PeytonPlayz585.shadow.Config; +import net.PeytonPlayz585.shadow.CustomColors; +import net.PeytonPlayz585.shadow.RenderEnv; +import net.PeytonPlayz585.shadow.SmartLeaves; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; @@ -31,16 +36,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockModelRenderer { @@ -80,7 +87,8 @@ public class BlockModelRenderer { } } - public boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) { + public boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, + BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) { boolean flag = false; RenderEnv renderenv = null; float[] afloat = new float[EnumFacing.values().length * 2]; @@ -92,7 +100,7 @@ public class BlockModelRenderer { if (!list.isEmpty()) { BlockPos blockpos = blockPosIn.offset(enumfacing); if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing)) { - + if (renderenv == null) { renderenv = RenderEnv.getInstance(blockAccessIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn); } @@ -100,7 +108,7 @@ public class BlockModelRenderer { if (!renderenv.isBreakingAnimation(list) && Config.isBetterGrass()) { list = BetterGrass.getFaceQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, list); } - + this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list, afloat, bitset, blockmodelrenderer$ambientocclusionface, renderenv); flag = true; } @@ -109,11 +117,10 @@ public class BlockModelRenderer { List list1 = modelIn.getGeneralQuads(); if (list1.size() > 0) { - this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list1, afloat, - bitset, blockmodelrenderer$ambientocclusionface, renderenv); + this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface, renderenv); flag = true; } - + if (renderenv != null && Config.isBetterSnow() && !renderenv.isBreakingAnimation() && BetterSnow.shouldRender(blockAccessIn, blockIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn)) { IBakedModel ibakedmodel = BetterSnow.getModelSnowLayer(); IBlockState iblockstate = BetterSnow.getStateSnowLayer(); @@ -137,7 +144,7 @@ public class BlockModelRenderer { if (!list.isEmpty()) { BlockPos blockpos = blockPosIn.offsetEvenFaster(enumfacing, pointer); if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing)) { - + if (renderenv == null) { renderenv = RenderEnv.getInstance(blockAccessIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn); } @@ -145,7 +152,7 @@ public class BlockModelRenderer { if (!renderenv.isBreakingAnimation(list) && Config.isBetterGrass()) { list = BetterGrass.getFaceQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, list); } - + int i = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos); this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, i, false, worldRendererIn, list, bitset, afloat); flag = true; @@ -159,7 +166,7 @@ public class BlockModelRenderer { worldRendererIn, list1, bitset, afloat); flag = true; } - + if (renderenv != null && Config.isBetterSnow() && !renderenv.isBreakingAnimation() && BetterSnow.shouldRender(blockAccessIn, blockIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn) && BetterSnow.shouldRender(blockAccessIn, blockIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn)) { IBakedModel ibakedmodel = BetterSnow.getModelSnowLayer(); IBlockState iblockstate = BetterSnow.getStateSnowLayer(); @@ -522,16 +529,16 @@ public class BlockModelRenderer { } public static class AmbientOcclusionFace { - private final float[] vertexColorMultiplier = new float[4]; - private final int[] vertexBrightness = new int[4]; - - public AmbientOcclusionFace(BlockModelRenderer p_i46235_1_) { - } + private final int[] vertexBrightness = new int[4]; + + private final BlockPos blockpos0 = new BlockPos(0, 0, 0); + private final BlockPos blockpos1 = new BlockPos(0, 0, 0); + private final BlockPos blockpos2 = new BlockPos(0, 0, 0); + private final BlockPos blockpos3 = new BlockPos(0, 0, 0); + private final BlockPos blockpos4 = new BlockPos(0, 0, 0); + private final BlockPos blockpos5 = new BlockPos(0, 0, 0); - public AmbientOcclusionFace() { - } - public void updateVertexBrightness(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags) { BlockPos blockpos = boundsFlags.get(0) ? blockPosIn.offset(facingIn) : blockPosIn; BlockModelRenderer.EnumNeighborInfo blockmodelrenderer$enumneighborinfo = BlockModelRenderer.EnumNeighborInfo.getNeighbourInfo(facingIn); diff --git a/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java b/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java index ba7e629..a713b63 100644 --- a/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java +++ b/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java @@ -65,16 +65,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockModelShapes { diff --git a/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java b/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java index 11f06b6..f296050 100644 --- a/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java +++ b/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java @@ -23,16 +23,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockRendererDispatcher implements IResourceManagerReloadListener { diff --git a/src/main/java/net/minecraft/client/renderer/ChestRenderer.java b/src/main/java/net/minecraft/client/renderer/ChestRenderer.java index 73ce844..acd521f 100644 --- a/src/main/java/net/minecraft/client/renderer/ChestRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/ChestRenderer.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChestRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java b/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java index 44ce0e4..652adf2 100644 --- a/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java +++ b/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java @@ -11,6 +11,26 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class ChunkRenderContainer { private double viewEntityX; private double viewEntityY; diff --git a/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java b/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java index eb4b61e..d6a9630 100644 --- a/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java +++ b/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java @@ -8,16 +8,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DestroyBlockProgress { diff --git a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java index 75fbcfa..a2a7ea6 100644 --- a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -13,7 +13,11 @@ import java.util.concurrent.Callable; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import net.FatalCodes.shadow.Shadow; +import net.PeytonPlayz585.shadow.Config; +import net.PeytonPlayz585.shadow.CustomColors; +import net.PeytonPlayz585.shadow.Lagometer; +import net.PeytonPlayz585.shadow.TextureUtils; +import net.PeytonPlayz585.shadow.debug.DebugChunkRenderer; import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; @@ -87,28 +91,24 @@ import net.minecraft.util.Vec3i; import net.minecraft.world.WorldSettings; import net.minecraft.world.biome.BiomeGenBase; -import net.PeytonPlayz585.shadow.Config; -import net.PeytonPlayz585.shadow.CustomColors; -import net.PeytonPlayz585.shadow.Lagometer; -import net.PeytonPlayz585.shadow.TextureUtils; -import net.PeytonPlayz585.shadow.debug.DebugChunkRenderer; - /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityRenderer implements IResourceManagerReloadListener { @@ -215,7 +215,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { } chunkRenderer = new DebugChunkRenderer(); - + } public boolean isShaderActive() { @@ -686,11 +686,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.loadIdentity(); float f = 0.07F; if (this.mc.gameSettings.anaglyph) { - if(this.mc.gameSettings.leftHand) { - GlStateManager.translate((float) (-(xOffset * 2 - 1)) * f, 0.0F, 0.0F); - } else { - GlStateManager.translate((float) (-(xOffset * 2 + 1)) * f, 0.0F, 0.0F); - } + GlStateManager.translate((float) (-(xOffset * 2 - 1)) * f, 0.0F, 0.0F); } GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, false), @@ -926,7 +922,6 @@ public class EntityRenderer implements IResourceManagerReloadListener { this.mc.mcProfiler.startSection("mouse"); if (this.mc.inGameHasFocus && flag) { - this.mc.mouseHelper.mouseXYChange(); float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; if (this.mc.gameSettings.keyBindZoomCamera.isKeyDown()) { @@ -989,14 +984,12 @@ public class EntityRenderer implements IResourceManagerReloadListener { this.setupOverlayRendering(); GlStateManager.disableLighting(); GlStateManager.enableBlend(); - if (Config.isVignetteEnabled()) { this.mc.ingameGUI.renderVignette(parFloat1, l, i1); } else { GlStateManager.enableDepth(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); } - this.mc.ingameGUI.renderGameOverlayCrosshairs(l, i1); GlStateManager.bindTexture(this.overlayFramebuffer.getTexture()); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); @@ -1018,9 +1011,9 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.enableAlpha(); GlStateManager.disableBlend(); if (this.mc.gameSettings.hudPlayer) { // give the player model HUD good fps - this.mc.ingameGUI.drawEaglerPlayerOverlay(l - 3, 3, parFloat1); + this.mc.ingameGUI.drawEaglerPlayerOverlay(l - 3, 3 + this.mc.ingameGUI.overlayDebug.playerOffset, parFloat1); } - + if (this.mc.gameSettings.showDebugInfo) { Lagometer.showLagometer(scaledresolution); } @@ -1072,7 +1065,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { } } - + Lagometer.updateLagometer(); if (this.mc.gameSettings.ofProfiler) { @@ -1292,15 +1285,6 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.enableAlpha(); } - if (this.chunkRenderer.shouldRender()) { - boolean fogEnabled = GlStateManager.isFogEnabled(); - GlStateManager.disableFog(); - this.chunkRenderer.render(partialTicks, finishTimeNano); - if(fogEnabled) { - GlStateManager.enableFog(); - } - } - this.mc.mcProfiler.endStartSection("destroyProgress"); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, 1, 1, 0); @@ -1322,6 +1306,16 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.depthMask(false); GlStateManager.enableCull(); + + if (this.chunkRenderer.shouldRender()) { + boolean fogEnabled = GlStateManager.isFogEnabled(); + GlStateManager.disableFog(); + this.chunkRenderer.render(partialTicks, finishTimeNano); + if(fogEnabled) { + GlStateManager.enableFog(); + } + } + this.mc.mcProfiler.endStartSection("weather"); this.renderRainSnow(partialTicks); GlStateManager.depthMask(true); @@ -1348,7 +1342,6 @@ public class EntityRenderer implements IResourceManagerReloadListener { } this.mc.mcProfiler.endStartSection("hand"); - Shadow.moduleManager.onRender(); if (this.renderHand) { GlStateManager.clear(GL_DEPTH_BUFFER_BIT); this.renderHand(partialTicks, pass); @@ -1359,7 +1352,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { if (this.mc.gameSettings.renderDistanceChunks >= 4 && !Config.isCloudsOff()) { - this.mc.mcProfiler.endStartSection("clouds"); + this.mc.mcProfiler.endStartSection("clouds"); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance * 4.0F); @@ -1373,76 +1366,80 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.loadIdentity(); GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance); GlStateManager.matrixMode(5888); - } + } + } private void addRainParticles() { - if (DeferredStateManager.isDeferredRenderer()) { + if (DeferredStateManager.isDeferredRenderer()) return; - } + float f = this.mc.theWorld.getRainStrength(1.0F); - float f = this.mc.theWorld.getRainStrength(1.0F); - - if (!Config.isRainFancy()) { + if (!Config.isRainFancy()) { f /= 2.0F; } - if (f != 0.0F && Config.isRainSplash()) { - this.random.setSeed((long)this.rendererUpdateCount * 312987231L); - Entity entity = this.mc.getRenderViewEntity(); - WorldClient worldclient = this.mc.theWorld; - BlockPos blockpos = new BlockPos(entity); - byte b0 = 10; - double d0 = 0.0D; - double d1 = 0.0D; - double d2 = 0.0D; - int i = 0; - int j = (int)(100.0F * f * f); + if (f != 0.0F && Config.isRainSplash()) { + this.random.setSeed((long) this.rendererUpdateCount * 312987231L); + Entity entity = this.mc.getRenderViewEntity(); + WorldClient worldclient = this.mc.theWorld; + BlockPos blockpos = new BlockPos(entity); + byte b0 = 10; + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + int i = 0; + int j = (int) (100.0F * f * f); + if (this.mc.gameSettings.particleSetting == 1) { + j >>= 1; + } else if (this.mc.gameSettings.particleSetting == 2) { + j = 0; + } - if (this.mc.gameSettings.particleSetting == 1) { - j >>= 1; - } else if (this.mc.gameSettings.particleSetting == 2) { - j = 0; - } + for (int k = 0; k < j; ++k) { + BlockPos blockpos1 = worldclient + .getPrecipitationHeight(blockpos.add(this.random.nextInt(b0) - this.random.nextInt(b0), 0, + this.random.nextInt(b0) - this.random.nextInt(b0))); + BiomeGenBase biomegenbase = worldclient.getBiomeGenForCoords(blockpos1); + BlockPos blockpos2 = blockpos1.down(); + Block block = worldclient.getBlockState(blockpos2).getBlock(); + if (blockpos1.getY() <= blockpos.getY() + b0 && blockpos1.getY() >= blockpos.getY() - b0 + && biomegenbase.canSpawnLightningBolt() + && biomegenbase.getFloatTemperature(blockpos1) >= 0.15F) { + double d3 = this.random.nextDouble(); + double d4 = this.random.nextDouble(); + if (block.getMaterial() == Material.lava) { + this.mc.theWorld.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double) blockpos1.getX() + d3, + (double) ((float) blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), + (double) blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } else if (block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(worldclient, blockpos2); + ++i; + if (this.random.nextInt(i) == 0) { + d0 = (double) blockpos2.getX() + d3; + d1 = (double) ((float) blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY() - 1.0D; + d2 = (double) blockpos2.getZ() + d4; + } - for (int k = 0; k < j; ++k) { - BlockPos blockpos1 = worldclient.getPrecipitationHeight(blockpos.add(this.random.nextInt(b0) - this.random.nextInt(b0), 0, this.random.nextInt(b0) - this.random.nextInt(b0))); - BiomeGenBase biomegenbase = worldclient.getBiomeGenForCoords(blockpos1); - BlockPos blockpos2 = blockpos1.down(); - Block block = worldclient.getBlockState(blockpos2).getBlock(); + this.mc.theWorld.spawnParticle(EnumParticleTypes.WATER_DROP, (double) blockpos2.getX() + d3, + (double) ((float) blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), + (double) blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } - if (blockpos1.getY() <= blockpos.getY() + b0 && blockpos1.getY() >= blockpos.getY() - b0 && biomegenbase.canSpawnLightningBolt() && biomegenbase.getFloatTemperature(blockpos1) >= 0.15F) { - double d3 = this.random.nextDouble(); - double d4 = this.random.nextDouble(); + if (i > 0 && this.random.nextInt(3) < this.rainSoundCounter++) { + this.rainSoundCounter = 0; + if (d1 > (double) (blockpos.getY() + 1) && worldclient.getPrecipitationHeight(blockpos) + .getY() > MathHelper.floor_float((float) blockpos.getY())) { + this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.1F, 0.5F, false); + } else { + this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.2F, 1.0F, false); + } + } - if (block.getMaterial() == Material.lava) { - this.mc.theWorld.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); - } else if (block.getMaterial() != Material.air) { - block.setBlockBoundsBasedOnState(worldclient, blockpos2); - ++i; - - if (this.random.nextInt(i) == 0) { - d0 = (double)blockpos2.getX() + d3; - d1 = (double)((float)blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY() - 1.0D; - d2 = (double)blockpos2.getZ() + d4; - } - - this.mc.theWorld.spawnParticle(EnumParticleTypes.WATER_DROP, (double)blockpos2.getX() + d3, (double)((float)blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), (double)blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); - } - } - } - - if (i > 0 && this.random.nextInt(3) < this.rainSoundCounter++) { - this.rainSoundCounter = 0; - - if (d1 > (double)(blockpos.getY() + 1) && worldclient.getPrecipitationHeight(blockpos).getY() > MathHelper.floor_float((float)blockpos.getY())) { - this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.1F, 0.5F, false); - } else { - this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.2F, 1.0F, false); - } - } - } - } + } + } /**+ * Render rain and snow @@ -1474,6 +1471,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { DeferredStateManager.reportForwardRenderObjectPosition2(0.0f, 0.0f, 0.0f); GlStateManager.alphaFunc(GL_GREATER, 0.01F); GlStateManager.depthMask(false); + GlStateManager.enableDepth(); EaglerDeferredPipeline.instance.setForwardRenderLightFactors(0.65f, 4.75f - MathHelper.clamp_float(DeferredStateManager.getSunHeight() * 8.0f - 3.0f, 0.0f, 4.0f), 1.0f, 0.03f); @@ -1637,6 +1635,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); DeferredStateManager.setDefaultMaterialConstants(); GlStateManager.depthMask(true); + GlStateManager.disableDepth(); EaglerDeferredPipeline.instance.setForwardRenderLightFactors(1.0f, 1.0f, 1.0f, 1.0f); } GlStateManager.alphaFunc(GL_GREATER, 0.1F); @@ -1829,24 +1828,22 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, parFloat1); if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.blindness)) { - float f2 = 5.0F; - int i = ((EntityLivingBase)entity).getActivePotionEffect(Potion.blindness).getDuration(); + float f1 = 5.0F; + int i = ((EntityLivingBase) entity).getActivePotionEffect(Potion.blindness).getDuration(); + if (i < 20) { + f1 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float) i / 20.0F); + } - if (i < 20) { - f2 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)i / 20.0F); - } - - GlStateManager.setFog(9729); - - if (partialTicks == -1) { - GlStateManager.setFogStart(0.0F); - GlStateManager.setFogEnd(f2 * 0.8F); - } else { - GlStateManager.setFogStart(f2 * 0.25F); - GlStateManager.setFogEnd(f2); - } - - if (Config.isFogFancy()) { + GlStateManager.setFog(GL_LINEAR); + if (partialTicks == -1) { + GlStateManager.setFogStart(0.0F); + GlStateManager.setFogEnd(f1 * 0.8F); + } else { + GlStateManager.setFogStart(f1 * 0.25F); + GlStateManager.setFogEnd(f1); + } + + if (Config.isFogFancy()) { EaglercraftGPU.glFogi(34138, 34139); } } else if (this.cloudFog) { @@ -1860,13 +1857,16 @@ public class EntityRenderer implements IResourceManagerReloadListener { } else { GlStateManager.setFogDensity(0.1F - (float) EnchantmentHelper.getRespiration(entity) * 0.03F); } - + if (Config.isClearWater()) { GlStateManager.setFogDensity(0.02F); } } else if (block.getMaterial() == Material.lava) { GlStateManager.setFog(GL_EXP); GlStateManager.setFogDensity(2.0F); + } else if (!this.mc.gameSettings.fog) { + GlStateManager.setFog(GL_EXP); + GlStateManager.setFogDensity(0.0F); } else { GlStateManager.setFogDensity(0.001F); float f = this.farPlaneDistance; @@ -1980,10 +1980,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { DeferredStateManager.setWavingBlockOffset(blockWaveDistX, blockWaveDistY, blockWaveDistZ); if (wavingBlocks) { - DeferredStateManager.setWavingBlockParams(1.0f * waveTimer, - 200.0f * waveTimer - + MathHelper.sin(waveTimer * 0.125f + MathHelper.sin(waveTimer * 1.5f) * 0.2f) * 125.0f, - 0.0f, 0.0f); + DeferredStateManager.setWavingBlockParams(1.0f * waveTimer, 200.0f * waveTimer, 0.0f, 0.0f); } // if (mc.gameSettings.renderDistanceChunks >= 4) vanilla shows sky not fog @@ -2611,7 +2608,10 @@ public class EntityRenderer implements IResourceManagerReloadListener { } ds *= 1.5f + mc.theWorld.getRainStrength(partialTicks) * 10.0f + mc.theWorld.getThunderStrength(partialTicks) * 5.0f; - ds *= MathHelper.clamp_float(6.0f - DeferredStateManager.getSunHeight() * 17.0f, 1.0f, 2.0f); + ds *= MathHelper.clamp_float(6.0f - DeferredStateManager.getSunHeight() * 17.0f, 1.0f, 3.0f); + if (conf.is_rendering_lightShafts) { + ds *= Math.max(2.0f - Math.abs(DeferredStateManager.getSunHeight()) * 5.0f, 1.0f); + } DeferredStateManager.enableFogExp(ds, true, 1.0f, 1.0f, 1.0f, 1.0f, ff, ff, ff, 1.0f); } diff --git a/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java b/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java index 4818afd..e063448 100644 --- a/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java +++ b/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java @@ -8,16 +8,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumFaceDirection { diff --git a/src/main/java/net/minecraft/client/renderer/GLAllocation.java b/src/main/java/net/minecraft/client/renderer/GLAllocation.java index b1f56d0..1416e57 100644 --- a/src/main/java/net/minecraft/client/renderer/GLAllocation.java +++ b/src/main/java/net/minecraft/client/renderer/GLAllocation.java @@ -13,16 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GLAllocation { diff --git a/src/main/java/net/minecraft/client/renderer/IImageBuffer.java b/src/main/java/net/minecraft/client/renderer/IImageBuffer.java index c8361c9..13025f7 100644 --- a/src/main/java/net/minecraft/client/renderer/IImageBuffer.java +++ b/src/main/java/net/minecraft/client/renderer/IImageBuffer.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IImageBuffer { diff --git a/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java b/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java index 7224561..625fa4f 100644 --- a/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java +++ b/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ImageBufferDownload implements IImageBuffer { @@ -49,7 +51,7 @@ public class ImageBufferDownload implements IImageBuffer { bufferedimage1.drawLayer(bufferedimage, 48, 52, 44, 64, 52, 20, 56, 32); } - this.imageData = bufferedimage1.getPixels(); + this.imageData = bufferedimage1.pixels; this.setAreaOpaque(0, 0, 32, 16); this.setAreaTransparent(32, 0, 64, 32); this.setAreaOpaque(0, 16, 64, 32); diff --git a/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java b/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java index 1735be1..1aa56d1 100644 --- a/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java @@ -9,6 +9,26 @@ import net.minecraft.inventory.Container; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class InventoryEffectRenderer extends GuiContainer { private boolean hasActivePotionEffects; diff --git a/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java b/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java index ba568d3..6f61cab 100644 --- a/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java +++ b/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java @@ -9,16 +9,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ItemMeshDefinition { diff --git a/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java b/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java index 3061f9a..367c91f 100644 --- a/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java +++ b/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java @@ -18,16 +18,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemModelMesher { diff --git a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java index 1068517..e37c7ce 100644 --- a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java @@ -39,16 +39,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java b/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java index 94d20ff..4484898 100644 --- a/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java +++ b/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java @@ -19,16 +19,18 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RegionRenderCache extends ChunkCache { diff --git a/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java b/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java index 5299f93..1d48f8b 100644 --- a/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java +++ b/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java @@ -9,16 +9,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RegionRenderCacheBuilder { diff --git a/src/main/java/net/minecraft/client/renderer/RenderGlobal.java b/src/main/java/net/minecraft/client/renderer/RenderGlobal.java index 2fb0aa6..c5e0e2e 100644 --- a/src/main/java/net/minecraft/client/renderer/RenderGlobal.java +++ b/src/main/java/net/minecraft/client/renderer/RenderGlobal.java @@ -19,6 +19,7 @@ import net.PeytonPlayz585.shadow.other.CloudRenderer; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.Keyboard; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL; import java.util.Set; import java.util.concurrent.Callable; @@ -59,7 +60,6 @@ import net.minecraft.client.renderer.chunk.CompiledChunk; import net.minecraft.client.renderer.chunk.IRenderChunkFactory; import net.minecraft.client.renderer.chunk.ListChunkFactory; import net.minecraft.client.renderer.chunk.RenderChunk; -import net.minecraft.client.renderer.chunk.VboChunkFactory; import net.minecraft.client.renderer.chunk.VisGraph; import net.minecraft.client.renderer.culling.ClippingHelper; import net.minecraft.client.renderer.culling.ClippingHelperImpl; @@ -88,6 +88,7 @@ import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ClassInheritanceMultiMap; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumFacing; @@ -101,6 +102,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.util.Vector3d; import net.minecraft.world.IWorldAccess; +import net.minecraft.world.World; import net.minecraft.world.border.WorldBorder; import net.minecraft.world.chunk.Chunk; @@ -110,16 +112,18 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderGlobal implements IWorldAccess, IResourceManagerReloadListener { @@ -208,7 +212,6 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene this.vboEnabled = false; this.renderContainer = new RenderList(); this.renderChunkFactory = new ListChunkFactory(); - this.generateStars(); this.generateSky(); this.generateSky2(); @@ -417,7 +420,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks; this.renderDistance = this.renderDistanceChunks * 16; this.renderDistanceSq = this.renderDistance * this.renderDistance; - + if (this.viewFrustum != null) { this.viewFrustum.deleteGlResources(); } @@ -468,11 +471,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene EaglerDeferredPipeline.isSuspended = true; } if (flag && !EaglerDeferredPipeline.isSuspended) { - ChatComponentText shaderF4Msg = new ChatComponentText("[EaglercraftX]"); + ChatComponentText shaderF4Msg = new ChatComponentText("[EaglercraftX] "); shaderF4Msg.getChatStyle().setColor(EnumChatFormatting.GOLD); - ChatComponentText shaderF4Msg2 = new ChatComponentText( - " Press " + Keyboard.getKeyName(mc.gameSettings.keyBindFunction.getKeyCode()) - + "+4 to access the shader debug menu"); + ChatComponentTranslation shaderF4Msg2 = new ChatComponentTranslation("shaders.debugMenuTip", + Keyboard.getKeyName(mc.gameSettings.keyBindFunction.getKeyCode())); shaderF4Msg2.getChatStyle().setColor(EnumChatFormatting.AQUA); shaderF4Msg.appendSibling(shaderF4Msg2); mc.ingameGUI.getChatGUI().printChatMessage(shaderF4Msg); @@ -946,7 +948,8 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene } while (!linkedlist.isEmpty()) { - RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = (RenderGlobal.ContainerLocalRenderInformation) linkedlist.poll(); + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = (RenderGlobal.ContainerLocalRenderInformation) linkedlist + .poll(); RenderChunk renderchunk3 = renderglobal$containerlocalrenderinformation1.renderChunk; EnumFacing enumfacing2 = renderglobal$containerlocalrenderinformation1.facing; BlockPos blockpos2 = renderchunk3.getPosition(); @@ -975,7 +978,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene this.fixTerrainFrustum(d3, d4, d5); this.debugFixTerrainFrustum = false; } - + Lagometer.timerVisibility.end(); Set set = this.chunksToUpdate; @@ -1213,13 +1216,13 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene this.mc.entityRenderer.enableLightmap(); if (Minecraft.getMinecraft().gameSettings.useVbo) { - //OpenGLManager.glEnableClientState(GL_VERTEX_ARRAY); + PlatformOpenGL._wglEnableVertexAttribArray(GL_VERTEX_ARRAY); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); - //OpenGLManager.glEnableClientState(GL_TEXTURE_COORD_ARRAY); + PlatformOpenGL._wglEnableVertexAttribArray(GL_TEXTURE_COORD_ARRAY); GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); - //OpenGLManager.glEnableClientState(GL_TEXTURE_COORD_ARRAY); + PlatformOpenGL._wglEnableVertexAttribArray(GL_TEXTURE_COORD_ARRAY); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); - //OpenGLManager.glEnableClientState(GL_COLOR_ARRAY); + PlatformOpenGL._wglEnableVertexAttribArray(GL_COLOR_ARRAY); } this.renderContainer.renderChunkLayer(blockLayerIn); @@ -2307,11 +2310,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene * tracker. */ public void onEntityAdded(Entity var1) { - if (Config.isDynamicLights()) { DynamicLights.entityAdded(var1, this); } - } /**+ @@ -2321,11 +2322,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene * entity tracker. */ public void onEntityRemoved(Entity var1) { - if (Config.isDynamicLights()) { DynamicLights.entityRemoved(var1, this); } - } /**+ @@ -2614,7 +2613,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene return "" + Minecraft.getDebugFPS() + "fps | C: " + j + "/" + i + ", E: " + this.countEntitiesRendered + "+" + k + ", " + renderDispatcher.getDebugInfo(); } - + public WorldClient getWorld() { return this.theWorld; } diff --git a/src/main/java/net/minecraft/client/renderer/RenderHelper.java b/src/main/java/net/minecraft/client/renderer/RenderHelper.java index e531277..da49263 100644 --- a/src/main/java/net/minecraft/client/renderer/RenderHelper.java +++ b/src/main/java/net/minecraft/client/renderer/RenderHelper.java @@ -12,16 +12,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderHelper { diff --git a/src/main/java/net/minecraft/client/renderer/RenderList.java b/src/main/java/net/minecraft/client/renderer/RenderList.java index 958d305..d6a8eda 100644 --- a/src/main/java/net/minecraft/client/renderer/RenderList.java +++ b/src/main/java/net/minecraft/client/renderer/RenderList.java @@ -12,16 +12,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderList extends ChunkRenderContainer { diff --git a/src/main/java/net/minecraft/client/renderer/StitcherException.java b/src/main/java/net/minecraft/client/renderer/StitcherException.java index 0284332..95381b5 100644 --- a/src/main/java/net/minecraft/client/renderer/StitcherException.java +++ b/src/main/java/net/minecraft/client/renderer/StitcherException.java @@ -8,16 +8,18 @@ import net.minecraft.client.renderer.texture.Stitcher; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StitcherException extends RuntimeException { diff --git a/src/main/java/net/minecraft/client/renderer/Tessellator.java b/src/main/java/net/minecraft/client/renderer/Tessellator.java index 33bb3b8..2111ea9 100644 --- a/src/main/java/net/minecraft/client/renderer/Tessellator.java +++ b/src/main/java/net/minecraft/client/renderer/Tessellator.java @@ -10,16 +10,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.WorldVertexBufferUploader; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Tessellator { diff --git a/src/main/java/net/minecraft/client/renderer/ViewFrustum.java b/src/main/java/net/minecraft/client/renderer/ViewFrustum.java index 87e662d..bc9a425 100644 --- a/src/main/java/net/minecraft/client/renderer/ViewFrustum.java +++ b/src/main/java/net/minecraft/client/renderer/ViewFrustum.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ViewFrustum { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java b/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java index 6a5542b..ec2d02e 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java @@ -8,16 +8,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BakedQuad { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java b/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java index 02f27d4..8047623 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java @@ -12,16 +12,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeDeserializer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockFaceUV { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java b/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java index 88b301d..acc4704 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java @@ -22,16 +22,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPart { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java b/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java index 8ec6f5d..d07e7fe 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java @@ -13,16 +13,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPartFace { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java b/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java index 5bf9254..2d86990 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java @@ -9,16 +9,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPartRotation { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java b/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java index 47c8766..899435f 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BreakingFour extends BakedQuad { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java b/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java index 1481958..43f4739 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java @@ -17,16 +17,18 @@ import net.minecraft.util.Vec3i; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FaceBakery { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java b/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java index 38db497..78bb9a7 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java @@ -13,16 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemCameraTransforms { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java b/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java index 2e557a8..76ffcc4 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemModelGenerator { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java b/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java index 0244f35..9d7f972 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java @@ -14,16 +14,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemTransformVec3f { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java b/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java index 2c0aef4..a0d5638 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java @@ -29,16 +29,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBlock { diff --git a/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java b/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java index 7f21984..574ce94 100644 --- a/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java +++ b/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java @@ -26,16 +26,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBlockDefinition { diff --git a/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java b/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java index c6455ec..3f4fd43 100644 --- a/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java +++ b/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java @@ -19,16 +19,18 @@ import net.minecraft.client.resources.model.ModelResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockStateMapper { diff --git a/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java b/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java index 5eded81..248480c 100644 --- a/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java +++ b/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DefaultStateMapper extends StateMapperBase { diff --git a/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java b/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java index d17b02b..d232fe0 100644 --- a/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java +++ b/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java @@ -12,16 +12,18 @@ import net.minecraft.client.resources.model.ModelResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IStateMapper { diff --git a/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java b/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java index c845151..5cfea37 100644 --- a/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java +++ b/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StateMap extends StateMapperBase { diff --git a/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java b/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java index cd94f7d..6b41307 100644 --- a/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java +++ b/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java @@ -10,6 +10,26 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.model.ModelResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class StateMapperBase implements IStateMapper { protected Map mapStateModelLocations = Maps.newLinkedHashMap(); diff --git a/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java b/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java index 5141c5f..0b68627 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java @@ -14,16 +14,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChunkCompileTaskGenerator { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java b/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java index d59c9ec..63a795e 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java @@ -15,16 +15,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChunkRenderWorker { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java b/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java index 6cb2d04..0209240 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java @@ -15,16 +15,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CompiledChunk { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java b/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java index a87ad6d..58974d6 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IRenderChunkFactory { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java b/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java index 7c9f1aa..bccfeac 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ListChunkFactory implements IRenderChunkFactory { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java b/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java index 5cfc793..90d0708 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ListedRenderChunk extends RenderChunk { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java b/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java index 272ef14..4631e39 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java @@ -11,16 +11,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SetVisibility { diff --git a/src/main/java/net/minecraft/client/renderer/chunk/VboChunkFactory.java b/src/main/java/net/minecraft/client/renderer/chunk/VboChunkFactory.java deleted file mode 100644 index fda85b7..0000000 --- a/src/main/java/net/minecraft/client/renderer/chunk/VboChunkFactory.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.minecraft.client.renderer.chunk; - -import net.minecraft.client.renderer.RenderGlobal; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; - -public class VboChunkFactory implements IRenderChunkFactory { - public RenderChunk makeRenderChunk(World worldIn, RenderGlobal globalRenderer, BlockPos pos, int index) { - return new RenderChunk(worldIn, globalRenderer, pos, index); - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java b/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java index 916976a..c9a521d 100644 --- a/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java +++ b/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java @@ -17,16 +17,18 @@ import net.minecraft.util.IntegerCache; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 VisGraph { diff --git a/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java b/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java index c4988cc..c0c2593 100644 --- a/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java +++ b/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java @@ -6,16 +6,18 @@ package net.minecraft.client.renderer.culling; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ClippingHelper { diff --git a/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java b/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java index e2503cc..34f3f01 100644 --- a/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java +++ b/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java @@ -15,16 +15,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ClippingHelperImpl extends ClippingHelper { diff --git a/src/main/java/net/minecraft/client/renderer/culling/Frustum.java b/src/main/java/net/minecraft/client/renderer/culling/Frustum.java index 2a72236..29f231b 100644 --- a/src/main/java/net/minecraft/client/renderer/culling/Frustum.java +++ b/src/main/java/net/minecraft/client/renderer/culling/Frustum.java @@ -8,16 +8,18 @@ import net.minecraft.util.AxisAlignedBB; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Frustum implements ICamera { diff --git a/src/main/java/net/minecraft/client/renderer/culling/ICamera.java b/src/main/java/net/minecraft/client/renderer/culling/ICamera.java index c4d37ec..07ff32a 100644 --- a/src/main/java/net/minecraft/client/renderer/culling/ICamera.java +++ b/src/main/java/net/minecraft/client/renderer/culling/ICamera.java @@ -8,16 +8,18 @@ import net.minecraft.util.AxisAlignedBB; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ICamera { diff --git a/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java b/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java index 890c975..265f797 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ArmorStandRenderer extends RendererLivingEntity { diff --git a/src/main/java/net/minecraft/client/renderer/entity/Render.java b/src/main/java/net/minecraft/client/renderer/entity/Render.java index 7bd6789..d2f0ede 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/Render.java +++ b/src/main/java/net/minecraft/client/renderer/entity/Render.java @@ -24,6 +24,26 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Render { private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); protected final RenderManager renderManager; diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java b/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java index 6cf6044..4ece5ba 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderArrow extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java b/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java index 321c6ba..aa5c5ee 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderBat extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java b/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java index 60a6aab..1fa42ff 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderBiped extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java b/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java index cc792e5..9277a25 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderBlaze extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java b/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java index 5e31256..d279329 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderBoat extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java b/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java index 955a89f..de4ca5e 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderCaveSpider extends RenderSpider { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java b/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java index 4ade0d7..27327e8 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderChicken extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java b/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java index 2d79aec..0c698c8 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderCow extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java b/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java index 52a1086..f604af0 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java @@ -16,16 +16,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderCreeper extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java b/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java index 30fda44..3d2120f 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java @@ -22,16 +22,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderDragon extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java b/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java index d02872f..2c426c1 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java @@ -14,16 +14,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderEnderman extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java b/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java index 5ae3e97..3de6291 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderEndermite extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java b/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java index 64d8d65..01292a7 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderEntity extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java b/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java index 731cb22..d4f586d 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java @@ -22,16 +22,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderEntityItem extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java b/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java index 2fde9a9..cd96a80 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderFallingBlock extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java b/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java index 819d655..b5752a8 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java @@ -17,16 +17,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderFireball extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java b/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java index 7c032b8..9cd0e04 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java @@ -16,16 +16,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderFish extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java b/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java index 41365d8..ece6d15 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderGhast extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java b/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java index a175c49..9322957 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java @@ -14,16 +14,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderGiantZombie extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java b/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java index 1babc94..61aa740 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java @@ -22,16 +22,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderGuardian extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java b/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java index 6a317bd..2f786a8 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java @@ -17,16 +17,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderHorse extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java b/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java index 40c7428..476345b 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderIronGolem extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java index 3f58176..e1608d4 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java @@ -77,16 +77,18 @@ import net.minecraft.util.Vec3i; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderItem implements IResourceManagerReloadListener { @@ -96,7 +98,7 @@ public class RenderItem implements IResourceManagerReloadListener { public float zLevel; private final ItemModelMesher itemModelMesher; private final TextureManager textureManager; - + private ModelResourceLocation modelLocation = null; public RenderItem(TextureManager textureManager, ModelManager modelManager) { @@ -130,7 +132,7 @@ public class RenderItem implements IResourceManagerReloadListener { this.registerItem(itm, 0, identifier); } - public void renderModel(IBakedModel model, ItemStack stack) { + private void renderModel(IBakedModel model, ItemStack stack) { this.renderModel(model, -1, stack); } @@ -138,7 +140,7 @@ public class RenderItem implements IResourceManagerReloadListener { this.renderModel(model, color, (ItemStack) null); } - public void renderModel(IBakedModel model, int color, ItemStack stack) { + private void renderModel(IBakedModel model, int color, ItemStack stack) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.begin(7, DefaultVertexFormats.ITEM); @@ -167,14 +169,12 @@ public class RenderItem implements IResourceManagerReloadListener { GlStateManager.enableRescaleNormal(); TileEntityItemStackRenderer.instance.renderByItem(stack); } else { - if (Config.isCustomItems()) { model1 = CustomItems.getCustomItemModel(stack, model1, this.modelLocation); } - final IBakedModel model = model1; RenderItem itemRenderer = this; - + GlStateManager.translate(-0.5F, -0.5F, -0.5F); if (DeferredStateManager.isInDeferredPass() && isTransparentItem(stack)) { if (DeferredStateManager.forwardCallbackHandler != null) { @@ -212,7 +212,7 @@ public class RenderItem implements IResourceManagerReloadListener { }); } } else { - this.renderModel(model, stack); + this.renderModel(model1, stack); if (stack.hasEffect()) { if (DeferredStateManager.isInDeferredPass()) { if (DeferredStateManager.forwardCallbackHandler != null @@ -247,8 +247,8 @@ public class RenderItem implements IResourceManagerReloadListener { } } else { GlStateManager.blendFunc(GL_SRC_COLOR, GL_ONE); - if (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model)) { - renderEffect(model); + if (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model1)) { + renderEffect(model1); } } } @@ -379,7 +379,6 @@ public class RenderItem implements IResourceManagerReloadListener { } this.modelLocation = modelresourcelocation; - if (modelresourcelocation != null) { ibakedmodel = this.itemModelMesher.getModelManager().getModel(modelresourcelocation); } diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java b/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java index bdc1e7f..92da97f 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderLeashKnot extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java b/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java index 41b4205..0d187fa 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java @@ -20,16 +20,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderLightningBolt extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java b/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java index d3c4cdd..1177f45 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java @@ -11,6 +11,26 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityHanging; import net.minecraft.entity.EntityLiving; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class RenderLiving extends RendererLivingEntity { public RenderLiving(RenderManager rendermanagerIn, ModelBase modelbaseIn, float shadowsizeIn) { super(rendermanagerIn, modelbaseIn, shadowsizeIn); diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java b/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java index 82a5a04..25b862c 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderMagmaCube extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java b/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java index 4413c89..dc23c21 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java @@ -110,16 +110,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderManager { @@ -127,9 +129,9 @@ public class RenderManager { private Map skinMap = Maps.newHashMap(); private RenderPlayer playerRenderer; private FontRenderer textRenderer; - public static double renderPosX; - public static double renderPosY; - public static double renderPosZ; + private double renderPosX; + private double renderPosY; + private double renderPosZ; public TextureManager renderEngine; public World worldObj; public Entity livingPlayer; diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java b/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java index 236dce0..d34fe83 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java @@ -17,16 +17,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderMinecart extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java b/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java index 9db79a2..8b73cec 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java @@ -11,16 +11,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderMinecartMobSpawner extends RenderMinecart { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java b/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java index 704eac5..087ad52 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderMooshroom extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java b/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java index 99b4a35..31897ea 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderOcelot extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java b/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java index ae53105..2e4d034 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java @@ -17,16 +17,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderPainting extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java b/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java index be8e814..03d9c3a 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderPig extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java b/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java index d982947..601f19c 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderPigZombie extends RenderBiped { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java b/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java index 8f1be83..2c20a0f 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java @@ -26,16 +26,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderPlayer extends RendererLivingEntity { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java b/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java index 7c682ec..3461f65 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java @@ -10,16 +10,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderPotion extends RenderSnowball { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java b/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java index e2739d0..17e6707 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderRabbit extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java index 5319fd2..0dedf5c 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSheep extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java index e03582b..b11b0b1 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSilverfish extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java index 7d659bf..da12fda 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSkeleton extends RenderBiped { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java index 79ada48..3d170bb 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSlime extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java index cd10d94..5908f44 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSnowMan extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java index 3e7b41d..651f943 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java @@ -14,16 +14,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSnowball extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java index 122c448..3904d5c 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSpider extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java b/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java index e3aedb4..88b8201 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderSquid extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java b/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java index e03e700..84e25a9 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java @@ -18,16 +18,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderTNTPrimed extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java b/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java index c4834f3..75cc411 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java @@ -16,16 +16,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderTntMinecart extends RenderMinecart { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java b/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java index 039363d..b0a47d5 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderVillager extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java b/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java index 56655a9..60fa308 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderWitch extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java b/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java index a1a8654..d84e0d8 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderWither extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java b/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java index 132fab3..7935ec6 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderWolf extends RenderLiving { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java b/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java index c46b21b..f7c5cd5 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java @@ -17,16 +17,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderXPOrb extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java b/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java index 7f83b12..2c2d4ba 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java @@ -21,16 +21,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderZombie extends RenderBiped { diff --git a/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java b/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java index ba82152..4011f25 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java @@ -37,6 +37,26 @@ import net.minecraft.scoreboard.Team; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class RendererLivingEntity extends Render { private static final Logger logger = LogManager.getLogger(); private static final DynamicTexture field_177096_e = new DynamicTexture(16, 16); diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java index 7c2a7b8..b907c6a 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java @@ -22,6 +22,26 @@ import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class LayerArmorBase implements LayerRenderer { protected static final ResourceLocation ENCHANTED_ITEM_GLINT_RES = new ResourceLocation( "textures/misc/enchanted_item_glint.png"); diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java index edecb81..f275147 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java @@ -17,16 +17,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerArrow implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java index 67f6eec..16eed85 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java @@ -9,16 +9,18 @@ import net.minecraft.client.renderer.entity.RendererLivingEntity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerBipedArmor extends LayerArmorBase { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java index 6f68a02..6b01a8a 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java @@ -1,14 +1,11 @@ package net.minecraft.client.renderer.entity.layers; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; -import net.lax1dude.eaglercraft.v1_8.profile.GuiScreenEditProfile; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -16,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerCape implements LayerRenderer { @@ -35,12 +34,14 @@ public class LayerCape implements LayerRenderer { this.playerRenderer = playerRendererIn; } - public void doRenderLayer(AbstractClientPlayer abstractclientplayer, float var2, float var3, float f, float var5, float var6, float var7, float var8) { + public void doRenderLayer(AbstractClientPlayer abstractclientplayer, float var2, float var3, float f, float var5, + float var6, float var7, float var8) { if (abstractclientplayer.hasPlayerInfo() && !abstractclientplayer.isInvisible() && abstractclientplayer.isWearing(EnumPlayerModelParts.CAPE) + && abstractclientplayer.getLocationCape() != null && this.playerRenderer.getMainModel() instanceof ModelPlayer) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.playerRenderer.bindTexture(new ResourceLocation("/capes/cape.png")); + this.playerRenderer.bindTexture(abstractclientplayer.getLocationCape()); GlStateManager.pushMatrix(); GlStateManager.translate(0.0F, 0.0F, 0.125F); double d0 = abstractclientplayer.prevChasingPosX diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java index 51fb9a5..6e15aa6 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerCreeperCharge implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java index ba09c5f..10aab24 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java @@ -27,16 +27,18 @@ import net.minecraft.util.StringUtils; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerCustomHead implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java index 8d277a7..4b00c83 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java @@ -11,16 +11,18 @@ import net.minecraft.client.renderer.entity.RenderPlayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerDeadmau5Head implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java index b7e7e8a..a5cb40a 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java @@ -22,16 +22,18 @@ import net.minecraft.entity.boss.EntityDragon; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerEnderDragonDeath implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java index 9f4fbd2..3d2f612 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerEnderDragonEyes implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java index 74322eb..72dd974 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerEndermanEyes implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java index ea2127a..b15739f 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java @@ -21,16 +21,18 @@ import net.minecraft.util.EnumWorldBlockLayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerHeldBlock implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java index df21879..02a99ca 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java @@ -19,16 +19,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerHeldItem implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java index 1aad535..f74b6bb 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java @@ -18,16 +18,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerHeldItemWitch implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java index afa103d..07346be 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java @@ -16,16 +16,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerIronGolemFlower implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java index ec825f7..0ceaa76 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java @@ -18,16 +18,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerMooshroomMushroom implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java index a8c6724..9e8d936 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java @@ -8,16 +8,18 @@ import net.minecraft.entity.EntityLivingBase; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java index 7f75f42..b3cb8f4 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerSaddle implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java index 9d926d1..c9337a6 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerSheepWool implements LayerRenderer { @@ -55,8 +57,7 @@ public class LayerSheepWool implements LayerRenderer { afloat2 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(l), afloat2); } - GlStateManager.color(afloat1[0] * (1.0F - f7) + afloat2[0] * f7, - afloat1[1] * (1.0F - f7) + afloat2[1] * f7, afloat1[2] * (1.0F - f7) + afloat2[2] * f7); + GlStateManager.color(afloat1[0] * (1.0F - f7) + afloat2[0] * f7, afloat1[1] * (1.0F - f7) + afloat2[1] * f7, afloat1[2] * (1.0F - f7) + afloat2[2] * f7); } else { float[] afloat = EntitySheep.func_175513_a(entitysheep.getFleeceColor()); diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java index bf6e9cc..8b2b32d 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java @@ -21,16 +21,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerSlimeGel implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java index d054d0e..2b0cfb5 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java @@ -14,16 +14,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerSnowmanHead implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java index 9999451..dd628d7 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerSpiderEyes implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java index 69b14d3..e15cb28 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java @@ -9,16 +9,18 @@ import net.minecraft.client.renderer.entity.RendererLivingEntity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerVillagerArmor extends LayerBipedArmor { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java index b1afc9b..528a848 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerWitherAura implements LayerRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java index 62d103a..5f5bd79 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayerWolfCollar implements LayerRenderer { @@ -35,7 +37,8 @@ public class LayerWolfCollar implements LayerRenderer { this.wolfRenderer = wolfRendererIn; } - public void doRenderLayer(EntityWolf entitywolf, float f, float f1, float var4, float f2, float f3, float f4, float f5) { + public void doRenderLayer(EntityWolf entitywolf, float f, float f1, float var4, float f2, float f3, float f4, + float f5) { if (entitywolf.isTamed() && !entitywolf.isInvisible()) { this.wolfRenderer.bindTexture(WOLF_COLLAR); EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitywolf.getCollarColor().getMetadata()); diff --git a/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java b/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java index 6014b00..5a98fa5 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java +++ b/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java @@ -4,6 +4,26 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class AbstractTexture implements ITextureObject { protected int glTextureId = -1; protected boolean blur; diff --git a/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java b/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java index 93c1e0c..c911269 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java +++ b/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java @@ -11,16 +11,18 @@ import net.minecraft.client.resources.IResourceManager; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DynamicTexture extends AbstractTexture { @@ -30,7 +32,7 @@ public class DynamicTexture extends AbstractTexture { public DynamicTexture(ImageData bufferedImage) { this(bufferedImage.width, bufferedImage.height); - System.arraycopy(bufferedImage.getPixels(), 0, dynamicTextureData, 0, bufferedImage.getPixels().length); + System.arraycopy(bufferedImage.pixels, 0, dynamicTextureData, 0, bufferedImage.pixels.length); this.updateDynamicTexture(); } diff --git a/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java b/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java index 75d08c2..1fb7b6c 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java +++ b/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java @@ -6,16 +6,18 @@ package net.minecraft.client.renderer.texture; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IIconCreator { diff --git a/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java b/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java index d1ac1fc..9856cb9 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java +++ b/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java @@ -10,16 +10,18 @@ import net.minecraft.client.resources.IResourceManager; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITextureObject { diff --git a/src/main/java/net/minecraft/client/renderer/texture/ITickable.java b/src/main/java/net/minecraft/client/renderer/texture/ITickable.java index d4bba88..1123887 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/ITickable.java +++ b/src/main/java/net/minecraft/client/renderer/texture/ITickable.java @@ -6,16 +6,18 @@ package net.minecraft.client.renderer.texture; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITickable { diff --git a/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java b/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java index 45e5dee..4787346 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java +++ b/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java @@ -6,16 +6,18 @@ package net.minecraft.client.renderer.texture; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITickableTextureObject extends ITextureObject, ITickable { diff --git a/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java b/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java index e7b4371..bde2a7c 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java +++ b/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayeredColorMaskTexture extends AbstractTexture { @@ -68,13 +70,13 @@ public class LayeredColorMaskTexture extends AbstractTexture { if (bufferedimage2.width == bufferedimage.width && bufferedimage2.height == bufferedimage.height) { for (int k = 0; k < bufferedimage2.height; ++k) { for (int l = 0; l < bufferedimage2.width; ++l) { - int i1 = bufferedimage2.getPixels()[k * bufferedimage2.width + l]; + int i1 = bufferedimage2.pixels[k * bufferedimage2.width + l]; if ((i1 & -16777216) != 0) { int j1 = (i1 & 16711680) << 8 & -16777216; - int k1 = bufferedimage1.getPixels()[k * bufferedimage1.width + l]; + int k1 = bufferedimage1.pixels[k * bufferedimage1.width + l]; int l1 = MathHelper.func_180188_d(k1, ImageData.swapRB(mapcolor.colorValue)) & 16777215; - bufferedimage2.getPixels()[k * bufferedimage2.width + l] = j1 | l1; + bufferedimage2.pixels[k * bufferedimage2.width + l] = j1 | l1; } } } diff --git a/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java b/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java index 0ac89a9..5a85eff 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java +++ b/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java @@ -18,16 +18,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LayeredTexture extends AbstractTexture { diff --git a/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java b/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java index 4db19d6..0d6abf3 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java +++ b/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java @@ -17,16 +17,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SimpleTexture extends AbstractTexture { diff --git a/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java b/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java index 0fa606c..a8d3664 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java +++ b/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java @@ -20,16 +20,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Stitcher { diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java b/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java index 3fef6c8..544db68 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java +++ b/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java @@ -11,16 +11,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureClock extends EaglerTextureAtlasSprite { diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java b/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java index 5457e55..d39d5e7 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java +++ b/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureCompass extends EaglerTextureAtlasSprite { diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java b/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java index bd0d6c6..d8f43ea 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java +++ b/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java @@ -30,16 +30,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureManager implements ITickable, IResourceManagerReloadListener { @@ -160,7 +162,7 @@ public class TextureManager implements ITickable, IResourceManagerReloadListener } } - + public void reloadBannerTextures() { for (Object entry : this.mapTextureObjects.entrySet()) { ResourceLocation resourcelocation = (ResourceLocation)((Entry) entry).getKey(); diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java b/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java index 601d363..2451b50 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java +++ b/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java @@ -46,16 +46,18 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureMap extends AbstractTexture implements ITickableTextureObject { @@ -582,7 +584,7 @@ public class TextureMap extends AbstractTexture implements ITickableTextureObjec GlStateManager.setActiveTexture(GL_TEXTURE0); } } - + public EaglerTextureAtlasSprite getSpriteSafe(String p_getSpriteSafe_1_) { ResourceLocation resourcelocation = new ResourceLocation(p_getSpriteSafe_1_); return (EaglerTextureAtlasSprite)this.mapRegisteredSprites.get(resourcelocation.toString()); diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java b/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java index 6eb7430..a31b1d1 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java +++ b/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java @@ -5,7 +5,7 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import java.io.IOException; import java.io.InputStream; import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer; - +import net.PeytonPlayz585.shadow.Config; import net.lax1dude.eaglercraft.v1_8.IOUtils; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -17,24 +17,24 @@ import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.resources.IResourceManager; import net.minecraft.util.ResourceLocation; -import net.PeytonPlayz585.shadow.Config; - /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureUtil { @@ -243,7 +243,7 @@ public class TextureUtil { private static void setTextureBlurred(boolean parFlag) { setTextureBlurMipmap(parFlag, false); } - + private static void setTextureBlurMipmap(boolean parFlag, boolean parFlag2) { if (parFlag) { EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, parFlag2 ? 9987 : 9729); @@ -277,7 +277,7 @@ public class TextureUtil { public static int[] readImageData(IResourceManager resourceManager, ResourceLocation imageLocation) throws IOException { - return readBufferedImage(resourceManager.getResource(imageLocation).getInputStream()).getPixels(); + return readBufferedImage(resourceManager.getResource(imageLocation).getInputStream()).pixels; } public static ImageData readBufferedImage(InputStream imageStream) throws IOException { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java b/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java index c0ab4f8..9c1bd40 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderEnderCrystal extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java b/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java index f346876..b9ba609 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java @@ -37,16 +37,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderItemFrame extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java b/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java index b3aed53..167dc90 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RenderWitherSkull extends Render { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java index 484e611..826d1a7 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java @@ -24,16 +24,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityBannerRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java index ba538d1..0f929be 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java @@ -23,16 +23,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityBeaconRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java index 73cff1a..4be2d70 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java @@ -4,6 +4,7 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import java.util.Calendar; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.block.Block; import net.minecraft.block.BlockChest; @@ -18,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityChestRenderer extends TileEntitySpecialRenderer { @@ -46,7 +49,7 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer= 24 && calendar.get(5) <= 26) { this.isChristams = true; } diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java index 3424a58..19b1093 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityEnchantmentTableRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java index 77c29f6..fb2fac0 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java @@ -23,16 +23,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityEndPortalRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java index 42129aa..707565b 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java @@ -13,16 +13,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityEnderChestRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java index 651b022..2a4ac88 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java @@ -22,16 +22,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityItemStackRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java index cf2bfe9..3b4d34a 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java @@ -12,16 +12,18 @@ import net.minecraft.tileentity.TileEntityMobSpawner; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java index 25bdfeb..5bdf7d0 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java @@ -28,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityPistonRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java index cc3c54f..28f5df8 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java @@ -33,16 +33,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityRendererDispatcher { @@ -118,8 +120,8 @@ public class TileEntityRendererDispatcher { if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn .getMaxRenderDistanceSquared()) { int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0); - int j = MathHelper.fastMath ? i % 65536 : i % 4096; - int k = MathHelper.fastMath ? i / 65536 : i / 4096; + int j = !MathHelper.fastMath ? i % 65536 : i % 4096; + int k = !MathHelper.fastMath ? i / 65536 : i / 4096; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); BlockPos blockpos = tileentityIn.getPos(); diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java index 64eba3b..37dc603 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java @@ -28,16 +28,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntitySignRenderer extends TileEntitySpecialRenderer { @@ -99,7 +101,7 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer { diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java index 90778c5..21e9892 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java @@ -6,6 +6,26 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class TileEntitySpecialRenderer { protected static final ResourceLocation[] DESTROY_STAGES = new ResourceLocation[] { new ResourceLocation("textures/blocks/destroy_stage_0.png"), diff --git a/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java b/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java index 7a95689..a9d4297 100644 --- a/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java +++ b/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.VertexFormat; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DefaultVertexFormats { diff --git a/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java b/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java index e441dc4..1bbb1d5 100644 --- a/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java +++ b/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java @@ -18,6 +18,26 @@ import net.minecraft.client.resources.data.IMetadataSection; import net.minecraft.client.resources.data.IMetadataSerializer; import net.minecraft.util.ResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class AbstractResourcePack implements IResourcePack { private static final Logger resourceLog = LogManager.getLogger(); public final String resourcePackFile; diff --git a/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java b/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java index faf6b77..02fd9fd 100644 --- a/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java +++ b/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DefaultPlayerSkin { diff --git a/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java b/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java index e8cf61d..28d2d45 100644 --- a/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java +++ b/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java @@ -20,16 +20,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DefaultResourcePack implements IResourcePack { diff --git a/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java b/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java index baeef1a..90829b9 100644 --- a/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java +++ b/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java @@ -20,16 +20,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FallbackResourceManager implements IResourceManager { diff --git a/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java b/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java index fbd1a3d..8488e5a 100644 --- a/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java +++ b/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java @@ -12,16 +12,18 @@ import net.minecraft.world.ColorizerFoliage; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FoliageColorReloadListener implements IResourceManagerReloadListener { diff --git a/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java b/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java index e292ed2..e4b05b4 100644 --- a/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java +++ b/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java @@ -12,16 +12,18 @@ import net.minecraft.world.ColorizerGrass; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GrassColorReloadListener implements IResourceManagerReloadListener { diff --git a/src/main/java/net/minecraft/client/resources/I18n.java b/src/main/java/net/minecraft/client/resources/I18n.java index e653548..669c55c 100644 --- a/src/main/java/net/minecraft/client/resources/I18n.java +++ b/src/main/java/net/minecraft/client/resources/I18n.java @@ -6,16 +6,18 @@ package net.minecraft.client.resources; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 I18n { diff --git a/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java b/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java index 6490fda..eb89a99 100644 --- a/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java +++ b/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java @@ -8,16 +8,18 @@ import java.util.List; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IReloadableResourceManager extends IResourceManager { diff --git a/src/main/java/net/minecraft/client/resources/IResource.java b/src/main/java/net/minecraft/client/resources/IResource.java index c9585d0..e344c58 100644 --- a/src/main/java/net/minecraft/client/resources/IResource.java +++ b/src/main/java/net/minecraft/client/resources/IResource.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IResource { diff --git a/src/main/java/net/minecraft/client/resources/IResourceManager.java b/src/main/java/net/minecraft/client/resources/IResourceManager.java index 2f87c1b..9a8db5c 100644 --- a/src/main/java/net/minecraft/client/resources/IResourceManager.java +++ b/src/main/java/net/minecraft/client/resources/IResourceManager.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IResourceManager { diff --git a/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java b/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java index e3d083f..0671798 100644 --- a/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java +++ b/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java @@ -6,16 +6,18 @@ package net.minecraft.client.resources; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IResourceManagerReloadListener { diff --git a/src/main/java/net/minecraft/client/resources/IResourcePack.java b/src/main/java/net/minecraft/client/resources/IResourcePack.java index 4730bab..3765052 100644 --- a/src/main/java/net/minecraft/client/resources/IResourcePack.java +++ b/src/main/java/net/minecraft/client/resources/IResourcePack.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IResourcePack { diff --git a/src/main/java/net/minecraft/client/resources/Language.java b/src/main/java/net/minecraft/client/resources/Language.java index 0c8b677..bb26bf8 100644 --- a/src/main/java/net/minecraft/client/resources/Language.java +++ b/src/main/java/net/minecraft/client/resources/Language.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.HString; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Language implements Comparable { diff --git a/src/main/java/net/minecraft/client/resources/LanguageManager.java b/src/main/java/net/minecraft/client/resources/LanguageManager.java index 3b3e11b..45216ca 100644 --- a/src/main/java/net/minecraft/client/resources/LanguageManager.java +++ b/src/main/java/net/minecraft/client/resources/LanguageManager.java @@ -22,16 +22,18 @@ import net.minecraft.util.StringTranslate; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LanguageManager implements IResourceManagerReloadListener { diff --git a/src/main/java/net/minecraft/client/resources/Locale.java b/src/main/java/net/minecraft/client/resources/Locale.java index 9d15948..c7ee6df 100644 --- a/src/main/java/net/minecraft/client/resources/Locale.java +++ b/src/main/java/net/minecraft/client/resources/Locale.java @@ -25,16 +25,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Locale { diff --git a/src/main/java/net/minecraft/client/resources/ResourceIndex.java b/src/main/java/net/minecraft/client/resources/ResourceIndex.java index 4d6e69a..d5c48d1 100644 --- a/src/main/java/net/minecraft/client/resources/ResourceIndex.java +++ b/src/main/java/net/minecraft/client/resources/ResourceIndex.java @@ -6,16 +6,18 @@ package net.minecraft.client.resources; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ResourceIndex { diff --git a/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java b/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java index c677ef5..a1b854a 100644 --- a/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java +++ b/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.HString; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ResourcePackFileNotFoundException extends FileNotFoundException { diff --git a/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java b/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java index 30c0124..9b2b7e2 100644 --- a/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java +++ b/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java @@ -16,6 +16,26 @@ import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IChatComponent; import net.minecraft.util.ResourceLocation; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class ResourcePackListEntry implements GuiListExtended.IGuiListEntry { private static final ResourceLocation RESOURCE_PACKS_TEXTURE = new ResourceLocation( "textures/gui/resource_packs.png"); diff --git a/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java b/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java index 6544095..0e9134d 100644 --- a/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java +++ b/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java @@ -19,16 +19,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ResourcePackListEntryDefault extends ResourcePackListEntry { diff --git a/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java b/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java index d5d0341..fcd654c 100644 --- a/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java +++ b/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java @@ -8,16 +8,18 @@ import net.minecraft.client.gui.GuiScreenResourcePacks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ResourcePackListEntryFound extends ResourcePackListEntry { diff --git a/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java b/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java index f1dfde4..19c33e4 100644 --- a/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java +++ b/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java @@ -2,7 +2,6 @@ package net.minecraft.client.resources; import java.io.Closeable; import java.io.IOException; -import java.io.InputStream; import java.util.Iterator; import java.util.List; import java.util.function.Consumer; @@ -32,16 +31,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ResourcePackRepository { @@ -162,21 +163,6 @@ public class ResourcePackRepository { } } - public IResource getResource(ResourceLocation location) { - for (ResourcePackRepository.Entry entry : this.repositoryEntries) { - try { - IResourcePack resourcePack = entry.getResourcePack(); - InputStream inputStream = resourcePack.getInputStream(location); - if (inputStream != null) { - return new SimpleResource(entry.getResourcePackName(), location, inputStream, null, null); - } - } catch (IOException e) { - logger.warn("Failed to access resource pack {}", entry.getResourcePackName(), e); - } - } - return null; - } - public class Entry { private final String resourcePackFile; private IResourcePack reResourcePack; diff --git a/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java b/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java index c7f1540..97c2c73 100644 --- a/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java +++ b/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java @@ -24,16 +24,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SimpleReloadableResourceManager implements IReloadableResourceManager { diff --git a/src/main/java/net/minecraft/client/resources/SimpleResource.java b/src/main/java/net/minecraft/client/resources/SimpleResource.java index dfddda4..36f18e2 100644 --- a/src/main/java/net/minecraft/client/resources/SimpleResource.java +++ b/src/main/java/net/minecraft/client/resources/SimpleResource.java @@ -21,16 +21,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SimpleResource implements IResource { diff --git a/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java b/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java index e7b32ea..f02fe10 100644 --- a/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java +++ b/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java @@ -6,16 +6,18 @@ package net.minecraft.client.resources.data; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AnimationFrame { diff --git a/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java b/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java index 1175aa3..4ab521d 100644 --- a/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java +++ b/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java @@ -12,16 +12,18 @@ import com.google.common.collect.Sets; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AnimationMetadataSection implements IMetadataSection { diff --git a/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java index bc07618..60ac3d3 100644 --- a/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java @@ -17,16 +17,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeSerializer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer diff --git a/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java index be16da4..1969b40 100644 --- a/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java @@ -1,5 +1,25 @@ package net.minecraft.client.resources.data; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BaseMetadataSectionSerializer implements IMetadataSectionSerializer { } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java b/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java index 1bd8b92..d9b5f51 100644 --- a/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java +++ b/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java @@ -6,16 +6,18 @@ package net.minecraft.client.resources.data; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FontMetadataSection implements IMetadataSection { diff --git a/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java index 0827bcb..c4cc56b 100644 --- a/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java @@ -10,16 +10,18 @@ import org.json.JSONObject; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FontMetadataSectionSerializer extends BaseMetadataSectionSerializer { diff --git a/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java b/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java index 48cc34f..0e058a9 100644 --- a/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java +++ b/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java @@ -6,16 +6,18 @@ package net.minecraft.client.resources.data; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IMetadataSection { diff --git a/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java index 3207d2c..e410fe5 100644 --- a/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java @@ -10,16 +10,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeDeserializer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IMetadataSectionSerializer extends JSONTypeDeserializer { diff --git a/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java b/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java index 90dad86..b906bfd 100644 --- a/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java @@ -12,16 +12,18 @@ import net.minecraft.util.RegistrySimple; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 IMetadataSerializer { diff --git a/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java b/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java index 7d189b3..bf34f53 100644 --- a/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java +++ b/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java @@ -10,16 +10,18 @@ import net.minecraft.client.resources.Language; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LanguageMetadataSection implements IMetadataSection { diff --git a/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java index 7d7f5be..e1471f2 100644 --- a/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java @@ -15,16 +15,18 @@ import net.minecraft.client.resources.Language; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer { diff --git a/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java b/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java index c97053f..30086fa 100644 --- a/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java +++ b/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PackMetadataSection implements IMetadataSection { diff --git a/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java index e6b061b..bcd1c2a 100644 --- a/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PackMetadataSectionSerializer extends BaseMetadataSectionSerializer diff --git a/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java b/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java index 4f9b4fa..4dba70f 100644 --- a/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java +++ b/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java @@ -9,16 +9,18 @@ import java.util.List; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureMetadataSection implements IMetadataSection { diff --git a/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java b/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java index 75eef6e..fafb960 100644 --- a/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java +++ b/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java @@ -14,16 +14,18 @@ import com.google.common.collect.Lists; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TextureMetadataSectionSerializer extends BaseMetadataSectionSerializer { diff --git a/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java b/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java index b89152f..d57e3fe 100644 --- a/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java +++ b/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java @@ -13,16 +13,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BuiltInModel implements IBakedModel { diff --git a/src/main/java/net/minecraft/client/resources/model/IBakedModel.java b/src/main/java/net/minecraft/client/resources/model/IBakedModel.java index 0425928..11ab9dd 100644 --- a/src/main/java/net/minecraft/client/resources/model/IBakedModel.java +++ b/src/main/java/net/minecraft/client/resources/model/IBakedModel.java @@ -13,16 +13,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBakedModel { diff --git a/src/main/java/net/minecraft/client/resources/model/ModelBakery.java b/src/main/java/net/minecraft/client/resources/model/ModelBakery.java index 586e39c..69ad5f4 100644 --- a/src/main/java/net/minecraft/client/resources/model/ModelBakery.java +++ b/src/main/java/net/minecraft/client/resources/model/ModelBakery.java @@ -55,16 +55,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelBakery { diff --git a/src/main/java/net/minecraft/client/resources/model/ModelManager.java b/src/main/java/net/minecraft/client/resources/model/ModelManager.java index af65025..9fab93a 100644 --- a/src/main/java/net/minecraft/client/resources/model/ModelManager.java +++ b/src/main/java/net/minecraft/client/resources/model/ModelManager.java @@ -12,16 +12,18 @@ import net.minecraft.util.IRegistry; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelManager implements IResourceManagerReloadListener { diff --git a/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java b/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java index 6d0dfb0..e8a0372 100644 --- a/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java +++ b/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelResourceLocation extends ResourceLocation { diff --git a/src/main/java/net/minecraft/client/resources/model/ModelRotation.java b/src/main/java/net/minecraft/client/resources/model/ModelRotation.java index cf2c759..447734c 100644 --- a/src/main/java/net/minecraft/client/resources/model/ModelRotation.java +++ b/src/main/java/net/minecraft/client/resources/model/ModelRotation.java @@ -15,16 +15,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModelRotation { diff --git a/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java b/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java index de54fbf..ebd4ce3 100644 --- a/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java +++ b/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java @@ -17,16 +17,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SimpleBakedModel implements IBakedModel { diff --git a/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java b/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java index fafd7a8..2b1acb7 100644 --- a/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java +++ b/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java @@ -18,16 +18,18 @@ import net.minecraft.util.WeightedRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WeightedBakedModel implements IBakedModel { diff --git a/src/main/java/net/minecraft/client/settings/GameSettings.java b/src/main/java/net/minecraft/client/settings/GameSettings.java index 62bc757..e21e5dc 100644 --- a/src/main/java/net/minecraft/client/settings/GameSettings.java +++ b/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -9,6 +9,9 @@ import java.util.List; import java.util.Map; import java.util.Set; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; import org.json.JSONArray; import com.google.common.collect.ImmutableSet; @@ -16,11 +19,12 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import net.PeytonPlayz585.shadow.BetterGrass; +import net.PeytonPlayz585.shadow.ClearWater; import net.PeytonPlayz585.shadow.Config; import net.PeytonPlayz585.shadow.CustomColors; import net.PeytonPlayz585.shadow.CustomSky; import net.PeytonPlayz585.shadow.DynamicLights; -import net.PeytonPlayz585.shadow.shaders.Shaders; import net.lax1dude.eaglercraft.v1_8.ArrayUtils; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; @@ -42,8 +46,6 @@ import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.network.play.client.C15PacketClientSettings; import net.minecraft.util.MathHelper; import net.minecraft.world.EnumDifficulty; -import net.PeytonPlayz585.shadow.BetterGrass; -import net.PeytonPlayz585.shadow.ClearWater; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -51,16 +53,18 @@ import net.PeytonPlayz585.shadow.ClearWater; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GameSettings { @@ -75,6 +79,14 @@ public class GameSettings { "options.particles.minimal" }; private static final String[] AMBIENT_OCCLUSIONS = new String[] { "options.ao.off", "options.ao.min", "options.ao.max" }; + private static final String[] STREAM_COMPRESSIONS = new String[] { "options.stream.compression.low", + "options.stream.compression.medium", "options.stream.compression.high" }; + private static final String[] STREAM_CHAT_MODES = new String[] { "options.stream.chat.enabled.streaming", + "options.stream.chat.enabled.always", "options.stream.chat.enabled.never" }; + private static final String[] STREAM_CHAT_FILTER_MODES = new String[] { "options.stream.chat.userFilter.all", + "options.stream.chat.userFilter.subs", "options.stream.chat.userFilter.mods" }; + private static final String[] STREAM_MIC_MODES = new String[] { "options.stream.mic_toggle.mute", + "options.stream.mic_toggle.talk" }; private static final String[] field_181149_aW = new String[] { "options.off", "options.graphics.fast", "options.graphics.fancy" }; public float mouseSensitivity = 0.5F; @@ -84,6 +96,9 @@ public class GameSettings { public boolean anaglyph; public boolean fboEnable = true; public int limitFramerate = 260; + /**+ + * Clouds flag + */ public boolean fancyGraphics = false; /**+ * Smooth Lighting @@ -125,23 +140,23 @@ public class GameSettings { public KeyBinding keyBindRight = new KeyBinding("key.right", 32, "key.categories.movement"); public KeyBinding keyBindJump = new KeyBinding("key.jump", 57, "key.categories.movement"); public KeyBinding keyBindSneak = new KeyBinding("key.sneak", 42, "key.categories.movement"); - public KeyBinding keyBindSprint = new KeyBinding(10, "key.sprint", KeyboardConstants.KEY_R, "key.categories.movement"); - public KeyBinding keyBindInventory = new KeyBinding(3, "key.inventory", 18, "key.categories.inventory"); - public KeyBinding keyBindUseItem = new KeyBinding(6, "key.use", -99, "key.categories.gameplay"); - public KeyBinding keyBindDrop = new KeyBinding(13, "key.drop", 16, "key.categories.gameplay"); - public KeyBinding keyBindAttack = new KeyBinding(7, "key.attack", -100, "key.categories.gameplay"); + public KeyBinding keyBindSprint = new KeyBinding("key.sprint", KeyboardConstants.KEY_R, "key.categories.movement"); + public KeyBinding keyBindInventory = new KeyBinding("key.inventory", 18, "key.categories.inventory"); + public KeyBinding keyBindUseItem = new KeyBinding("key.use", -99, "key.categories.gameplay"); + public KeyBinding keyBindDrop = new KeyBinding("key.drop", 16, "key.categories.gameplay"); + public KeyBinding keyBindAttack = new KeyBinding("key.attack", -100, "key.categories.gameplay"); public KeyBinding keyBindPickBlock = new KeyBinding("key.pickItem", -98, "key.categories.gameplay"); - public KeyBinding keyBindChat = new KeyBinding(15, "key.chat", 20, "key.categories.multiplayer"); + public KeyBinding keyBindChat = new KeyBinding("key.chat", 20, "key.categories.multiplayer"); public KeyBinding keyBindPlayerList = new KeyBinding("key.playerlist", 15, "key.categories.multiplayer"); public KeyBinding keyBindCommand = new KeyBinding("key.command", 53, "key.categories.multiplayer"); public KeyBinding keyBindScreenshot = new KeyBinding("key.screenshot", 60, "key.categories.misc"); - public KeyBinding keyBindTogglePerspective = new KeyBinding(12, "key.togglePerspective", 63, "key.categories.misc"); - public KeyBinding keyBindSmoothCamera = new KeyBinding(14, "key.smoothCamera", KeyboardConstants.KEY_M, + public KeyBinding keyBindTogglePerspective = new KeyBinding("key.togglePerspective", 63, "key.categories.misc"); + public KeyBinding keyBindSmoothCamera = new KeyBinding("key.smoothCamera", KeyboardConstants.KEY_M, "key.categories.misc"); public KeyBinding keyBindZoomCamera = new KeyBinding("key.zoomCamera", KeyboardConstants.KEY_C, "key.categories.misc"); public KeyBinding keyBindFunction = new KeyBinding("key.function", KeyboardConstants.KEY_F, "key.categories.misc"); - public KeyBinding keyBindClose = new KeyBinding(9, "key.close", KeyboardConstants.KEY_GRAVE, "key.categories.misc"); + public KeyBinding keyBindClose = new KeyBinding("key.close", KeyboardConstants.KEY_GRAVE, "key.categories.misc"); public KeyBinding[] keyBindsHotbar = new KeyBinding[] { new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"), @@ -155,6 +170,9 @@ public class GameSettings { public KeyBinding[] keyBindings; protected Minecraft mc; public EnumDifficulty difficulty; + public boolean hasCreatedDemoWorld; + public int relayTimeout; + public boolean hideJoinCode; public boolean hideGUI; public int thirdPersonView; public boolean showDebugInfo; @@ -180,90 +198,85 @@ public class GameSettings { public boolean hudStats = false; public boolean hud24h = false; public boolean chunkFix = true; + public boolean fog = true; public int fxaa = 0; public boolean shaders = false; public boolean shadersAODisable = false; public EaglerDeferredConfig deferredShaderConf = new EaglerDeferredConfig(); + public boolean enableUpdateSvc = true; //Main Menu Settings - public float ofAoLevel = 1.0F; - public boolean useVbo = false; - public int ofFogType = 1; - public float ofFogStart = 0.8F; - - //Quality Settings - public int ofMipmapType = 0; - public boolean ofCustomSky = true; - public boolean ofClearWater = false; - public boolean ofBetterSnow = false; - public boolean ofCustomFonts = true; - public int ofBetterGrass = 3; - public int ofDynamicLights = 3; - public boolean ofCustomColors = true; - public boolean ofSwampColors = true; - public boolean ofSmoothBiomes = true; - public boolean ofCustomItems = true; - - //Detail Settings - /** Clouds flag */ - public int clouds = 2; - public int ofClouds = 0; - public float ofCloudsHeight = 0.0F; - public int ofTrees = 0; - public int ofRain = 0; - public boolean ofSky = false; - public boolean ofStars = false; - public boolean ofSunMoon = false; - public boolean ofShowCapes = false; - public int ofTranslucentBlocks = 0; - public boolean heldItemTooltips = false; - public int ofDroppedItems = 0; - public int ofVignette = 0; - public boolean ofDynamicFov = false; - - //Optifine Animations - public int ofAnimatedWater = 2; - public int ofAnimatedLava = 2; - public boolean ofAnimatedFire = false; - public boolean ofAnimatedPortal = false; - public boolean ofAnimatedRedstone = false; - public boolean ofAnimatedExplosion = false; - public boolean ofAnimatedFlame = false; - public boolean ofAnimatedSmoke = false; - public boolean ofVoidParticles = false; - public boolean ofWaterParticles = false; - public boolean ofPortalParticles = false; - public boolean ofPotionParticles = false; - public boolean ofFireworkParticles = false; - public boolean ofDrippingWaterLava = false; - public boolean ofAnimatedTerrain = false; - public boolean ofAnimatedTextures = false; - public boolean ofRainSplash = false; - - //Performance Settings - public boolean ofSmoothFps = false; - public int ofChunkUpdates = 1; - public static boolean ofFastMath = true; - - //Super Secret Setting :> - public boolean secret = false; - - //Shaders - public int profile = 1; - - - //Other... - private static final int[] OF_DYNAMIC_LIGHTS = new int[] {3, 1, 2}; - private static final String[] KEYS_DYNAMIC_LIGHTS = new String[] {"options.off", "options.graphics.fast", "options.graphics.fancy"}; - private static final int[] OF_TREES_VALUES = new int[] {0, 1, 4, 2}; + public float ofAoLevel = 1.0F; + public boolean useVbo = false; + public int ofFogType = 1; + public float ofFogStart = 0.8F; + + //Quality Settings + public int ofMipmapType = 0; + public boolean ofCustomSky = true; + public boolean ofClearWater = false; + public boolean ofBetterSnow = false; + public boolean ofCustomFonts = true; + public int ofBetterGrass = 3; + public int ofDynamicLights = 3; + public boolean ofCustomColors = true; + public boolean ofSwampColors = true; + public boolean ofSmoothBiomes = true; + public boolean ofCustomItems = true; + + //Detail Settings + /** Clouds flag */ + public int clouds = 2; + public int ofClouds = 0; + public float ofCloudsHeight = 0.0F; + public int ofTrees = 0; + public int ofRain = 0; + public boolean ofSky = false; + public boolean ofStars = false; + public boolean ofSunMoon = false; + public boolean ofShowCapes = false; + public int ofTranslucentBlocks = 0; + public boolean heldItemTooltips = false; + public int ofDroppedItems = 0; + public int ofVignette = 0; + public boolean ofDynamicFov = false; + + //Optifine Animations + public int ofAnimatedWater = 2; + public int ofAnimatedLava = 2; + public boolean ofAnimatedFire = false; + public boolean ofAnimatedPortal = false; + public boolean ofAnimatedRedstone = false; + public boolean ofAnimatedExplosion = false; + public boolean ofAnimatedFlame = false; + public boolean ofAnimatedSmoke = false; + public boolean ofVoidParticles = false; + public boolean ofWaterParticles = false; + public boolean ofPortalParticles = false; + public boolean ofPotionParticles = false; + public boolean ofFireworkParticles = false; + public boolean ofDrippingWaterLava = false; + public boolean ofAnimatedTerrain = false; + public boolean ofAnimatedTextures = false; + public boolean ofRainSplash = false; + + //Performance Settings + public boolean ofSmoothFps = false; + public int ofChunkUpdates = 1; + public static boolean ofFastMath = true; + + //Other... + private static final int[] OF_DYNAMIC_LIGHTS = new int[] {3, 1, 2}; + private static final String[] KEYS_DYNAMIC_LIGHTS = new String[] {"options.off", "options.graphics.fast", "options.graphics.fancy"}; + private static final int[] OF_TREES_VALUES = new int[] {0, 1, 4, 2}; - public static boolean toggleSprint = false; - public static boolean toggleSprintEnabled = false; - public boolean leftHand = false; - public boolean chunkBorders = false; - public boolean ofLagometer = false; - public boolean ofProfiler = false; - public boolean hidePassword = true; + public static boolean toggleSprint = false; + public static boolean toggleSprintEnabled = false; + public boolean leftHand = false; + public boolean chunkBorders = false; + public boolean ofLagometer = false; + public boolean ofProfiler = false; + public boolean hidePassword = true; public GameSettings(Minecraft mcIn) { this.keyBindings = (KeyBinding[]) ArrayUtils.addAll(new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem, @@ -273,6 +286,8 @@ public class GameSettings { this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindZoomCamera, this.keyBindFunction, this.keyBindClose }, this.keyBindsHotbar); this.difficulty = EnumDifficulty.NORMAL; + this.relayTimeout = 4; + this.hideJoinCode = false; this.lastServer = ""; this.fovSetting = 70.0F; this.gammaSetting = 1.0F; @@ -418,6 +433,10 @@ public class GameSettings { this.viewBobbing = !this.viewBobbing; } + if (parOptions == GameSettings.Options.RENDER_CLOUDS) { + this.clouds = (this.clouds + parInt1) % 3; + } + if (parOptions == GameSettings.Options.FORCE_UNICODE_FONT) { this.forceUnicodeFont = !this.forceUnicodeFont; this.mc.fontRendererObj @@ -510,7 +529,11 @@ public class GameSettings { if (parOptions == GameSettings.Options.CHUNK_FIX) { this.chunkFix = !this.chunkFix; } - + + if (parOptions == GameSettings.Options.FOG) { + this.fog = !this.fog; + } + if (parOptions == GameSettings.Options.FXAA) { this.fxaa = (this.fxaa + parInt1) % 3; } @@ -653,17 +676,6 @@ public class GameSettings { } } - if(parOptions == GameSettings.Options.SHADER_PROFILE) { - ++this.profile; - - if(this.profile > 4) { - this.profile = 1; - } - - Shaders shader = new Shaders(); - shader.updateShaderProfile(profile); - } - if (parOptions == GameSettings.Options.SMOOTH_FPS) { this.ofSmoothFps = !this.ofSmoothFps; } @@ -695,6 +707,7 @@ public class GameSettings { if (parOptions == GameSettings.Options.FAST_MATH) { ofFastMath = !ofFastMath; MathHelper.fastMath = ofFastMath; + net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper.fastMath = ofFastMath; } if (parOptions == GameSettings.Options.RAIN) { @@ -883,6 +896,8 @@ public class GameSettings { return this.hud24h; case CHUNK_FIX: return this.chunkFix; + case FOG: + return this.fog; case FULLSCREEN: return this.mc.isFullScreen(); case USE_VBO: @@ -928,7 +943,7 @@ public class GameSettings { if (parInt1 < 0 || parInt1 >= parArrayOfString.length) { parInt1 = 0; } - + return I18n.format(parArrayOfString[parInt1], new Object[0]); } @@ -941,21 +956,22 @@ public class GameSettings { float f1 = this.getOptionFloatValue(parOptions); float f = parOptions.normalizeValue(f1); return parOptions == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int) (f * 200.0F) + "%")) - : (parOptions == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int) f1)) - : (parOptions == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == parOptions.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int) f1 + " fps") - : (parOptions == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int) (f * 100.0F) + "%")) - : (parOptions == GameSettings.Options.SATURATION ? s + (int) (f * 400.0F) + "%" - : (parOptions == GameSettings.Options.CHAT_OPACITY ? s + (int) (f * 90.0F + 10.0F) + "%" - : (parOptions == GameSettings.Options.CHAT_SCALE ? s + (int) (f * 90.0F + 10.0F) + "%" - : (parOptions == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" - : (parOptions == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" - : (parOptions == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.calculateChatboxWidth(f) + "px" - : (parOptions == GameSettings.Options.RENDER_DISTANCE ? s + (int) f1 + (f1 == 1.0F ? " chunk" : " chunks") - : (parOptions == GameSettings.Options.MIPMAP_LEVELS ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") - : (parOptions == GameSettings.Options.AO_LEVEL ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") - : (parOptions == GameSettings.Options.CLOUD_HEIGHT ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") - : (parOptions == GameSettings.Options.MIPMAP_TYPE ? (ofMipmapType == 0 ? s + "Nearest" : ofMipmapType == 1 ? s + "Linear" : ofMipmapType == 2 ? s + "Bilinear" : ofMipmapType == 3 ? s + "Trilinear": s) - : "yee")))))))))))))); + : (parOptions == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int) f1)) + : (parOptions == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == parOptions.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int) f1 + " fps") + : (parOptions == GameSettings.Options.RENDER_CLOUDS ? (f1 == parOptions.valueMin ? s + I18n.format("options.cloudHeight.min", new Object[0]) : s + ((int) f1 + 128)) + : (parOptions == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int) (f * 100.0F) + "%")) + : (parOptions == GameSettings.Options.SATURATION ? s + (int) (f * 400.0F) + "%" + : (parOptions == GameSettings.Options.CHAT_OPACITY ? s + (int) (f * 90.0F + 10.0F) + "%" + : (parOptions == GameSettings.Options.CHAT_SCALE ? s + (int) (f * 90.0F + 10.0F) + "%" + : (parOptions == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" + : (parOptions == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" + : (parOptions == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.calculateChatboxWidth(f) + "px" + : (parOptions == GameSettings.Options.RENDER_DISTANCE ? s + (int) f1 + (f1 == 1.0F ? " chunk" : " chunks") + : (parOptions == GameSettings.Options.MIPMAP_LEVELS ? (f == 0.0F ? s + I18n .format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") + : (parOptions == GameSettings.Options.AO_LEVEL ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") + : (parOptions == GameSettings.Options.CLOUD_HEIGHT ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") + : (parOptions == GameSettings.Options.MIPMAP_TYPE ? (ofMipmapType == 0 ? s + "Nearest" : ofMipmapType == 1 ? s + "Linear" : ofMipmapType == 2 ? s + "Bilinear" : ofMipmapType == 3 ? s + "Trilinear": s) + : "yee"))))))))))))))); } else if (parOptions.getEnumBoolean()) { boolean flag = this.getOptionOrdinalValue(parOptions); return flag ? s + I18n.format("options.on", new Object[0]) : s + I18n.format("options.off", new Object[0]); @@ -967,10 +983,13 @@ public class GameSettings { return s + getTranslation(PARTICLES, this.particleSetting); } else if (parOptions == GameSettings.Options.AMBIENT_OCCLUSION) { return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); + } else if (parOptions == GameSettings.Options.RENDER_CLOUDS) { + return s + getTranslation(field_181149_aW, this.clouds); } else if (parOptions == GameSettings.Options.GRAPHICS) { if (this.fancyGraphics) { return s + I18n.format("options.graphics.fancy", new Object[0]); } else { + String s1 = "options.graphics.fast"; return s + I18n.format("options.graphics.fast", new Object[0]); } } else if (parOptions == GameSettings.Options.FXAA) { @@ -983,215 +1002,198 @@ public class GameSettings { } } else if (parOptions == GameSettings.Options.ANIMATED_WATER) { switch (this.ofAnimatedWater) { - case 1: - return s + "Dynamic"; + case 1: + return s + "Dynamic"; - case 2: - return s + "OFF"; + case 2: + return s + "OFF"; - default: - return s + "ON"; + default: + return s + "ON"; } - } else if (parOptions == GameSettings.Options.ANIMATED_LAVA) { - switch (this.ofAnimatedLava) { - case 1: - return s + "Dynamic"; + } else if (parOptions == GameSettings.Options.ANIMATED_LAVA) { + switch (this.ofAnimatedLava) { + case 1: + return s + "Dynamic"; - case 2: - return s + "OFF"; + case 2: + return s + "OFF"; - default: - return s + "ON"; - } - } else if (parOptions == GameSettings.Options.ANIMATED_FIRE) { - return this.ofAnimatedFire ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_PORTAL) { - return this.ofAnimatedPortal ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_REDSTONE) { - return this.ofAnimatedRedstone ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_EXPLOSION) { - return this.ofAnimatedExplosion ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_FLAME) { - return this.ofAnimatedFlame ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_SMOKE) { - return this.ofAnimatedSmoke ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.VOID_PARTICLES) { - return this.ofVoidParticles ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.WATER_PARTICLES) { - return this.ofWaterParticles ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.PORTAL_PARTICLES) { - return this.ofPortalParticles ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.POTION_PARTICLES) { - return this.ofPotionParticles ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.FIREWORK_PARTICLES) { - return this.ofFireworkParticles ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.DRIPPING_WATER_LAVA) { - return this.ofDrippingWaterLava ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_TERRAIN) { - return this.ofAnimatedTerrain ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.ANIMATED_TEXTURES) { - return this.ofAnimatedTextures ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.USE_VBO) { + default: + return s + "ON"; + } + } else if (parOptions == GameSettings.Options.ANIMATED_FIRE) { + return this.ofAnimatedFire ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_PORTAL) { + return this.ofAnimatedPortal ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_REDSTONE) { + return this.ofAnimatedRedstone ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_EXPLOSION) { + return this.ofAnimatedExplosion ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_FLAME) { + return this.ofAnimatedFlame ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_SMOKE) { + return this.ofAnimatedSmoke ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.VOID_PARTICLES) { + return this.ofVoidParticles ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.WATER_PARTICLES) { + return this.ofWaterParticles ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.PORTAL_PARTICLES) { + return this.ofPortalParticles ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.POTION_PARTICLES) { + return this.ofPotionParticles ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.FIREWORK_PARTICLES) { + return this.ofFireworkParticles ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.DRIPPING_WATER_LAVA) { + return this.ofDrippingWaterLava ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_TERRAIN) { + return this.ofAnimatedTerrain ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.ANIMATED_TEXTURES) { + return this.ofAnimatedTextures ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.USE_VBO) { return this.useVbo ? s + "ON" : s + "OFF"; } else if (parOptions == GameSettings.Options.CUSTOM_SKY) { - return this.ofCustomSky ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.CLEAR_WATER) { - return this.ofClearWater ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.BETTER_GRASS) { - switch (this.ofBetterGrass) { - case 1: - return s + "Fast"; + return this.ofCustomSky ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.CLEAR_WATER) { + return this.ofClearWater ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.BETTER_GRASS) { + switch (this.ofBetterGrass) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - default: - return s + "OFF"; - } + default: + return s + "OFF"; + } } else if (parOptions == GameSettings.Options.FOG_FANCY) { - switch (this.ofFogType) { - case 1: - return s + "Fast"; + switch (this.ofFogType) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - case 3: - return s + "OFF"; + case 3: + return s + "OFF"; - default: - return s + "OFF"; - } - } else if (parOptions == GameSettings.Options.FOG_START) { - return s + this.ofFogStart; - } else if (parOptions == GameSettings.Options.SHADER_PROFILE) { - switch (this.profile) { - case 1: - return s + "Low"; - - case 2: - return s + "Medium"; - - case 3: - return s + "High"; - - case 4: - return s + "Ultra"; - - default: - return s + "Low"; - } - } else if (parOptions == GameSettings.Options.SMOOTH_FPS) { - return this.ofSmoothFps ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.CHUNK_UPDATES) { - return s + this.ofChunkUpdates; - } else if (parOptions == GameSettings.Options.CLOUDS) { - switch (this.ofClouds) { - case 1: - return s + "Fast"; + default: + return s + "OFF"; + } + } else if (parOptions == GameSettings.Options.FOG_START) { + return s + this.ofFogStart; + } else if (parOptions == GameSettings.Options.SMOOTH_FPS) { + return this.ofSmoothFps ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.CHUNK_UPDATES) { + return s + this.ofChunkUpdates; + } else if (parOptions == GameSettings.Options.CLOUDS) { + switch (this.ofClouds) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - case 3: - return s + "OFF"; + case 3: + return s + "OFF"; - default: - return s + "Default"; - } - } else if (parOptions == GameSettings.Options.DYNAMIC_LIGHTS) { - int k = indexOf(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); - return s + getTranslation(KEYS_DYNAMIC_LIGHTS, k); - } else if (parOptions == GameSettings.Options.FAST_MATH) { - return ofFastMath ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.RAIN) { - switch (this.ofRain) { - case 1: - return s + "Fast"; + default: + return s + "Default"; + } + } else if (parOptions == GameSettings.Options.DYNAMIC_LIGHTS) { + int k = indexOf(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); + return s + getTranslation(KEYS_DYNAMIC_LIGHTS, k); + } else if (parOptions == GameSettings.Options.FAST_MATH) { + return ofFastMath ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.RAIN) { + switch (this.ofRain) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - case 3: - return s + "OFF"; + case 3: + return s + "OFF"; - default: - return s + "Default"; - } - } else if (parOptions == GameSettings.Options.RAIN_SPLASH) { - return this.ofRainSplash ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.TREES) { - switch (this.ofTrees) { - case 1: - return s + "Fast"; + default: + return s + "Default"; + } + } else if (parOptions == GameSettings.Options.RAIN_SPLASH) { + return this.ofRainSplash ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.TREES) { + switch (this.ofTrees) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - case 3: - default: - return s + "Default"; + case 3: + default: + return s + "Default"; - case 4: - return s + "Smart"; - } - } else if (parOptions == GameSettings.Options.SKY) { - return this.ofSky ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.STARS) { - return this.ofStars ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.SUN_MOON) { - return this.ofSunMoon ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.SHOW_CAPES) { - return this.ofShowCapes ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.TRANSLUCENT_BLOCKS) { - return this.ofTranslucentBlocks == 1 ? s + "Fast" : (this.ofTranslucentBlocks == 2 ? s + "Fancy" : s + "Default"); - } else if (parOptions == GameSettings.Options.HELD_ITEM_TOOLTIPS) { - return this.heldItemTooltips ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.DROPPED_ITEMS) { - switch (this.ofDroppedItems) { - case 1: - return s + "Fast"; + case 4: + return s + "Smart"; + } + } else if (parOptions == GameSettings.Options.SKY) { + return this.ofSky ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.STARS) { + return this.ofStars ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.SUN_MOON) { + return this.ofSunMoon ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.SHOW_CAPES) { + return this.ofShowCapes ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.TRANSLUCENT_BLOCKS) { + return this.ofTranslucentBlocks == 1 ? s + "Fast" : (this.ofTranslucentBlocks == 2 ? s + "Fancy" : s + "Default"); + } else if (parOptions == GameSettings.Options.HELD_ITEM_TOOLTIPS) { + return this.heldItemTooltips ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.DROPPED_ITEMS) { + switch (this.ofDroppedItems) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - default: - return s + "Default"; - } - } else if (parOptions == GameSettings.Options.VIGNETTE) { - switch (this.ofVignette) { - case 1: - return s + "Fast"; + default: + return s + "Default"; + } + } else if (parOptions == GameSettings.Options.VIGNETTE) { + switch (this.ofVignette) { + case 1: + return s + "Fast"; - case 2: - return s + "Fancy"; + case 2: + return s + "Fancy"; - default: - return s + "Default"; - } - } else if (parOptions == GameSettings.Options.DYNAMIC_FOV) { - return this.ofDynamicFov ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.BETTER_SNOW) { - return this.ofBetterSnow ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.CUSTOM_FONTS) { - return this.ofCustomFonts ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.TOGGLE_SPRINT) { + default: + return s + "Default"; + } + } else if (parOptions == GameSettings.Options.DYNAMIC_FOV) { + return this.ofDynamicFov ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.BETTER_SNOW) { + return this.ofBetterSnow ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.CUSTOM_FONTS) { + return this.ofCustomFonts ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.TOGGLE_SPRINT) { return toggleSprint ? s + "Toggle" : s + "Hold"; } else if (parOptions == GameSettings.Options.LAGOMETER) { - return this.ofLagometer ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.PROFILER) { - return this.ofProfiler ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.HIDE_PASSWORD) { + return this.ofLagometer ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.PROFILER) { + return this.ofProfiler ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.HIDE_PASSWORD) { return hidePassword ? s + "ON" : s + "OFF"; } else if (parOptions == GameSettings.Options.CUSTOM_COLORS) { - return this.ofCustomColors ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.SWAMP_COLORS) { - return this.ofSwampColors ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.SMOOTH_BIOMES) { - return this.ofSmoothBiomes ? s + "ON" : s + "OFF"; - } else if (parOptions == GameSettings.Options.CUSTOM_ITEMS) { - return this.ofCustomItems ? s + "ON" : s + "OFF"; - } else { + return this.ofCustomColors ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.SWAMP_COLORS) { + return this.ofSwampColors ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.SMOOTH_BIOMES) { + return this.ofSmoothBiomes ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.CUSTOM_ITEMS) { + return this.ofCustomItems ? s + "ON" : s + "OFF"; + } else { return s; } } @@ -1267,6 +1269,18 @@ public class GameSettings { this.difficulty = EnumDifficulty.getDifficultyEnum(Integer.parseInt(astring[1])); } + if (astring[0].equals("hasCreatedDemoWorld")) { + this.hasCreatedDemoWorld = astring[1].equals("true"); + } + + if (astring[0].equals("relayTimeout")) { + this.relayTimeout = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("hideJoinCode")) { + this.hideJoinCode = astring[1].equals("true"); + } + if (astring[0].equals("fancyGraphics")) { this.fancyGraphics = astring[1].equals("true"); } @@ -1442,11 +1456,15 @@ public class GameSettings { this.chunkFix = astring[1].equals("true"); } + if (astring[0].equals("fog")) { + this.fog = astring[1].equals("true"); + } + if (astring[0].equals("fxaa")) { this.fxaa = (astring[1].equals("true") || astring[1].equals("false")) ? 0 : Integer.parseInt(astring[1]); } - + for (KeyBinding keybinding : this.keyBindings) { if (astring[0].equals("key_" + keybinding.getKeyDescription())) { keybinding.setKeyCode(Integer.parseInt(astring[1])); @@ -1456,6 +1474,10 @@ public class GameSettings { if (astring[0].equals("shaders")) { this.shaders = astring[1].equals("true"); } + + if (astring[0].equals("enableUpdateSvc")) { + this.enableUpdateSvc = astring[1].equals("true"); + } if (astring[0].equals("ofAnimatedWater") && astring.length >= 2) { this.ofAnimatedWater = Integer.valueOf(astring[1]).intValue(); @@ -1563,23 +1585,6 @@ public class GameSettings { } } - if (astring[0].equals("secret") && astring.length >= 2) { - this.secret = Boolean.valueOf(astring[1]).booleanValue(); - } - - if (astring[0].equals("profile")) { - if (astring[1].equals("low")) { - this.profile = 1; - } else if (astring[1].equals("mid")) { - this.profile = 2; - } else if (astring[1].equals("high")) { - this.profile = 3; - } else if(astring[1].equals("ultra")) { - this.profile = 4; - } - System.out.println("Loaded Shader Profile: " + this.profile); - } - if (astring[0].equals("ofSmoothFps") && astring.length >= 2) { this.ofSmoothFps = Boolean.valueOf(astring[1]).booleanValue(); } @@ -1608,6 +1613,7 @@ public class GameSettings { if (astring[0].equals("ofFastMath") && astring.length >= 2) { ofFastMath = Boolean.valueOf(astring[1]).booleanValue(); MathHelper.fastMath = ofFastMath; + net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.MathHelper.fastMath = ofFastMath; } if (astring[0].equals("ofRain") && astring.length >= 2) { @@ -1758,6 +1764,9 @@ public class GameSettings { printwriter.println("maxFps:" + this.limitFramerate); printwriter.println("fboEnable:" + this.fboEnable); printwriter.println("difficulty:" + this.difficulty.getDifficultyId()); + printwriter.println("hasCreatedDemoWorld:" + this.hasCreatedDemoWorld); + printwriter.println("relayTimeout:" + this.relayTimeout); + printwriter.println("hideJoinCode:" + this.hideJoinCode); printwriter.println("fancyGraphics:" + this.fancyGraphics); printwriter.println("ao:" + this.ambientOcclusion); printwriter.println("resourcePacks:" + toJSONArray(this.resourcePacks)); @@ -1796,8 +1805,10 @@ public class GameSettings { printwriter.println("hudStats:" + this.hudStats); printwriter.println("hud24h:" + this.hud24h); printwriter.println("chunkFix:" + this.chunkFix); + printwriter.println("fog:" + this.fog); printwriter.println("fxaa:" + this.fxaa); printwriter.println("shaders:" + this.shaders); + printwriter.println("enableUpdateSvc:" + this.enableUpdateSvc); printwriter.println("ofAnimatedWater:" + this.ofAnimatedWater); printwriter.println("ofAnimatedLava:" + this.ofAnimatedLava); printwriter.println("ofAnimatedFire:" + this.ofAnimatedFire); @@ -1821,20 +1832,6 @@ public class GameSettings { printwriter.println("ofBetterGrass:" + this.ofBetterGrass); printwriter.println("ofFogType:" + this.ofFogType); printwriter.println("ofFogStart:" + this.ofFogStart); - switch(this.profile) { - case 1: - printwriter.println("profile:low"); - break; - case 2: - printwriter.println("profile:mid"); - break; - case 3: - printwriter.println("profile:high"); - break; - case 4: - printwriter.println("profile:ultra"); - break; - } printwriter.println("ofSmoothFps:" + this.ofSmoothFps); printwriter.println("ofChunkUpdates:" + this.ofChunkUpdates); printwriter.println("ofClouds:" + this.ofClouds); @@ -1885,6 +1882,8 @@ public class GameSettings { printwriter.close(); EagRuntime.setStorage("g", bao.toByteArray()); + + RelayManager.relayManager.save(); } catch (Exception exception) { logger.error("Failed to save options", exception); } @@ -1916,7 +1915,7 @@ public class GameSettings { } this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, - this.renderDistanceChunks, this.chatVisibility, this.chatColours, i)); + Math.max(this.renderDistanceChunks, 2), this.chatVisibility, this.chatColours, i)); } } @@ -1944,7 +1943,11 @@ public class GameSettings { this.sendSettingsToServer(); } - + + public int func_181147_e() { + return this.renderDistanceChunks >= 4 ? this.clouds : 0; + } + public boolean func_181148_f() { return this.field_181150_U; } @@ -1967,10 +1970,11 @@ public class GameSettings { VIEW_BOBBING("options.viewBobbing", false, true), ANAGLYPH("options.anaglyph", false, true), FRAMERATE_LIMIT("options.framerateLimit", true, false, 10.0F, 260.0F, 10.0F), - FBO_ENABLE("options.fboEnable", false, true), + FBO_ENABLE("options.fboEnable", false, true), + RENDER_CLOUDS("options.renderClouds", false, false), GRAPHICS("options.graphics", false, false), AMBIENT_OCCLUSION("options.ao", false, false), - GUI_SCALE("options.guiScale", false, false), + GUI_SCALE("options.guiScale", false, false), PARTICLES("options.particles", false, false), CHAT_VISIBILITY("options.chat.visibility", false, false), CHAT_COLOR("options.chat.color", false, true), @@ -1988,8 +1992,7 @@ public class GameSettings { STREAM_BYTES_PER_PIXEL("options.stream.bytesPerPixel", true, false), STREAM_VOLUME_MIC("options.stream.micVolumne", true, false), STREAM_VOLUME_SYSTEM("options.stream.systemVolume", true, false), - STREAM_KBPS("options.stream.kbps", true, false), - STREAM_FPS("options.stream.fps", true, false), + STREAM_KBPS("options.stream.kbps", true, false), STREAM_FPS("options.stream.fps", true, false), STREAM_COMPRESSION("options.stream.compression", false, false), STREAM_SEND_METADATA("options.stream.sendMetadata", false, true), STREAM_CHAT_ENABLED("options.stream.chat.enabled", false, false), @@ -2005,9 +2008,10 @@ public class GameSettings { HUD_PLAYER("options.hud.player", false, true), HUD_24H("options.hud.24h", false, true), CHUNK_FIX("options.chunkFix", false, true), + FOG("options.fog", false, true), FXAA("options.fxaa", false, false), FULLSCREEN("options.fullscreen", false, true), - FAST_MATH("options.fastMath", false, true), + FAST_MATH("options.fastMath", false, false), ANIMATED_WATER("Water Animated", false, false), ANIMATED_LAVA("Lava Animated", false, false), ANIMATED_FIRE("Fire Animated", false, false), @@ -2193,11 +2197,12 @@ public class GameSettings { this.ofAnimatedTextures = p_setAllAnimations_1_; this.ofRainSplash = p_setAllAnimations_1_; } - - public void resetSettings() { - } - + private void updateWaterOpacity() { + if (this.mc.isIntegratedServerRunning()) { + Config.waterOpacityChanged = true; + } + ClearWater.updateWaterOpacity(this, this.mc.theWorld); } diff --git a/src/main/java/net/minecraft/client/settings/KeyBinding.java b/src/main/java/net/minecraft/client/settings/KeyBinding.java index 1c82585..aae2944 100644 --- a/src/main/java/net/minecraft/client/settings/KeyBinding.java +++ b/src/main/java/net/minecraft/client/settings/KeyBinding.java @@ -6,7 +6,6 @@ import java.util.Set; import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import net.PeytonPlayz585.shadow.input.Controller; import net.minecraft.client.resources.I18n; import net.minecraft.util.IntHashMap; @@ -16,16 +15,18 @@ import net.minecraft.util.IntHashMap; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 KeyBinding implements Comparable { @@ -38,7 +39,6 @@ public class KeyBinding implements Comparable { public int keyCode; public boolean pressed; private int pressTime; - private int buttonID; public static void onTick(int keyCode) { if (keyCode != 0) { @@ -88,18 +88,6 @@ public class KeyBinding implements Comparable { keybindArray.add(this); hash.addKey(keyCode, this); keybindSet.add(category); - buttonID = -1; - } - - public KeyBinding(int parButtonID, String description, int keyCode, String category) { - this.keyDescription = description; - this.keyCode = keyCode; - this.keyCodeDefault = keyCode; - this.keyCategory = category; - keybindArray.add(this); - hash.addKey(keyCode, this); - keybindSet.add(category); - buttonID = parButtonID; } /**+ @@ -107,7 +95,7 @@ public class KeyBinding implements Comparable { * querying). Should be used in tickers. */ public boolean isKeyDown() { - return this.pressed | Controller.isKeyDown(keyDescription); + return this.pressed; } public String getKeyCategory() { diff --git a/src/main/java/net/minecraft/client/stream/IStream.java b/src/main/java/net/minecraft/client/stream/IStream.java index 2c5f5a6..51834e3 100644 --- a/src/main/java/net/minecraft/client/stream/IStream.java +++ b/src/main/java/net/minecraft/client/stream/IStream.java @@ -6,16 +6,18 @@ package net.minecraft.client.stream; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IStream { diff --git a/src/main/java/net/minecraft/client/util/JsonBlendingMode.java b/src/main/java/net/minecraft/client/util/JsonBlendingMode.java index d47a683..e2acc30 100644 --- a/src/main/java/net/minecraft/client/util/JsonBlendingMode.java +++ b/src/main/java/net/minecraft/client/util/JsonBlendingMode.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JsonBlendingMode { diff --git a/src/main/java/net/minecraft/client/util/JsonException.java b/src/main/java/net/minecraft/client/util/JsonException.java index 1394f6e..ba546fa 100644 --- a/src/main/java/net/minecraft/client/util/JsonException.java +++ b/src/main/java/net/minecraft/client/util/JsonException.java @@ -14,16 +14,18 @@ import com.google.common.collect.Lists; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JsonException extends IOException { diff --git a/src/main/java/net/minecraft/command/CommandException.java b/src/main/java/net/minecraft/command/CommandException.java index 3bcef26..760c22e 100644 --- a/src/main/java/net/minecraft/command/CommandException.java +++ b/src/main/java/net/minecraft/command/CommandException.java @@ -6,16 +6,18 @@ package net.minecraft.command; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CommandException extends Exception { diff --git a/src/main/java/net/minecraft/command/EntityNotFoundException.java b/src/main/java/net/minecraft/command/EntityNotFoundException.java index e0cc2e5..e68a162 100644 --- a/src/main/java/net/minecraft/command/EntityNotFoundException.java +++ b/src/main/java/net/minecraft/command/EntityNotFoundException.java @@ -6,16 +6,18 @@ package net.minecraft.command; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityNotFoundException extends CommandException { diff --git a/src/main/java/net/minecraft/command/ICommandSender.java b/src/main/java/net/minecraft/command/ICommandSender.java index 9f6d500..6c52a43 100644 --- a/src/main/java/net/minecraft/command/ICommandSender.java +++ b/src/main/java/net/minecraft/command/ICommandSender.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ICommandSender { diff --git a/src/main/java/net/minecraft/command/PlayerNotFoundException.java b/src/main/java/net/minecraft/command/PlayerNotFoundException.java index 167e220..44dd6f4 100644 --- a/src/main/java/net/minecraft/command/PlayerNotFoundException.java +++ b/src/main/java/net/minecraft/command/PlayerNotFoundException.java @@ -6,16 +6,18 @@ package net.minecraft.command; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlayerNotFoundException extends CommandException { diff --git a/src/main/java/net/minecraft/command/PlayerSelector.java b/src/main/java/net/minecraft/command/PlayerSelector.java index 3f066b6..62a4efa 100644 --- a/src/main/java/net/minecraft/command/PlayerSelector.java +++ b/src/main/java/net/minecraft/command/PlayerSelector.java @@ -43,16 +43,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlayerSelector { diff --git a/src/main/java/net/minecraft/command/server/CommandBlockLogic.java b/src/main/java/net/minecraft/command/server/CommandBlockLogic.java index 2cce35d..742f5d4 100644 --- a/src/main/java/net/minecraft/command/server/CommandBlockLogic.java +++ b/src/main/java/net/minecraft/command/server/CommandBlockLogic.java @@ -2,6 +2,7 @@ package net.minecraft.command.server; import java.text.SimpleDateFormat; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -9,11 +10,31 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class CommandBlockLogic { /**+ * The formatting for the timestamp on commands run. */ - private static final SimpleDateFormat timestampFormat = new SimpleDateFormat("HH:mm:ss"); + private static final SimpleDateFormat timestampFormat = EagRuntime.fixDateFormat(new SimpleDateFormat("HH:mm:ss")); private int successCount; private boolean trackOutput = true; /**+ diff --git a/src/main/java/net/minecraft/crash/CrashReport.java b/src/main/java/net/minecraft/crash/CrashReport.java index b2f7709..d7f3305 100644 --- a/src/main/java/net/minecraft/crash/CrashReport.java +++ b/src/main/java/net/minecraft/crash/CrashReport.java @@ -23,16 +23,18 @@ import net.minecraft.util.ReportedException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CrashReport { diff --git a/src/main/java/net/minecraft/crash/CrashReportCategory.java b/src/main/java/net/minecraft/crash/CrashReportCategory.java index 5d9bbec..7c5b2d9 100644 --- a/src/main/java/net/minecraft/crash/CrashReportCategory.java +++ b/src/main/java/net/minecraft/crash/CrashReportCategory.java @@ -17,16 +17,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CrashReportCategory { diff --git a/src/main/java/net/minecraft/creativetab/CreativeTabs.java b/src/main/java/net/minecraft/creativetab/CreativeTabs.java index bbc1fb4..f0bf192 100644 --- a/src/main/java/net/minecraft/creativetab/CreativeTabs.java +++ b/src/main/java/net/minecraft/creativetab/CreativeTabs.java @@ -11,6 +11,26 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class CreativeTabs { public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; public static final CreativeTabs tabBlock = new CreativeTabs(0, "buildingBlocks") { diff --git a/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java b/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java index 6be863b..92aa888 100644 --- a/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java +++ b/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BehaviorDefaultDispenseItem implements IBehaviorDispenseItem { diff --git a/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java b/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java index a3a7995..0d1f70e 100644 --- a/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java +++ b/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java @@ -7,6 +7,26 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem { /**+ * Dispense the specified stack, play the dispense sound and diff --git a/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java b/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java index 9e62fba..861d9ef 100644 --- a/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java +++ b/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java @@ -8,16 +8,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBehaviorDispenseItem { diff --git a/src/main/java/net/minecraft/dispenser/IBlockSource.java b/src/main/java/net/minecraft/dispenser/IBlockSource.java index ad3032a..ff30a6c 100644 --- a/src/main/java/net/minecraft/dispenser/IBlockSource.java +++ b/src/main/java/net/minecraft/dispenser/IBlockSource.java @@ -9,16 +9,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBlockSource extends ILocatableSource { diff --git a/src/main/java/net/minecraft/dispenser/ILocatableSource.java b/src/main/java/net/minecraft/dispenser/ILocatableSource.java index 2bfb53e..5c05413 100644 --- a/src/main/java/net/minecraft/dispenser/ILocatableSource.java +++ b/src/main/java/net/minecraft/dispenser/ILocatableSource.java @@ -6,16 +6,18 @@ package net.minecraft.dispenser; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ILocatableSource extends ILocation { diff --git a/src/main/java/net/minecraft/dispenser/ILocation.java b/src/main/java/net/minecraft/dispenser/ILocation.java index 32e6eb9..fa08a18 100644 --- a/src/main/java/net/minecraft/dispenser/ILocation.java +++ b/src/main/java/net/minecraft/dispenser/ILocation.java @@ -8,16 +8,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ILocation extends IPosition { diff --git a/src/main/java/net/minecraft/dispenser/IPosition.java b/src/main/java/net/minecraft/dispenser/IPosition.java index 0dd8887..6cfabc2 100644 --- a/src/main/java/net/minecraft/dispenser/IPosition.java +++ b/src/main/java/net/minecraft/dispenser/IPosition.java @@ -6,16 +6,18 @@ package net.minecraft.dispenser; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IPosition { diff --git a/src/main/java/net/minecraft/dispenser/PositionImpl.java b/src/main/java/net/minecraft/dispenser/PositionImpl.java index 939da9f..63a6967 100644 --- a/src/main/java/net/minecraft/dispenser/PositionImpl.java +++ b/src/main/java/net/minecraft/dispenser/PositionImpl.java @@ -6,16 +6,18 @@ package net.minecraft.dispenser; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PositionImpl implements IPosition { diff --git a/src/main/java/net/minecraft/enchantment/Enchantment.java b/src/main/java/net/minecraft/enchantment/Enchantment.java index b0fb593..4452ef1 100644 --- a/src/main/java/net/minecraft/enchantment/Enchantment.java +++ b/src/main/java/net/minecraft/enchantment/Enchantment.java @@ -15,6 +15,26 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Enchantment { private static final Enchantment[] enchantmentsList = new Enchantment[256]; public static final Enchantment[] enchantmentsBookList; diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java b/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java index 7552e02..40b75cc 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentArrowDamage extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java b/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java index 0ddd664..998c6dd 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentArrowFire extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java b/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java index fb6f581..81dca09 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentArrowInfinite extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java b/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java index 06c9466..537a678 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentArrowKnockback extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java b/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java index eed304a..259454a 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentDamage extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentData.java b/src/main/java/net/minecraft/enchantment/EnchantmentData.java index 085a2cd..cfb4e0a 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentData.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentData.java @@ -8,16 +8,18 @@ import net.minecraft.util.WeightedRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentData extends WeightedRandom.Item { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java b/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java index c479be8..88b5ed3 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentDigging extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java b/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java index 6733b8a..347b3e9 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentDurability extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java b/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java index 8754706..e565b65 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentFireAspect extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java b/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java index 04b13ee..5dc1d30 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentFishingSpeed extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java index c4bd000..2279c01 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java @@ -29,16 +29,18 @@ import net.minecraft.util.WeightedRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentHelper { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java b/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java index 47c13b7..75f73a6 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentKnockback extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java b/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java index 89aa5d6..df45d6c 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentLootBonus extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java b/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java index 968dfbe..cc3f5b1 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentOxygen extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java b/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java index 838dc43..845eae4 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java @@ -11,16 +11,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentProtection extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java b/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java index 851450b..92d96a4 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java @@ -15,16 +15,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentThorns extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java b/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java index b358573..0c2f421 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentUntouching extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java b/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java index e5f4184..1cfa924 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentWaterWalker extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java b/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java index b41aed3..ac80ec6 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentWaterWorker extends Enchantment { diff --git a/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java b/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java index d563c14..f000b97 100644 --- a/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java +++ b/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java @@ -13,16 +13,18 @@ import net.minecraft.item.ItemTool; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumEnchantmentType { diff --git a/src/main/java/net/minecraft/entity/DataWatcher.java b/src/main/java/net/minecraft/entity/DataWatcher.java index 687f4ea..06f7578 100644 --- a/src/main/java/net/minecraft/entity/DataWatcher.java +++ b/src/main/java/net/minecraft/entity/DataWatcher.java @@ -24,16 +24,18 @@ import net.minecraft.util.Rotations; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DataWatcher { diff --git a/src/main/java/net/minecraft/entity/Entity.java b/src/main/java/net/minecraft/entity/Entity.java index 92c8e19..9fba472 100644 --- a/src/main/java/net/minecraft/entity/Entity.java +++ b/src/main/java/net/minecraft/entity/Entity.java @@ -46,6 +46,26 @@ import net.minecraft.util.Vec3; import net.minecraft.world.Explosion; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Entity { private static final AxisAlignedBB ZERO_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); private static int nextEntityID; diff --git a/src/main/java/net/minecraft/entity/EntityAgeable.java b/src/main/java/net/minecraft/entity/EntityAgeable.java index d559567..9db8ed8 100644 --- a/src/main/java/net/minecraft/entity/EntityAgeable.java +++ b/src/main/java/net/minecraft/entity/EntityAgeable.java @@ -8,6 +8,26 @@ import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAgeable extends EntityCreature { protected int growingAge; protected int field_175502_b; diff --git a/src/main/java/net/minecraft/entity/EntityBodyHelper.java b/src/main/java/net/minecraft/entity/EntityBodyHelper.java index 9cfa91a..ae8b550 100644 --- a/src/main/java/net/minecraft/entity/EntityBodyHelper.java +++ b/src/main/java/net/minecraft/entity/EntityBodyHelper.java @@ -8,16 +8,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBodyHelper { diff --git a/src/main/java/net/minecraft/entity/EntityConstructor.java b/src/main/java/net/minecraft/entity/EntityConstructor.java index 9a60eac..b5d6130 100644 --- a/src/main/java/net/minecraft/entity/EntityConstructor.java +++ b/src/main/java/net/minecraft/entity/EntityConstructor.java @@ -3,16 +3,18 @@ package net.minecraft.entity; import net.minecraft.world.World; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface EntityConstructor { diff --git a/src/main/java/net/minecraft/entity/EntityCreature.java b/src/main/java/net/minecraft/entity/EntityCreature.java index 03b6886..a045393 100644 --- a/src/main/java/net/minecraft/entity/EntityCreature.java +++ b/src/main/java/net/minecraft/entity/EntityCreature.java @@ -7,6 +7,26 @@ import net.minecraft.entity.passive.EntityTameable; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityCreature extends EntityLiving { public static final EaglercraftUUID FLEEING_SPEED_MODIFIER_UUID = EaglercraftUUID .fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); diff --git a/src/main/java/net/minecraft/entity/EntityFlying.java b/src/main/java/net/minecraft/entity/EntityFlying.java index 2bed68f..d5a30a6 100644 --- a/src/main/java/net/minecraft/entity/EntityFlying.java +++ b/src/main/java/net/minecraft/entity/EntityFlying.java @@ -5,6 +5,26 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityFlying extends EntityLiving { public EntityFlying(World worldIn) { super(worldIn); diff --git a/src/main/java/net/minecraft/entity/EntityHanging.java b/src/main/java/net/minecraft/entity/EntityHanging.java index 21c27f7..a9553aa 100644 --- a/src/main/java/net/minecraft/entity/EntityHanging.java +++ b/src/main/java/net/minecraft/entity/EntityHanging.java @@ -12,6 +12,26 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityHanging extends Entity { private int tickCounter1; protected BlockPos hangingPosition; diff --git a/src/main/java/net/minecraft/entity/EntityLeashKnot.java b/src/main/java/net/minecraft/entity/EntityLeashKnot.java index ad3101e..837be79 100644 --- a/src/main/java/net/minecraft/entity/EntityLeashKnot.java +++ b/src/main/java/net/minecraft/entity/EntityLeashKnot.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityLeashKnot extends EntityHanging { diff --git a/src/main/java/net/minecraft/entity/EntityList.java b/src/main/java/net/minecraft/entity/EntityList.java index 535487b..e0441f6 100644 --- a/src/main/java/net/minecraft/entity/EntityList.java +++ b/src/main/java/net/minecraft/entity/EntityList.java @@ -83,16 +83,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityList { diff --git a/src/main/java/net/minecraft/entity/EntityLiving.java b/src/main/java/net/minecraft/entity/EntityLiving.java index 2daae80..309d7df 100644 --- a/src/main/java/net/minecraft/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/entity/EntityLiving.java @@ -28,6 +28,26 @@ import net.minecraft.world.DifficultyInstance; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityLiving extends EntityLivingBase { public int livingSoundTime; protected int experienceValue; diff --git a/src/main/java/net/minecraft/entity/EntityLivingBase.java b/src/main/java/net/minecraft/entity/EntityLivingBase.java index 836fb6b..975a420 100644 --- a/src/main/java/net/minecraft/entity/EntityLivingBase.java +++ b/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -44,6 +44,26 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityLivingBase extends Entity { private static final EaglercraftUUID sprintingSpeedBoostModifierUUID = EaglercraftUUID .fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); diff --git a/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java b/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java index ccf009c..57f8cdc 100644 --- a/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java +++ b/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartCommandBlock extends EntityMinecart { diff --git a/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java b/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java index 3effda7..97ef50f 100644 --- a/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java +++ b/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java @@ -43,16 +43,18 @@ import net.minecraft.entity.passive.EntityWolf; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySpawnPlacementRegistry { diff --git a/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java b/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java index c223e91..aa6bf7c 100644 --- a/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java +++ b/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java @@ -6,16 +6,18 @@ package net.minecraft.entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumCreatureAttribute { diff --git a/src/main/java/net/minecraft/entity/EnumCreatureType.java b/src/main/java/net/minecraft/entity/EnumCreatureType.java index d8ba0f0..2ed985e 100644 --- a/src/main/java/net/minecraft/entity/EnumCreatureType.java +++ b/src/main/java/net/minecraft/entity/EnumCreatureType.java @@ -13,16 +13,18 @@ import net.minecraft.entity.passive.IAnimals; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumCreatureType { diff --git a/src/main/java/net/minecraft/entity/IEntityLivingData.java b/src/main/java/net/minecraft/entity/IEntityLivingData.java index 64bac00..5540e12 100644 --- a/src/main/java/net/minecraft/entity/IEntityLivingData.java +++ b/src/main/java/net/minecraft/entity/IEntityLivingData.java @@ -6,16 +6,18 @@ package net.minecraft.entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IEntityLivingData { diff --git a/src/main/java/net/minecraft/entity/IEntityMultiPart.java b/src/main/java/net/minecraft/entity/IEntityMultiPart.java index e379ac8..37f820b 100644 --- a/src/main/java/net/minecraft/entity/IEntityMultiPart.java +++ b/src/main/java/net/minecraft/entity/IEntityMultiPart.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IEntityMultiPart { diff --git a/src/main/java/net/minecraft/entity/IEntityOwnable.java b/src/main/java/net/minecraft/entity/IEntityOwnable.java index c0c8b5a..2a5e65f 100644 --- a/src/main/java/net/minecraft/entity/IEntityOwnable.java +++ b/src/main/java/net/minecraft/entity/IEntityOwnable.java @@ -6,16 +6,18 @@ package net.minecraft.entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IEntityOwnable { diff --git a/src/main/java/net/minecraft/entity/IMerchant.java b/src/main/java/net/minecraft/entity/IMerchant.java index a47442e..8100f38 100644 --- a/src/main/java/net/minecraft/entity/IMerchant.java +++ b/src/main/java/net/minecraft/entity/IMerchant.java @@ -12,16 +12,18 @@ import net.minecraft.village.MerchantRecipeList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IMerchant { diff --git a/src/main/java/net/minecraft/entity/INpc.java b/src/main/java/net/minecraft/entity/INpc.java index ef20591..4934033 100644 --- a/src/main/java/net/minecraft/entity/INpc.java +++ b/src/main/java/net/minecraft/entity/INpc.java @@ -8,16 +8,18 @@ import net.minecraft.entity.passive.IAnimals; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INpc extends IAnimals { diff --git a/src/main/java/net/minecraft/entity/IProjectile.java b/src/main/java/net/minecraft/entity/IProjectile.java index 24f8644..4657da9 100644 --- a/src/main/java/net/minecraft/entity/IProjectile.java +++ b/src/main/java/net/minecraft/entity/IProjectile.java @@ -6,16 +6,18 @@ package net.minecraft.entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IProjectile { diff --git a/src/main/java/net/minecraft/entity/IRangedAttackMob.java b/src/main/java/net/minecraft/entity/IRangedAttackMob.java index d3df07f..960ed00 100644 --- a/src/main/java/net/minecraft/entity/IRangedAttackMob.java +++ b/src/main/java/net/minecraft/entity/IRangedAttackMob.java @@ -6,16 +6,18 @@ package net.minecraft.entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IRangedAttackMob { diff --git a/src/main/java/net/minecraft/entity/NpcMerchant.java b/src/main/java/net/minecraft/entity/NpcMerchant.java index b8ca04a..f1199a2 100644 --- a/src/main/java/net/minecraft/entity/NpcMerchant.java +++ b/src/main/java/net/minecraft/entity/NpcMerchant.java @@ -14,16 +14,18 @@ import net.minecraft.village.MerchantRecipeList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NpcMerchant implements IMerchant { diff --git a/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java b/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java index 4fd7469..76c5aa8 100644 --- a/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java +++ b/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java @@ -19,16 +19,18 @@ import net.minecraft.nbt.NBTTagList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SharedMonsterAttributes { diff --git a/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java b/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java index e8c05c8..e6a5ec0 100644 --- a/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java +++ b/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartMobSpawner extends EntityMinecart { diff --git a/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java index b6de061..95f6a8f 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java @@ -13,16 +13,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AttributeModifier { diff --git a/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java b/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java index 4621ebd..525b8c0 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java @@ -1,5 +1,25 @@ package net.minecraft.entity.ai.attributes; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BaseAttribute implements IAttribute { private final IAttribute field_180373_a; private final String unlocalizedName; diff --git a/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java b/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java index 58fb102..4661b20 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java @@ -10,6 +10,26 @@ import com.google.common.collect.Multimap; import net.minecraft.server.management.LowerStringMap; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BaseAttributeMap { protected final Map attributes = Maps.newHashMap(); protected final Map attributesByName = new LowerStringMap(); diff --git a/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java b/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java index b1760f7..0235604 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java @@ -6,16 +6,18 @@ package net.minecraft.entity.ai.attributes; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IAttribute { diff --git a/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java b/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java index 9bccf0d..605f06e 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java @@ -9,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IAttributeInstance { diff --git a/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java b/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java index 1fa078a..85a02b6 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java @@ -17,16 +17,18 @@ import com.google.common.collect.Sets; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ModifiableAttributeInstance implements IAttributeInstance { diff --git a/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java b/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java index af502e4..3982037 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java @@ -8,16 +8,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RangedAttribute extends BaseAttribute { diff --git a/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java b/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java index d48b1e5..ae93464 100644 --- a/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java +++ b/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java @@ -18,16 +18,18 @@ import net.minecraft.server.management.LowerStringMap; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServersideAttributeMap extends BaseAttributeMap { diff --git a/src/main/java/net/minecraft/entity/boss/BossStatus.java b/src/main/java/net/minecraft/entity/boss/BossStatus.java index 968f4fb..ae59218 100644 --- a/src/main/java/net/minecraft/entity/boss/BossStatus.java +++ b/src/main/java/net/minecraft/entity/boss/BossStatus.java @@ -1,5 +1,25 @@ package net.minecraft.entity.boss; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class BossStatus { public static float healthScale; public static int statusBarTime; diff --git a/src/main/java/net/minecraft/entity/boss/EntityDragon.java b/src/main/java/net/minecraft/entity/boss/EntityDragon.java index 2a67160..63ad6ff 100644 --- a/src/main/java/net/minecraft/entity/boss/EntityDragon.java +++ b/src/main/java/net/minecraft/entity/boss/EntityDragon.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob { diff --git a/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java b/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java index cdf426a..7a56a65 100644 --- a/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java +++ b/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java @@ -11,16 +11,18 @@ import net.minecraft.util.DamageSource; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityDragonPart extends Entity { diff --git a/src/main/java/net/minecraft/entity/boss/EntityWither.java b/src/main/java/net/minecraft/entity/boss/EntityWither.java index 73ff14e..f7f46a4 100644 --- a/src/main/java/net/minecraft/entity/boss/EntityWither.java +++ b/src/main/java/net/minecraft/entity/boss/EntityWither.java @@ -35,16 +35,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob { diff --git a/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java b/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java index aef7a2e..0bb5a14 100644 --- a/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java +++ b/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBossDisplayData { diff --git a/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java b/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java index 3ddcff5..c3fd5be 100644 --- a/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java +++ b/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java @@ -9,16 +9,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityLightningBolt extends EntityWeatherEffect { diff --git a/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java b/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java index 7b0c1ef..9160c54 100644 --- a/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java +++ b/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java @@ -3,6 +3,26 @@ package net.minecraft.entity.effect; import net.minecraft.entity.Entity; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityWeatherEffect extends Entity { public EntityWeatherEffect(World worldIn) { super(worldIn); diff --git a/src/main/java/net/minecraft/entity/item/EntityArmorStand.java b/src/main/java/net/minecraft/entity/item/EntityArmorStand.java index 7136462..bd5edd1 100644 --- a/src/main/java/net/minecraft/entity/item/EntityArmorStand.java +++ b/src/main/java/net/minecraft/entity/item/EntityArmorStand.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityArmorStand extends EntityLivingBase { diff --git a/src/main/java/net/minecraft/entity/item/EntityBoat.java b/src/main/java/net/minecraft/entity/item/EntityBoat.java index 9241116..e154e68 100644 --- a/src/main/java/net/minecraft/entity/item/EntityBoat.java +++ b/src/main/java/net/minecraft/entity/item/EntityBoat.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBoat extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java b/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java index c6f1c21..b11d163 100644 --- a/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java +++ b/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java @@ -14,16 +14,18 @@ import net.minecraft.world.WorldProviderEnd; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEnderCrystal extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityEnderEye.java b/src/main/java/net/minecraft/entity/item/EntityEnderEye.java index b8d597d..5ecc1a6 100644 --- a/src/main/java/net/minecraft/entity/item/EntityEnderEye.java +++ b/src/main/java/net/minecraft/entity/item/EntityEnderEye.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEnderEye extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java b/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java index cbccc7c..8bd9993 100644 --- a/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEnderPearl extends EntityThrowable { diff --git a/src/main/java/net/minecraft/entity/item/EntityExpBottle.java b/src/main/java/net/minecraft/entity/item/EntityExpBottle.java index f7e8bd7..505f3c1 100644 --- a/src/main/java/net/minecraft/entity/item/EntityExpBottle.java +++ b/src/main/java/net/minecraft/entity/item/EntityExpBottle.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityExpBottle extends EntityThrowable { diff --git a/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java b/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java index 958913a..a966029 100644 --- a/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java @@ -25,16 +25,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFallingBlock extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java b/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java index e39fa91..e6f2b14 100644 --- a/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java +++ b/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFireworkRocket extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityItem.java b/src/main/java/net/minecraft/entity/item/EntityItem.java index c154f39..dacda9b 100644 --- a/src/main/java/net/minecraft/entity/item/EntityItem.java +++ b/src/main/java/net/minecraft/entity/item/EntityItem.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityItem extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityItemFrame.java b/src/main/java/net/minecraft/entity/item/EntityItemFrame.java index f6cba37..4225c3b 100644 --- a/src/main/java/net/minecraft/entity/item/EntityItemFrame.java +++ b/src/main/java/net/minecraft/entity/item/EntityItemFrame.java @@ -21,16 +21,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityItemFrame extends EntityHanging { diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecart.java b/src/main/java/net/minecraft/entity/item/EntityMinecart.java index 559edf6..4b05e27 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecart.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecart.java @@ -28,6 +28,26 @@ import net.minecraft.util.Vec3; import net.minecraft.world.IWorldNameable; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityMinecart extends Entity implements IWorldNameable { private boolean isInReverse; private String entityName; diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java b/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java index 3c92c6a..7914ce1 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartChest extends EntityMinecartContainer { diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java b/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java index a4948c2..4a9aa4a 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java @@ -11,6 +11,26 @@ import net.minecraft.world.ILockableContainer; import net.minecraft.world.LockCode; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityMinecartContainer extends EntityMinecart implements ILockableContainer { private ItemStack[] minecartContainerItems = new ItemStack[36]; /**+ diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java b/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java index 2a9222f..e0a5ae1 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartEmpty extends EntityMinecart { diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java b/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java index 10650fe..00800e4 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartFurnace extends EntityMinecart { diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java b/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java index 91851f8..e3c4c1b 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartHopper extends EntityMinecartContainer implements IHopper { diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java b/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java index 9561c7f..be77e93 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMinecartTNT extends EntityMinecart { diff --git a/src/main/java/net/minecraft/entity/item/EntityPainting.java b/src/main/java/net/minecraft/entity/item/EntityPainting.java index ce5f797..5dd2891 100644 --- a/src/main/java/net/minecraft/entity/item/EntityPainting.java +++ b/src/main/java/net/minecraft/entity/item/EntityPainting.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPainting extends EntityHanging { diff --git a/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java b/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java index b2d2a01..d9f144c 100644 --- a/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityTNTPrimed extends Entity { diff --git a/src/main/java/net/minecraft/entity/item/EntityXPOrb.java b/src/main/java/net/minecraft/entity/item/EntityXPOrb.java index def5846..e56bd98 100644 --- a/src/main/java/net/minecraft/entity/item/EntityXPOrb.java +++ b/src/main/java/net/minecraft/entity/item/EntityXPOrb.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityXPOrb extends Entity { diff --git a/src/main/java/net/minecraft/entity/monster/EntityBlaze.java b/src/main/java/net/minecraft/entity/monster/EntityBlaze.java index c07f833..cf85113 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityBlaze.java +++ b/src/main/java/net/minecraft/entity/monster/EntityBlaze.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBlaze extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java b/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java index 663f897..77b2e22 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java +++ b/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityCaveSpider extends EntitySpider { diff --git a/src/main/java/net/minecraft/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/entity/monster/EntityCreeper.java index 72997b4..80f2321 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityCreeper.java +++ b/src/main/java/net/minecraft/entity/monster/EntityCreeper.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityCreeper extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/entity/monster/EntityEnderman.java index 195bae6..3c18f11 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityEnderman.java +++ b/src/main/java/net/minecraft/entity/monster/EntityEnderman.java @@ -32,16 +32,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEnderman extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityEndermite.java b/src/main/java/net/minecraft/entity/monster/EntityEndermite.java index 84dc01a..d5d12c3 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityEndermite.java +++ b/src/main/java/net/minecraft/entity/monster/EntityEndermite.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEndermite extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityGhast.java b/src/main/java/net/minecraft/entity/monster/EntityGhast.java index 8e1b84b..829f0e1 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityGhast.java +++ b/src/main/java/net/minecraft/entity/monster/EntityGhast.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityGhast extends EntityFlying implements IMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java b/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java index 3c5a4f0..5c62440 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java +++ b/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityGiantZombie extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityGolem.java b/src/main/java/net/minecraft/entity/monster/EntityGolem.java index b31d0c4..7a70b93 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityGolem.java +++ b/src/main/java/net/minecraft/entity/monster/EntityGolem.java @@ -4,6 +4,26 @@ import net.minecraft.entity.EntityCreature; import net.minecraft.entity.passive.IAnimals; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityGolem extends EntityCreature implements IAnimals { public EntityGolem(World worldIn) { super(worldIn); diff --git a/src/main/java/net/minecraft/entity/monster/EntityGuardian.java b/src/main/java/net/minecraft/entity/monster/EntityGuardian.java index 8c77e10..e746372 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityGuardian.java +++ b/src/main/java/net/minecraft/entity/monster/EntityGuardian.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityGuardian extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java b/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java index b3afdb7..0beb559 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java +++ b/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java @@ -24,16 +24,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityIronGolem extends EntityGolem { diff --git a/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java b/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java index c4e7f2b..6b5dec1 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java +++ b/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMagmaCube extends EntitySlime { diff --git a/src/main/java/net/minecraft/entity/monster/EntityMob.java b/src/main/java/net/minecraft/entity/monster/EntityMob.java index c4c17aa..f50a227 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityMob.java +++ b/src/main/java/net/minecraft/entity/monster/EntityMob.java @@ -12,6 +12,26 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityMob extends EntityCreature implements IMob { public EntityMob(World worldIn) { super(worldIn); diff --git a/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java index 76bd8c2..a51a6cd 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java +++ b/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPigZombie extends EntityZombie { diff --git a/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java index 58dbec2..1a336ab 100644 --- a/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySilverfish extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java b/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java index bc52e04..0a6cbdc 100644 --- a/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java @@ -33,16 +33,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySkeleton extends EntityMob implements IRangedAttackMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntitySlime.java b/src/main/java/net/minecraft/entity/monster/EntitySlime.java index b638395..b77ce5d 100644 --- a/src/main/java/net/minecraft/entity/monster/EntitySlime.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySlime.java @@ -26,16 +26,18 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySlime extends EntityLiving implements IMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntitySnowman.java b/src/main/java/net/minecraft/entity/monster/EntitySnowman.java index b1df39b..db314cc 100644 --- a/src/main/java/net/minecraft/entity/monster/EntitySnowman.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySnowman.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySnowman extends EntityGolem implements IRangedAttackMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntitySpider.java b/src/main/java/net/minecraft/entity/monster/EntitySpider.java index b764b69..c4d0f0b 100644 --- a/src/main/java/net/minecraft/entity/monster/EntitySpider.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySpider.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySpider extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityWitch.java b/src/main/java/net/minecraft/entity/monster/EntityWitch.java index 3a0e87b..927c83d 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityWitch.java +++ b/src/main/java/net/minecraft/entity/monster/EntityWitch.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityWitch extends EntityMob implements IRangedAttackMob { diff --git a/src/main/java/net/minecraft/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/entity/monster/EntityZombie.java index df136f6..f6c2adf 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityZombie.java +++ b/src/main/java/net/minecraft/entity/monster/EntityZombie.java @@ -38,16 +38,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityZombie extends EntityMob { diff --git a/src/main/java/net/minecraft/entity/monster/IMob.java b/src/main/java/net/minecraft/entity/monster/IMob.java index 400c1c9..2e1c045 100644 --- a/src/main/java/net/minecraft/entity/monster/IMob.java +++ b/src/main/java/net/minecraft/entity/monster/IMob.java @@ -11,16 +11,18 @@ import net.minecraft.entity.passive.IAnimals; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IMob extends IAnimals { diff --git a/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java b/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java index e199418..27036e9 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java +++ b/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java @@ -4,6 +4,26 @@ import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAmbientCreature extends EntityLiving implements IAnimals { public EntityAmbientCreature(World worldIn) { super(worldIn); diff --git a/src/main/java/net/minecraft/entity/passive/EntityAnimal.java b/src/main/java/net/minecraft/entity/passive/EntityAnimal.java index 1fdaf07..eb5bfc1 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityAnimal.java +++ b/src/main/java/net/minecraft/entity/passive/EntityAnimal.java @@ -13,6 +13,26 @@ import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityAnimal extends EntityAgeable implements IAnimals { protected Block spawnableBlock = Blocks.grass; private int inLove; diff --git a/src/main/java/net/minecraft/entity/passive/EntityBat.java b/src/main/java/net/minecraft/entity/passive/EntityBat.java index 39a9f70..ea402a2 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityBat.java +++ b/src/main/java/net/minecraft/entity/passive/EntityBat.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityBat extends EntityAmbientCreature { diff --git a/src/main/java/net/minecraft/entity/passive/EntityChicken.java b/src/main/java/net/minecraft/entity/passive/EntityChicken.java index 69977e5..b775e0e 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityChicken.java +++ b/src/main/java/net/minecraft/entity/passive/EntityChicken.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityChicken extends EntityAnimal { diff --git a/src/main/java/net/minecraft/entity/passive/EntityCow.java b/src/main/java/net/minecraft/entity/passive/EntityCow.java index 7ac3f37..3d793f1 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityCow.java +++ b/src/main/java/net/minecraft/entity/passive/EntityCow.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityCow extends EntityAnimal { diff --git a/src/main/java/net/minecraft/entity/passive/EntityHorse.java b/src/main/java/net/minecraft/entity/passive/EntityHorse.java index 079ea6e..c2872f7 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityHorse.java +++ b/src/main/java/net/minecraft/entity/passive/EntityHorse.java @@ -37,16 +37,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityHorse extends EntityAnimal implements IInvBasic { diff --git a/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java b/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java index 09af571..5736176 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java +++ b/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityMooshroom extends EntityCow { diff --git a/src/main/java/net/minecraft/entity/passive/EntityOcelot.java b/src/main/java/net/minecraft/entity/passive/EntityOcelot.java index 14a353f..75f678d 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityOcelot.java +++ b/src/main/java/net/minecraft/entity/passive/EntityOcelot.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityOcelot extends EntityTameable { diff --git a/src/main/java/net/minecraft/entity/passive/EntityPig.java b/src/main/java/net/minecraft/entity/passive/EntityPig.java index bbe867e..6795aad 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityPig.java +++ b/src/main/java/net/minecraft/entity/passive/EntityPig.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPig extends EntityAnimal { diff --git a/src/main/java/net/minecraft/entity/passive/EntityRabbit.java b/src/main/java/net/minecraft/entity/passive/EntityRabbit.java index 7cfe0bc..09029ce 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityRabbit.java +++ b/src/main/java/net/minecraft/entity/passive/EntityRabbit.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityRabbit extends EntityAnimal { diff --git a/src/main/java/net/minecraft/entity/passive/EntitySheep.java b/src/main/java/net/minecraft/entity/passive/EntitySheep.java index b1bb9de..38ce764 100644 --- a/src/main/java/net/minecraft/entity/passive/EntitySheep.java +++ b/src/main/java/net/minecraft/entity/passive/EntitySheep.java @@ -30,16 +30,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySheep extends EntityAnimal { diff --git a/src/main/java/net/minecraft/entity/passive/EntitySquid.java b/src/main/java/net/minecraft/entity/passive/EntitySquid.java index 2f5dc32..46a9e5e 100644 --- a/src/main/java/net/minecraft/entity/passive/EntitySquid.java +++ b/src/main/java/net/minecraft/entity/passive/EntitySquid.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySquid extends EntityWaterMob { diff --git a/src/main/java/net/minecraft/entity/passive/EntityTameable.java b/src/main/java/net/minecraft/entity/passive/EntityTameable.java index ecf675e..17bf406 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityTameable.java +++ b/src/main/java/net/minecraft/entity/passive/EntityTameable.java @@ -9,6 +9,26 @@ import net.minecraft.scoreboard.Team; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityTameable extends EntityAnimal implements IEntityOwnable { public EntityTameable(World worldIn) { diff --git a/src/main/java/net/minecraft/entity/passive/EntityVillager.java b/src/main/java/net/minecraft/entity/passive/EntityVillager.java index 50b82c0..68f691d 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityVillager.java +++ b/src/main/java/net/minecraft/entity/passive/EntityVillager.java @@ -41,16 +41,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityVillager extends EntityAgeable implements IMerchant, INpc { diff --git a/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java b/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java index 459dd5f..803ce62 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java +++ b/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java @@ -5,6 +5,26 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityWaterMob extends EntityLiving implements IAnimals { public EntityWaterMob(World worldIn) { super(worldIn); diff --git a/src/main/java/net/minecraft/entity/passive/EntityWolf.java b/src/main/java/net/minecraft/entity/passive/EntityWolf.java index c52c9ac..8bfc136 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityWolf.java +++ b/src/main/java/net/minecraft/entity/passive/EntityWolf.java @@ -27,16 +27,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityWolf extends EntityTameable { diff --git a/src/main/java/net/minecraft/entity/passive/IAnimals.java b/src/main/java/net/minecraft/entity/passive/IAnimals.java index fc1de7e..830aeca 100644 --- a/src/main/java/net/minecraft/entity/passive/IAnimals.java +++ b/src/main/java/net/minecraft/entity/passive/IAnimals.java @@ -6,16 +6,18 @@ package net.minecraft.entity.passive; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IAnimals { diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/minecraft/entity/player/EntityPlayer.java index 204f137..466379d 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayer.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -75,6 +75,26 @@ import net.minecraft.world.LockCode; import net.minecraft.world.World; import net.minecraft.world.WorldSettings; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityPlayer extends EntityLivingBase implements ICommandSender { /**+ * Inventory of the player diff --git a/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java b/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java index 13e1a5b..35d8559 100644 --- a/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java +++ b/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java @@ -9,16 +9,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumPlayerModelParts { diff --git a/src/main/java/net/minecraft/entity/player/InventoryPlayer.java b/src/main/java/net/minecraft/entity/player/InventoryPlayer.java index 0e57746..2bf546d 100644 --- a/src/main/java/net/minecraft/entity/player/InventoryPlayer.java +++ b/src/main/java/net/minecraft/entity/player/InventoryPlayer.java @@ -23,16 +23,18 @@ import net.minecraft.util.ReportedException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryPlayer implements IInventory { diff --git a/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java b/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java index 5379540..0a3ab2f 100644 --- a/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java +++ b/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java @@ -8,16 +8,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlayerCapabilities { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/entity/projectile/EntityArrow.java index ed76c51..94f90d9 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityArrow.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityArrow.java @@ -28,16 +28,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityArrow extends Entity implements IProjectile { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityEgg.java b/src/main/java/net/minecraft/entity/projectile/EntityEgg.java index 74ffee2..f294add 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityEgg.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityEgg.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityEgg extends EntityThrowable { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityFireball.java b/src/main/java/net/minecraft/entity/projectile/EntityFireball.java index ee49656..0fa42a5 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityFireball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityFireball.java @@ -17,6 +17,26 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityFireball extends Entity { private int xTile = -1; private int yTile = -1; diff --git a/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java b/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java index 5d23192..0e41a6c 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java @@ -29,16 +29,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityFishHook extends Entity { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java index 72d9bf7..914d02d 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityLargeFireball extends EntityFireball { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityPotion.java b/src/main/java/net/minecraft/entity/projectile/EntityPotion.java index 8b9ba5c..ca8ce3a 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityPotion.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityPotion.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityPotion extends EntityThrowable { diff --git a/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java b/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java index 8722c8d..df88a3a 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySmallFireball extends EntityFireball { diff --git a/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java b/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java index 0ed5001..6bac7c5 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntitySnowball extends EntityThrowable { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java b/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java index dc47bfa..e21de55 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java @@ -15,6 +15,26 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class EntityThrowable extends Entity implements IProjectile { private int xTile = -1; private int yTile = -1; diff --git a/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java b/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java index 7b3f9a6..6d36f26 100644 --- a/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityWitherSkull extends EntityFireball { diff --git a/src/main/java/net/minecraft/event/ClickEvent.java b/src/main/java/net/minecraft/event/ClickEvent.java index a85d503..598c54f 100644 --- a/src/main/java/net/minecraft/event/ClickEvent.java +++ b/src/main/java/net/minecraft/event/ClickEvent.java @@ -10,16 +10,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ClickEvent { @@ -83,7 +85,7 @@ public class ClickEvent { public static enum Action { OPEN_URL("open_url", true), OPEN_FILE("open_file", false), RUN_COMMAND("run_command", true), TWITCH_USER_INFO("twitch_user_info", false), SUGGEST_COMMAND("suggest_command", true), - CHANGE_PAGE("change_page", true); + CHANGE_PAGE("change_page", true), EAGLER_PLUGIN_DOWNLOAD("eagler_plugin_download", true); private static final Map nameMapping = Maps.newHashMap(); private final boolean allowedInChat; diff --git a/src/main/java/net/minecraft/event/HoverEvent.java b/src/main/java/net/minecraft/event/HoverEvent.java index cb591bb..b6c74bd 100644 --- a/src/main/java/net/minecraft/event/HoverEvent.java +++ b/src/main/java/net/minecraft/event/HoverEvent.java @@ -12,16 +12,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 HoverEvent { diff --git a/src/main/java/net/minecraft/init/Blocks.java b/src/main/java/net/minecraft/init/Blocks.java index d82a7ad..e330f61 100644 --- a/src/main/java/net/minecraft/init/Blocks.java +++ b/src/main/java/net/minecraft/init/Blocks.java @@ -40,16 +40,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Blocks { diff --git a/src/main/java/net/minecraft/init/Bootstrap.java b/src/main/java/net/minecraft/init/Bootstrap.java index 4e1e805..33c9df0 100644 --- a/src/main/java/net/minecraft/init/Bootstrap.java +++ b/src/main/java/net/minecraft/init/Bootstrap.java @@ -58,16 +58,18 @@ import net.minecraft.world.biome.BiomeGenBase; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Bootstrap { diff --git a/src/main/java/net/minecraft/init/Items.java b/src/main/java/net/minecraft/init/Items.java index 5e7b28a..e200a3d 100644 --- a/src/main/java/net/minecraft/init/Items.java +++ b/src/main/java/net/minecraft/init/Items.java @@ -18,16 +18,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Items { diff --git a/src/main/java/net/minecraft/inventory/AnimalChest.java b/src/main/java/net/minecraft/inventory/AnimalChest.java index e71394c..6c86254 100644 --- a/src/main/java/net/minecraft/inventory/AnimalChest.java +++ b/src/main/java/net/minecraft/inventory/AnimalChest.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AnimalChest extends InventoryBasic { diff --git a/src/main/java/net/minecraft/inventory/Container.java b/src/main/java/net/minecraft/inventory/Container.java index f495d72..a231e30 100644 --- a/src/main/java/net/minecraft/inventory/Container.java +++ b/src/main/java/net/minecraft/inventory/Container.java @@ -14,6 +14,26 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Container { /**+ * the list of all items(stacks) for the corresponding slot diff --git a/src/main/java/net/minecraft/inventory/ContainerBeacon.java b/src/main/java/net/minecraft/inventory/ContainerBeacon.java index 70834a9..a5fc51c 100644 --- a/src/main/java/net/minecraft/inventory/ContainerBeacon.java +++ b/src/main/java/net/minecraft/inventory/ContainerBeacon.java @@ -10,16 +10,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerBeacon extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java b/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java index 152c512..22e6639 100644 --- a/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java +++ b/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java @@ -12,16 +12,18 @@ import net.minecraft.stats.AchievementList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerBrewingStand extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerChest.java b/src/main/java/net/minecraft/inventory/ContainerChest.java index 4b07497..89c662f 100644 --- a/src/main/java/net/minecraft/inventory/ContainerChest.java +++ b/src/main/java/net/minecraft/inventory/ContainerChest.java @@ -9,16 +9,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerChest extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerDispenser.java b/src/main/java/net/minecraft/inventory/ContainerDispenser.java index afbed51..4ddeee7 100644 --- a/src/main/java/net/minecraft/inventory/ContainerDispenser.java +++ b/src/main/java/net/minecraft/inventory/ContainerDispenser.java @@ -9,16 +9,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerDispenser extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerEnchantment.java b/src/main/java/net/minecraft/inventory/ContainerEnchantment.java index a2a0ab1..0759af1 100644 --- a/src/main/java/net/minecraft/inventory/ContainerEnchantment.java +++ b/src/main/java/net/minecraft/inventory/ContainerEnchantment.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerEnchantment extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerFurnace.java b/src/main/java/net/minecraft/inventory/ContainerFurnace.java index edb127a..ad910fd 100644 --- a/src/main/java/net/minecraft/inventory/ContainerFurnace.java +++ b/src/main/java/net/minecraft/inventory/ContainerFurnace.java @@ -12,16 +12,18 @@ import net.minecraft.tileentity.TileEntityFurnace; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerFurnace extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerHopper.java b/src/main/java/net/minecraft/inventory/ContainerHopper.java index ad97345..e45e778 100644 --- a/src/main/java/net/minecraft/inventory/ContainerHopper.java +++ b/src/main/java/net/minecraft/inventory/ContainerHopper.java @@ -10,16 +10,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerHopper extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java b/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java index 8579972..353df0d 100644 --- a/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java +++ b/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerHorseInventory extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerMerchant.java b/src/main/java/net/minecraft/inventory/ContainerMerchant.java index 350266c..a5acdc8 100644 --- a/src/main/java/net/minecraft/inventory/ContainerMerchant.java +++ b/src/main/java/net/minecraft/inventory/ContainerMerchant.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerMerchant extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerPlayer.java b/src/main/java/net/minecraft/inventory/ContainerPlayer.java index 00a913c..6ef5459 100644 --- a/src/main/java/net/minecraft/inventory/ContainerPlayer.java +++ b/src/main/java/net/minecraft/inventory/ContainerPlayer.java @@ -15,16 +15,18 @@ import net.minecraft.item.crafting.CraftingManager; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerPlayer extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerRepair.java b/src/main/java/net/minecraft/inventory/ContainerRepair.java index 73d483e..919975b 100644 --- a/src/main/java/net/minecraft/inventory/ContainerRepair.java +++ b/src/main/java/net/minecraft/inventory/ContainerRepair.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerRepair extends Container { diff --git a/src/main/java/net/minecraft/inventory/ContainerWorkbench.java b/src/main/java/net/minecraft/inventory/ContainerWorkbench.java index 3f24385..0687328 100644 --- a/src/main/java/net/minecraft/inventory/ContainerWorkbench.java +++ b/src/main/java/net/minecraft/inventory/ContainerWorkbench.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ContainerWorkbench extends Container { diff --git a/src/main/java/net/minecraft/inventory/ICrafting.java b/src/main/java/net/minecraft/inventory/ICrafting.java index f72ef1e..5bee2a3 100644 --- a/src/main/java/net/minecraft/inventory/ICrafting.java +++ b/src/main/java/net/minecraft/inventory/ICrafting.java @@ -10,16 +10,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ICrafting { diff --git a/src/main/java/net/minecraft/inventory/IInvBasic.java b/src/main/java/net/minecraft/inventory/IInvBasic.java index d3e3bd1..b413898 100644 --- a/src/main/java/net/minecraft/inventory/IInvBasic.java +++ b/src/main/java/net/minecraft/inventory/IInvBasic.java @@ -6,16 +6,18 @@ package net.minecraft.inventory; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IInvBasic { diff --git a/src/main/java/net/minecraft/inventory/IInventory.java b/src/main/java/net/minecraft/inventory/IInventory.java index 25d8963..27f26de 100644 --- a/src/main/java/net/minecraft/inventory/IInventory.java +++ b/src/main/java/net/minecraft/inventory/IInventory.java @@ -10,16 +10,18 @@ import net.minecraft.world.IWorldNameable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IInventory extends IWorldNameable { diff --git a/src/main/java/net/minecraft/inventory/ISidedInventory.java b/src/main/java/net/minecraft/inventory/ISidedInventory.java index eb95377..eedd360 100644 --- a/src/main/java/net/minecraft/inventory/ISidedInventory.java +++ b/src/main/java/net/minecraft/inventory/ISidedInventory.java @@ -9,16 +9,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISidedInventory extends IInventory { diff --git a/src/main/java/net/minecraft/inventory/InventoryBasic.java b/src/main/java/net/minecraft/inventory/InventoryBasic.java index 5b852b1..2e35ead 100644 --- a/src/main/java/net/minecraft/inventory/InventoryBasic.java +++ b/src/main/java/net/minecraft/inventory/InventoryBasic.java @@ -16,16 +16,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryBasic implements IInventory { diff --git a/src/main/java/net/minecraft/inventory/InventoryCraftResult.java b/src/main/java/net/minecraft/inventory/InventoryCraftResult.java index b34a558..13c8598 100644 --- a/src/main/java/net/minecraft/inventory/InventoryCraftResult.java +++ b/src/main/java/net/minecraft/inventory/InventoryCraftResult.java @@ -12,16 +12,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryCraftResult implements IInventory { diff --git a/src/main/java/net/minecraft/inventory/InventoryCrafting.java b/src/main/java/net/minecraft/inventory/InventoryCrafting.java index 019c707..0b65212 100644 --- a/src/main/java/net/minecraft/inventory/InventoryCrafting.java +++ b/src/main/java/net/minecraft/inventory/InventoryCrafting.java @@ -12,16 +12,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryCrafting implements IInventory { diff --git a/src/main/java/net/minecraft/inventory/InventoryEnderChest.java b/src/main/java/net/minecraft/inventory/InventoryEnderChest.java index 36b6eed..63b2f55 100644 --- a/src/main/java/net/minecraft/inventory/InventoryEnderChest.java +++ b/src/main/java/net/minecraft/inventory/InventoryEnderChest.java @@ -12,16 +12,18 @@ import net.minecraft.tileentity.TileEntityEnderChest; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryEnderChest extends InventoryBasic { diff --git a/src/main/java/net/minecraft/inventory/InventoryHelper.java b/src/main/java/net/minecraft/inventory/InventoryHelper.java index fecd20c..079362b 100644 --- a/src/main/java/net/minecraft/inventory/InventoryHelper.java +++ b/src/main/java/net/minecraft/inventory/InventoryHelper.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryHelper { diff --git a/src/main/java/net/minecraft/inventory/InventoryLargeChest.java b/src/main/java/net/minecraft/inventory/InventoryLargeChest.java index 3dd46c3..2127c69 100644 --- a/src/main/java/net/minecraft/inventory/InventoryLargeChest.java +++ b/src/main/java/net/minecraft/inventory/InventoryLargeChest.java @@ -15,16 +15,18 @@ import net.minecraft.world.LockCode; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryLargeChest implements ILockableContainer { diff --git a/src/main/java/net/minecraft/inventory/InventoryMerchant.java b/src/main/java/net/minecraft/inventory/InventoryMerchant.java index 45e349c..b0b7d86 100644 --- a/src/main/java/net/minecraft/inventory/InventoryMerchant.java +++ b/src/main/java/net/minecraft/inventory/InventoryMerchant.java @@ -15,16 +15,18 @@ import net.minecraft.village.MerchantRecipeList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 InventoryMerchant implements IInventory { diff --git a/src/main/java/net/minecraft/inventory/Slot.java b/src/main/java/net/minecraft/inventory/Slot.java index 7ff9438..3749b34 100644 --- a/src/main/java/net/minecraft/inventory/Slot.java +++ b/src/main/java/net/minecraft/inventory/Slot.java @@ -9,16 +9,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Slot { diff --git a/src/main/java/net/minecraft/inventory/SlotCrafting.java b/src/main/java/net/minecraft/inventory/SlotCrafting.java index a91d881..7e2c527 100644 --- a/src/main/java/net/minecraft/inventory/SlotCrafting.java +++ b/src/main/java/net/minecraft/inventory/SlotCrafting.java @@ -17,16 +17,18 @@ import net.minecraft.stats.AchievementList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SlotCrafting extends Slot { diff --git a/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java b/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java index e5f38a2..c800db7 100644 --- a/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java +++ b/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java @@ -10,16 +10,18 @@ import net.minecraft.tileentity.TileEntityFurnace; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SlotFurnaceFuel extends Slot { diff --git a/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java b/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java index 89210a5..a5e70a4 100644 --- a/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java +++ b/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java @@ -11,16 +11,18 @@ import net.minecraft.stats.AchievementList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SlotFurnaceOutput extends Slot { diff --git a/src/main/java/net/minecraft/inventory/SlotMerchantResult.java b/src/main/java/net/minecraft/inventory/SlotMerchantResult.java index 6375f30..9255f2a 100644 --- a/src/main/java/net/minecraft/inventory/SlotMerchantResult.java +++ b/src/main/java/net/minecraft/inventory/SlotMerchantResult.java @@ -12,16 +12,18 @@ import net.minecraft.village.MerchantRecipe; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SlotMerchantResult extends Slot { diff --git a/src/main/java/net/minecraft/item/EnumAction.java b/src/main/java/net/minecraft/item/EnumAction.java index 1020ce2..01758fc 100644 --- a/src/main/java/net/minecraft/item/EnumAction.java +++ b/src/main/java/net/minecraft/item/EnumAction.java @@ -6,16 +6,18 @@ package net.minecraft.item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumAction { diff --git a/src/main/java/net/minecraft/item/EnumDyeColor.java b/src/main/java/net/minecraft/item/EnumDyeColor.java index 75c02c2..b723188 100644 --- a/src/main/java/net/minecraft/item/EnumDyeColor.java +++ b/src/main/java/net/minecraft/item/EnumDyeColor.java @@ -10,16 +10,18 @@ import net.minecraft.util.IStringSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumDyeColor implements IStringSerializable { diff --git a/src/main/java/net/minecraft/item/EnumRarity.java b/src/main/java/net/minecraft/item/EnumRarity.java index fa505bb..e5fcac8 100644 --- a/src/main/java/net/minecraft/item/EnumRarity.java +++ b/src/main/java/net/minecraft/item/EnumRarity.java @@ -8,16 +8,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumRarity { diff --git a/src/main/java/net/minecraft/item/Item.java b/src/main/java/net/minecraft/item/Item.java index fad3b66..b9a38a8 100644 --- a/src/main/java/net/minecraft/item/Item.java +++ b/src/main/java/net/minecraft/item/Item.java @@ -52,16 +52,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Item { diff --git a/src/main/java/net/minecraft/item/ItemAnvilBlock.java b/src/main/java/net/minecraft/item/ItemAnvilBlock.java index dd27a17..02ce6ea 100644 --- a/src/main/java/net/minecraft/item/ItemAnvilBlock.java +++ b/src/main/java/net/minecraft/item/ItemAnvilBlock.java @@ -8,16 +8,18 @@ import net.minecraft.block.Block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemAnvilBlock extends ItemMultiTexture { diff --git a/src/main/java/net/minecraft/item/ItemAppleGold.java b/src/main/java/net/minecraft/item/ItemAppleGold.java index 75de3df..7077736 100644 --- a/src/main/java/net/minecraft/item/ItemAppleGold.java +++ b/src/main/java/net/minecraft/item/ItemAppleGold.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemAppleGold extends ItemFood { diff --git a/src/main/java/net/minecraft/item/ItemArmor.java b/src/main/java/net/minecraft/item/ItemArmor.java index 66ce62d..48e6f3d 100644 --- a/src/main/java/net/minecraft/item/ItemArmor.java +++ b/src/main/java/net/minecraft/item/ItemArmor.java @@ -25,16 +25,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemArmor extends Item { diff --git a/src/main/java/net/minecraft/item/ItemArmorStand.java b/src/main/java/net/minecraft/item/ItemArmorStand.java index 0c64fcd..2b48705 100644 --- a/src/main/java/net/minecraft/item/ItemArmorStand.java +++ b/src/main/java/net/minecraft/item/ItemArmorStand.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemArmorStand extends Item { diff --git a/src/main/java/net/minecraft/item/ItemAxe.java b/src/main/java/net/minecraft/item/ItemAxe.java index 445fbf3..24dc879 100644 --- a/src/main/java/net/minecraft/item/ItemAxe.java +++ b/src/main/java/net/minecraft/item/ItemAxe.java @@ -14,16 +14,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemAxe extends ItemTool { diff --git a/src/main/java/net/minecraft/item/ItemBanner.java b/src/main/java/net/minecraft/item/ItemBanner.java index ccbcc46..c5301b4 100644 --- a/src/main/java/net/minecraft/item/ItemBanner.java +++ b/src/main/java/net/minecraft/item/ItemBanner.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBanner extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemBed.java b/src/main/java/net/minecraft/item/ItemBed.java index 134f1bb..7c6f6ac 100644 --- a/src/main/java/net/minecraft/item/ItemBed.java +++ b/src/main/java/net/minecraft/item/ItemBed.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBed extends Item { diff --git a/src/main/java/net/minecraft/item/ItemBlock.java b/src/main/java/net/minecraft/item/ItemBlock.java index 462a970..ab472b0 100644 --- a/src/main/java/net/minecraft/item/ItemBlock.java +++ b/src/main/java/net/minecraft/item/ItemBlock.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBlock extends Item { diff --git a/src/main/java/net/minecraft/item/ItemBoat.java b/src/main/java/net/minecraft/item/ItemBoat.java index bcff002..ba806db 100644 --- a/src/main/java/net/minecraft/item/ItemBoat.java +++ b/src/main/java/net/minecraft/item/ItemBoat.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBoat extends Item { diff --git a/src/main/java/net/minecraft/item/ItemBook.java b/src/main/java/net/minecraft/item/ItemBook.java index bc6a882..f7b06e8 100644 --- a/src/main/java/net/minecraft/item/ItemBook.java +++ b/src/main/java/net/minecraft/item/ItemBook.java @@ -6,16 +6,18 @@ package net.minecraft.item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBook extends Item { diff --git a/src/main/java/net/minecraft/item/ItemBow.java b/src/main/java/net/minecraft/item/ItemBow.java index 60d24c9..2bc63ab 100644 --- a/src/main/java/net/minecraft/item/ItemBow.java +++ b/src/main/java/net/minecraft/item/ItemBow.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBow extends Item { diff --git a/src/main/java/net/minecraft/item/ItemBucket.java b/src/main/java/net/minecraft/item/ItemBucket.java index 358dfd5..1491cd9 100644 --- a/src/main/java/net/minecraft/item/ItemBucket.java +++ b/src/main/java/net/minecraft/item/ItemBucket.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBucket extends Item { diff --git a/src/main/java/net/minecraft/item/ItemBucketMilk.java b/src/main/java/net/minecraft/item/ItemBucketMilk.java index 4773d37..648e03a 100644 --- a/src/main/java/net/minecraft/item/ItemBucketMilk.java +++ b/src/main/java/net/minecraft/item/ItemBucketMilk.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemBucketMilk extends Item { diff --git a/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java b/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java index 27fc4f9..611d2da 100644 --- a/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java +++ b/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemCarrotOnAStick extends Item { diff --git a/src/main/java/net/minecraft/item/ItemCloth.java b/src/main/java/net/minecraft/item/ItemCloth.java index cd00c1c..6d294f6 100644 --- a/src/main/java/net/minecraft/item/ItemCloth.java +++ b/src/main/java/net/minecraft/item/ItemCloth.java @@ -8,16 +8,18 @@ import net.minecraft.block.Block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemCloth extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemCoal.java b/src/main/java/net/minecraft/item/ItemCoal.java index 9c19f30..3779b7d 100644 --- a/src/main/java/net/minecraft/item/ItemCoal.java +++ b/src/main/java/net/minecraft/item/ItemCoal.java @@ -10,16 +10,18 @@ import net.minecraft.creativetab.CreativeTabs; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemCoal extends Item { diff --git a/src/main/java/net/minecraft/item/ItemColored.java b/src/main/java/net/minecraft/item/ItemColored.java index 4026154..f1da60c 100644 --- a/src/main/java/net/minecraft/item/ItemColored.java +++ b/src/main/java/net/minecraft/item/ItemColored.java @@ -8,16 +8,18 @@ import net.minecraft.block.Block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemColored extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemDoor.java b/src/main/java/net/minecraft/item/ItemDoor.java index ba48830..32908f9 100644 --- a/src/main/java/net/minecraft/item/ItemDoor.java +++ b/src/main/java/net/minecraft/item/ItemDoor.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemDoor extends Item { diff --git a/src/main/java/net/minecraft/item/ItemDoublePlant.java b/src/main/java/net/minecraft/item/ItemDoublePlant.java index 2773bb3..1e74789 100644 --- a/src/main/java/net/minecraft/item/ItemDoublePlant.java +++ b/src/main/java/net/minecraft/item/ItemDoublePlant.java @@ -12,16 +12,18 @@ import net.minecraft.world.ColorizerGrass; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemDoublePlant extends ItemMultiTexture { diff --git a/src/main/java/net/minecraft/item/ItemDye.java b/src/main/java/net/minecraft/item/ItemDye.java index b55f510..c2659ec 100644 --- a/src/main/java/net/minecraft/item/ItemDye.java +++ b/src/main/java/net/minecraft/item/ItemDye.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemDye extends Item { diff --git a/src/main/java/net/minecraft/item/ItemEditableBook.java b/src/main/java/net/minecraft/item/ItemEditableBook.java index d0a93e2..adba339 100644 --- a/src/main/java/net/minecraft/item/ItemEditableBook.java +++ b/src/main/java/net/minecraft/item/ItemEditableBook.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemEditableBook extends Item { diff --git a/src/main/java/net/minecraft/item/ItemEgg.java b/src/main/java/net/minecraft/item/ItemEgg.java index 52a0e0c..f32ae69 100644 --- a/src/main/java/net/minecraft/item/ItemEgg.java +++ b/src/main/java/net/minecraft/item/ItemEgg.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemEgg extends Item { diff --git a/src/main/java/net/minecraft/item/ItemEmptyMap.java b/src/main/java/net/minecraft/item/ItemEmptyMap.java index 08017ee..ecc726b 100644 --- a/src/main/java/net/minecraft/item/ItemEmptyMap.java +++ b/src/main/java/net/minecraft/item/ItemEmptyMap.java @@ -13,16 +13,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemEmptyMap extends ItemMapBase { diff --git a/src/main/java/net/minecraft/item/ItemEnchantedBook.java b/src/main/java/net/minecraft/item/ItemEnchantedBook.java index de7a2b0..8d58c41 100644 --- a/src/main/java/net/minecraft/item/ItemEnchantedBook.java +++ b/src/main/java/net/minecraft/item/ItemEnchantedBook.java @@ -18,16 +18,18 @@ import net.minecraft.util.WeightedRandomChestContent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemEnchantedBook extends Item { diff --git a/src/main/java/net/minecraft/item/ItemEnderEye.java b/src/main/java/net/minecraft/item/ItemEnderEye.java index c91f52e..4b9c78a 100644 --- a/src/main/java/net/minecraft/item/ItemEnderEye.java +++ b/src/main/java/net/minecraft/item/ItemEnderEye.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemEnderEye extends Item { diff --git a/src/main/java/net/minecraft/item/ItemEnderPearl.java b/src/main/java/net/minecraft/item/ItemEnderPearl.java index b0e9dbc..e4285c5 100644 --- a/src/main/java/net/minecraft/item/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/item/ItemEnderPearl.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemEnderPearl extends Item { diff --git a/src/main/java/net/minecraft/item/ItemExpBottle.java b/src/main/java/net/minecraft/item/ItemExpBottle.java index 4f4c7c4..ada3feb 100644 --- a/src/main/java/net/minecraft/item/ItemExpBottle.java +++ b/src/main/java/net/minecraft/item/ItemExpBottle.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemExpBottle extends Item { diff --git a/src/main/java/net/minecraft/item/ItemFireball.java b/src/main/java/net/minecraft/item/ItemFireball.java index 0a89431..bac4191 100644 --- a/src/main/java/net/minecraft/item/ItemFireball.java +++ b/src/main/java/net/minecraft/item/ItemFireball.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFireball extends Item { diff --git a/src/main/java/net/minecraft/item/ItemFirework.java b/src/main/java/net/minecraft/item/ItemFirework.java index 35427c0..796115f 100644 --- a/src/main/java/net/minecraft/item/ItemFirework.java +++ b/src/main/java/net/minecraft/item/ItemFirework.java @@ -16,16 +16,18 @@ import net.minecraft.util.StatCollector; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFirework extends Item { diff --git a/src/main/java/net/minecraft/item/ItemFireworkCharge.java b/src/main/java/net/minecraft/item/ItemFireworkCharge.java index 6f9b46b..d1d78b8 100644 --- a/src/main/java/net/minecraft/item/ItemFireworkCharge.java +++ b/src/main/java/net/minecraft/item/ItemFireworkCharge.java @@ -14,16 +14,18 @@ import net.minecraft.util.StatCollector; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFireworkCharge extends Item { diff --git a/src/main/java/net/minecraft/item/ItemFishFood.java b/src/main/java/net/minecraft/item/ItemFishFood.java index 1e84bfb..8422e15 100644 --- a/src/main/java/net/minecraft/item/ItemFishFood.java +++ b/src/main/java/net/minecraft/item/ItemFishFood.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFishFood extends ItemFood { diff --git a/src/main/java/net/minecraft/item/ItemFishingRod.java b/src/main/java/net/minecraft/item/ItemFishingRod.java index c926dcb..76c8538 100644 --- a/src/main/java/net/minecraft/item/ItemFishingRod.java +++ b/src/main/java/net/minecraft/item/ItemFishingRod.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFishingRod extends Item { diff --git a/src/main/java/net/minecraft/item/ItemFlintAndSteel.java b/src/main/java/net/minecraft/item/ItemFlintAndSteel.java index f4d849d..17ed9d9 100644 --- a/src/main/java/net/minecraft/item/ItemFlintAndSteel.java +++ b/src/main/java/net/minecraft/item/ItemFlintAndSteel.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFlintAndSteel extends Item { diff --git a/src/main/java/net/minecraft/item/ItemFood.java b/src/main/java/net/minecraft/item/ItemFood.java index 60540a8..b80eb80 100644 --- a/src/main/java/net/minecraft/item/ItemFood.java +++ b/src/main/java/net/minecraft/item/ItemFood.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemFood extends Item { diff --git a/src/main/java/net/minecraft/item/ItemGlassBottle.java b/src/main/java/net/minecraft/item/ItemGlassBottle.java index 0fbe595..ff8da31 100644 --- a/src/main/java/net/minecraft/item/ItemGlassBottle.java +++ b/src/main/java/net/minecraft/item/ItemGlassBottle.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemGlassBottle extends Item { diff --git a/src/main/java/net/minecraft/item/ItemHangingEntity.java b/src/main/java/net/minecraft/item/ItemHangingEntity.java index a389a09..9babe95 100644 --- a/src/main/java/net/minecraft/item/ItemHangingEntity.java +++ b/src/main/java/net/minecraft/item/ItemHangingEntity.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemHangingEntity extends Item { diff --git a/src/main/java/net/minecraft/item/ItemHoe.java b/src/main/java/net/minecraft/item/ItemHoe.java index 8f3a5b7..8beeb01 100644 --- a/src/main/java/net/minecraft/item/ItemHoe.java +++ b/src/main/java/net/minecraft/item/ItemHoe.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemHoe extends Item { diff --git a/src/main/java/net/minecraft/item/ItemLead.java b/src/main/java/net/minecraft/item/ItemLead.java index f2ded28..cf1b31e 100644 --- a/src/main/java/net/minecraft/item/ItemLead.java +++ b/src/main/java/net/minecraft/item/ItemLead.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemLead extends Item { diff --git a/src/main/java/net/minecraft/item/ItemLeaves.java b/src/main/java/net/minecraft/item/ItemLeaves.java index 90e52ac..090113e 100644 --- a/src/main/java/net/minecraft/item/ItemLeaves.java +++ b/src/main/java/net/minecraft/item/ItemLeaves.java @@ -8,16 +8,18 @@ import net.minecraft.block.BlockLeaves; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemLeaves extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemLilyPad.java b/src/main/java/net/minecraft/item/ItemLilyPad.java index 30881df..3b8eb27 100644 --- a/src/main/java/net/minecraft/item/ItemLilyPad.java +++ b/src/main/java/net/minecraft/item/ItemLilyPad.java @@ -17,16 +17,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemLilyPad extends ItemColored { diff --git a/src/main/java/net/minecraft/item/ItemMap.java b/src/main/java/net/minecraft/item/ItemMap.java index d978767..f04cbd4 100644 --- a/src/main/java/net/minecraft/item/ItemMap.java +++ b/src/main/java/net/minecraft/item/ItemMap.java @@ -28,16 +28,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemMap extends ItemMapBase { diff --git a/src/main/java/net/minecraft/item/ItemMapBase.java b/src/main/java/net/minecraft/item/ItemMapBase.java index 47b5765..0c16dce 100644 --- a/src/main/java/net/minecraft/item/ItemMapBase.java +++ b/src/main/java/net/minecraft/item/ItemMapBase.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemMapBase extends Item { diff --git a/src/main/java/net/minecraft/item/ItemMinecart.java b/src/main/java/net/minecraft/item/ItemMinecart.java index 4b5c93e..d215a87 100644 --- a/src/main/java/net/minecraft/item/ItemMinecart.java +++ b/src/main/java/net/minecraft/item/ItemMinecart.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemMinecart extends Item { diff --git a/src/main/java/net/minecraft/item/ItemMonsterPlacer.java b/src/main/java/net/minecraft/item/ItemMonsterPlacer.java index 18bfacc..4abc86a 100644 --- a/src/main/java/net/minecraft/item/ItemMonsterPlacer.java +++ b/src/main/java/net/minecraft/item/ItemMonsterPlacer.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemMonsterPlacer extends Item { diff --git a/src/main/java/net/minecraft/item/ItemMultiTexture.java b/src/main/java/net/minecraft/item/ItemMultiTexture.java index 4c9842e..f6e400e 100644 --- a/src/main/java/net/minecraft/item/ItemMultiTexture.java +++ b/src/main/java/net/minecraft/item/ItemMultiTexture.java @@ -10,16 +10,18 @@ import net.minecraft.block.Block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemMultiTexture extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemNameTag.java b/src/main/java/net/minecraft/item/ItemNameTag.java index 672edb4..5dfe707 100644 --- a/src/main/java/net/minecraft/item/ItemNameTag.java +++ b/src/main/java/net/minecraft/item/ItemNameTag.java @@ -11,16 +11,18 @@ import net.minecraft.entity.player.EntityPlayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemNameTag extends Item { diff --git a/src/main/java/net/minecraft/item/ItemPickaxe.java b/src/main/java/net/minecraft/item/ItemPickaxe.java index 5b20ab8..c8bc448 100644 --- a/src/main/java/net/minecraft/item/ItemPickaxe.java +++ b/src/main/java/net/minecraft/item/ItemPickaxe.java @@ -14,16 +14,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemPickaxe extends ItemTool { diff --git a/src/main/java/net/minecraft/item/ItemPiston.java b/src/main/java/net/minecraft/item/ItemPiston.java index 1d0f26f..557dab5 100644 --- a/src/main/java/net/minecraft/item/ItemPiston.java +++ b/src/main/java/net/minecraft/item/ItemPiston.java @@ -8,16 +8,18 @@ import net.minecraft.block.Block; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemPiston extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemPotion.java b/src/main/java/net/minecraft/item/ItemPotion.java index 905c43b..b9b86ff 100644 --- a/src/main/java/net/minecraft/item/ItemPotion.java +++ b/src/main/java/net/minecraft/item/ItemPotion.java @@ -32,16 +32,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemPotion extends Item { diff --git a/src/main/java/net/minecraft/item/ItemRecord.java b/src/main/java/net/minecraft/item/ItemRecord.java index b1033e1..e3e779a 100644 --- a/src/main/java/net/minecraft/item/ItemRecord.java +++ b/src/main/java/net/minecraft/item/ItemRecord.java @@ -21,16 +21,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemRecord extends Item { diff --git a/src/main/java/net/minecraft/item/ItemRedstone.java b/src/main/java/net/minecraft/item/ItemRedstone.java index ec30f79..9073723 100644 --- a/src/main/java/net/minecraft/item/ItemRedstone.java +++ b/src/main/java/net/minecraft/item/ItemRedstone.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemRedstone extends Item { diff --git a/src/main/java/net/minecraft/item/ItemReed.java b/src/main/java/net/minecraft/item/ItemReed.java index 2c8310f..69176b9 100644 --- a/src/main/java/net/minecraft/item/ItemReed.java +++ b/src/main/java/net/minecraft/item/ItemReed.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemReed extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSaddle.java b/src/main/java/net/minecraft/item/ItemSaddle.java index ad35ce9..0f87ff3 100644 --- a/src/main/java/net/minecraft/item/ItemSaddle.java +++ b/src/main/java/net/minecraft/item/ItemSaddle.java @@ -11,16 +11,18 @@ import net.minecraft.entity.player.EntityPlayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSaddle extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSeedFood.java b/src/main/java/net/minecraft/item/ItemSeedFood.java index 30974d2..83b4d20 100644 --- a/src/main/java/net/minecraft/item/ItemSeedFood.java +++ b/src/main/java/net/minecraft/item/ItemSeedFood.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSeedFood extends ItemFood { diff --git a/src/main/java/net/minecraft/item/ItemSeeds.java b/src/main/java/net/minecraft/item/ItemSeeds.java index b5b174e..2072a44 100644 --- a/src/main/java/net/minecraft/item/ItemSeeds.java +++ b/src/main/java/net/minecraft/item/ItemSeeds.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSeeds extends Item { diff --git a/src/main/java/net/minecraft/item/ItemShears.java b/src/main/java/net/minecraft/item/ItemShears.java index 59cb69b..74d87b5 100644 --- a/src/main/java/net/minecraft/item/ItemShears.java +++ b/src/main/java/net/minecraft/item/ItemShears.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemShears extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSign.java b/src/main/java/net/minecraft/item/ItemSign.java index fdd03e0..b8e8582 100644 --- a/src/main/java/net/minecraft/item/ItemSign.java +++ b/src/main/java/net/minecraft/item/ItemSign.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSign extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSimpleFoiled.java b/src/main/java/net/minecraft/item/ItemSimpleFoiled.java index 5f6c523..6200e0c 100644 --- a/src/main/java/net/minecraft/item/ItemSimpleFoiled.java +++ b/src/main/java/net/minecraft/item/ItemSimpleFoiled.java @@ -6,16 +6,18 @@ package net.minecraft.item; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSimpleFoiled extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSkull.java b/src/main/java/net/minecraft/item/ItemSkull.java index 0b4e3cd..785a45d 100644 --- a/src/main/java/net/minecraft/item/ItemSkull.java +++ b/src/main/java/net/minecraft/item/ItemSkull.java @@ -23,16 +23,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSkull extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSlab.java b/src/main/java/net/minecraft/item/ItemSlab.java index 22474e7..90c8675 100644 --- a/src/main/java/net/minecraft/item/ItemSlab.java +++ b/src/main/java/net/minecraft/item/ItemSlab.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSlab extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemSnow.java b/src/main/java/net/minecraft/item/ItemSnow.java index 3d696b7..5c2b37f 100644 --- a/src/main/java/net/minecraft/item/ItemSnow.java +++ b/src/main/java/net/minecraft/item/ItemSnow.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSnow extends ItemBlock { diff --git a/src/main/java/net/minecraft/item/ItemSnowball.java b/src/main/java/net/minecraft/item/ItemSnowball.java index 561922e..35494fb 100644 --- a/src/main/java/net/minecraft/item/ItemSnowball.java +++ b/src/main/java/net/minecraft/item/ItemSnowball.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSnowball extends Item { diff --git a/src/main/java/net/minecraft/item/ItemSoup.java b/src/main/java/net/minecraft/item/ItemSoup.java index c0563f3..57431d2 100644 --- a/src/main/java/net/minecraft/item/ItemSoup.java +++ b/src/main/java/net/minecraft/item/ItemSoup.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSoup extends ItemFood { diff --git a/src/main/java/net/minecraft/item/ItemSpade.java b/src/main/java/net/minecraft/item/ItemSpade.java index 737df8b..ca8b4f6 100644 --- a/src/main/java/net/minecraft/item/ItemSpade.java +++ b/src/main/java/net/minecraft/item/ItemSpade.java @@ -13,16 +13,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSpade extends ItemTool { diff --git a/src/main/java/net/minecraft/item/ItemStack.java b/src/main/java/net/minecraft/item/ItemStack.java index 060247e..69a716d 100644 --- a/src/main/java/net/minecraft/item/ItemStack.java +++ b/src/main/java/net/minecraft/item/ItemStack.java @@ -38,6 +38,26 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class ItemStack { public static final DecimalFormat DECIMALFORMAT = new DecimalFormat("#.###"); public int stackSize; diff --git a/src/main/java/net/minecraft/item/ItemSword.java b/src/main/java/net/minecraft/item/ItemSword.java index 89004d5..4436655 100644 --- a/src/main/java/net/minecraft/item/ItemSword.java +++ b/src/main/java/net/minecraft/item/ItemSword.java @@ -19,16 +19,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemSword extends Item { diff --git a/src/main/java/net/minecraft/item/ItemTool.java b/src/main/java/net/minecraft/item/ItemTool.java index 976cb8a..4edf6ea 100644 --- a/src/main/java/net/minecraft/item/ItemTool.java +++ b/src/main/java/net/minecraft/item/ItemTool.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemTool extends Item { diff --git a/src/main/java/net/minecraft/item/ItemWritableBook.java b/src/main/java/net/minecraft/item/ItemWritableBook.java index 05d3c8b..94f1975 100644 --- a/src/main/java/net/minecraft/item/ItemWritableBook.java +++ b/src/main/java/net/minecraft/item/ItemWritableBook.java @@ -12,16 +12,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ItemWritableBook extends Item { diff --git a/src/main/java/net/minecraft/item/crafting/CraftingManager.java b/src/main/java/net/minecraft/item/crafting/CraftingManager.java index 2860f81..db4f057 100644 --- a/src/main/java/net/minecraft/item/crafting/CraftingManager.java +++ b/src/main/java/net/minecraft/item/crafting/CraftingManager.java @@ -29,16 +29,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CraftingManager { diff --git a/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java b/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java index f70d9ec..a1a60fd 100644 --- a/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java +++ b/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java @@ -20,16 +20,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FurnaceRecipes { diff --git a/src/main/java/net/minecraft/item/crafting/IRecipe.java b/src/main/java/net/minecraft/item/crafting/IRecipe.java index 6775a51..08a0eb9 100644 --- a/src/main/java/net/minecraft/item/crafting/IRecipe.java +++ b/src/main/java/net/minecraft/item/crafting/IRecipe.java @@ -10,16 +10,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java b/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java index 0839358..e45ec86 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java +++ b/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipeBookCloning implements IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java b/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java index 7f00956..3b4be4f 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java +++ b/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipeFireworks implements IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java b/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java index cde63b6..fb6001b 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java +++ b/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipeRepairItem implements IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesArmor.java b/src/main/java/net/minecraft/item/crafting/RecipesArmor.java index 5ce188c..fb38f04 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesArmor.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesArmor.java @@ -10,16 +10,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesArmor { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java b/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java index 6ae9fae..86ea33e 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java @@ -18,16 +18,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesArmorDyes implements IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesBanners.java b/src/main/java/net/minecraft/item/crafting/RecipesBanners.java index 580f962..70914e2 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesBanners.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesBanners.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesBanners { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java b/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java index 2a29110..7714ae0 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java @@ -21,16 +21,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesCrafting { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesDyes.java b/src/main/java/net/minecraft/item/crafting/RecipesDyes.java index d7536e2..de6a670 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesDyes.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesDyes.java @@ -14,16 +14,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesDyes { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesFood.java b/src/main/java/net/minecraft/item/crafting/RecipesFood.java index f401725..ac3c90f 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesFood.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesFood.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesFood { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesIngots.java b/src/main/java/net/minecraft/item/crafting/RecipesIngots.java index b08036a..6c374f6 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesIngots.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesIngots.java @@ -12,16 +12,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesIngots { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java b/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java index 0507dd4..e879004 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesMapCloning implements IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java b/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java index bb4cd9f..9986fd4 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java @@ -13,16 +13,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesMapExtending extends ShapedRecipes { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesTools.java b/src/main/java/net/minecraft/item/crafting/RecipesTools.java index 2520ee2..b1cb2f3 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesTools.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesTools.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesTools { diff --git a/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java b/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java index 0c4973e..f2075e0 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RecipesWeapons { diff --git a/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java b/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java index 31d574d..940ff9a 100644 --- a/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java +++ b/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java @@ -11,16 +11,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShapedRecipes implements IRecipe { diff --git a/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java b/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java index ddbcbc1..70d6532 100644 --- a/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java +++ b/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ShapelessRecipes implements IRecipe { diff --git a/src/main/java/net/minecraft/nbt/CompressedStreamTools.java b/src/main/java/net/minecraft/nbt/CompressedStreamTools.java index 57ce49d..834608d 100644 --- a/src/main/java/net/minecraft/nbt/CompressedStreamTools.java +++ b/src/main/java/net/minecraft/nbt/CompressedStreamTools.java @@ -21,16 +21,18 @@ import net.minecraft.util.ReportedException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CompressedStreamTools { diff --git a/src/main/java/net/minecraft/nbt/JsonToNBT.java b/src/main/java/net/minecraft/nbt/JsonToNBT.java index 9f6388d..35bdacd 100644 --- a/src/main/java/net/minecraft/nbt/JsonToNBT.java +++ b/src/main/java/net/minecraft/nbt/JsonToNBT.java @@ -16,16 +16,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JsonToNBT { diff --git a/src/main/java/net/minecraft/nbt/NBTBase.java b/src/main/java/net/minecraft/nbt/NBTBase.java index 8cf8318..1b33e08 100644 --- a/src/main/java/net/minecraft/nbt/NBTBase.java +++ b/src/main/java/net/minecraft/nbt/NBTBase.java @@ -4,6 +4,26 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class NBTBase { public static final String[] NBT_TYPES = new String[] { "END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]" }; diff --git a/src/main/java/net/minecraft/nbt/NBTException.java b/src/main/java/net/minecraft/nbt/NBTException.java index da0e811..f5c381a 100644 --- a/src/main/java/net/minecraft/nbt/NBTException.java +++ b/src/main/java/net/minecraft/nbt/NBTException.java @@ -6,16 +6,18 @@ package net.minecraft.nbt; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTException extends Exception { diff --git a/src/main/java/net/minecraft/nbt/NBTSizeTracker.java b/src/main/java/net/minecraft/nbt/NBTSizeTracker.java index bbeed9a..5e3498c 100644 --- a/src/main/java/net/minecraft/nbt/NBTSizeTracker.java +++ b/src/main/java/net/minecraft/nbt/NBTSizeTracker.java @@ -6,16 +6,18 @@ package net.minecraft.nbt; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTSizeTracker { diff --git a/src/main/java/net/minecraft/nbt/NBTTagByte.java b/src/main/java/net/minecraft/nbt/NBTTagByte.java index 6734376..356e8cf 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagByte.java +++ b/src/main/java/net/minecraft/nbt/NBTTagByte.java @@ -10,16 +10,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagByte extends NBTBase.NBTPrimitive { diff --git a/src/main/java/net/minecraft/nbt/NBTTagByteArray.java b/src/main/java/net/minecraft/nbt/NBTTagByteArray.java index 27464d4..bc9ff64 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagByteArray.java +++ b/src/main/java/net/minecraft/nbt/NBTTagByteArray.java @@ -11,16 +11,18 @@ import java.util.Arrays; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagByteArray extends NBTBase { diff --git a/src/main/java/net/minecraft/nbt/NBTTagCompound.java b/src/main/java/net/minecraft/nbt/NBTTagCompound.java index ec86878..7d11488 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagCompound.java +++ b/src/main/java/net/minecraft/nbt/NBTTagCompound.java @@ -20,16 +20,18 @@ import net.minecraft.util.ReportedException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagCompound extends NBTBase { diff --git a/src/main/java/net/minecraft/nbt/NBTTagDouble.java b/src/main/java/net/minecraft/nbt/NBTTagDouble.java index 4b7cdbe..2b5463d 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagDouble.java +++ b/src/main/java/net/minecraft/nbt/NBTTagDouble.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagDouble extends NBTBase.NBTPrimitive { diff --git a/src/main/java/net/minecraft/nbt/NBTTagEnd.java b/src/main/java/net/minecraft/nbt/NBTTagEnd.java index 964e2a9..5f23292 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagEnd.java +++ b/src/main/java/net/minecraft/nbt/NBTTagEnd.java @@ -10,16 +10,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagEnd extends NBTBase { diff --git a/src/main/java/net/minecraft/nbt/NBTTagFloat.java b/src/main/java/net/minecraft/nbt/NBTTagFloat.java index 44f49aa..cf3a33f 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagFloat.java +++ b/src/main/java/net/minecraft/nbt/NBTTagFloat.java @@ -12,16 +12,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagFloat extends NBTBase.NBTPrimitive { diff --git a/src/main/java/net/minecraft/nbt/NBTTagInt.java b/src/main/java/net/minecraft/nbt/NBTTagInt.java index 1103605..6f5973d 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagInt.java +++ b/src/main/java/net/minecraft/nbt/NBTTagInt.java @@ -10,16 +10,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagInt extends NBTBase.NBTPrimitive { diff --git a/src/main/java/net/minecraft/nbt/NBTTagIntArray.java b/src/main/java/net/minecraft/nbt/NBTTagIntArray.java index f5d6834..94af030 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagIntArray.java +++ b/src/main/java/net/minecraft/nbt/NBTTagIntArray.java @@ -11,16 +11,18 @@ import java.util.Arrays; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagIntArray extends NBTBase { diff --git a/src/main/java/net/minecraft/nbt/NBTTagList.java b/src/main/java/net/minecraft/nbt/NBTTagList.java index 1c0ad29..7ba9bee 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagList.java +++ b/src/main/java/net/minecraft/nbt/NBTTagList.java @@ -16,16 +16,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagList extends NBTBase { diff --git a/src/main/java/net/minecraft/nbt/NBTTagLong.java b/src/main/java/net/minecraft/nbt/NBTTagLong.java index dac658d..738ff07 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagLong.java +++ b/src/main/java/net/minecraft/nbt/NBTTagLong.java @@ -10,16 +10,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagLong extends NBTBase.NBTPrimitive { diff --git a/src/main/java/net/minecraft/nbt/NBTTagShort.java b/src/main/java/net/minecraft/nbt/NBTTagShort.java index 3103448..a92ac40 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagShort.java +++ b/src/main/java/net/minecraft/nbt/NBTTagShort.java @@ -10,16 +10,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagShort extends NBTBase.NBTPrimitive { diff --git a/src/main/java/net/minecraft/nbt/NBTTagString.java b/src/main/java/net/minecraft/nbt/NBTTagString.java index d4210df..47e376b 100644 --- a/src/main/java/net/minecraft/nbt/NBTTagString.java +++ b/src/main/java/net/minecraft/nbt/NBTTagString.java @@ -10,16 +10,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NBTTagString extends NBTBase { diff --git a/src/main/java/net/minecraft/nbt/NBTUtil.java b/src/main/java/net/minecraft/nbt/NBTUtil.java index 79aa12a..211eede 100644 --- a/src/main/java/net/minecraft/nbt/NBTUtil.java +++ b/src/main/java/net/minecraft/nbt/NBTUtil.java @@ -9,6 +9,26 @@ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; import net.lax1dude.eaglercraft.v1_8.mojang.authlib.Property; import net.minecraft.util.StringUtils; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class NBTUtil { /**+ * Reads and returns a GameProfile that has been saved to the @@ -89,6 +109,7 @@ public final class NBTUtil { nbttagcompound.setTag(s, nbttaglist); } + tagCompound.setTag("Properties", nbttagcompound); } return tagCompound; diff --git a/src/main/java/net/minecraft/network/EnumConnectionState.java b/src/main/java/net/minecraft/network/EnumConnectionState.java index fcf29e3..9984589 100644 --- a/src/main/java/net/minecraft/network/EnumConnectionState.java +++ b/src/main/java/net/minecraft/network/EnumConnectionState.java @@ -120,16 +120,18 @@ import net.minecraft.network.status.server.S01PacketPong; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumConnectionState { diff --git a/src/main/java/net/minecraft/network/EnumPacketDirection.java b/src/main/java/net/minecraft/network/EnumPacketDirection.java index 9aecc45..fc17acb 100644 --- a/src/main/java/net/minecraft/network/EnumPacketDirection.java +++ b/src/main/java/net/minecraft/network/EnumPacketDirection.java @@ -6,16 +6,18 @@ package net.minecraft.network; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumPacketDirection { diff --git a/src/main/java/net/minecraft/network/INetHandler.java b/src/main/java/net/minecraft/network/INetHandler.java index fb77086..2fdd5cd 100644 --- a/src/main/java/net/minecraft/network/INetHandler.java +++ b/src/main/java/net/minecraft/network/INetHandler.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandler { diff --git a/src/main/java/net/minecraft/network/Packet.java b/src/main/java/net/minecraft/network/Packet.java index 42253e3..a9f59fc 100644 --- a/src/main/java/net/minecraft/network/Packet.java +++ b/src/main/java/net/minecraft/network/Packet.java @@ -8,16 +8,18 @@ import java.io.IOException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface Packet { diff --git a/src/main/java/net/minecraft/network/PacketBuffer.java b/src/main/java/net/minecraft/network/PacketBuffer.java index 23c96f1..ff7393d 100644 --- a/src/main/java/net/minecraft/network/PacketBuffer.java +++ b/src/main/java/net/minecraft/network/PacketBuffer.java @@ -30,16 +30,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PacketBuffer extends ByteBuf { diff --git a/src/main/java/net/minecraft/network/ServerStatusResponse.java b/src/main/java/net/minecraft/network/ServerStatusResponse.java index dbfcf5b..d696b1e 100644 --- a/src/main/java/net/minecraft/network/ServerStatusResponse.java +++ b/src/main/java/net/minecraft/network/ServerStatusResponse.java @@ -16,16 +16,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ServerStatusResponse { diff --git a/src/main/java/net/minecraft/network/ThreadQuickExitException.java b/src/main/java/net/minecraft/network/ThreadQuickExitException.java deleted file mode 100644 index 08d1cdb..0000000 --- a/src/main/java/net/minecraft/network/ThreadQuickExitException.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.minecraft.network; - -public final class ThreadQuickExitException extends RuntimeException { - public static final ThreadQuickExitException field_179886_a = new ThreadQuickExitException(); - - private ThreadQuickExitException() { - this.setStackTrace(new StackTraceElement[0]); - } - - public synchronized Throwable fillInStackTrace() { - this.setStackTrace(new StackTraceElement[0]); - return this; - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java b/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java index 21043b1..8a8dbdf 100644 --- a/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java +++ b/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java @@ -9,16 +9,18 @@ import net.minecraft.network.handshake.client.C00Handshake; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerHandshakeServer extends INetHandler { diff --git a/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java b/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java index c026560..eea8595 100644 --- a/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java +++ b/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java @@ -13,16 +13,18 @@ import net.minecraft.network.handshake.INetHandlerHandshakeServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C00Handshake implements Packet { diff --git a/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java b/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java index 46324be..0b12529 100644 --- a/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java +++ b/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java @@ -12,16 +12,18 @@ import net.minecraft.network.login.server.S03PacketEnableCompression; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerLoginClient extends INetHandler { diff --git a/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java b/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java index 2ad8051..debb865 100644 --- a/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java +++ b/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java @@ -10,16 +10,18 @@ import net.minecraft.network.login.client.C01PacketEncryptionResponse; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerLoginServer extends INetHandler { diff --git a/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java b/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java index 4407711..69ece90 100644 --- a/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java +++ b/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java @@ -14,26 +14,30 @@ import net.minecraft.network.login.INetHandlerLoginServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C00PacketLoginStart implements Packet { private GameProfile profile; + private byte[] skin; public C00PacketLoginStart() { } - public C00PacketLoginStart(GameProfile profileIn) { + public C00PacketLoginStart(GameProfile profileIn, byte[] skin) { this.profile = profileIn; + this.skin = skin; } /**+ @@ -41,6 +45,7 @@ public class C00PacketLoginStart implements Packet { */ public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { this.profile = new GameProfile((EaglercraftUUID) null, parPacketBuffer.readStringFromBuffer(16)); + this.skin = parPacketBuffer.readByteArray(); } /**+ @@ -48,6 +53,7 @@ public class C00PacketLoginStart implements Packet { */ public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { parPacketBuffer.writeString(this.profile.getName()); + parPacketBuffer.writeByteArray(this.skin); } /**+ diff --git a/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java b/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java index dc98e72..4e994bd 100644 --- a/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java +++ b/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java @@ -12,16 +12,18 @@ import net.minecraft.network.login.INetHandlerLoginServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C01PacketEncryptionResponse implements Packet { diff --git a/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java b/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java index f9b0260..266d284 100644 --- a/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java +++ b/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S00PacketDisconnect implements Packet { diff --git a/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java b/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java index 72d175f..0d2386b 100644 --- a/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java +++ b/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java @@ -12,16 +12,18 @@ import net.minecraft.network.login.INetHandlerLoginClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S01PacketEncryptionRequest implements Packet { diff --git a/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java b/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java index e920dec..0cdf7e7 100644 --- a/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java +++ b/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java @@ -14,16 +14,18 @@ import net.minecraft.network.login.INetHandlerLoginClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S02PacketLoginSuccess implements Packet { diff --git a/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java b/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java index 26281a6..77d0757 100644 --- a/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java +++ b/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java @@ -12,16 +12,18 @@ import net.minecraft.network.login.INetHandlerLoginClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S03PacketEnableCompression implements Packet { diff --git a/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java b/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java index 0597af1..bbdb2a8 100644 --- a/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java +++ b/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java @@ -79,16 +79,18 @@ import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerPlayClient extends INetHandler { diff --git a/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java b/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java index 9eb1e3b..2059778 100644 --- a/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java +++ b/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java @@ -31,16 +31,18 @@ import net.minecraft.network.play.client.C19PacketResourcePackStatus; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerPlayServer extends INetHandler { diff --git a/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java b/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java index ed5587d..1001434 100644 --- a/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java +++ b/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C00PacketKeepAlive implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java b/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java index 789ff14..eae02ab 100644 --- a/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java +++ b/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C01PacketChatMessage implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java b/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java index 6a41473..8ceefc7 100644 --- a/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java +++ b/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C02PacketUseEntity implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java b/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java index bf346e6..b620de6 100644 --- a/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java +++ b/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C03PacketPlayer implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java b/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java index a89a0b1..c3b85e8 100644 --- a/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java +++ b/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java @@ -14,16 +14,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C07PacketPlayerDigging implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java b/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java index 35a3052..01bd5ba 100644 --- a/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java +++ b/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java @@ -14,16 +14,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C08PacketPlayerBlockPlacement implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java b/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java index 5f0c87b..00aa1c0 100644 --- a/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java +++ b/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C09PacketHeldItemChange implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java b/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java index 2d585af..5717222 100644 --- a/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java +++ b/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C0APacketAnimation implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java b/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java index 9e42261..2d502e5 100644 --- a/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java +++ b/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C0BPacketEntityAction implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java b/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java index b68d244..e1df5f0 100644 --- a/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java +++ b/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C0CPacketInput implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java b/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java index 0e9a3c4..9c1db61 100644 --- a/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java +++ b/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C0DPacketCloseWindow implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java b/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java index d6510af..10d3998 100644 --- a/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java +++ b/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C0EPacketClickWindow implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java b/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java index 89baf76..7307b10 100644 --- a/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java +++ b/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C0FPacketConfirmTransaction implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java b/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java index 6708572..1bacd99 100644 --- a/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java +++ b/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C10PacketCreativeInventoryAction implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java b/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java index e3a2c1d..4a31b88 100644 --- a/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java +++ b/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C11PacketEnchantItem implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java b/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java index ad76024..6b70f2a 100644 --- a/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java +++ b/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java @@ -14,16 +14,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C12PacketUpdateSign implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java b/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java index e3886e7..683c6c9 100644 --- a/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java +++ b/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C13PacketPlayerAbilities implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java b/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java index a30e797..bf6c2d2 100644 --- a/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java +++ b/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java @@ -15,16 +15,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C14PacketTabComplete implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java b/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java index 3851dab..4006af8 100644 --- a/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java +++ b/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C15PacketClientSettings implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java b/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java index fb099f5..f91edab 100644 --- a/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java +++ b/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C16PacketClientStatus implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java b/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java index 75eab7f..1476efb 100644 --- a/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java +++ b/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C17PacketCustomPayload implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java b/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java index f585735..3242348 100644 --- a/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java +++ b/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C18PacketSpectate implements Packet { diff --git a/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java b/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java index 95039b0..3a13f4f 100644 --- a/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java +++ b/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C19PacketResourcePackStatus implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java b/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java index e40beb7..9d74b62 100644 --- a/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java +++ b/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S00PacketKeepAlive implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java b/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java index 0f5a057..e5407ad 100644 --- a/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java +++ b/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java @@ -15,16 +15,18 @@ import net.minecraft.world.WorldType; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S01PacketJoinGame implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S02PacketChat.java b/src/main/java/net/minecraft/network/play/server/S02PacketChat.java index d8813d8..923c3ab 100644 --- a/src/main/java/net/minecraft/network/play/server/S02PacketChat.java +++ b/src/main/java/net/minecraft/network/play/server/S02PacketChat.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S02PacketChat implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java b/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java index 6017fa9..19156e2 100644 --- a/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java +++ b/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S03PacketTimeUpdate implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java b/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java index 095ee53..1339609 100644 --- a/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java +++ b/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S04PacketEntityEquipment implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java b/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java index 72941ca..fb43d73 100644 --- a/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java +++ b/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java @@ -13,16 +13,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S05PacketSpawnPosition implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java b/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java index ba8fbfb..6441266 100644 --- a/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java +++ b/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S06PacketUpdateHealth implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java b/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java index 379434b..5bdc483 100644 --- a/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java +++ b/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java @@ -15,16 +15,18 @@ import net.minecraft.world.WorldType; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S07PacketRespawn implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java b/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java index fa0062a..e475430 100644 --- a/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java +++ b/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java @@ -14,16 +14,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S08PacketPlayerPosLook implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java b/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java index fe4e62b..6495071 100644 --- a/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java +++ b/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S09PacketHeldItemChange implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java b/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java index 5eb7f1e..ff65507 100644 --- a/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java +++ b/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S0APacketUseBed implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java b/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java index 098ae6c..bd7463b 100644 --- a/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java +++ b/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S0BPacketAnimation implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java b/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java index 6ff4202..c76d627 100644 --- a/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java +++ b/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java @@ -19,16 +19,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S0CPacketSpawnPlayer implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java b/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java index 3652c3e..bbeb5dd 100644 --- a/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java +++ b/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S0DPacketCollectItem implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java b/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java index bd5b6cb..7b04495 100644 --- a/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java +++ b/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java @@ -14,16 +14,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S0EPacketSpawnObject implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java b/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java index 371f5c7..f2989af 100644 --- a/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java +++ b/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java @@ -17,16 +17,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S0FPacketSpawnMob implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java b/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java index 747ada6..e3c7d48 100644 --- a/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java +++ b/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java @@ -15,16 +15,18 @@ import net.minecraft.util.EnumFacing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S10PacketSpawnPainting implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java b/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java index a622511..c76453c 100644 --- a/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java +++ b/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java @@ -14,16 +14,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S11PacketSpawnExperienceOrb implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java b/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java index 2af8277..f1eb7f6 100644 --- a/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java +++ b/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S12PacketEntityVelocity implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java b/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java index abd5d76..1ca1571 100644 --- a/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java +++ b/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S13PacketDestroyEntities implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java b/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java index 9937c70..882d08e 100644 --- a/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java +++ b/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S14PacketEntity implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java b/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java index e74bad8..e28b65f 100644 --- a/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java +++ b/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java @@ -14,16 +14,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S18PacketEntityTeleport implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java b/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java index 1e71c39..f3853d2 100644 --- a/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java +++ b/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S19PacketEntityHeadLook implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java b/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java index 50ce2fd..05ef6a7 100644 --- a/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java +++ b/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S19PacketEntityStatus implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java b/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java index cf818fe..97a5a13 100644 --- a/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java +++ b/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S1BPacketEntityAttach implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java b/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java index 4767bf5..68e522a 100644 --- a/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java +++ b/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java @@ -14,16 +14,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S1CPacketEntityMetadata implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java b/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java index 8574bd8..a9d9a2b 100644 --- a/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java +++ b/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java @@ -13,16 +13,18 @@ import net.minecraft.potion.PotionEffect; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S1DPacketEntityEffect implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java b/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java index b9b608c..0fb29b2 100644 --- a/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java +++ b/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java @@ -13,16 +13,18 @@ import net.minecraft.potion.PotionEffect; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S1EPacketRemoveEntityEffect implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java b/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java index 7d576b8..d96c7ce 100644 --- a/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java +++ b/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S1FPacketSetExperience implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java b/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java index 98b545b..197214a 100644 --- a/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java +++ b/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java @@ -20,16 +20,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S20PacketEntityProperties implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java b/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java index c902950..4e619a1 100644 --- a/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java +++ b/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java @@ -17,16 +17,18 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S21PacketChunkData implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java b/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java index b04a1ac..804f9b7 100644 --- a/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java +++ b/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java @@ -17,16 +17,18 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S22PacketMultiBlockChange implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java b/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java index 9ad236e..91875a6 100644 --- a/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java +++ b/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S23PacketBlockChange implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java b/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java index 32fb2d0..ef87dd8 100644 --- a/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java +++ b/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java @@ -14,16 +14,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S24PacketBlockAction implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java b/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java index dadf928..037120a 100644 --- a/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java +++ b/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java @@ -13,16 +13,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S25PacketBlockBreakAnim implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java b/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java index 301e56e..75da010 100644 --- a/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java +++ b/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java @@ -14,16 +14,18 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S26PacketMapChunkBulk implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java b/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java index e1344a7..a5ba57a 100644 --- a/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java +++ b/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java @@ -17,16 +17,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S27PacketExplosion implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java b/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java index a40d88c..71f1dba 100644 --- a/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java +++ b/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java @@ -13,16 +13,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S28PacketEffect implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java b/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java index d34aeaa..25d3ffe 100644 --- a/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java +++ b/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java @@ -15,16 +15,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S29PacketSoundEffect implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java b/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java index 8ae655e..b3e371f 100644 --- a/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java +++ b/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java @@ -13,16 +13,18 @@ import net.minecraft.util.EnumParticleTypes; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S2APacketParticles implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java b/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java index 0260988..7636d38 100644 --- a/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java +++ b/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S2BPacketChangeGameState implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java b/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java index 79df84d..f9d369a 100644 --- a/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java +++ b/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java @@ -15,16 +15,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S2CPacketSpawnGlobalEntity implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java b/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java index 86dcf25..8e19e67 100644 --- a/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java +++ b/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S2DPacketOpenWindow implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java b/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java index d5809b2..6b86a0f 100644 --- a/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java +++ b/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S2EPacketCloseWindow implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java b/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java index c449ffc..2fb6fed 100644 --- a/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java +++ b/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S2FPacketSetSlot implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java b/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java index d27a858..5d50d75 100644 --- a/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java +++ b/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java @@ -14,16 +14,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S30PacketWindowItems implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java b/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java index 9ee9059..f5498af 100644 --- a/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java +++ b/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S31PacketWindowProperty implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java b/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java index 367b294..ddc9e8c 100644 --- a/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java +++ b/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S32PacketConfirmTransaction implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java b/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java index 3da8636..0730f22 100644 --- a/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java +++ b/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S33PacketUpdateSign implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java b/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java index 27e997a..72642d5 100644 --- a/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java +++ b/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java @@ -15,16 +15,18 @@ import net.minecraft.world.storage.MapData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S34PacketMaps implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java b/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java index 313b004..80c8413 100644 --- a/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java +++ b/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java @@ -14,16 +14,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S35PacketUpdateTileEntity implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java b/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java index 767f39c..1c4b115 100644 --- a/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java +++ b/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java @@ -13,16 +13,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S36PacketSignEditorOpen implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java b/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java index 089cde8..213331c 100644 --- a/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java +++ b/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java @@ -18,16 +18,18 @@ import net.minecraft.stats.StatList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S37PacketStatistics implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java b/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java index 4e2c80f..452283a 100644 --- a/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java +++ b/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java @@ -20,16 +20,18 @@ import net.minecraft.world.WorldSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S38PacketPlayerListItem implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java b/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java index 2aa8dbc..f556582 100644 --- a/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java +++ b/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S39PacketPlayerAbilities implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java b/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java index 14c3761..54429eb 100644 --- a/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java +++ b/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S3APacketTabComplete implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java b/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java index 0e62a08..e6b8203 100644 --- a/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java +++ b/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java @@ -14,16 +14,18 @@ import net.minecraft.scoreboard.ScoreObjective; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S3BPacketScoreboardObjective implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java b/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java index 8bafe71..52d2ca4 100644 --- a/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java +++ b/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java @@ -14,16 +14,18 @@ import net.minecraft.scoreboard.ScoreObjective; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S3CPacketUpdateScore implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java b/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java index 3e4ae83..1d276ca 100644 --- a/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java +++ b/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java @@ -13,16 +13,18 @@ import net.minecraft.scoreboard.ScoreObjective; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S3DPacketDisplayScoreboard implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java b/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java index 9667ed5..7b6030f 100644 --- a/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java +++ b/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java @@ -17,16 +17,18 @@ import net.minecraft.scoreboard.Team; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S3EPacketTeams implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java b/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java index f13e48a..fcc5663 100644 --- a/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java +++ b/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java @@ -13,16 +13,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S3FPacketCustomPayload implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java b/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java index fef7f5a..3a5b9c3 100644 --- a/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java +++ b/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S40PacketDisconnect implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java b/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java index fd3ef96..f42bcc0 100644 --- a/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java +++ b/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java @@ -13,16 +13,18 @@ import net.minecraft.world.EnumDifficulty; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S41PacketServerDifficulty implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java b/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java index 7d06b4a..e44f7d1 100644 --- a/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java +++ b/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java @@ -14,16 +14,18 @@ import net.minecraft.util.CombatTracker; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S42PacketCombatEvent implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java b/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java index f3d5e00..b3c410a 100644 --- a/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java +++ b/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S43PacketCamera implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java b/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java index 7f0bea3..c0be7a8 100644 --- a/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java +++ b/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java @@ -13,16 +13,18 @@ import net.minecraft.world.border.WorldBorder; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S44PacketWorldBorder implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java b/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java index e294f16..d545267 100644 --- a/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java +++ b/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S45PacketTitle implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java b/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java index 0b2d52e..a384728 100644 --- a/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java +++ b/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S46PacketSetCompressionLevel implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java b/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java index 4d7c4d6..ba5e307 100644 --- a/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java +++ b/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java @@ -13,16 +13,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S47PacketPlayerListHeaderFooter implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java b/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java index 39eba06..1390c38 100644 --- a/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java +++ b/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java @@ -12,16 +12,18 @@ import net.minecraft.network.play.INetHandlerPlayClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S48PacketResourcePackSend implements Packet { diff --git a/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java b/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java index f58f55f..4179072 100644 --- a/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java +++ b/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java @@ -15,16 +15,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S49PacketUpdateEntityNBT implements Packet { diff --git a/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java b/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java index 37be3f4..a1513e6 100644 --- a/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java +++ b/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java @@ -10,16 +10,18 @@ import net.minecraft.network.status.server.S01PacketPong; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerStatusClient extends INetHandler { diff --git a/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java b/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java index dd3e543..9bb762c 100644 --- a/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java +++ b/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java @@ -10,16 +10,18 @@ import net.minecraft.network.status.client.C01PacketPing; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface INetHandlerStatusServer extends INetHandler { diff --git a/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java b/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java index 73f2796..f9331f7 100644 --- a/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java +++ b/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java @@ -12,16 +12,18 @@ import net.minecraft.network.status.INetHandlerStatusServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C00PacketServerQuery implements Packet { diff --git a/src/main/java/net/minecraft/network/status/client/C01PacketPing.java b/src/main/java/net/minecraft/network/status/client/C01PacketPing.java index a1c0b22..1614d60 100644 --- a/src/main/java/net/minecraft/network/status/client/C01PacketPing.java +++ b/src/main/java/net/minecraft/network/status/client/C01PacketPing.java @@ -12,16 +12,18 @@ import net.minecraft.network.status.INetHandlerStatusServer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 C01PacketPing implements Packet { diff --git a/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java b/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java index de3c8b3..6e75f7a 100644 --- a/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java +++ b/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java @@ -19,16 +19,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S00PacketServerInfo implements Packet { diff --git a/src/main/java/net/minecraft/network/status/server/S01PacketPong.java b/src/main/java/net/minecraft/network/status/server/S01PacketPong.java index 16059ef..38dcf01 100644 --- a/src/main/java/net/minecraft/network/status/server/S01PacketPong.java +++ b/src/main/java/net/minecraft/network/status/server/S01PacketPong.java @@ -12,16 +12,18 @@ import net.minecraft.network.status.INetHandlerStatusClient; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 S01PacketPong implements Packet { diff --git a/src/main/java/net/minecraft/potion/Potion.java b/src/main/java/net/minecraft/potion/Potion.java index 88ce8b6..52d1b58 100644 --- a/src/main/java/net/minecraft/potion/Potion.java +++ b/src/main/java/net/minecraft/potion/Potion.java @@ -25,16 +25,18 @@ import net.minecraft.util.StringUtils; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Potion { diff --git a/src/main/java/net/minecraft/potion/PotionAbsorption.java b/src/main/java/net/minecraft/potion/PotionAbsorption.java index 40dd1a2..81060fe 100644 --- a/src/main/java/net/minecraft/potion/PotionAbsorption.java +++ b/src/main/java/net/minecraft/potion/PotionAbsorption.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PotionAbsorption extends Potion { diff --git a/src/main/java/net/minecraft/potion/PotionAttackDamage.java b/src/main/java/net/minecraft/potion/PotionAttackDamage.java index 4e8a99e..2002c96 100644 --- a/src/main/java/net/minecraft/potion/PotionAttackDamage.java +++ b/src/main/java/net/minecraft/potion/PotionAttackDamage.java @@ -9,16 +9,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PotionAttackDamage extends Potion { diff --git a/src/main/java/net/minecraft/potion/PotionEffect.java b/src/main/java/net/minecraft/potion/PotionEffect.java index 0fb177b..2fb6ad6 100644 --- a/src/main/java/net/minecraft/potion/PotionEffect.java +++ b/src/main/java/net/minecraft/potion/PotionEffect.java @@ -11,16 +11,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PotionEffect { diff --git a/src/main/java/net/minecraft/potion/PotionHealth.java b/src/main/java/net/minecraft/potion/PotionHealth.java index 2f6ab8a..0201411 100644 --- a/src/main/java/net/minecraft/potion/PotionHealth.java +++ b/src/main/java/net/minecraft/potion/PotionHealth.java @@ -8,16 +8,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PotionHealth extends Potion { diff --git a/src/main/java/net/minecraft/potion/PotionHealthBoost.java b/src/main/java/net/minecraft/potion/PotionHealthBoost.java index 1f91a41..1778ee3 100644 --- a/src/main/java/net/minecraft/potion/PotionHealthBoost.java +++ b/src/main/java/net/minecraft/potion/PotionHealthBoost.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PotionHealthBoost extends Potion { diff --git a/src/main/java/net/minecraft/potion/PotionHelper.java b/src/main/java/net/minecraft/potion/PotionHelper.java index 02ed7e9..639577e 100644 --- a/src/main/java/net/minecraft/potion/PotionHelper.java +++ b/src/main/java/net/minecraft/potion/PotionHelper.java @@ -18,16 +18,18 @@ import net.minecraft.util.IntegerCache; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PotionHelper { @@ -111,9 +113,9 @@ public class PotionHelper { if (potioneffect.getIsShowParticles()) { int j = Potion.potionTypes[potioneffect.getPotionID()].getLiquidColor(); - if (Config.isCustomColors()) { - j = CustomColors.getPotionColor(potioneffect.getPotionID(), j); - } + if (Config.isCustomColors()) { + j = CustomColors.getPotionColor(potioneffect.getPotionID(), j); + } for (int k = 0; k <= potioneffect.getAmplifier(); ++k) { f += (float) (j >> 16 & 255) / 255.0F; diff --git a/src/main/java/net/minecraft/profiler/Profiler.java b/src/main/java/net/minecraft/profiler/Profiler.java index b18be30..514a7e5 100644 --- a/src/main/java/net/minecraft/profiler/Profiler.java +++ b/src/main/java/net/minecraft/profiler/Profiler.java @@ -8,7 +8,6 @@ import java.util.Map; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import net.PeytonPlayz585.shadow.Config; import net.PeytonPlayz585.shadow.Lagometer; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -19,16 +18,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Profiler { @@ -47,7 +48,7 @@ public class Profiler { */ private String profilingSection = ""; private final Map profilingMap = Maps.newHashMap(); - + private static final int HASH_SCHEDULED_EXECUTABLES = "scheduledExecutables".hashCode(); private static final int HASH_TICK = "tick".hashCode(); private static final int HASH_PRE_RENDER_ERRORS = "preRenderErrors".hashCode(); @@ -65,7 +66,7 @@ public class Profiler { * Start section */ public void startSection(String name) { - + if (Lagometer.isActive()) { int i = name.hashCode(); @@ -78,7 +79,7 @@ public class Profiler { Lagometer.timerTick.end(); } } - + if (this.profilingEnabled) { if (this.profilingSection.length() > 0) { this.profilingSection = this.profilingSection + "."; diff --git a/src/main/java/net/minecraft/scoreboard/GoalColor.java b/src/main/java/net/minecraft/scoreboard/GoalColor.java index 4191881..ace2c90 100644 --- a/src/main/java/net/minecraft/scoreboard/GoalColor.java +++ b/src/main/java/net/minecraft/scoreboard/GoalColor.java @@ -11,16 +11,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GoalColor implements IScoreObjectiveCriteria { diff --git a/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java b/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java index 9314d1f..7cc44d0 100644 --- a/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java +++ b/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java @@ -14,16 +14,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IScoreObjectiveCriteria { diff --git a/src/main/java/net/minecraft/scoreboard/Score.java b/src/main/java/net/minecraft/scoreboard/Score.java index 8588747..7a44070 100644 --- a/src/main/java/net/minecraft/scoreboard/Score.java +++ b/src/main/java/net/minecraft/scoreboard/Score.java @@ -11,16 +11,18 @@ import net.minecraft.entity.player.EntityPlayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Score { diff --git a/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java b/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java index 82d22a9..a7f8350 100644 --- a/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java +++ b/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java @@ -10,16 +10,18 @@ import net.minecraft.entity.player.EntityPlayer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScoreDummyCriteria implements IScoreObjectiveCriteria { diff --git a/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java b/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java index 71c5f3f..4017a80 100644 --- a/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java +++ b/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java @@ -11,16 +11,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScoreHealthCriteria extends ScoreDummyCriteria { diff --git a/src/main/java/net/minecraft/scoreboard/ScoreObjective.java b/src/main/java/net/minecraft/scoreboard/ScoreObjective.java index 11ecad4..08c14d6 100644 --- a/src/main/java/net/minecraft/scoreboard/ScoreObjective.java +++ b/src/main/java/net/minecraft/scoreboard/ScoreObjective.java @@ -6,16 +6,18 @@ package net.minecraft.scoreboard; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScoreObjective { diff --git a/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java b/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java index 27a5a4c..74f502c 100644 --- a/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java +++ b/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java @@ -13,16 +13,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScorePlayerTeam extends Team { diff --git a/src/main/java/net/minecraft/scoreboard/Scoreboard.java b/src/main/java/net/minecraft/scoreboard/Scoreboard.java index f1314f4..726f814 100644 --- a/src/main/java/net/minecraft/scoreboard/Scoreboard.java +++ b/src/main/java/net/minecraft/scoreboard/Scoreboard.java @@ -19,16 +19,18 @@ import net.minecraft.util.EnumChatFormatting; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Scoreboard { @@ -258,15 +260,13 @@ public class Scoreboard { * memberships and broadcasts the deletion to all players */ public void removeTeam(ScorePlayerTeam parScorePlayerTeam) { - if(parScorePlayerTeam != null) { - this.teams.remove(parScorePlayerTeam.getRegisteredName()); + this.teams.remove(parScorePlayerTeam.getRegisteredName()); - for (String s : parScorePlayerTeam.getMembershipCollection()) { - this.teamMemberships.remove(s); - } - - this.func_96513_c(parScorePlayerTeam); + for (String s : parScorePlayerTeam.getMembershipCollection()) { + this.teamMemberships.remove(s); } + + this.func_96513_c(parScorePlayerTeam); } /**+ @@ -305,13 +305,13 @@ public class Scoreboard { * is thrown. */ public void removePlayerFromTeam(String parString1, ScorePlayerTeam parScorePlayerTeam) { - if(parScorePlayerTeam != null) { - if (this.getPlayersTeam(parString1) != parScorePlayerTeam) { - throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team \'" + parScorePlayerTeam.getRegisteredName() + "\'."); - } else { - this.teamMemberships.remove(parString1); - parScorePlayerTeam.getMembershipCollection().remove(parString1); - } + if (this.getPlayersTeam(parString1) != parScorePlayerTeam) { + throw new IllegalStateException( + "Player is either on another team or not on any team. Cannot remove from team \'" + + parScorePlayerTeam.getRegisteredName() + "\'."); + } else { + this.teamMemberships.remove(parString1); + parScorePlayerTeam.getMembershipCollection().remove(parString1); } } diff --git a/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java b/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java index 512ede0..0d92334 100644 --- a/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java +++ b/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java @@ -14,16 +14,18 @@ import net.minecraft.world.WorldSavedData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScoreboardSaveData extends WorldSavedData { diff --git a/src/main/java/net/minecraft/scoreboard/Team.java b/src/main/java/net/minecraft/scoreboard/Team.java index ae1e693..fa06742 100644 --- a/src/main/java/net/minecraft/scoreboard/Team.java +++ b/src/main/java/net/minecraft/scoreboard/Team.java @@ -5,6 +5,26 @@ import java.util.Map; import com.google.common.collect.Maps; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class Team { /**+ * Same as == diff --git a/src/main/java/net/minecraft/server/management/LowerStringMap.java b/src/main/java/net/minecraft/server/management/LowerStringMap.java index 0dcd908..f514483 100644 --- a/src/main/java/net/minecraft/server/management/LowerStringMap.java +++ b/src/main/java/net/minecraft/server/management/LowerStringMap.java @@ -12,16 +12,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LowerStringMap implements Map { diff --git a/src/main/java/net/minecraft/stats/Achievement.java b/src/main/java/net/minecraft/stats/Achievement.java index 860ca90..5d01e90 100644 --- a/src/main/java/net/minecraft/stats/Achievement.java +++ b/src/main/java/net/minecraft/stats/Achievement.java @@ -15,16 +15,18 @@ import net.minecraft.util.StatCollector; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Achievement extends StatBase { diff --git a/src/main/java/net/minecraft/stats/AchievementList.java b/src/main/java/net/minecraft/stats/AchievementList.java index c710ec2..246dde3 100644 --- a/src/main/java/net/minecraft/stats/AchievementList.java +++ b/src/main/java/net/minecraft/stats/AchievementList.java @@ -15,16 +15,18 @@ import net.minecraft.util.JsonSerializableSet; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AchievementList { diff --git a/src/main/java/net/minecraft/stats/IStatStringFormat.java b/src/main/java/net/minecraft/stats/IStatStringFormat.java index 99c1f68..c739524 100644 --- a/src/main/java/net/minecraft/stats/IStatStringFormat.java +++ b/src/main/java/net/minecraft/stats/IStatStringFormat.java @@ -6,16 +6,18 @@ package net.minecraft.stats; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IStatStringFormat { diff --git a/src/main/java/net/minecraft/stats/IStatType.java b/src/main/java/net/minecraft/stats/IStatType.java index f23acff..bbe7149 100644 --- a/src/main/java/net/minecraft/stats/IStatType.java +++ b/src/main/java/net/minecraft/stats/IStatType.java @@ -6,16 +6,18 @@ package net.minecraft.stats; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IStatType { diff --git a/src/main/java/net/minecraft/stats/ObjectiveStat.java b/src/main/java/net/minecraft/stats/ObjectiveStat.java index 0057b43..189e1a5 100644 --- a/src/main/java/net/minecraft/stats/ObjectiveStat.java +++ b/src/main/java/net/minecraft/stats/ObjectiveStat.java @@ -8,16 +8,18 @@ import net.minecraft.scoreboard.ScoreDummyCriteria; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ObjectiveStat extends ScoreDummyCriteria { diff --git a/src/main/java/net/minecraft/stats/StatBase.java b/src/main/java/net/minecraft/stats/StatBase.java index 4dd09a5..019fce9 100644 --- a/src/main/java/net/minecraft/stats/StatBase.java +++ b/src/main/java/net/minecraft/stats/StatBase.java @@ -17,16 +17,18 @@ import net.minecraft.util.IJsonSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StatBase { diff --git a/src/main/java/net/minecraft/stats/StatBasic.java b/src/main/java/net/minecraft/stats/StatBasic.java index a8b85a2..e5ae485 100644 --- a/src/main/java/net/minecraft/stats/StatBasic.java +++ b/src/main/java/net/minecraft/stats/StatBasic.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StatBasic extends StatBase { diff --git a/src/main/java/net/minecraft/stats/StatCrafting.java b/src/main/java/net/minecraft/stats/StatCrafting.java index 4dc9105..13d7f8b 100644 --- a/src/main/java/net/minecraft/stats/StatCrafting.java +++ b/src/main/java/net/minecraft/stats/StatCrafting.java @@ -10,16 +10,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StatCrafting extends StatBase { diff --git a/src/main/java/net/minecraft/stats/StatFileWriter.java b/src/main/java/net/minecraft/stats/StatFileWriter.java index dc3050e..1d10b44 100644 --- a/src/main/java/net/minecraft/stats/StatFileWriter.java +++ b/src/main/java/net/minecraft/stats/StatFileWriter.java @@ -14,16 +14,18 @@ import net.minecraft.util.TupleIntJsonSerializable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StatFileWriter { diff --git a/src/main/java/net/minecraft/stats/StatList.java b/src/main/java/net/minecraft/stats/StatList.java index f058265..1ac5fdd 100644 --- a/src/main/java/net/minecraft/stats/StatList.java +++ b/src/main/java/net/minecraft/stats/StatList.java @@ -26,16 +26,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StatList { diff --git a/src/main/java/net/minecraft/tileentity/IHopper.java b/src/main/java/net/minecraft/tileentity/IHopper.java index d89aed0..6b0c1aa 100644 --- a/src/main/java/net/minecraft/tileentity/IHopper.java +++ b/src/main/java/net/minecraft/tileentity/IHopper.java @@ -9,16 +9,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IHopper extends IInventory { diff --git a/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java b/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java index 18eb591..375f49a 100644 --- a/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java +++ b/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java @@ -19,6 +19,26 @@ import net.minecraft.util.StringUtils; import net.minecraft.util.WeightedRandom; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class MobSpawnerBaseLogic { /**+ * The delay to spawn. diff --git a/src/main/java/net/minecraft/tileentity/TileEntity.java b/src/main/java/net/minecraft/tileentity/TileEntity.java index 1f9d441..eddb2f3 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntity.java +++ b/src/main/java/net/minecraft/tileentity/TileEntity.java @@ -18,6 +18,26 @@ import net.minecraft.network.Packet; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class TileEntity { private static final Logger logger = LogManager.getLogger(); private static Map> nameToClassMap = Maps.newHashMap(); diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBanner.java b/src/main/java/net/minecraft/tileentity/TileEntityBanner.java index cb698e7..0697a5c 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityBanner.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBanner.java @@ -21,16 +21,18 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityBanner extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java b/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java index 467cc79..c8346c1 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java @@ -32,16 +32,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityBeacon extends TileEntityLockable implements ITickable, IInventory { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java index 4f6f3e2..be4db1f 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -23,16 +23,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityBrewingStand extends TileEntityLockable implements ITickable, ISidedInventory { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityChest.java b/src/main/java/net/minecraft/tileentity/TileEntityChest.java index adacd15..7dad77a 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityChest.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityChest.java @@ -20,16 +20,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityChest extends TileEntityLockable implements ITickable, IInventory { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java b/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java index 111057a..c09ffab 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java @@ -16,16 +16,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityCommandBlock extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityComparator.java b/src/main/java/net/minecraft/tileentity/TileEntityComparator.java index 73bf4c9..bf1abe8 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityComparator.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityComparator.java @@ -8,16 +8,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityComparator extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java b/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java index 3d0f11a..2aee452 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java @@ -8,16 +8,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityDaylightDetector extends TileEntity implements ITickable { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java b/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java index 4a6a4d4..786bf47 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java @@ -17,16 +17,18 @@ import net.minecraft.nbt.NBTTagList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityDispenser extends TileEntityLockable implements IInventory { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityDropper.java b/src/main/java/net/minecraft/tileentity/TileEntityDropper.java index d23dbf0..f004c3d 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityDropper.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityDropper.java @@ -6,16 +6,18 @@ package net.minecraft.tileentity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityDropper extends TileEntityDispenser { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java b/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java index e3f6982..d230112 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java @@ -20,16 +20,18 @@ import net.minecraft.world.IInteractionObject; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityEnchantmentTable extends TileEntity implements ITickable, IInteractionObject { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java b/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java index 2da9d03..07cf848 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java @@ -6,16 +6,18 @@ package net.minecraft.tileentity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityEndPortal extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java b/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java index b16c9b7..54742b4 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java @@ -10,16 +10,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityEnderChest extends TileEntity implements ITickable { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java b/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java index c5119e2..dbbafce 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java @@ -12,16 +12,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityFlowerPot extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java b/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java index 96d6157..93d0dbd 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java @@ -29,16 +29,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityFurnace extends TileEntityLockable implements ITickable, ISidedInventory { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityHopper.java b/src/main/java/net/minecraft/tileentity/TileEntityHopper.java index a94b2d5..a60ea69 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityHopper.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityHopper.java @@ -29,16 +29,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityHopper extends TileEntityLockable implements IHopper, ITickable { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityLockable.java b/src/main/java/net/minecraft/tileentity/TileEntityLockable.java index c33fc9e..c2ce3ed 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityLockable.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityLockable.java @@ -8,6 +8,26 @@ import net.minecraft.world.IInteractionObject; import net.minecraft.world.ILockableContainer; import net.minecraft.world.LockCode; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class TileEntityLockable extends TileEntity implements IInteractionObject, ILockableContainer { private LockCode code = LockCode.EMPTY_CODE; diff --git a/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java b/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java index 9dc03dd..189162a 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java @@ -14,16 +14,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityMobSpawner extends TileEntity implements ITickable { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityNote.java b/src/main/java/net/minecraft/tileentity/TileEntityNote.java index 2e66eaa..0e17297 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityNote.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityNote.java @@ -13,16 +13,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityNote extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityPiston.java b/src/main/java/net/minecraft/tileentity/TileEntityPiston.java index 42532f2..724fc65 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityPiston.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityPiston.java @@ -19,16 +19,18 @@ import net.minecraft.util.ITickable; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntityPiston extends TileEntity implements ITickable { diff --git a/src/main/java/net/minecraft/tileentity/TileEntitySign.java b/src/main/java/net/minecraft/tileentity/TileEntitySign.java index 24d69bf..b99e496 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntitySign.java +++ b/src/main/java/net/minecraft/tileentity/TileEntitySign.java @@ -22,16 +22,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntitySign extends TileEntity { diff --git a/src/main/java/net/minecraft/tileentity/TileEntitySkull.java b/src/main/java/net/minecraft/tileentity/TileEntitySkull.java index bd61c39..620d486 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntitySkull.java +++ b/src/main/java/net/minecraft/tileentity/TileEntitySkull.java @@ -15,16 +15,18 @@ import net.minecraft.util.StringUtils; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TileEntitySkull extends TileEntity { diff --git a/src/main/java/net/minecraft/util/AxisAlignedBB.java b/src/main/java/net/minecraft/util/AxisAlignedBB.java index 160f8c6..66e902c 100644 --- a/src/main/java/net/minecraft/util/AxisAlignedBB.java +++ b/src/main/java/net/minecraft/util/AxisAlignedBB.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 AxisAlignedBB { @@ -44,14 +46,6 @@ public class AxisAlignedBB { this.maxZ = (double) pos2.getZ(); } - /** - * Returns a bounding box with the specified bounds. Args: minX, minY, minZ, - * maxX, maxY, maxZ - */ - public static AxisAlignedBB getBoundingBox(double par0, double par2, double par4, double par6, double par8, double par10) { - return new AxisAlignedBB(par0, par2, par4, par6, par8, par10); - } - /**+ * Adds the coordinates to the bounding box extending it if the * point lies outside the current ranges. Args: x, y, z diff --git a/src/main/java/net/minecraft/util/BlockPos.java b/src/main/java/net/minecraft/util/BlockPos.java index 8932475..1aff9c1 100644 --- a/src/main/java/net/minecraft/util/BlockPos.java +++ b/src/main/java/net/minecraft/util/BlockPos.java @@ -12,16 +12,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BlockPos extends Vec3i { diff --git a/src/main/java/net/minecraft/util/Cartesian.java b/src/main/java/net/minecraft/util/Cartesian.java index 1dc4034..3059dfc 100644 --- a/src/main/java/net/minecraft/util/Cartesian.java +++ b/src/main/java/net/minecraft/util/Cartesian.java @@ -19,16 +19,18 @@ import com.google.common.collect.UnmodifiableIterator; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Cartesian { diff --git a/src/main/java/net/minecraft/util/ChatAllowedCharacters.java b/src/main/java/net/minecraft/util/ChatAllowedCharacters.java index 62f3e81..b1e7ae6 100644 --- a/src/main/java/net/minecraft/util/ChatAllowedCharacters.java +++ b/src/main/java/net/minecraft/util/ChatAllowedCharacters.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatAllowedCharacters { diff --git a/src/main/java/net/minecraft/util/ChatComponentProcessor.java b/src/main/java/net/minecraft/util/ChatComponentProcessor.java index 8b5a90c..153f7f8 100644 --- a/src/main/java/net/minecraft/util/ChatComponentProcessor.java +++ b/src/main/java/net/minecraft/util/ChatComponentProcessor.java @@ -14,16 +14,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatComponentProcessor { diff --git a/src/main/java/net/minecraft/util/ChatComponentScore.java b/src/main/java/net/minecraft/util/ChatComponentScore.java index 9fa96d4..80df712 100644 --- a/src/main/java/net/minecraft/util/ChatComponentScore.java +++ b/src/main/java/net/minecraft/util/ChatComponentScore.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatComponentScore extends ChatComponentStyle { diff --git a/src/main/java/net/minecraft/util/ChatComponentSelector.java b/src/main/java/net/minecraft/util/ChatComponentSelector.java index d50a498..91e1ead 100644 --- a/src/main/java/net/minecraft/util/ChatComponentSelector.java +++ b/src/main/java/net/minecraft/util/ChatComponentSelector.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatComponentSelector extends ChatComponentStyle { diff --git a/src/main/java/net/minecraft/util/ChatComponentStyle.java b/src/main/java/net/minecraft/util/ChatComponentStyle.java index 041f34b..e33b696 100644 --- a/src/main/java/net/minecraft/util/ChatComponentStyle.java +++ b/src/main/java/net/minecraft/util/ChatComponentStyle.java @@ -7,6 +7,26 @@ import com.google.common.base.Function; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class ChatComponentStyle implements IChatComponent { /**+ * The later siblings of this component. If this component turns diff --git a/src/main/java/net/minecraft/util/ChatComponentText.java b/src/main/java/net/minecraft/util/ChatComponentText.java index 3658a5f..a995946 100644 --- a/src/main/java/net/minecraft/util/ChatComponentText.java +++ b/src/main/java/net/minecraft/util/ChatComponentText.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatComponentText extends ChatComponentStyle { diff --git a/src/main/java/net/minecraft/util/ChatComponentTranslation.java b/src/main/java/net/minecraft/util/ChatComponentTranslation.java index 4a6dd67..da831fa 100644 --- a/src/main/java/net/minecraft/util/ChatComponentTranslation.java +++ b/src/main/java/net/minecraft/util/ChatComponentTranslation.java @@ -18,16 +18,18 @@ import net.lax1dude.eaglercraft.v1_8.HString; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatComponentTranslation extends ChatComponentStyle { diff --git a/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java b/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java index 5fd018a..5377185 100644 --- a/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java +++ b/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.HString; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatComponentTranslationFormatException extends IllegalArgumentException { diff --git a/src/main/java/net/minecraft/util/ChatStyle.java b/src/main/java/net/minecraft/util/ChatStyle.java index e4a81d0..4bf0686 100644 --- a/src/main/java/net/minecraft/util/ChatStyle.java +++ b/src/main/java/net/minecraft/util/ChatStyle.java @@ -14,16 +14,18 @@ import net.minecraft.event.HoverEvent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChatStyle { @@ -637,7 +639,7 @@ public class ChatStyle { } if (chatstyle.color != null) { - jsonobject.put("color", (String) JSONTypeProvider.serialize(chatstyle.color)); + jsonobject.put("color", chatstyle.color.getFriendlyName()); } if (chatstyle.insertion != null) { @@ -654,8 +656,14 @@ public class ChatStyle { if (chatstyle.chatHoverEvent != null) { JSONObject jsonobject2 = new JSONObject(); jsonobject2.put("action", chatstyle.chatHoverEvent.getAction().getCanonicalName()); - jsonobject2.put("value", - (JSONObject) JSONTypeProvider.serialize(chatstyle.chatHoverEvent.getValue())); + Object obj = JSONTypeProvider.serialize(chatstyle.chatHoverEvent.getValue()); + if (obj instanceof String) { + jsonobject2.put("value", (String) obj); + } else if (obj instanceof JSONObject) { + jsonobject2.put("value", (JSONObject) obj); + } else { + throw new ClassCastException(); + } jsonobject.put("hoverEvent", jsonobject2); } diff --git a/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java b/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java index 959f670..d164306 100644 --- a/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java +++ b/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java @@ -17,16 +17,18 @@ import com.google.common.collect.Sets; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ClassInheritanceMultiMap extends AbstractSet { diff --git a/src/main/java/net/minecraft/util/CombatEntry.java b/src/main/java/net/minecraft/util/CombatEntry.java index 1ccb080..0d243cd 100644 --- a/src/main/java/net/minecraft/util/CombatEntry.java +++ b/src/main/java/net/minecraft/util/CombatEntry.java @@ -8,16 +8,18 @@ import net.minecraft.entity.EntityLivingBase; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CombatEntry { diff --git a/src/main/java/net/minecraft/util/CombatTracker.java b/src/main/java/net/minecraft/util/CombatTracker.java index 4906afb..806c350 100644 --- a/src/main/java/net/minecraft/util/CombatTracker.java +++ b/src/main/java/net/minecraft/util/CombatTracker.java @@ -17,16 +17,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 CombatTracker { diff --git a/src/main/java/net/minecraft/util/DamageSource.java b/src/main/java/net/minecraft/util/DamageSource.java index f75ba62..b814df5 100644 --- a/src/main/java/net/minecraft/util/DamageSource.java +++ b/src/main/java/net/minecraft/util/DamageSource.java @@ -13,16 +13,18 @@ import net.minecraft.world.Explosion; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DamageSource { diff --git a/src/main/java/net/minecraft/util/EnchantmentNameParts.java b/src/main/java/net/minecraft/util/EnchantmentNameParts.java index 48edc34..b71075d 100644 --- a/src/main/java/net/minecraft/util/EnchantmentNameParts.java +++ b/src/main/java/net/minecraft/util/EnchantmentNameParts.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnchantmentNameParts { diff --git a/src/main/java/net/minecraft/util/EntityDamageSource.java b/src/main/java/net/minecraft/util/EntityDamageSource.java index 240490c..ece9f5a 100644 --- a/src/main/java/net/minecraft/util/EntityDamageSource.java +++ b/src/main/java/net/minecraft/util/EntityDamageSource.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityDamageSource extends DamageSource { diff --git a/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java b/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java index b24bc59..321f533 100644 --- a/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java +++ b/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java @@ -10,16 +10,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EntityDamageSourceIndirect extends EntityDamageSource { diff --git a/src/main/java/net/minecraft/util/EntitySelectors.java b/src/main/java/net/minecraft/util/EntitySelectors.java index cff2772..639e5c6 100644 --- a/src/main/java/net/minecraft/util/EntitySelectors.java +++ b/src/main/java/net/minecraft/util/EntitySelectors.java @@ -10,6 +10,26 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class EntitySelectors { public static final Predicate selectAnything = new Predicate() { public boolean apply(Entity entity) { diff --git a/src/main/java/net/minecraft/util/EnumChatFormatting.java b/src/main/java/net/minecraft/util/EnumChatFormatting.java index c856551..28215d0 100644 --- a/src/main/java/net/minecraft/util/EnumChatFormatting.java +++ b/src/main/java/net/minecraft/util/EnumChatFormatting.java @@ -14,16 +14,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumChatFormatting { diff --git a/src/main/java/net/minecraft/util/EnumFacing.java b/src/main/java/net/minecraft/util/EnumFacing.java index fdb5435..31c50bc 100644 --- a/src/main/java/net/minecraft/util/EnumFacing.java +++ b/src/main/java/net/minecraft/util/EnumFacing.java @@ -14,16 +14,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumFacing implements IStringSerializable { diff --git a/src/main/java/net/minecraft/util/EnumParticleTypes.java b/src/main/java/net/minecraft/util/EnumParticleTypes.java index b461935..7f49fff 100644 --- a/src/main/java/net/minecraft/util/EnumParticleTypes.java +++ b/src/main/java/net/minecraft/util/EnumParticleTypes.java @@ -12,16 +12,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumParticleTypes { diff --git a/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java b/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java index de87dd3..b3f7bdb 100644 --- a/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java +++ b/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumWorldBlockLayer { diff --git a/src/main/java/net/minecraft/util/FoodStats.java b/src/main/java/net/minecraft/util/FoodStats.java index fdc7433..9590d20 100644 --- a/src/main/java/net/minecraft/util/FoodStats.java +++ b/src/main/java/net/minecraft/util/FoodStats.java @@ -12,16 +12,18 @@ import net.minecraft.world.EnumDifficulty; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FoodStats { diff --git a/src/main/java/net/minecraft/util/FrameTimer.java b/src/main/java/net/minecraft/util/FrameTimer.java index 2f01420..a557b75 100644 --- a/src/main/java/net/minecraft/util/FrameTimer.java +++ b/src/main/java/net/minecraft/util/FrameTimer.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FrameTimer { diff --git a/src/main/java/net/minecraft/util/IChatComponent.java b/src/main/java/net/minecraft/util/IChatComponent.java index a3c0496..52372f4 100644 --- a/src/main/java/net/minecraft/util/IChatComponent.java +++ b/src/main/java/net/minecraft/util/IChatComponent.java @@ -15,16 +15,18 @@ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IChatComponent extends Iterable { @@ -228,7 +230,8 @@ public interface IChatComponent extends Iterable { * So sorry for this implementation */ public static String componentToJson(IChatComponent component) { - if (component instanceof ChatComponentText) { + if ((component instanceof ChatComponentText) && component.getChatStyle().isEmpty() + && component.getSiblings().isEmpty()) { String escaped = new JSONObject().put("E", component.getUnformattedTextForChat()).toString(); return escaped.substring(5, escaped.length() - 1); } else { @@ -237,6 +240,9 @@ public interface IChatComponent extends Iterable { } public static IChatComponent jsonToComponent(String json) { + if (json.equals("null")) { + return new ChatComponentText(""); + } return (IChatComponent) JSONTypeProvider.deserialize(json, IChatComponent.class); } } diff --git a/src/main/java/net/minecraft/util/IJsonSerializable.java b/src/main/java/net/minecraft/util/IJsonSerializable.java index d7c75da..2c6fa5c 100644 --- a/src/main/java/net/minecraft/util/IJsonSerializable.java +++ b/src/main/java/net/minecraft/util/IJsonSerializable.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IJsonSerializable { diff --git a/src/main/java/net/minecraft/util/IObjectIntIterable.java b/src/main/java/net/minecraft/util/IObjectIntIterable.java index 21f978a..4fb1c31 100644 --- a/src/main/java/net/minecraft/util/IObjectIntIterable.java +++ b/src/main/java/net/minecraft/util/IObjectIntIterable.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IObjectIntIterable extends Iterable { diff --git a/src/main/java/net/minecraft/util/IProgressUpdate.java b/src/main/java/net/minecraft/util/IProgressUpdate.java index b73384e..1fe54f0 100644 --- a/src/main/java/net/minecraft/util/IProgressUpdate.java +++ b/src/main/java/net/minecraft/util/IProgressUpdate.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IProgressUpdate { diff --git a/src/main/java/net/minecraft/util/IRegistry.java b/src/main/java/net/minecraft/util/IRegistry.java index 75c7629..e05db28 100644 --- a/src/main/java/net/minecraft/util/IRegistry.java +++ b/src/main/java/net/minecraft/util/IRegistry.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IRegistry extends Iterable { diff --git a/src/main/java/net/minecraft/util/IStringSerializable.java b/src/main/java/net/minecraft/util/IStringSerializable.java index b8b5f52..1265f28 100644 --- a/src/main/java/net/minecraft/util/IStringSerializable.java +++ b/src/main/java/net/minecraft/util/IStringSerializable.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IStringSerializable { diff --git a/src/main/java/net/minecraft/util/IThreadListener.java b/src/main/java/net/minecraft/util/IThreadListener.java index 35655cd..0e5847f 100644 --- a/src/main/java/net/minecraft/util/IThreadListener.java +++ b/src/main/java/net/minecraft/util/IThreadListener.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.futures.ListenableFuture; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IThreadListener { diff --git a/src/main/java/net/minecraft/util/ITickable.java b/src/main/java/net/minecraft/util/ITickable.java index 89bcb3e..e63c727 100644 --- a/src/main/java/net/minecraft/util/ITickable.java +++ b/src/main/java/net/minecraft/util/ITickable.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ITickable { diff --git a/src/main/java/net/minecraft/util/IntHashMap.java b/src/main/java/net/minecraft/util/IntHashMap.java index b1c39ed..e4e9138 100644 --- a/src/main/java/net/minecraft/util/IntHashMap.java +++ b/src/main/java/net/minecraft/util/IntHashMap.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 IntHashMap { diff --git a/src/main/java/net/minecraft/util/IntegerCache.java b/src/main/java/net/minecraft/util/IntegerCache.java index b390acf..9083309 100644 --- a/src/main/java/net/minecraft/util/IntegerCache.java +++ b/src/main/java/net/minecraft/util/IntegerCache.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 IntegerCache { diff --git a/src/main/java/net/minecraft/util/JsonSerializableSet.java b/src/main/java/net/minecraft/util/JsonSerializableSet.java index 887dcfb..4ac4b28 100644 --- a/src/main/java/net/minecraft/util/JsonSerializableSet.java +++ b/src/main/java/net/minecraft/util/JsonSerializableSet.java @@ -13,16 +13,18 @@ import com.google.common.collect.Sets; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 JsonSerializableSet extends ForwardingSet implements IJsonSerializable { diff --git a/src/main/java/net/minecraft/util/LazyLoadBase.java b/src/main/java/net/minecraft/util/LazyLoadBase.java index c70fa6f..9ff2de5 100644 --- a/src/main/java/net/minecraft/util/LazyLoadBase.java +++ b/src/main/java/net/minecraft/util/LazyLoadBase.java @@ -1,5 +1,25 @@ package net.minecraft.util; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class LazyLoadBase { private T value; private boolean isLoaded = false; diff --git a/src/main/java/net/minecraft/util/LoggingPrintStream.java b/src/main/java/net/minecraft/util/LoggingPrintStream.java index adf6b11..70fedb6 100644 --- a/src/main/java/net/minecraft/util/LoggingPrintStream.java +++ b/src/main/java/net/minecraft/util/LoggingPrintStream.java @@ -13,16 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LoggingPrintStream extends PrintStream { diff --git a/src/main/java/net/minecraft/util/LongHashMap.java b/src/main/java/net/minecraft/util/LongHashMap.java index 8565403..554f952 100644 --- a/src/main/java/net/minecraft/util/LongHashMap.java +++ b/src/main/java/net/minecraft/util/LongHashMap.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LongHashMap { diff --git a/src/main/java/net/minecraft/util/MapPopulator.java b/src/main/java/net/minecraft/util/MapPopulator.java index 0f974fb..3607637 100644 --- a/src/main/java/net/minecraft/util/MapPopulator.java +++ b/src/main/java/net/minecraft/util/MapPopulator.java @@ -12,16 +12,18 @@ import com.google.common.collect.Maps; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MapPopulator { diff --git a/src/main/java/net/minecraft/util/MathHelper.java b/src/main/java/net/minecraft/util/MathHelper.java index b57d7b7..3db17ec 100644 --- a/src/main/java/net/minecraft/util/MathHelper.java +++ b/src/main/java/net/minecraft/util/MathHelper.java @@ -9,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MathHelper { @@ -39,14 +41,14 @@ public class MathHelper { * sin looked up in a table */ public static float sin(float parFloat1) { - return fastMath ? SIN_TABLE_FAST[(int)(parFloat1 * 651.8986F) & 4095] : SIN_TABLE[(int)(parFloat1 * 10430.378F) & 65535]; + return fastMath ? SIN_TABLE_FAST[(int)(parFloat1 * 651.8986F) & 4095] : SIN_TABLE[(int) (parFloat1 * 10430.378F) & '\uffff']; } /**+ * cos looked up in the sin table with the appropriate offset */ public static float cos(float value) { - return fastMath ? SIN_TABLE_FAST[(int)((value + ((float) Math.PI / 2F)) * 651.8986F) & 4095] : SIN_TABLE[(int)(value * 10430.378F + 16384.0F) & 65535]; + return fastMath ? SIN_TABLE_FAST[(int)((value + ((float) Math.PI / 2F)) * 651.8986F) & 4095] : SIN_TABLE[(int) (value * 10430.378F + 16384.0F) & '\uffff']; } public static float sqrt_float(float value) { @@ -490,10 +492,10 @@ public class MathHelper { static { for (int i = 0; i < 65536; ++i) { - SIN_TABLE[i] = (float) Math.sin((double) i * Math.PI * 2.0D / 65536.0D); - } - - for (int j = 0; j < 4096; ++j) { + SIN_TABLE[i] = (float) Math.sin((double) i * 3.141592653589793D * 2.0D / 65536.0D); + } + + for (int j = 0; j < 4096; ++j) { SIN_TABLE_FAST[j] = (float) Math.sin((double)(((float) j + 0.5F) / 4096.0F * ((float) Math.PI * 2F))); } diff --git a/src/main/java/net/minecraft/util/Matrix4f.java b/src/main/java/net/minecraft/util/Matrix4f.java index 029837f..f74f423 100644 --- a/src/main/java/net/minecraft/util/Matrix4f.java +++ b/src/main/java/net/minecraft/util/Matrix4f.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Matrix4f extends net.lax1dude.eaglercraft.v1_8.vector.Matrix4f { diff --git a/src/main/java/net/minecraft/util/MinecraftError.java b/src/main/java/net/minecraft/util/MinecraftError.java index b707a73..e0af5c3 100644 --- a/src/main/java/net/minecraft/util/MinecraftError.java +++ b/src/main/java/net/minecraft/util/MinecraftError.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MinecraftError extends Error { diff --git a/src/main/java/net/minecraft/util/MouseFilter.java b/src/main/java/net/minecraft/util/MouseFilter.java index 28d32db..7cb2290 100644 --- a/src/main/java/net/minecraft/util/MouseFilter.java +++ b/src/main/java/net/minecraft/util/MouseFilter.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MouseFilter { diff --git a/src/main/java/net/minecraft/util/MouseHelper.java b/src/main/java/net/minecraft/util/MouseHelper.java index 473ac41..ba8549d 100644 --- a/src/main/java/net/minecraft/util/MouseHelper.java +++ b/src/main/java/net/minecraft/util/MouseHelper.java @@ -1,6 +1,5 @@ package net.minecraft.util; -import net.PeytonPlayz585.shadow.input.Controller; import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.Mouse; @@ -10,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.Mouse; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MouseHelper { @@ -45,7 +46,7 @@ public class MouseHelper { } public void mouseXYChange() { - this.deltaX = Mouse.getDX() + Controller.getCameraX(); - this.deltaY = Mouse.getDY() + Controller.getCameraY() * -1; + this.deltaX = Mouse.getDX(); + this.deltaY = Mouse.getDY(); } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/util/MovementInput.java b/src/main/java/net/minecraft/util/MovementInput.java index 83ecdd5..ed5342a 100644 --- a/src/main/java/net/minecraft/util/MovementInput.java +++ b/src/main/java/net/minecraft/util/MovementInput.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MovementInput { diff --git a/src/main/java/net/minecraft/util/MovementInputFromOptions.java b/src/main/java/net/minecraft/util/MovementInputFromOptions.java index 6ecc456..60d4e66 100644 --- a/src/main/java/net/minecraft/util/MovementInputFromOptions.java +++ b/src/main/java/net/minecraft/util/MovementInputFromOptions.java @@ -1,6 +1,5 @@ package net.minecraft.util; -import net.PeytonPlayz585.shadow.input.Controller; import net.minecraft.client.settings.GameSettings; /**+ @@ -9,16 +8,18 @@ import net.minecraft.client.settings.GameSettings; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MovementInputFromOptions extends MovementInput { @@ -31,19 +32,19 @@ public class MovementInputFromOptions extends MovementInput { public void updatePlayerMoveState() { this.moveStrafe = 0.0F; this.moveForward = 0.0F; - if (this.gameSettings.keyBindForward.isKeyDown() || Controller.isWalkingForward()) { + if (this.gameSettings.keyBindForward.isKeyDown()) { ++this.moveForward; } - if (this.gameSettings.keyBindBack.isKeyDown() || Controller.isWalkingBackward()) { + if (this.gameSettings.keyBindBack.isKeyDown()) { --this.moveForward; } - if (this.gameSettings.keyBindLeft.isKeyDown() || Controller.isWalkingLeft()) { + if (this.gameSettings.keyBindLeft.isKeyDown()) { ++this.moveStrafe; } - if (this.gameSettings.keyBindRight.isKeyDown() || Controller.isWalkingRight()) { + if (this.gameSettings.keyBindRight.isKeyDown()) { --this.moveStrafe; } diff --git a/src/main/java/net/minecraft/util/MovingObjectPosition.java b/src/main/java/net/minecraft/util/MovingObjectPosition.java index 18d7210..d7e96cc 100644 --- a/src/main/java/net/minecraft/util/MovingObjectPosition.java +++ b/src/main/java/net/minecraft/util/MovingObjectPosition.java @@ -8,16 +8,18 @@ import net.minecraft.entity.Entity; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MovingObjectPosition { diff --git a/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java b/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java index 2787963..357b6d2 100644 --- a/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java +++ b/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java @@ -14,16 +14,18 @@ import com.google.common.collect.Lists; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ObjectIntIdentityMap implements IObjectIntIterable { diff --git a/src/main/java/net/minecraft/util/RegistryDefaulted.java b/src/main/java/net/minecraft/util/RegistryDefaulted.java index f49e90e..8c15bc2 100644 --- a/src/main/java/net/minecraft/util/RegistryDefaulted.java +++ b/src/main/java/net/minecraft/util/RegistryDefaulted.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RegistryDefaulted extends RegistrySimple { diff --git a/src/main/java/net/minecraft/util/RegistryNamespaced.java b/src/main/java/net/minecraft/util/RegistryNamespaced.java index baae474..0aad460 100644 --- a/src/main/java/net/minecraft/util/RegistryNamespaced.java +++ b/src/main/java/net/minecraft/util/RegistryNamespaced.java @@ -12,16 +12,18 @@ import com.google.common.collect.HashBiMap; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RegistryNamespaced extends RegistrySimple implements IObjectIntIterable { diff --git a/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java b/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java index 321525f..c7b280e 100644 --- a/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java +++ b/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java @@ -8,16 +8,18 @@ import org.apache.commons.lang3.Validate; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RegistryNamespacedDefaultedByKey extends RegistryNamespaced { diff --git a/src/main/java/net/minecraft/util/RegistrySimple.java b/src/main/java/net/minecraft/util/RegistrySimple.java index 5aed79b..c36cde4 100644 --- a/src/main/java/net/minecraft/util/RegistrySimple.java +++ b/src/main/java/net/minecraft/util/RegistrySimple.java @@ -18,16 +18,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 RegistrySimple implements IRegistry { diff --git a/src/main/java/net/minecraft/util/ReportedException.java b/src/main/java/net/minecraft/util/ReportedException.java index a1a4330..7dfea3e 100644 --- a/src/main/java/net/minecraft/util/ReportedException.java +++ b/src/main/java/net/minecraft/util/ReportedException.java @@ -8,16 +8,18 @@ import net.minecraft.crash.CrashReport; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ReportedException extends RuntimeException { diff --git a/src/main/java/net/minecraft/util/ResourceLocation.java b/src/main/java/net/minecraft/util/ResourceLocation.java index 3344185..12170d1 100644 --- a/src/main/java/net/minecraft/util/ResourceLocation.java +++ b/src/main/java/net/minecraft/util/ResourceLocation.java @@ -8,16 +8,18 @@ import org.apache.commons.lang3.Validate; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ResourceLocation { diff --git a/src/main/java/net/minecraft/util/Rotations.java b/src/main/java/net/minecraft/util/Rotations.java index 8323cf1..b2f214b 100644 --- a/src/main/java/net/minecraft/util/Rotations.java +++ b/src/main/java/net/minecraft/util/Rotations.java @@ -9,16 +9,18 @@ import net.minecraft.nbt.NBTTagList; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Rotations { diff --git a/src/main/java/net/minecraft/util/ScreenShotHelper.java b/src/main/java/net/minecraft/util/ScreenShotHelper.java index 27887c9..891f9b9 100644 --- a/src/main/java/net/minecraft/util/ScreenShotHelper.java +++ b/src/main/java/net/minecraft/util/ScreenShotHelper.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ScreenShotHelper { diff --git a/src/main/java/net/minecraft/util/Session.java b/src/main/java/net/minecraft/util/Session.java index a9f5a81..4d34fcf 100644 --- a/src/main/java/net/minecraft/util/Session.java +++ b/src/main/java/net/minecraft/util/Session.java @@ -4,6 +4,7 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; +import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player.EntityPlayer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -11,16 +12,18 @@ import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Session { @@ -44,6 +47,10 @@ public class Session { update(EaglerProfile.getName(), offlineUUID); } + public void setLAN() { + update(EaglerProfile.getName(), EntityPlayer.getOfflineUUID(EaglerProfile.getName())); + } + static { byte[] bytes = new byte[16]; (new EaglercraftRandom()).nextBytes(bytes); diff --git a/src/main/java/net/minecraft/util/StatCollector.java b/src/main/java/net/minecraft/util/StatCollector.java index d0019f6..cce7ad7 100644 --- a/src/main/java/net/minecraft/util/StatCollector.java +++ b/src/main/java/net/minecraft/util/StatCollector.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StatCollector { diff --git a/src/main/java/net/minecraft/util/StringTranslate.java b/src/main/java/net/minecraft/util/StringTranslate.java index 766e97c..ccd3c5c 100644 --- a/src/main/java/net/minecraft/util/StringTranslate.java +++ b/src/main/java/net/minecraft/util/StringTranslate.java @@ -1,8 +1,11 @@ package net.minecraft.util; import java.io.InputStream; +import java.util.ArrayList; import java.util.IllegalFormatException; +import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -14,6 +17,7 @@ import com.google.common.collect.Maps; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.IOUtils; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -21,16 +25,18 @@ import net.lax1dude.eaglercraft.v1_8.IOUtils; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StringTranslate { @@ -85,23 +91,24 @@ public class StringTranslate { * Replaces all the current instance's translations with the * ones that are passed in. */ - public static synchronized void replaceWith(Map parMap) { + public static void replaceWith(Map parMap) { instance.languageList.clear(); instance.languageList.putAll(parMap); instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + SingleplayerServerController.updateLocale(dump()); } /**+ * Translate a key to current language. */ - public synchronized String translateKey(String key) { + public String translateKey(String key) { return this.tryTranslateKey(key); } /**+ * Translate a key to current language applying String.format() */ - public synchronized String translateKeyFormat(String key, Object... format) { + public String translateKeyFormat(String key, Object... format) { String s = this.tryTranslateKey(key); try { @@ -123,7 +130,7 @@ public class StringTranslate { /**+ * Returns true if the passed key is in the translation table. */ - public synchronized boolean isKeyTranslated(String key) { + public boolean isKeyTranslated(String key) { return this.languageList.containsKey(key); } @@ -134,4 +141,12 @@ public class StringTranslate { public long getLastUpdateTimeInMilliseconds() { return this.lastUpdateTimeInMilliseconds; } + + public static List dump() { + List ret = new ArrayList(instance.languageList.size()); + for (Entry etr : instance.languageList.entrySet()) { + ret.add(etr.getKey() + "=" + etr.getValue()); + } + return ret; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/util/StringUtils.java b/src/main/java/net/minecraft/util/StringUtils.java index 3c8fa87..71bcf35 100644 --- a/src/main/java/net/minecraft/util/StringUtils.java +++ b/src/main/java/net/minecraft/util/StringUtils.java @@ -8,16 +8,18 @@ import java.util.regex.Pattern; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 StringUtils { diff --git a/src/main/java/net/minecraft/util/Timer.java b/src/main/java/net/minecraft/util/Timer.java index 278edfe..2183239 100644 --- a/src/main/java/net/minecraft/util/Timer.java +++ b/src/main/java/net/minecraft/util/Timer.java @@ -8,16 +8,18 @@ import net.minecraft.client.Minecraft; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Timer { @@ -82,7 +84,6 @@ public class Timer { if (this.elapsedTicks > 10) { this.elapsedTicks = 10; } - this.renderPartialTicks = this.elapsedPartialTicks; } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/util/Tuple.java b/src/main/java/net/minecraft/util/Tuple.java index da195fc..87dca18 100644 --- a/src/main/java/net/minecraft/util/Tuple.java +++ b/src/main/java/net/minecraft/util/Tuple.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Tuple { diff --git a/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java b/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java index 7545262..976bb8a 100644 --- a/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java +++ b/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TupleIntJsonSerializable { diff --git a/src/main/java/net/minecraft/util/Util.java b/src/main/java/net/minecraft/util/Util.java index 9998500..495ea5e 100644 --- a/src/main/java/net/minecraft/util/Util.java +++ b/src/main/java/net/minecraft/util/Util.java @@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Util { diff --git a/src/main/java/net/minecraft/util/Vec3.java b/src/main/java/net/minecraft/util/Vec3.java index 0483a7b..4ec3d61 100644 --- a/src/main/java/net/minecraft/util/Vec3.java +++ b/src/main/java/net/minecraft/util/Vec3.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Vec3 { diff --git a/src/main/java/net/minecraft/util/Vec3i.java b/src/main/java/net/minecraft/util/Vec3i.java index a008e9d..c7aa2a5 100644 --- a/src/main/java/net/minecraft/util/Vec3i.java +++ b/src/main/java/net/minecraft/util/Vec3i.java @@ -8,16 +8,18 @@ import com.google.common.base.Objects; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Vec3i implements Comparable { diff --git a/src/main/java/net/minecraft/util/Vec4b.java b/src/main/java/net/minecraft/util/Vec4b.java index 0f69981..85cde28 100644 --- a/src/main/java/net/minecraft/util/Vec4b.java +++ b/src/main/java/net/minecraft/util/Vec4b.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Vec4b { diff --git a/src/main/java/net/minecraft/util/Vector3d.java b/src/main/java/net/minecraft/util/Vector3d.java index 24a06df..ad16e65 100644 --- a/src/main/java/net/minecraft/util/Vector3d.java +++ b/src/main/java/net/minecraft/util/Vector3d.java @@ -6,16 +6,18 @@ package net.minecraft.util; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Vector3d { diff --git a/src/main/java/net/minecraft/util/WeightedRandom.java b/src/main/java/net/minecraft/util/WeightedRandom.java index a0550de..8a4c581 100644 --- a/src/main/java/net/minecraft/util/WeightedRandom.java +++ b/src/main/java/net/minecraft/util/WeightedRandom.java @@ -9,16 +9,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WeightedRandom { diff --git a/src/main/java/net/minecraft/util/WeightedRandomChestContent.java b/src/main/java/net/minecraft/util/WeightedRandomChestContent.java index 8b12c6d..8251ee6 100644 --- a/src/main/java/net/minecraft/util/WeightedRandomChestContent.java +++ b/src/main/java/net/minecraft/util/WeightedRandomChestContent.java @@ -18,16 +18,18 @@ import net.minecraft.tileentity.TileEntityDispenser; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WeightedRandomChestContent extends WeightedRandom.Item { diff --git a/src/main/java/net/minecraft/util/WeightedRandomFishable.java b/src/main/java/net/minecraft/util/WeightedRandomFishable.java index e03946e..43416f1 100644 --- a/src/main/java/net/minecraft/util/WeightedRandomFishable.java +++ b/src/main/java/net/minecraft/util/WeightedRandomFishable.java @@ -11,16 +11,18 @@ import net.minecraft.item.ItemStack; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WeightedRandomFishable extends WeightedRandom.Item { diff --git a/src/main/java/net/minecraft/village/MerchantRecipe.java b/src/main/java/net/minecraft/village/MerchantRecipe.java index 19759f3..7caa01b 100644 --- a/src/main/java/net/minecraft/village/MerchantRecipe.java +++ b/src/main/java/net/minecraft/village/MerchantRecipe.java @@ -10,16 +10,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MerchantRecipe { diff --git a/src/main/java/net/minecraft/village/MerchantRecipeList.java b/src/main/java/net/minecraft/village/MerchantRecipeList.java index ea8851e..43d59c8 100644 --- a/src/main/java/net/minecraft/village/MerchantRecipeList.java +++ b/src/main/java/net/minecraft/village/MerchantRecipeList.java @@ -15,16 +15,18 @@ import net.minecraft.network.PacketBuffer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MerchantRecipeList extends ArrayList { diff --git a/src/main/java/net/minecraft/world/ChunkCache.java b/src/main/java/net/minecraft/world/ChunkCache.java index 44bc5aa..b6c62f1 100644 --- a/src/main/java/net/minecraft/world/ChunkCache.java +++ b/src/main/java/net/minecraft/world/ChunkCache.java @@ -15,16 +15,18 @@ import net.minecraft.world.chunk.Chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChunkCache implements IBlockAccess { diff --git a/src/main/java/net/minecraft/world/ChunkCoordIntPair.java b/src/main/java/net/minecraft/world/ChunkCoordIntPair.java index 5b4c5e9..3dc6240 100644 --- a/src/main/java/net/minecraft/world/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/world/ChunkCoordIntPair.java @@ -8,16 +8,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChunkCoordIntPair { diff --git a/src/main/java/net/minecraft/world/ColorizerFoliage.java b/src/main/java/net/minecraft/world/ColorizerFoliage.java index 2af2c69..fc6215c 100644 --- a/src/main/java/net/minecraft/world/ColorizerFoliage.java +++ b/src/main/java/net/minecraft/world/ColorizerFoliage.java @@ -6,16 +6,18 @@ package net.minecraft.world; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ColorizerFoliage { diff --git a/src/main/java/net/minecraft/world/ColorizerGrass.java b/src/main/java/net/minecraft/world/ColorizerGrass.java index eab4583..434f301 100644 --- a/src/main/java/net/minecraft/world/ColorizerGrass.java +++ b/src/main/java/net/minecraft/world/ColorizerGrass.java @@ -6,16 +6,18 @@ package net.minecraft.world; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ColorizerGrass { diff --git a/src/main/java/net/minecraft/world/DifficultyInstance.java b/src/main/java/net/minecraft/world/DifficultyInstance.java index 76048e8..2d0c899 100644 --- a/src/main/java/net/minecraft/world/DifficultyInstance.java +++ b/src/main/java/net/minecraft/world/DifficultyInstance.java @@ -8,16 +8,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 DifficultyInstance { diff --git a/src/main/java/net/minecraft/world/EnumDifficulty.java b/src/main/java/net/minecraft/world/EnumDifficulty.java index 571decb..1c88d6d 100644 --- a/src/main/java/net/minecraft/world/EnumDifficulty.java +++ b/src/main/java/net/minecraft/world/EnumDifficulty.java @@ -6,16 +6,18 @@ package net.minecraft.world; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumDifficulty { diff --git a/src/main/java/net/minecraft/world/EnumSkyBlock.java b/src/main/java/net/minecraft/world/EnumSkyBlock.java index ff8b3ca..2bcc021 100644 --- a/src/main/java/net/minecraft/world/EnumSkyBlock.java +++ b/src/main/java/net/minecraft/world/EnumSkyBlock.java @@ -6,16 +6,18 @@ package net.minecraft.world; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumSkyBlock { diff --git a/src/main/java/net/minecraft/world/Explosion.java b/src/main/java/net/minecraft/world/Explosion.java index 1475156..082635e 100644 --- a/src/main/java/net/minecraft/world/Explosion.java +++ b/src/main/java/net/minecraft/world/Explosion.java @@ -31,16 +31,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Explosion { diff --git a/src/main/java/net/minecraft/world/GameRules.java b/src/main/java/net/minecraft/world/GameRules.java index 2239e35..c19ebb5 100644 --- a/src/main/java/net/minecraft/world/GameRules.java +++ b/src/main/java/net/minecraft/world/GameRules.java @@ -11,16 +11,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 GameRules { diff --git a/src/main/java/net/minecraft/world/IBlockAccess.java b/src/main/java/net/minecraft/world/IBlockAccess.java index 7e83ff7..d8538c5 100644 --- a/src/main/java/net/minecraft/world/IBlockAccess.java +++ b/src/main/java/net/minecraft/world/IBlockAccess.java @@ -12,16 +12,18 @@ import net.minecraft.world.biome.BiomeGenBase; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBlockAccess { diff --git a/src/main/java/net/minecraft/world/IInteractionObject.java b/src/main/java/net/minecraft/world/IInteractionObject.java index 2b67247..cee350a 100644 --- a/src/main/java/net/minecraft/world/IInteractionObject.java +++ b/src/main/java/net/minecraft/world/IInteractionObject.java @@ -10,16 +10,18 @@ import net.minecraft.inventory.Container; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IInteractionObject extends IWorldNameable { diff --git a/src/main/java/net/minecraft/world/ILockableContainer.java b/src/main/java/net/minecraft/world/ILockableContainer.java index 0c7b3da..112a4c4 100644 --- a/src/main/java/net/minecraft/world/ILockableContainer.java +++ b/src/main/java/net/minecraft/world/ILockableContainer.java @@ -8,16 +8,18 @@ import net.minecraft.inventory.IInventory; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ILockableContainer extends IInventory, IInteractionObject { diff --git a/src/main/java/net/minecraft/world/IWorldAccess.java b/src/main/java/net/minecraft/world/IWorldAccess.java index e747d58..c42db99 100644 --- a/src/main/java/net/minecraft/world/IWorldAccess.java +++ b/src/main/java/net/minecraft/world/IWorldAccess.java @@ -10,16 +10,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IWorldAccess { diff --git a/src/main/java/net/minecraft/world/IWorldNameable.java b/src/main/java/net/minecraft/world/IWorldNameable.java index a51260e..b4f46d5 100644 --- a/src/main/java/net/minecraft/world/IWorldNameable.java +++ b/src/main/java/net/minecraft/world/IWorldNameable.java @@ -8,16 +8,18 @@ import net.minecraft.util.IChatComponent; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IWorldNameable { diff --git a/src/main/java/net/minecraft/world/LockCode.java b/src/main/java/net/minecraft/world/LockCode.java index 87f006a..9d72940 100644 --- a/src/main/java/net/minecraft/world/LockCode.java +++ b/src/main/java/net/minecraft/world/LockCode.java @@ -8,16 +8,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 LockCode { diff --git a/src/main/java/net/minecraft/world/MinecraftException.java b/src/main/java/net/minecraft/world/MinecraftException.java index 26a12e7..3c32844 100644 --- a/src/main/java/net/minecraft/world/MinecraftException.java +++ b/src/main/java/net/minecraft/world/MinecraftException.java @@ -6,16 +6,18 @@ package net.minecraft.world; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MinecraftException extends Exception { diff --git a/src/main/java/net/minecraft/world/NextTickListEntry.java b/src/main/java/net/minecraft/world/NextTickListEntry.java index 0640030..bead7b8 100644 --- a/src/main/java/net/minecraft/world/NextTickListEntry.java +++ b/src/main/java/net/minecraft/world/NextTickListEntry.java @@ -9,16 +9,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NextTickListEntry implements Comparable { diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index bc6fa65..abbf590 100644 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -5,6 +5,8 @@ import java.util.Calendar; import java.util.Collection; import java.util.Iterator; import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import java.util.Set; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; @@ -22,12 +24,10 @@ import net.minecraft.block.BlockSnow; import net.minecraft.block.BlockStairs; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReportCategory; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -54,6 +54,26 @@ import net.minecraft.world.storage.ISaveHandler; import net.minecraft.world.storage.MapStorage; import net.minecraft.world.storage.WorldInfo; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class World implements IBlockAccess { private int field_181546_a = 63; protected boolean scheduledUpdatesAreImmediate; @@ -109,7 +129,7 @@ public abstract class World implements IBlockAccess { protected boolean findingSpawnPoint; protected MapStorage mapStorage; public final Profiler theProfiler; - private final Calendar theCalendar = Calendar.getInstance(); + private final Calendar theCalendar = EagRuntime.getLocaleCalendar(); protected Scoreboard worldScoreboard = new Scoreboard(); /**+ * populated by chunks that are within 9 chunks of any player diff --git a/src/main/java/net/minecraft/world/WorldProvider.java b/src/main/java/net/minecraft/world/WorldProvider.java index e2e5c89..d2cbea1 100644 --- a/src/main/java/net/minecraft/world/WorldProvider.java +++ b/src/main/java/net/minecraft/world/WorldProvider.java @@ -6,6 +6,26 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.border.WorldBorder; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldProvider { public static final float[] moonPhaseFactors = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F }; protected World worldObj; diff --git a/src/main/java/net/minecraft/world/WorldProviderEnd.java b/src/main/java/net/minecraft/world/WorldProviderEnd.java index 2496fd2..e0f0ad2 100644 --- a/src/main/java/net/minecraft/world/WorldProviderEnd.java +++ b/src/main/java/net/minecraft/world/WorldProviderEnd.java @@ -11,16 +11,18 @@ import net.minecraft.util.Vec3; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldProviderEnd extends WorldProvider { diff --git a/src/main/java/net/minecraft/world/WorldProviderHell.java b/src/main/java/net/minecraft/world/WorldProviderHell.java index 6062249..0ddaffb 100644 --- a/src/main/java/net/minecraft/world/WorldProviderHell.java +++ b/src/main/java/net/minecraft/world/WorldProviderHell.java @@ -10,16 +10,18 @@ import net.minecraft.world.border.WorldBorder; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldProviderHell extends WorldProvider { diff --git a/src/main/java/net/minecraft/world/WorldProviderSurface.java b/src/main/java/net/minecraft/world/WorldProviderSurface.java index 3e8b6db..5b7c128 100644 --- a/src/main/java/net/minecraft/world/WorldProviderSurface.java +++ b/src/main/java/net/minecraft/world/WorldProviderSurface.java @@ -8,24 +8,26 @@ import net.PeytonPlayz585.shadow.Config; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldProviderSurface extends WorldProvider { @Override public void registerWorldChunkManager() { - Config.chunkFix = true; super.registerWorldChunkManager(); + Config.chunkFix = true; } /**+ diff --git a/src/main/java/net/minecraft/world/WorldSavedData.java b/src/main/java/net/minecraft/world/WorldSavedData.java index 74b1dff..1212c85 100644 --- a/src/main/java/net/minecraft/world/WorldSavedData.java +++ b/src/main/java/net/minecraft/world/WorldSavedData.java @@ -2,6 +2,26 @@ package net.minecraft.world; import net.minecraft.nbt.NBTTagCompound; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class WorldSavedData { public final String mapName; private boolean dirty; diff --git a/src/main/java/net/minecraft/world/WorldSettings.java b/src/main/java/net/minecraft/world/WorldSettings.java index 888344b..61752e3 100644 --- a/src/main/java/net/minecraft/world/WorldSettings.java +++ b/src/main/java/net/minecraft/world/WorldSettings.java @@ -3,6 +3,26 @@ package net.minecraft.world; import net.minecraft.entity.player.PlayerCapabilities; import net.minecraft.world.storage.WorldInfo; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 final class WorldSettings { private final long seed; private final WorldSettings.GameType theGameType; diff --git a/src/main/java/net/minecraft/world/WorldType.java b/src/main/java/net/minecraft/world/WorldType.java index 28795ef..590daac 100644 --- a/src/main/java/net/minecraft/world/WorldType.java +++ b/src/main/java/net/minecraft/world/WorldType.java @@ -6,16 +6,18 @@ package net.minecraft.world; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldType { @@ -40,6 +42,7 @@ public class WorldType { */ public static final WorldType AMPLIFIED = (new WorldType(3, "amplified")).setNotificationData(); public static final WorldType CUSTOMIZED = new WorldType(4, "customized"); + public static final WorldType DEBUG_WORLD = new WorldType(5, "debug_all_block_states"); /**+ * Default (1.1) world type. */ diff --git a/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java b/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java index afb9803..04c2eee 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java +++ b/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java @@ -9,16 +9,18 @@ import net.minecraft.world.IBlockAccess; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeColorHelper { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenBase.java b/src/main/java/net/minecraft/world/biome/BiomeGenBase.java index 92fca87..8b756bc 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenBase.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenBase.java @@ -42,6 +42,26 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.NoiseGeneratorPerlin; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class BiomeGenBase { private static final Logger logger = LogManager.getLogger(); protected static final BiomeGenBase.Height height_Default = new BiomeGenBase.Height(0.1F, 0.2F); diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java b/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java index 7d98c0d..64f1057 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java @@ -8,16 +8,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenBeach extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java b/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java index aed7a1a..f7a6561 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java @@ -8,16 +8,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenDesert extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java b/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java index 00de225..9f388b7 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java @@ -9,16 +9,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenEnd extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenForest.java b/src/main/java/net/minecraft/world/biome/BiomeGenForest.java index e52fa9a..e5cee78 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenForest.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenForest.java @@ -13,16 +13,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenForest extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenHell.java b/src/main/java/net/minecraft/world/biome/BiomeGenHell.java index cffe1b5..0c20fdf 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenHell.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenHell.java @@ -10,16 +10,18 @@ import net.minecraft.entity.monster.EntityPigZombie; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenHell extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenHills.java b/src/main/java/net/minecraft/world/biome/BiomeGenHills.java index 216583a..24809c8 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenHills.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenHills.java @@ -12,16 +12,18 @@ import net.minecraft.world.chunk.ChunkPrimer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenHills extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java b/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java index 94f62ff..580846d 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java @@ -15,16 +15,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenJungle extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java b/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java index cd7212f..b3485bd 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java @@ -21,16 +21,18 @@ import net.minecraft.world.gen.NoiseGeneratorPerlin; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenMesa extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java b/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java index e308022..56e6cf8 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java @@ -9,16 +9,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenMushroomIsland extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java b/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java index 2142b1c..705aada 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java @@ -14,16 +14,18 @@ import net.minecraft.world.chunk.ChunkPrimer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenMutated extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java b/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java index 4fd415c..852fccf 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java @@ -11,16 +11,18 @@ import net.minecraft.world.chunk.ChunkPrimer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenOcean extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java b/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java index 8551a12..9fc8851 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java @@ -12,16 +12,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenPlains extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java b/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java index 2c7511f..e8f1c40 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java @@ -6,16 +6,18 @@ package net.minecraft.world.biome; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenRiver extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java b/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java index 0d2c8fd..103bac5 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java @@ -14,16 +14,18 @@ import net.minecraft.world.chunk.ChunkPrimer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenSavanna extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java b/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java index 06d37ef..15f5f2b 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java @@ -8,16 +8,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenSnow extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java b/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java index 5fc37a5..e7472ad 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java @@ -8,16 +8,18 @@ import net.minecraft.init.Blocks; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenStoneBeach extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java b/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java index b515abf..56754a1 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java @@ -12,16 +12,18 @@ import net.minecraft.util.BlockPos; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenSwamp extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java b/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java index f8f935b..7f106a1 100644 --- a/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java @@ -14,16 +14,18 @@ import net.minecraft.world.chunk.ChunkPrimer; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 BiomeGenTaiga extends BiomeGenBase { diff --git a/src/main/java/net/minecraft/world/border/EnumBorderStatus.java b/src/main/java/net/minecraft/world/border/EnumBorderStatus.java index e6160c4..e407940 100644 --- a/src/main/java/net/minecraft/world/border/EnumBorderStatus.java +++ b/src/main/java/net/minecraft/world/border/EnumBorderStatus.java @@ -6,16 +6,18 @@ package net.minecraft.world.border; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EnumBorderStatus { diff --git a/src/main/java/net/minecraft/world/border/IBorderListener.java b/src/main/java/net/minecraft/world/border/IBorderListener.java index 0ce2f1a..6a735a8 100644 --- a/src/main/java/net/minecraft/world/border/IBorderListener.java +++ b/src/main/java/net/minecraft/world/border/IBorderListener.java @@ -6,16 +6,18 @@ package net.minecraft.world.border; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IBorderListener { diff --git a/src/main/java/net/minecraft/world/border/WorldBorder.java b/src/main/java/net/minecraft/world/border/WorldBorder.java index cbfdea2..a4bbf7d 100644 --- a/src/main/java/net/minecraft/world/border/WorldBorder.java +++ b/src/main/java/net/minecraft/world/border/WorldBorder.java @@ -15,16 +15,18 @@ import net.minecraft.world.ChunkCoordIntPair; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldBorder { diff --git a/src/main/java/net/minecraft/world/chunk/Chunk.java b/src/main/java/net/minecraft/world/chunk/Chunk.java index 97f9213..5fdd478 100644 --- a/src/main/java/net/minecraft/world/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/chunk/Chunk.java @@ -40,16 +40,18 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 Chunk { diff --git a/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java b/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java index 9c1b6fc..1a38378 100644 --- a/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java +++ b/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java @@ -1,9 +1,11 @@ package net.minecraft.world.chunk; +import java.util.HashMap; +import java.util.Map; + import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; -import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -11,21 +13,22 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ChunkPrimer { - private final short[] data = new short[4096]; - private final short[] data_fast = new short[4096]; + private final Map data = new HashMap(); private final IBlockState defaultState = Blocks.air.getDefaultState(); public IBlockState getBlockState(int x, int y, int z) { @@ -34,20 +37,11 @@ public class ChunkPrimer { } public IBlockState getBlockState(int index) { - if (MathHelper.fastMath) { - if (index >= 0 && index < this.data.length) { - IBlockState iblockstate = (IBlockState) Block.BLOCK_STATE_IDS.getByValue(this.data[index]); - return iblockstate != null ? iblockstate : this.defaultState; - } else { - throw new IndexOutOfBoundsException("The coordinate is out of range"); - } - } else { - if (index >= 0 && index < this.data_fast.length) { - IBlockState iblockstate = (IBlockState) Block.BLOCK_STATE_IDS.getByValue(this.data_fast[index]); - return iblockstate != null ? iblockstate : this.defaultState; - } else { - throw new IndexOutOfBoundsException("The coordinate is out of range"); - } + if (index >= 0 && index < this.data.size()) { + IBlockState iblockstate = (IBlockState) Block.BLOCK_STATE_IDS.getByValue(this.data.get(index)); + return iblockstate != null ? iblockstate : this.defaultState; + } else { + throw new IndexOutOfBoundsException("The coordinate is out of range"); } } @@ -57,18 +51,10 @@ public class ChunkPrimer { } public void setBlockState(int index, IBlockState state) { - if(MathHelper.fastMath) { - if (index >= 0 && index < this.data.length) { - this.data[index] = (short) Block.BLOCK_STATE_IDS.get(state); - } else { - throw new IndexOutOfBoundsException("The coordinate is out of range"); - } - } else { - if (index >= 0 && index < this.data_fast.length) { - this.data_fast[index] = (short) Block.BLOCK_STATE_IDS.get(state); - } else { - throw new IndexOutOfBoundsException("The coordinate is out of range"); - } + if (index >= 0 && index < this.data.size()) { + this.data.put(index, (short) Block.BLOCK_STATE_IDS.get(state)); + } else { + throw new IndexOutOfBoundsException("The coordinate is out of range"); } } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/chunk/EmptyChunk.java b/src/main/java/net/minecraft/world/chunk/EmptyChunk.java index 1043065..4d765cb 100644 --- a/src/main/java/net/minecraft/world/chunk/EmptyChunk.java +++ b/src/main/java/net/minecraft/world/chunk/EmptyChunk.java @@ -20,16 +20,18 @@ import net.minecraft.world.World; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EmptyChunk extends Chunk { diff --git a/src/main/java/net/minecraft/world/chunk/IChunkProvider.java b/src/main/java/net/minecraft/world/chunk/IChunkProvider.java index 2dbe286..3fa0f00 100644 --- a/src/main/java/net/minecraft/world/chunk/IChunkProvider.java +++ b/src/main/java/net/minecraft/world/chunk/IChunkProvider.java @@ -14,16 +14,18 @@ import net.minecraft.world.biome.BiomeGenBase; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IChunkProvider { diff --git a/src/main/java/net/minecraft/world/chunk/NibbleArray.java b/src/main/java/net/minecraft/world/chunk/NibbleArray.java index bc5536b..73456f9 100644 --- a/src/main/java/net/minecraft/world/chunk/NibbleArray.java +++ b/src/main/java/net/minecraft/world/chunk/NibbleArray.java @@ -6,16 +6,18 @@ package net.minecraft.world.chunk; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NibbleArray { diff --git a/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java b/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java index d69fc98..9848199 100644 --- a/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java +++ b/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java @@ -11,16 +11,18 @@ import net.minecraft.world.chunk.NibbleArray; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ExtendedBlockStorage { diff --git a/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java b/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java index 6081bad..70b978e 100644 --- a/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java +++ b/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java @@ -6,16 +6,18 @@ package net.minecraft.world.chunk.storage; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NibbleArrayReader { diff --git a/src/main/java/net/minecraft/world/demo/DemoWorldServer.java b/src/main/java/net/minecraft/world/demo/DemoWorldServer.java new file mode 100644 index 0000000..b7a7782 --- /dev/null +++ b/src/main/java/net/minecraft/world/demo/DemoWorldServer.java @@ -0,0 +1,31 @@ +package net.minecraft.world.demo; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 DemoWorldServer { + private static final long demoWorldSeed = EaglercraftVersion.demoWorldSeed; + public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, + WorldSettings.GameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/gen/ChunkProviderSettings.java b/src/main/java/net/minecraft/world/gen/ChunkProviderSettings.java new file mode 100644 index 0000000..f3f6b87 --- /dev/null +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderSettings.java @@ -0,0 +1,909 @@ +package net.minecraft.world.gen; + +import org.json.JSONException; +import org.json.JSONObject; + +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeCodec; +import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; +import net.minecraft.world.biome.BiomeGenBase; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 ChunkProviderSettings { + public final float coordinateScale; + public final float heightScale; + public final float upperLimitScale; + public final float lowerLimitScale; + public final float depthNoiseScaleX; + public final float depthNoiseScaleZ; + public final float depthNoiseScaleExponent; + public final float mainNoiseScaleX; + public final float mainNoiseScaleY; + public final float mainNoiseScaleZ; + public final float baseSize; + public final float stretchY; + public final float biomeDepthWeight; + public final float biomeDepthOffSet; + public final float biomeScaleWeight; + public final float biomeScaleOffset; + public final int seaLevel; + public final boolean useCaves; + public final boolean useDungeons; + public final int dungeonChance; + public final boolean useStrongholds; + public final boolean useVillages; + public final boolean useMineShafts; + public final boolean useTemples; + public final boolean useMonuments; + public final boolean useRavines; + public final boolean useWaterLakes; + public final int waterLakeChance; + public final boolean useLavaLakes; + public final int lavaLakeChance; + public final boolean useLavaOceans; + public final int fixedBiome; + public final int biomeSize; + public final int riverSize; + public final int dirtSize; + public final int dirtCount; + public final int dirtMinHeight; + public final int dirtMaxHeight; + public final int gravelSize; + public final int gravelCount; + public final int gravelMinHeight; + public final int gravelMaxHeight; + public final int graniteSize; + public final int graniteCount; + public final int graniteMinHeight; + public final int graniteMaxHeight; + public final int dioriteSize; + public final int dioriteCount; + public final int dioriteMinHeight; + public final int dioriteMaxHeight; + public final int andesiteSize; + public final int andesiteCount; + public final int andesiteMinHeight; + public final int andesiteMaxHeight; + public final int coalSize; + public final int coalCount; + public final int coalMinHeight; + public final int coalMaxHeight; + public final int ironSize; + public final int ironCount; + public final int ironMinHeight; + public final int ironMaxHeight; + public final int goldSize; + public final int goldCount; + public final int goldMinHeight; + public final int goldMaxHeight; + public final int redstoneSize; + public final int redstoneCount; + public final int redstoneMinHeight; + public final int redstoneMaxHeight; + public final int diamondSize; + public final int diamondCount; + public final int diamondMinHeight; + public final int diamondMaxHeight; + public final int lapisSize; + public final int lapisCount; + public final int lapisCenterHeight; + public final int lapisSpread; + + private ChunkProviderSettings(ChunkProviderSettings.Factory settingsFactory) { + this.coordinateScale = settingsFactory.coordinateScale; + this.heightScale = settingsFactory.heightScale; + this.upperLimitScale = settingsFactory.upperLimitScale; + this.lowerLimitScale = settingsFactory.lowerLimitScale; + this.depthNoiseScaleX = settingsFactory.depthNoiseScaleX; + this.depthNoiseScaleZ = settingsFactory.depthNoiseScaleZ; + this.depthNoiseScaleExponent = settingsFactory.depthNoiseScaleExponent; + this.mainNoiseScaleX = settingsFactory.mainNoiseScaleX; + this.mainNoiseScaleY = settingsFactory.mainNoiseScaleY; + this.mainNoiseScaleZ = settingsFactory.mainNoiseScaleZ; + this.baseSize = settingsFactory.baseSize; + this.stretchY = settingsFactory.stretchY; + this.biomeDepthWeight = settingsFactory.biomeDepthWeight; + this.biomeDepthOffSet = settingsFactory.biomeDepthOffset; + this.biomeScaleWeight = settingsFactory.biomeScaleWeight; + this.biomeScaleOffset = settingsFactory.biomeScaleOffset; + this.seaLevel = settingsFactory.seaLevel; + this.useCaves = settingsFactory.useCaves; + this.useDungeons = settingsFactory.useDungeons; + this.dungeonChance = settingsFactory.dungeonChance; + this.useStrongholds = settingsFactory.useStrongholds; + this.useVillages = settingsFactory.useVillages; + this.useMineShafts = settingsFactory.useMineShafts; + this.useTemples = settingsFactory.useTemples; + this.useMonuments = settingsFactory.useMonuments; + this.useRavines = settingsFactory.useRavines; + this.useWaterLakes = settingsFactory.useWaterLakes; + this.waterLakeChance = settingsFactory.waterLakeChance; + this.useLavaLakes = settingsFactory.useLavaLakes; + this.lavaLakeChance = settingsFactory.lavaLakeChance; + this.useLavaOceans = settingsFactory.useLavaOceans; + this.fixedBiome = settingsFactory.fixedBiome; + this.biomeSize = settingsFactory.biomeSize; + this.riverSize = settingsFactory.riverSize; + this.dirtSize = settingsFactory.dirtSize; + this.dirtCount = settingsFactory.dirtCount; + this.dirtMinHeight = settingsFactory.dirtMinHeight; + this.dirtMaxHeight = settingsFactory.dirtMaxHeight; + this.gravelSize = settingsFactory.gravelSize; + this.gravelCount = settingsFactory.gravelCount; + this.gravelMinHeight = settingsFactory.gravelMinHeight; + this.gravelMaxHeight = settingsFactory.gravelMaxHeight; + this.graniteSize = settingsFactory.graniteSize; + this.graniteCount = settingsFactory.graniteCount; + this.graniteMinHeight = settingsFactory.graniteMinHeight; + this.graniteMaxHeight = settingsFactory.graniteMaxHeight; + this.dioriteSize = settingsFactory.dioriteSize; + this.dioriteCount = settingsFactory.dioriteCount; + this.dioriteMinHeight = settingsFactory.dioriteMinHeight; + this.dioriteMaxHeight = settingsFactory.dioriteMaxHeight; + this.andesiteSize = settingsFactory.andesiteSize; + this.andesiteCount = settingsFactory.andesiteCount; + this.andesiteMinHeight = settingsFactory.andesiteMinHeight; + this.andesiteMaxHeight = settingsFactory.andesiteMaxHeight; + this.coalSize = settingsFactory.coalSize; + this.coalCount = settingsFactory.coalCount; + this.coalMinHeight = settingsFactory.coalMinHeight; + this.coalMaxHeight = settingsFactory.coalMaxHeight; + this.ironSize = settingsFactory.ironSize; + this.ironCount = settingsFactory.ironCount; + this.ironMinHeight = settingsFactory.ironMinHeight; + this.ironMaxHeight = settingsFactory.ironMaxHeight; + this.goldSize = settingsFactory.goldSize; + this.goldCount = settingsFactory.goldCount; + this.goldMinHeight = settingsFactory.goldMinHeight; + this.goldMaxHeight = settingsFactory.goldMaxHeight; + this.redstoneSize = settingsFactory.redstoneSize; + this.redstoneCount = settingsFactory.redstoneCount; + this.redstoneMinHeight = settingsFactory.redstoneMinHeight; + this.redstoneMaxHeight = settingsFactory.redstoneMaxHeight; + this.diamondSize = settingsFactory.diamondSize; + this.diamondCount = settingsFactory.diamondCount; + this.diamondMinHeight = settingsFactory.diamondMinHeight; + this.diamondMaxHeight = settingsFactory.diamondMaxHeight; + this.lapisSize = settingsFactory.lapisSize; + this.lapisCount = settingsFactory.lapisCount; + this.lapisCenterHeight = settingsFactory.lapisCenterHeight; + this.lapisSpread = settingsFactory.lapisSpread; + } + + public static class Factory { + public float coordinateScale = 684.412F; + public float heightScale = 684.412F; + public float upperLimitScale = 512.0F; + public float lowerLimitScale = 512.0F; + public float depthNoiseScaleX = 200.0F; + public float depthNoiseScaleZ = 200.0F; + public float depthNoiseScaleExponent = 0.5F; + public float mainNoiseScaleX = 80.0F; + public float mainNoiseScaleY = 160.0F; + public float mainNoiseScaleZ = 80.0F; + public float baseSize = 8.5F; + public float stretchY = 12.0F; + public float biomeDepthWeight = 1.0F; + public float biomeDepthOffset = 0.0F; + public float biomeScaleWeight = 1.0F; + public float biomeScaleOffset = 0.0F; + public int seaLevel = 63; + public boolean useCaves = true; + public boolean useDungeons = true; + public int dungeonChance = 8; + public boolean useStrongholds = true; + public boolean useVillages = true; + public boolean useMineShafts = true; + public boolean useTemples = true; + public boolean useMonuments = true; + public boolean useRavines = true; + public boolean useWaterLakes = true; + public int waterLakeChance = 4; + public boolean useLavaLakes = true; + public int lavaLakeChance = 80; + public boolean useLavaOceans = false; + public int fixedBiome = -1; + public int biomeSize = 4; + public int riverSize = 4; + public int dirtSize = 33; + public int dirtCount = 10; + public int dirtMinHeight = 0; + public int dirtMaxHeight = 256; + public int gravelSize = 33; + public int gravelCount = 8; + public int gravelMinHeight = 0; + public int gravelMaxHeight = 256; + public int graniteSize = 33; + public int graniteCount = 10; + public int graniteMinHeight = 0; + public int graniteMaxHeight = 80; + public int dioriteSize = 33; + public int dioriteCount = 10; + public int dioriteMinHeight = 0; + public int dioriteMaxHeight = 80; + public int andesiteSize = 33; + public int andesiteCount = 10; + public int andesiteMinHeight = 0; + public int andesiteMaxHeight = 80; + public int coalSize = 17; + public int coalCount = 20; + public int coalMinHeight = 0; + public int coalMaxHeight = 128; + public int ironSize = 9; + public int ironCount = 20; + public int ironMinHeight = 0; + public int ironMaxHeight = 64; + public int goldSize = 9; + public int goldCount = 2; + public int goldMinHeight = 0; + public int goldMaxHeight = 32; + public int redstoneSize = 8; + public int redstoneCount = 8; + public int redstoneMinHeight = 0; + public int redstoneMaxHeight = 16; + public int diamondSize = 8; + public int diamondCount = 1; + public int diamondMinHeight = 0; + public int diamondMaxHeight = 16; + public int lapisSize = 7; + public int lapisCount = 1; + public int lapisCenterHeight = 16; + public int lapisSpread = 16; + + public static ChunkProviderSettings.Factory jsonToFactory(String parString1) { + if (parString1.length() == 0) { + return new ChunkProviderSettings.Factory(); + } else { + try { + return JSONTypeProvider.deserialize(parString1, ChunkProviderSettings.Factory.class); + } catch (Exception var2) { + return new ChunkProviderSettings.Factory(); + } + } + } + + public String toString() { + return JSONTypeProvider.serialize(this).toString(); + } + + public Factory() { + this.func_177863_a(); + } + + public void func_177863_a() { + this.coordinateScale = 684.412F; + this.heightScale = 684.412F; + this.upperLimitScale = 512.0F; + this.lowerLimitScale = 512.0F; + this.depthNoiseScaleX = 200.0F; + this.depthNoiseScaleZ = 200.0F; + this.depthNoiseScaleExponent = 0.5F; + this.mainNoiseScaleX = 80.0F; + this.mainNoiseScaleY = 160.0F; + this.mainNoiseScaleZ = 80.0F; + this.baseSize = 8.5F; + this.stretchY = 12.0F; + this.biomeDepthWeight = 1.0F; + this.biomeDepthOffset = 0.0F; + this.biomeScaleWeight = 1.0F; + this.biomeScaleOffset = 0.0F; + this.seaLevel = 63; + this.useCaves = true; + this.useDungeons = true; + this.dungeonChance = 8; + this.useStrongholds = true; + this.useVillages = true; + this.useMineShafts = true; + this.useTemples = true; + this.useMonuments = true; + this.useRavines = true; + this.useWaterLakes = true; + this.waterLakeChance = 4; + this.useLavaLakes = true; + this.lavaLakeChance = 80; + this.useLavaOceans = false; + this.fixedBiome = -1; + this.biomeSize = 4; + this.riverSize = 4; + this.dirtSize = 33; + this.dirtCount = 10; + this.dirtMinHeight = 0; + this.dirtMaxHeight = 256; + this.gravelSize = 33; + this.gravelCount = 8; + this.gravelMinHeight = 0; + this.gravelMaxHeight = 256; + this.graniteSize = 33; + this.graniteCount = 10; + this.graniteMinHeight = 0; + this.graniteMaxHeight = 80; + this.dioriteSize = 33; + this.dioriteCount = 10; + this.dioriteMinHeight = 0; + this.dioriteMaxHeight = 80; + this.andesiteSize = 33; + this.andesiteCount = 10; + this.andesiteMinHeight = 0; + this.andesiteMaxHeight = 80; + this.coalSize = 17; + this.coalCount = 20; + this.coalMinHeight = 0; + this.coalMaxHeight = 128; + this.ironSize = 9; + this.ironCount = 20; + this.ironMinHeight = 0; + this.ironMaxHeight = 64; + this.goldSize = 9; + this.goldCount = 2; + this.goldMinHeight = 0; + this.goldMaxHeight = 32; + this.redstoneSize = 8; + this.redstoneCount = 8; + this.redstoneMinHeight = 0; + this.redstoneMaxHeight = 16; + this.diamondSize = 8; + this.diamondCount = 1; + this.diamondMinHeight = 0; + this.diamondMaxHeight = 16; + this.lapisSize = 7; + this.lapisCount = 1; + this.lapisCenterHeight = 16; + this.lapisSpread = 16; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + ChunkProviderSettings.Factory chunkprovidersettings$factory = (ChunkProviderSettings.Factory) object; + return this.andesiteCount != chunkprovidersettings$factory.andesiteCount ? false + : (this.andesiteMaxHeight != chunkprovidersettings$factory.andesiteMaxHeight ? false + : (this.andesiteMinHeight != chunkprovidersettings$factory.andesiteMinHeight ? false + : (this.andesiteSize != chunkprovidersettings$factory.andesiteSize ? false + : (Float.compare(chunkprovidersettings$factory.baseSize, + this.baseSize) != 0 ? false + : (Float.compare( + chunkprovidersettings$factory.biomeDepthOffset, + this.biomeDepthOffset) != 0 ? false + : (Float.compare( + chunkprovidersettings$factory.biomeDepthWeight, + this.biomeDepthWeight) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.biomeScaleOffset, + this.biomeScaleOffset) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.biomeScaleWeight, + this.biomeScaleWeight) != 0 + ? false + : (this.biomeSize != chunkprovidersettings$factory.biomeSize + ? false + : (this.coalCount != chunkprovidersettings$factory.coalCount + ? false + : (this.coalMaxHeight != chunkprovidersettings$factory.coalMaxHeight + ? false + : (this.coalMinHeight != chunkprovidersettings$factory.coalMinHeight + ? false + : (this.coalSize != chunkprovidersettings$factory.coalSize + ? false + : (Float.compare( + chunkprovidersettings$factory.coordinateScale, + this.coordinateScale) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.depthNoiseScaleExponent, + this.depthNoiseScaleExponent) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.depthNoiseScaleX, + this.depthNoiseScaleX) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.depthNoiseScaleZ, + this.depthNoiseScaleZ) != 0 + ? false + : (this.diamondCount != chunkprovidersettings$factory.diamondCount + ? false + : (this.diamondMaxHeight != chunkprovidersettings$factory.diamondMaxHeight + ? false + : (this.diamondMinHeight != chunkprovidersettings$factory.diamondMinHeight + ? false + : (this.diamondSize != chunkprovidersettings$factory.diamondSize + ? false + : (this.dioriteCount != chunkprovidersettings$factory.dioriteCount + ? false + : (this.dioriteMaxHeight != chunkprovidersettings$factory.dioriteMaxHeight + ? false + : (this.dioriteMinHeight != chunkprovidersettings$factory.dioriteMinHeight + ? false + : (this.dioriteSize != chunkprovidersettings$factory.dioriteSize + ? false + : (this.dirtCount != chunkprovidersettings$factory.dirtCount + ? false + : (this.dirtMaxHeight != chunkprovidersettings$factory.dirtMaxHeight + ? false + : (this.dirtMinHeight != chunkprovidersettings$factory.dirtMinHeight + ? false + : (this.dirtSize != chunkprovidersettings$factory.dirtSize + ? false + : (this.dungeonChance != chunkprovidersettings$factory.dungeonChance + ? false + : (this.fixedBiome != chunkprovidersettings$factory.fixedBiome + ? false + : (this.goldCount != chunkprovidersettings$factory.goldCount + ? false + : (this.goldMaxHeight != chunkprovidersettings$factory.goldMaxHeight + ? false + : (this.goldMinHeight != chunkprovidersettings$factory.goldMinHeight + ? false + : (this.goldSize != chunkprovidersettings$factory.goldSize + ? false + : (this.graniteCount != chunkprovidersettings$factory.graniteCount + ? false + : (this.graniteMaxHeight != chunkprovidersettings$factory.graniteMaxHeight + ? false + : (this.graniteMinHeight != chunkprovidersettings$factory.graniteMinHeight + ? false + : (this.graniteSize != chunkprovidersettings$factory.graniteSize + ? false + : (this.gravelCount != chunkprovidersettings$factory.gravelCount + ? false + : (this.gravelMaxHeight != chunkprovidersettings$factory.gravelMaxHeight + ? false + : (this.gravelMinHeight != chunkprovidersettings$factory.gravelMinHeight + ? false + : (this.gravelSize != chunkprovidersettings$factory.gravelSize + ? false + : (Float.compare( + chunkprovidersettings$factory.heightScale, + this.heightScale) != 0 + ? false + : (this.ironCount != chunkprovidersettings$factory.ironCount + ? false + : (this.ironMaxHeight != chunkprovidersettings$factory.ironMaxHeight + ? false + : (this.ironMinHeight != chunkprovidersettings$factory.ironMinHeight + ? false + : (this.ironSize != chunkprovidersettings$factory.ironSize + ? false + : (this.lapisCenterHeight != chunkprovidersettings$factory.lapisCenterHeight + ? false + : (this.lapisCount != chunkprovidersettings$factory.lapisCount + ? false + : (this.lapisSize != chunkprovidersettings$factory.lapisSize + ? false + : (this.lapisSpread != chunkprovidersettings$factory.lapisSpread + ? false + : (this.lavaLakeChance != chunkprovidersettings$factory.lavaLakeChance + ? false + : (Float.compare( + chunkprovidersettings$factory.lowerLimitScale, + this.lowerLimitScale) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.mainNoiseScaleX, + this.mainNoiseScaleX) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.mainNoiseScaleY, + this.mainNoiseScaleY) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.mainNoiseScaleZ, + this.mainNoiseScaleZ) != 0 + ? false + : (this.redstoneCount != chunkprovidersettings$factory.redstoneCount + ? false + : (this.redstoneMaxHeight != chunkprovidersettings$factory.redstoneMaxHeight + ? false + : (this.redstoneMinHeight != chunkprovidersettings$factory.redstoneMinHeight + ? false + : (this.redstoneSize != chunkprovidersettings$factory.redstoneSize + ? false + : (this.riverSize != chunkprovidersettings$factory.riverSize + ? false + : (this.seaLevel != chunkprovidersettings$factory.seaLevel + ? false + : (Float.compare( + chunkprovidersettings$factory.stretchY, + this.stretchY) != 0 + ? false + : (Float.compare( + chunkprovidersettings$factory.upperLimitScale, + this.upperLimitScale) != 0 + ? false + : (this.useCaves != chunkprovidersettings$factory.useCaves + ? false + : (this.useDungeons != chunkprovidersettings$factory.useDungeons + ? false + : (this.useLavaLakes != chunkprovidersettings$factory.useLavaLakes + ? false + : (this.useLavaOceans != chunkprovidersettings$factory.useLavaOceans + ? false + : (this.useMineShafts != chunkprovidersettings$factory.useMineShafts + ? false + : (this.useRavines != chunkprovidersettings$factory.useRavines + ? false + : (this.useStrongholds != chunkprovidersettings$factory.useStrongholds + ? false + : (this.useTemples != chunkprovidersettings$factory.useTemples + ? false + : (this.useMonuments != chunkprovidersettings$factory.useMonuments + ? false + : (this.useVillages != chunkprovidersettings$factory.useVillages + ? false + : (this.useWaterLakes != chunkprovidersettings$factory.useWaterLakes + ? false + : this.waterLakeChance == chunkprovidersettings$factory.waterLakeChance)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); + } else { + return false; + } + } + + public int hashCode() { + int i = this.coordinateScale != 0.0F ? Float.floatToIntBits(this.coordinateScale) : 0; + i = 31 * i + (this.heightScale != 0.0F ? Float.floatToIntBits(this.heightScale) : 0); + i = 31 * i + (this.upperLimitScale != 0.0F ? Float.floatToIntBits(this.upperLimitScale) : 0); + i = 31 * i + (this.lowerLimitScale != 0.0F ? Float.floatToIntBits(this.lowerLimitScale) : 0); + i = 31 * i + (this.depthNoiseScaleX != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleX) : 0); + i = 31 * i + (this.depthNoiseScaleZ != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleZ) : 0); + i = 31 * i + + (this.depthNoiseScaleExponent != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleExponent) : 0); + i = 31 * i + (this.mainNoiseScaleX != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleX) : 0); + i = 31 * i + (this.mainNoiseScaleY != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleY) : 0); + i = 31 * i + (this.mainNoiseScaleZ != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleZ) : 0); + i = 31 * i + (this.baseSize != 0.0F ? Float.floatToIntBits(this.baseSize) : 0); + i = 31 * i + (this.stretchY != 0.0F ? Float.floatToIntBits(this.stretchY) : 0); + i = 31 * i + (this.biomeDepthWeight != 0.0F ? Float.floatToIntBits(this.biomeDepthWeight) : 0); + i = 31 * i + (this.biomeDepthOffset != 0.0F ? Float.floatToIntBits(this.biomeDepthOffset) : 0); + i = 31 * i + (this.biomeScaleWeight != 0.0F ? Float.floatToIntBits(this.biomeScaleWeight) : 0); + i = 31 * i + (this.biomeScaleOffset != 0.0F ? Float.floatToIntBits(this.biomeScaleOffset) : 0); + i = 31 * i + this.seaLevel; + i = 31 * i + (this.useCaves ? 1 : 0); + i = 31 * i + (this.useDungeons ? 1 : 0); + i = 31 * i + this.dungeonChance; + i = 31 * i + (this.useStrongholds ? 1 : 0); + i = 31 * i + (this.useVillages ? 1 : 0); + i = 31 * i + (this.useMineShafts ? 1 : 0); + i = 31 * i + (this.useTemples ? 1 : 0); + i = 31 * i + (this.useMonuments ? 1 : 0); + i = 31 * i + (this.useRavines ? 1 : 0); + i = 31 * i + (this.useWaterLakes ? 1 : 0); + i = 31 * i + this.waterLakeChance; + i = 31 * i + (this.useLavaLakes ? 1 : 0); + i = 31 * i + this.lavaLakeChance; + i = 31 * i + (this.useLavaOceans ? 1 : 0); + i = 31 * i + this.fixedBiome; + i = 31 * i + this.biomeSize; + i = 31 * i + this.riverSize; + i = 31 * i + this.dirtSize; + i = 31 * i + this.dirtCount; + i = 31 * i + this.dirtMinHeight; + i = 31 * i + this.dirtMaxHeight; + i = 31 * i + this.gravelSize; + i = 31 * i + this.gravelCount; + i = 31 * i + this.gravelMinHeight; + i = 31 * i + this.gravelMaxHeight; + i = 31 * i + this.graniteSize; + i = 31 * i + this.graniteCount; + i = 31 * i + this.graniteMinHeight; + i = 31 * i + this.graniteMaxHeight; + i = 31 * i + this.dioriteSize; + i = 31 * i + this.dioriteCount; + i = 31 * i + this.dioriteMinHeight; + i = 31 * i + this.dioriteMaxHeight; + i = 31 * i + this.andesiteSize; + i = 31 * i + this.andesiteCount; + i = 31 * i + this.andesiteMinHeight; + i = 31 * i + this.andesiteMaxHeight; + i = 31 * i + this.coalSize; + i = 31 * i + this.coalCount; + i = 31 * i + this.coalMinHeight; + i = 31 * i + this.coalMaxHeight; + i = 31 * i + this.ironSize; + i = 31 * i + this.ironCount; + i = 31 * i + this.ironMinHeight; + i = 31 * i + this.ironMaxHeight; + i = 31 * i + this.goldSize; + i = 31 * i + this.goldCount; + i = 31 * i + this.goldMinHeight; + i = 31 * i + this.goldMaxHeight; + i = 31 * i + this.redstoneSize; + i = 31 * i + this.redstoneCount; + i = 31 * i + this.redstoneMinHeight; + i = 31 * i + this.redstoneMaxHeight; + i = 31 * i + this.diamondSize; + i = 31 * i + this.diamondCount; + i = 31 * i + this.diamondMinHeight; + i = 31 * i + this.diamondMaxHeight; + i = 31 * i + this.lapisSize; + i = 31 * i + this.lapisCount; + i = 31 * i + this.lapisCenterHeight; + i = 31 * i + this.lapisSpread; + return i; + } + + public ChunkProviderSettings func_177864_b() { + return new ChunkProviderSettings(this); + } + } + + public static class Serializer implements JSONTypeCodec { + public ChunkProviderSettings.Factory deserialize(JSONObject jsonobject) throws JSONException { + ChunkProviderSettings.Factory chunkprovidersettings$factory = new ChunkProviderSettings.Factory(); + + try { + chunkprovidersettings$factory.coordinateScale = jsonobject.optFloat("coordinateScale", + chunkprovidersettings$factory.coordinateScale); + chunkprovidersettings$factory.heightScale = jsonobject.optFloat("heightScale", + chunkprovidersettings$factory.heightScale); + chunkprovidersettings$factory.lowerLimitScale = jsonobject.optFloat("lowerLimitScale", + chunkprovidersettings$factory.lowerLimitScale); + chunkprovidersettings$factory.upperLimitScale = jsonobject.optFloat("upperLimitScale", + chunkprovidersettings$factory.upperLimitScale); + chunkprovidersettings$factory.depthNoiseScaleX = jsonobject.optFloat("depthNoiseScaleX", + chunkprovidersettings$factory.depthNoiseScaleX); + chunkprovidersettings$factory.depthNoiseScaleZ = jsonobject.optFloat("depthNoiseScaleZ", + chunkprovidersettings$factory.depthNoiseScaleZ); + chunkprovidersettings$factory.depthNoiseScaleExponent = jsonobject.optFloat("depthNoiseScaleExponent", + chunkprovidersettings$factory.depthNoiseScaleExponent); + chunkprovidersettings$factory.mainNoiseScaleX = jsonobject.optFloat("mainNoiseScaleX", + chunkprovidersettings$factory.mainNoiseScaleX); + chunkprovidersettings$factory.mainNoiseScaleY = jsonobject.optFloat("mainNoiseScaleY", + chunkprovidersettings$factory.mainNoiseScaleY); + chunkprovidersettings$factory.mainNoiseScaleZ = jsonobject.optFloat("mainNoiseScaleZ", + chunkprovidersettings$factory.mainNoiseScaleZ); + chunkprovidersettings$factory.baseSize = jsonobject.optFloat("baseSize", + chunkprovidersettings$factory.baseSize); + chunkprovidersettings$factory.stretchY = jsonobject.optFloat("stretchY", + chunkprovidersettings$factory.stretchY); + chunkprovidersettings$factory.biomeDepthWeight = jsonobject.optFloat("biomeDepthWeight", + chunkprovidersettings$factory.biomeDepthWeight); + chunkprovidersettings$factory.biomeDepthOffset = jsonobject.optFloat("biomeDepthOffset", + chunkprovidersettings$factory.biomeDepthOffset); + chunkprovidersettings$factory.biomeScaleWeight = jsonobject.optFloat("biomeScaleWeight", + chunkprovidersettings$factory.biomeScaleWeight); + chunkprovidersettings$factory.biomeScaleOffset = jsonobject.optFloat("biomeScaleOffset", + chunkprovidersettings$factory.biomeScaleOffset); + chunkprovidersettings$factory.seaLevel = jsonobject.optInt("seaLevel", + chunkprovidersettings$factory.seaLevel); + chunkprovidersettings$factory.useCaves = jsonobject.optBoolean("useCaves", + chunkprovidersettings$factory.useCaves); + chunkprovidersettings$factory.useDungeons = jsonobject.optBoolean("useDungeons", + chunkprovidersettings$factory.useDungeons); + chunkprovidersettings$factory.dungeonChance = jsonobject.optInt("dungeonChance", + chunkprovidersettings$factory.dungeonChance); + chunkprovidersettings$factory.useStrongholds = jsonobject.optBoolean("useStrongholds", + chunkprovidersettings$factory.useStrongholds); + chunkprovidersettings$factory.useVillages = jsonobject.optBoolean("useVillages", + chunkprovidersettings$factory.useVillages); + chunkprovidersettings$factory.useMineShafts = jsonobject.optBoolean("useMineShafts", + chunkprovidersettings$factory.useMineShafts); + chunkprovidersettings$factory.useTemples = jsonobject.optBoolean("useTemples", + chunkprovidersettings$factory.useTemples); + chunkprovidersettings$factory.useMonuments = jsonobject.optBoolean("useMonuments", + chunkprovidersettings$factory.useMonuments); + chunkprovidersettings$factory.useRavines = jsonobject.optBoolean("useRavines", + chunkprovidersettings$factory.useRavines); + chunkprovidersettings$factory.useWaterLakes = jsonobject.optBoolean("useWaterLakes", + chunkprovidersettings$factory.useWaterLakes); + chunkprovidersettings$factory.waterLakeChance = jsonobject.optInt("waterLakeChance", + chunkprovidersettings$factory.waterLakeChance); + chunkprovidersettings$factory.useLavaLakes = jsonobject.optBoolean("useLavaLakes", + chunkprovidersettings$factory.useLavaLakes); + chunkprovidersettings$factory.lavaLakeChance = jsonobject.optInt("lavaLakeChance", + chunkprovidersettings$factory.lavaLakeChance); + chunkprovidersettings$factory.useLavaOceans = jsonobject.optBoolean("useLavaOceans", + chunkprovidersettings$factory.useLavaOceans); + chunkprovidersettings$factory.fixedBiome = jsonobject.optInt("fixedBiome", + chunkprovidersettings$factory.fixedBiome); + if (chunkprovidersettings$factory.fixedBiome < 38 && chunkprovidersettings$factory.fixedBiome >= -1) { + if (chunkprovidersettings$factory.fixedBiome >= BiomeGenBase.hell.biomeID) { + chunkprovidersettings$factory.fixedBiome += 2; + } + } else { + chunkprovidersettings$factory.fixedBiome = -1; + } + + chunkprovidersettings$factory.biomeSize = jsonobject.optInt("biomeSize", + chunkprovidersettings$factory.biomeSize); + chunkprovidersettings$factory.riverSize = jsonobject.optInt("riverSize", + chunkprovidersettings$factory.riverSize); + chunkprovidersettings$factory.dirtSize = jsonobject.optInt("dirtSize", + chunkprovidersettings$factory.dirtSize); + chunkprovidersettings$factory.dirtCount = jsonobject.optInt("dirtCount", + chunkprovidersettings$factory.dirtCount); + chunkprovidersettings$factory.dirtMinHeight = jsonobject.optInt("dirtMinHeight", + chunkprovidersettings$factory.dirtMinHeight); + chunkprovidersettings$factory.dirtMaxHeight = jsonobject.optInt("dirtMaxHeight", + chunkprovidersettings$factory.dirtMaxHeight); + chunkprovidersettings$factory.gravelSize = jsonobject.optInt("gravelSize", + chunkprovidersettings$factory.gravelSize); + chunkprovidersettings$factory.gravelCount = jsonobject.optInt("gravelCount", + chunkprovidersettings$factory.gravelCount); + chunkprovidersettings$factory.gravelMinHeight = jsonobject.optInt("gravelMinHeight", + chunkprovidersettings$factory.gravelMinHeight); + chunkprovidersettings$factory.gravelMaxHeight = jsonobject.optInt("gravelMaxHeight", + chunkprovidersettings$factory.gravelMaxHeight); + chunkprovidersettings$factory.graniteSize = jsonobject.optInt("graniteSize", + chunkprovidersettings$factory.graniteSize); + chunkprovidersettings$factory.graniteCount = jsonobject.optInt("graniteCount", + chunkprovidersettings$factory.graniteCount); + chunkprovidersettings$factory.graniteMinHeight = jsonobject.optInt("graniteMinHeight", + chunkprovidersettings$factory.graniteMinHeight); + chunkprovidersettings$factory.graniteMaxHeight = jsonobject.optInt("graniteMaxHeight", + chunkprovidersettings$factory.graniteMaxHeight); + chunkprovidersettings$factory.dioriteSize = jsonobject.optInt("dioriteSize", + chunkprovidersettings$factory.dioriteSize); + chunkprovidersettings$factory.dioriteCount = jsonobject.optInt("dioriteCount", + chunkprovidersettings$factory.dioriteCount); + chunkprovidersettings$factory.dioriteMinHeight = jsonobject.optInt("dioriteMinHeight", + chunkprovidersettings$factory.dioriteMinHeight); + chunkprovidersettings$factory.dioriteMaxHeight = jsonobject.optInt("dioriteMaxHeight", + chunkprovidersettings$factory.dioriteMaxHeight); + chunkprovidersettings$factory.andesiteSize = jsonobject.optInt("andesiteSize", + chunkprovidersettings$factory.andesiteSize); + chunkprovidersettings$factory.andesiteCount = jsonobject.optInt("andesiteCount", + chunkprovidersettings$factory.andesiteCount); + chunkprovidersettings$factory.andesiteMinHeight = jsonobject.optInt("andesiteMinHeight", + chunkprovidersettings$factory.andesiteMinHeight); + chunkprovidersettings$factory.andesiteMaxHeight = jsonobject.optInt("andesiteMaxHeight", + chunkprovidersettings$factory.andesiteMaxHeight); + chunkprovidersettings$factory.coalSize = jsonobject.optInt("coalSize", + chunkprovidersettings$factory.coalSize); + chunkprovidersettings$factory.coalCount = jsonobject.optInt("coalCount", + chunkprovidersettings$factory.coalCount); + chunkprovidersettings$factory.coalMinHeight = jsonobject.optInt("coalMinHeight", + chunkprovidersettings$factory.coalMinHeight); + chunkprovidersettings$factory.coalMaxHeight = jsonobject.optInt("coalMaxHeight", + chunkprovidersettings$factory.coalMaxHeight); + chunkprovidersettings$factory.ironSize = jsonobject.optInt("ironSize", + chunkprovidersettings$factory.ironSize); + chunkprovidersettings$factory.ironCount = jsonobject.optInt("ironCount", + chunkprovidersettings$factory.ironCount); + chunkprovidersettings$factory.ironMinHeight = jsonobject.optInt("ironMinHeight", + chunkprovidersettings$factory.ironMinHeight); + chunkprovidersettings$factory.ironMaxHeight = jsonobject.optInt("ironMaxHeight", + chunkprovidersettings$factory.ironMaxHeight); + chunkprovidersettings$factory.goldSize = jsonobject.optInt("goldSize", + chunkprovidersettings$factory.goldSize); + chunkprovidersettings$factory.goldCount = jsonobject.optInt("goldCount", + chunkprovidersettings$factory.goldCount); + chunkprovidersettings$factory.goldMinHeight = jsonobject.optInt("goldMinHeight", + chunkprovidersettings$factory.goldMinHeight); + chunkprovidersettings$factory.goldMaxHeight = jsonobject.optInt("goldMaxHeight", + chunkprovidersettings$factory.goldMaxHeight); + chunkprovidersettings$factory.redstoneSize = jsonobject.optInt("redstoneSize", + chunkprovidersettings$factory.redstoneSize); + chunkprovidersettings$factory.redstoneCount = jsonobject.optInt("redstoneCount", + chunkprovidersettings$factory.redstoneCount); + chunkprovidersettings$factory.redstoneMinHeight = jsonobject.optInt("redstoneMinHeight", + chunkprovidersettings$factory.redstoneMinHeight); + chunkprovidersettings$factory.redstoneMaxHeight = jsonobject.optInt("redstoneMaxHeight", + chunkprovidersettings$factory.redstoneMaxHeight); + chunkprovidersettings$factory.diamondSize = jsonobject.optInt("diamondSize", + chunkprovidersettings$factory.diamondSize); + chunkprovidersettings$factory.diamondCount = jsonobject.optInt("diamondCount", + chunkprovidersettings$factory.diamondCount); + chunkprovidersettings$factory.diamondMinHeight = jsonobject.optInt("diamondMinHeight", + chunkprovidersettings$factory.diamondMinHeight); + chunkprovidersettings$factory.diamondMaxHeight = jsonobject.optInt("diamondMaxHeight", + chunkprovidersettings$factory.diamondMaxHeight); + chunkprovidersettings$factory.lapisSize = jsonobject.optInt("lapisSize", + chunkprovidersettings$factory.lapisSize); + chunkprovidersettings$factory.lapisCount = jsonobject.optInt("lapisCount", + chunkprovidersettings$factory.lapisCount); + chunkprovidersettings$factory.lapisCenterHeight = jsonobject.optInt("lapisCenterHeight", + chunkprovidersettings$factory.lapisCenterHeight); + chunkprovidersettings$factory.lapisSpread = jsonobject.optInt("lapisSpread", + chunkprovidersettings$factory.lapisSpread); + } catch (Exception var7) { + ; + } + + return chunkprovidersettings$factory; + } + + public JSONObject serialize(ChunkProviderSettings.Factory parFactory) throws JSONException { + JSONObject jsonobject = new JSONObject(); + jsonobject.put("coordinateScale", Float.valueOf(parFactory.coordinateScale)); + jsonobject.put("heightScale", Float.valueOf(parFactory.heightScale)); + jsonobject.put("lowerLimitScale", Float.valueOf(parFactory.lowerLimitScale)); + jsonobject.put("upperLimitScale", Float.valueOf(parFactory.upperLimitScale)); + jsonobject.put("depthNoiseScaleX", Float.valueOf(parFactory.depthNoiseScaleX)); + jsonobject.put("depthNoiseScaleZ", Float.valueOf(parFactory.depthNoiseScaleZ)); + jsonobject.put("depthNoiseScaleExponent", Float.valueOf(parFactory.depthNoiseScaleExponent)); + jsonobject.put("mainNoiseScaleX", Float.valueOf(parFactory.mainNoiseScaleX)); + jsonobject.put("mainNoiseScaleY", Float.valueOf(parFactory.mainNoiseScaleY)); + jsonobject.put("mainNoiseScaleZ", Float.valueOf(parFactory.mainNoiseScaleZ)); + jsonobject.put("baseSize", Float.valueOf(parFactory.baseSize)); + jsonobject.put("stretchY", Float.valueOf(parFactory.stretchY)); + jsonobject.put("biomeDepthWeight", Float.valueOf(parFactory.biomeDepthWeight)); + jsonobject.put("biomeDepthOffset", Float.valueOf(parFactory.biomeDepthOffset)); + jsonobject.put("biomeScaleWeight", Float.valueOf(parFactory.biomeScaleWeight)); + jsonobject.put("biomeScaleOffset", Float.valueOf(parFactory.biomeScaleOffset)); + jsonobject.put("seaLevel", Integer.valueOf(parFactory.seaLevel)); + jsonobject.put("useCaves", Boolean.valueOf(parFactory.useCaves)); + jsonobject.put("useDungeons", Boolean.valueOf(parFactory.useDungeons)); + jsonobject.put("dungeonChance", Integer.valueOf(parFactory.dungeonChance)); + jsonobject.put("useStrongholds", Boolean.valueOf(parFactory.useStrongholds)); + jsonobject.put("useVillages", Boolean.valueOf(parFactory.useVillages)); + jsonobject.put("useMineShafts", Boolean.valueOf(parFactory.useMineShafts)); + jsonobject.put("useTemples", Boolean.valueOf(parFactory.useTemples)); + jsonobject.put("useMonuments", Boolean.valueOf(parFactory.useMonuments)); + jsonobject.put("useRavines", Boolean.valueOf(parFactory.useRavines)); + jsonobject.put("useWaterLakes", Boolean.valueOf(parFactory.useWaterLakes)); + jsonobject.put("waterLakeChance", Integer.valueOf(parFactory.waterLakeChance)); + jsonobject.put("useLavaLakes", Boolean.valueOf(parFactory.useLavaLakes)); + jsonobject.put("lavaLakeChance", Integer.valueOf(parFactory.lavaLakeChance)); + jsonobject.put("useLavaOceans", Boolean.valueOf(parFactory.useLavaOceans)); + jsonobject.put("fixedBiome", Integer.valueOf(parFactory.fixedBiome)); + jsonobject.put("biomeSize", Integer.valueOf(parFactory.biomeSize)); + jsonobject.put("riverSize", Integer.valueOf(parFactory.riverSize)); + jsonobject.put("dirtSize", Integer.valueOf(parFactory.dirtSize)); + jsonobject.put("dirtCount", Integer.valueOf(parFactory.dirtCount)); + jsonobject.put("dirtMinHeight", Integer.valueOf(parFactory.dirtMinHeight)); + jsonobject.put("dirtMaxHeight", Integer.valueOf(parFactory.dirtMaxHeight)); + jsonobject.put("gravelSize", Integer.valueOf(parFactory.gravelSize)); + jsonobject.put("gravelCount", Integer.valueOf(parFactory.gravelCount)); + jsonobject.put("gravelMinHeight", Integer.valueOf(parFactory.gravelMinHeight)); + jsonobject.put("gravelMaxHeight", Integer.valueOf(parFactory.gravelMaxHeight)); + jsonobject.put("graniteSize", Integer.valueOf(parFactory.graniteSize)); + jsonobject.put("graniteCount", Integer.valueOf(parFactory.graniteCount)); + jsonobject.put("graniteMinHeight", Integer.valueOf(parFactory.graniteMinHeight)); + jsonobject.put("graniteMaxHeight", Integer.valueOf(parFactory.graniteMaxHeight)); + jsonobject.put("dioriteSize", Integer.valueOf(parFactory.dioriteSize)); + jsonobject.put("dioriteCount", Integer.valueOf(parFactory.dioriteCount)); + jsonobject.put("dioriteMinHeight", Integer.valueOf(parFactory.dioriteMinHeight)); + jsonobject.put("dioriteMaxHeight", Integer.valueOf(parFactory.dioriteMaxHeight)); + jsonobject.put("andesiteSize", Integer.valueOf(parFactory.andesiteSize)); + jsonobject.put("andesiteCount", Integer.valueOf(parFactory.andesiteCount)); + jsonobject.put("andesiteMinHeight", Integer.valueOf(parFactory.andesiteMinHeight)); + jsonobject.put("andesiteMaxHeight", Integer.valueOf(parFactory.andesiteMaxHeight)); + jsonobject.put("coalSize", Integer.valueOf(parFactory.coalSize)); + jsonobject.put("coalCount", Integer.valueOf(parFactory.coalCount)); + jsonobject.put("coalMinHeight", Integer.valueOf(parFactory.coalMinHeight)); + jsonobject.put("coalMaxHeight", Integer.valueOf(parFactory.coalMaxHeight)); + jsonobject.put("ironSize", Integer.valueOf(parFactory.ironSize)); + jsonobject.put("ironCount", Integer.valueOf(parFactory.ironCount)); + jsonobject.put("ironMinHeight", Integer.valueOf(parFactory.ironMinHeight)); + jsonobject.put("ironMaxHeight", Integer.valueOf(parFactory.ironMaxHeight)); + jsonobject.put("goldSize", Integer.valueOf(parFactory.goldSize)); + jsonobject.put("goldCount", Integer.valueOf(parFactory.goldCount)); + jsonobject.put("goldMinHeight", Integer.valueOf(parFactory.goldMinHeight)); + jsonobject.put("goldMaxHeight", Integer.valueOf(parFactory.goldMaxHeight)); + jsonobject.put("redstoneSize", Integer.valueOf(parFactory.redstoneSize)); + jsonobject.put("redstoneCount", Integer.valueOf(parFactory.redstoneCount)); + jsonobject.put("redstoneMinHeight", Integer.valueOf(parFactory.redstoneMinHeight)); + jsonobject.put("redstoneMaxHeight", Integer.valueOf(parFactory.redstoneMaxHeight)); + jsonobject.put("diamondSize", Integer.valueOf(parFactory.diamondSize)); + jsonobject.put("diamondCount", Integer.valueOf(parFactory.diamondCount)); + jsonobject.put("diamondMinHeight", Integer.valueOf(parFactory.diamondMinHeight)); + jsonobject.put("diamondMaxHeight", Integer.valueOf(parFactory.diamondMaxHeight)); + jsonobject.put("lapisSize", Integer.valueOf(parFactory.lapisSize)); + jsonobject.put("lapisCount", Integer.valueOf(parFactory.lapisCount)); + jsonobject.put("lapisCenterHeight", Integer.valueOf(parFactory.lapisCenterHeight)); + jsonobject.put("lapisSpread", Integer.valueOf(parFactory.lapisSpread)); + return jsonobject; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java b/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java index 2355232..763e758 100644 --- a/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java +++ b/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java @@ -21,16 +21,18 @@ import net.minecraft.world.biome.BiomeGenBase; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FlatGeneratorInfo { diff --git a/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java b/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java index 3a85de3..fc81284 100644 --- a/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java +++ b/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java @@ -10,16 +10,18 @@ import net.minecraft.util.ResourceLocation; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 FlatLayerInfo { diff --git a/src/main/java/net/minecraft/world/gen/NoiseGenerator.java b/src/main/java/net/minecraft/world/gen/NoiseGenerator.java index 01d789b..1fb7a2e 100644 --- a/src/main/java/net/minecraft/world/gen/NoiseGenerator.java +++ b/src/main/java/net/minecraft/world/gen/NoiseGenerator.java @@ -1,4 +1,24 @@ package net.minecraft.world.gen; +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 abstract class NoiseGenerator { } \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java b/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java index 610c08c..b274f56 100644 --- a/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java +++ b/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NoiseGeneratorImproved extends NoiseGenerator { diff --git a/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java b/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java index 8e31b27..d710b3b 100644 --- a/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java +++ b/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java @@ -10,16 +10,18 @@ import net.minecraft.util.MathHelper; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NoiseGeneratorOctaves extends NoiseGenerator { diff --git a/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java b/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java index 700ce0c..aeba9ea 100644 --- a/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java +++ b/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NoiseGeneratorPerlin extends NoiseGenerator { diff --git a/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java b/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java index f006fe5..764b817 100644 --- a/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java +++ b/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java @@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 NoiseGeneratorSimplex { diff --git a/src/main/java/net/minecraft/world/storage/IPlayerFileData.java b/src/main/java/net/minecraft/world/storage/IPlayerFileData.java index c5ebff9..0e2c751 100644 --- a/src/main/java/net/minecraft/world/storage/IPlayerFileData.java +++ b/src/main/java/net/minecraft/world/storage/IPlayerFileData.java @@ -9,16 +9,18 @@ import net.minecraft.nbt.NBTTagCompound; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface IPlayerFileData { diff --git a/src/main/java/net/minecraft/world/storage/ISaveFormat.java b/src/main/java/net/minecraft/world/storage/ISaveFormat.java new file mode 100644 index 0000000..c5bf199 --- /dev/null +++ b/src/main/java/net/minecraft/world/storage/ISaveFormat.java @@ -0,0 +1,81 @@ +package net.minecraft.world.storage; + +import java.util.List; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.WorldInfo; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 interface ISaveFormat { + /**+ + * Returns the name of the save format. + */ + String getName(); + + /**+ + * Returns back a loader for the specified save directory + */ + ISaveHandler getSaveLoader(String var1, boolean var2); + + List getSaveList(); + + void flushCache(); + + /**+ + * Returns the world's WorldInfo object + */ + WorldInfo getWorldInfo(String var1); + + boolean func_154335_d(String var1); + + /**+ + * @args: Takes one argument - the name of the directory of the + * world to delete. @desc: Delete the world by deleting the + * associated directory recursively. + */ + boolean deleteWorldDirectory(String var1); + + /**+ + * Renames the world by storing the new name in level.dat. It + * does *not* rename the directory containing the world data. + */ + void renameWorld(String var1, String var2); + + boolean func_154334_a(String var1); + + /**+ + * gets if the map is old chunk saving (true) or McRegion + * (false) + */ + boolean isOldMapFormat(String var1); + + /**+ + * converts the map to mcRegion + */ + boolean convertMapFormat(String var1, IProgressUpdate var2); + + /**+ + * Return whether the given world can be loaded. + */ + boolean canLoadWorld(String var1); +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/storage/ISaveHandler.java b/src/main/java/net/minecraft/world/storage/ISaveHandler.java index a499a4f..226e459 100644 --- a/src/main/java/net/minecraft/world/storage/ISaveHandler.java +++ b/src/main/java/net/minecraft/world/storage/ISaveHandler.java @@ -9,16 +9,18 @@ import net.minecraft.world.MinecraftException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface ISaveHandler { diff --git a/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java b/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java deleted file mode 100644 index 45e3c24..0000000 --- a/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.minecraft.world.storage; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * - */ -public interface IThreadedFileIO { - /**+ - * Returns a boolean stating if the write was unsuccessful. - */ - boolean writeNextIO(); -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/storage/MapData.java b/src/main/java/net/minecraft/world/storage/MapData.java index 9bdb312..972c028 100644 --- a/src/main/java/net/minecraft/world/storage/MapData.java +++ b/src/main/java/net/minecraft/world/storage/MapData.java @@ -25,16 +25,18 @@ import net.minecraft.world.WorldSavedData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MapData extends WorldSavedData { diff --git a/src/main/java/net/minecraft/world/storage/MapStorage.java b/src/main/java/net/minecraft/world/storage/MapStorage.java index 69f167a..638fd6e 100644 --- a/src/main/java/net/minecraft/world/storage/MapStorage.java +++ b/src/main/java/net/minecraft/world/storage/MapStorage.java @@ -14,16 +14,18 @@ import net.minecraft.world.WorldSavedData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MapStorage { diff --git a/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java b/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java index 5b2b95d..a48758f 100644 --- a/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java +++ b/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java @@ -8,16 +8,18 @@ import net.minecraft.world.WorldSavedData; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SaveDataMemoryStorage extends MapStorage { diff --git a/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java b/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java new file mode 100644 index 0000000..58822c2 --- /dev/null +++ b/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java @@ -0,0 +1,100 @@ +package net.minecraft.world.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSettings; + +/**+ + * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. + * + * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" + * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team + * + * EaglercraftX 1.8 patch files (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 SaveFormatComparator implements Comparable { + private final String fileName; + private final String displayName; + private final long lastTimePlayed; + private final long sizeOnDisk; + private final boolean requiresConversion; + private final WorldSettings.GameType theEnumGameType; + private final boolean hardcore; + private final boolean cheatsEnabled; + public final NBTTagCompound levelDat; + + public SaveFormatComparator(String fileNameIn, String displayNameIn, long lastTimePlayedIn, long sizeOnDiskIn, + WorldSettings.GameType theEnumGameTypeIn, boolean requiresConversionIn, boolean hardcoreIn, + boolean cheatsEnabledIn, NBTTagCompound levelDat) { + this.fileName = fileNameIn; + this.displayName = displayNameIn; + this.lastTimePlayed = lastTimePlayedIn; + this.sizeOnDisk = sizeOnDiskIn; + this.theEnumGameType = theEnumGameTypeIn; + this.requiresConversion = requiresConversionIn; + this.hardcore = hardcoreIn; + this.cheatsEnabled = cheatsEnabledIn; + this.levelDat = levelDat; + } + + /**+ + * return the file name + */ + public String getFileName() { + return this.fileName; + } + + /**+ + * return the display name of the save + */ + public String getDisplayName() { + return this.displayName; + } + + public long getSizeOnDisk() { + return this.sizeOnDisk; + } + + public boolean requiresConversion() { + return this.requiresConversion; + } + + public long getLastTimePlayed() { + return this.lastTimePlayed; + } + + public int compareTo(SaveFormatComparator saveformatcomparator) { + return this.lastTimePlayed < saveformatcomparator.lastTimePlayed ? 1 + : (this.lastTimePlayed > saveformatcomparator.lastTimePlayed ? -1 + : this.fileName.compareTo(saveformatcomparator.fileName)); + } + + /**+ + * Gets the EnumGameType. + */ + public WorldSettings.GameType getEnumGameType() { + return this.theEnumGameType; + } + + public boolean isHardcoreModeEnabled() { + return this.hardcore; + } + + /**+ + * @return {@code true} if cheats are enabled for this world + */ + public boolean getCheatsEnabled() { + return this.cheatsEnabled; + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java b/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java index 2cfd08a..7c196ac 100644 --- a/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java +++ b/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java @@ -9,16 +9,18 @@ import net.minecraft.world.MinecraftException; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 SaveHandlerMP implements ISaveHandler { diff --git a/src/main/java/net/minecraft/world/storage/WorldInfo.java b/src/main/java/net/minecraft/world/storage/WorldInfo.java index 2172a29..e6d6107 100644 --- a/src/main/java/net/minecraft/world/storage/WorldInfo.java +++ b/src/main/java/net/minecraft/world/storage/WorldInfo.java @@ -18,16 +18,18 @@ import net.lax1dude.eaglercraft.v1_8.HString; * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team * - * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 WorldInfo { diff --git a/src/main/java/net/PeytonPlayz585/shadow/opengl/GL11.java b/src/teavm/java/net/PeytonPlayz585/shadow/opengl/GL11.java similarity index 100% rename from src/main/java/net/PeytonPlayz585/shadow/opengl/GL11.java rename to src/teavm/java/net/PeytonPlayz585/shadow/opengl/GL11.java diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java index 755ac40..cf0901d 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/OpenGLObjects.java @@ -12,16 +12,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGLQuery; import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGLVertexArray; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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. * */ class OpenGLObjects { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java index da91032..27adee8 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java @@ -16,29 +16,37 @@ import org.teavm.jso.canvas.CanvasRenderingContext2D; import org.teavm.jso.dom.events.Event; import org.teavm.jso.dom.events.EventListener; import org.teavm.jso.dom.html.HTMLCanvasElement; +import org.teavm.jso.dom.html.HTMLDocument; import org.teavm.jso.dom.html.HTMLInputElement; -import org.teavm.jso.dom.xml.Document; import org.teavm.jso.typedarrays.ArrayBuffer; -import org.teavm.jso.typedarrays.Int8Array; +import org.teavm.jso.typedarrays.Uint8Array; import net.lax1dude.eaglercraft.v1_8.Base64; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.DebugConsoleWindow; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformApplication { public static void openLink(String url) { + if(url.indexOf(':') == -1) { + url = "http://" + url; + } Window.current().open(url, "_blank", "noopener,noreferrer"); } @@ -90,7 +98,11 @@ public class PlatformApplication { try { Storage s = Window.current().getLocalStorage(); if(s != null) { - s.setItem("_eaglercraftX." + name, Base64.encodeBase64String(data)); + if(data != null) { + s.setItem("_eaglercraftX." + name, Base64.encodeBase64String(data)); + }else { + s.removeItem("_eaglercraftX." + name); + } } }catch(Throwable t) { } @@ -114,7 +126,7 @@ public class PlatformApplication { } } - private static final DateFormat dateFormatSS = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); + private static final DateFormat dateFormatSS = EagRuntime.fixDateFormat(new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")); public static String saveScreenshot() { String name = "screenshot_" + dateFormatSS.format(new Date()).toString() + ".png"; @@ -156,12 +168,7 @@ public class PlatformApplication { if(name == null) { fileChooserResultObject = null; }else { - Int8Array typedArray = Int8Array.create(buffer); - byte[] bytes = new byte[typedArray.getByteLength()]; - for(int i = 0; i < bytes.length; ++i) { - bytes[i] = typedArray.get(i); - } - fileChooserResultObject = new FileChooserResult(name, bytes); + fileChooserResultObject = new FileChooserResult(name, TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(buffer))); } } @@ -213,8 +220,14 @@ public class PlatformApplication { return res; } - @JSBody(params = { "doc", "str" }, script = "doc.write(str);") - private static native void documentWrite(Document doc, String str); + private static final String faviconURLString = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAR/SURBVEhLtZXZK3ZRFMYPcqXc+gv413DHxVuGIpIhkciQWaRccCNjSCkligwXSOZ5nmfv9zvn2e8+58V753sudmuvvdZ61l5r7XOc8H+GS/D19aUNkPz5+aktQH5/f//4+LBKZKuRkpUtQjCUYG5gD2T38vLy/PwsDfL9/f3Dw8PT05M0b29vnKLhCKCBT4L4gvBLBIei4//4+Hh1dUVEQutUuLu7E83FxQUGnKLBWKfQaA3S+AREVxaEOD8/Pzk50XpzcyMDcH19zdZG3N3d3dzc3Nvb01aX5pQUpQGGQJxcQpfNysoKhUIdHR1o1tbWbInYAgxIPDMzMy8vLzc3FxqOdMoRqwJK8G8ALUYIhHMiSEhIwI6CyIb0qQzC4eGhsXCc1tZWnZIEKzdQJQSXgKxfX18RCM3Z5eWlcfVAxKOjo+Pj49PTU88lTOk2NjbMsePc3t6SAfcgFdszOyMuAdeBg0CQi2lhYUHOeOLDCisN8FzcPFZXV3t7ezHY3t5GQ+6it+2xMASsKhEEWKsmRLRBBUpPvpJ/TpFKFBwKYAiITmicsbYhdHfJAltqhUCVsCQhwslmeXmZxiBQT9c0Ar9E2O3v72sYSE0N1yQArkKy0kBMXLqlZqIZHR3t6empqqqSDcBdhXEJSJ/bUc3q6uq+vj629GB9fR1WsLW1NTs7u7S0RN2locMjIyOEm5ubQ7+4uJienk4/+vv77Y1hwhLBEKhwWHitdVFfX9/Y2Gg2HuLi4owUAysrK8yCG97rh0+ApP5Q2ZycHFlPTExUVFRIBvn5+WhKSkp2dnaMKhptbW2426GgQ/rwuAQCZ1hwFayLiork9hMFBQV1dXVmE0BLS4vqw3QFB8kn4IAxoGPkYpxi4FeDmpqas7Mz4pClAgqGwD48rjY2NmacYqC0tJQ1KSlJWyE5OZkpUKkBAxZVIntAoZh04+Q48fHxPNGBgYHExMT29naj9cBodnZ2mo3jlJWVMeW2OGQck4B1amqqoaGhqamJjx2lGxwcpL0mUgR8fJhsWqJtSkoKU2SbHHUDpkhPBujd8xuQG6PJRM/Pz09PT7O1NNnZ2Tw3fgZkXVhYKCUlUhBATP+hCVyKZGky17RV0g04laayslJ6hlVeFHB4eFhKaogGd0LxtmTgE+hbhKDnPjMzgw8E3qGL2tpaBWpubjYqj2BoaEj6rq4uNATRZ0ZwCbiL6gXEzINk5vCBQJ9rMD4+rkA8QNK036uDg4Py8vLu7m680KjIBNR3zBDoWQM1g98snyB+VSoRW8C/UwR81/SvhgNj9JOTkwwVERUdRBEI0BAdLRVERkhLS8vIyEDQlrsTPTU1lVFhKxARvZgUlFLbegCf4BvIsbi4mIg4E5EogIHhiKCMtU0WUFiVy06j5fAJIDdSBDQw+PegDfBRcbOPwH4F9LuFWIIQdQNKwWqzIE0aoFUaBsw+SQuFw0uNtC9A+F4i3QNrbg3IDn+SAsHh+wYiEpeyBEMLv/cAO6KzAijxxB+Y4wisBhssJUhjEbPJf4Nw+B+JXqLW3bw+wQAAAABJRU5ErkJggg=="; + + public static String faviconURLTeaVM() { + return faviconURLString.substring(0); + } + + @JSBody(params = { "doc", "str" }, script = "doc.write(str);doc.close();") + private static native void documentWrite(HTMLDocument doc, String str); public static void openCreditsPopup(String text) { Window currentWin = Window.current(); @@ -226,9 +239,43 @@ public class PlatformApplication { int y = (currentWin.getScreen().getHeight() - h) / 2; Window newWin = Window.current().open("", "_blank", "top=" + y + ",left=" + x + ",width=" + w + ",height=" + h + ",menubar=0,status=0,titlebar=0,toolbar=0"); - + if(newWin == null) { + Window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!"); + return; + } + newWin.focus(); - documentWrite(newWin.getDocument(), "EaglercraftX 1.8 Credits
" + text + "
"); + documentWrite(newWin.getDocument(), "" + + "EaglercraftX 1.8 Credits" + + "" + + "
" + text + "
"); } + public static void clearFileChooserResult() { + fileChooserHasResult = false; + fileChooserResultObject = null; + } + + @JSBody(params = { "name", "buf" }, script = + "var hr = window.URL.createObjectURL(new Blob([buf], {type: \"octet/stream\"}));" + + "var a = document.createElement(\"a\");" + + "a.href = hr; a.download = name; a.click();" + + "window.URL.revokeObjectURL(hr);") + private static final native void downloadBytesImpl(String str, ArrayBuffer buf); + + public static final void downloadFileWithName(String str, byte[] dat) { + downloadBytesImpl(str, TeaVMUtils.unwrapUnsignedByteArray(dat).getBuffer()); + } + + public static void showDebugConsole() { + DebugConsoleWindow.showDebugConsole(); + } + + public static void addLogMessage(String text, boolean err) { + DebugConsoleWindow.addLogMessage(text, err); + } + + public static boolean isShowingDebugConsole() { + return DebugConsoleWindow.isShowingDebugConsole(); + } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java index 840cd5f..0e2d783 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAssets.java @@ -1,10 +1,7 @@ package net.lax1dude.eaglercraft.v1_8.internal; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.teavm.interop.Async; @@ -19,27 +16,27 @@ import org.teavm.jso.dom.html.HTMLCanvasElement; import org.teavm.jso.dom.html.HTMLImageElement; import org.teavm.jso.dom.xml.Document; import org.teavm.jso.typedarrays.ArrayBuffer; -import org.teavm.jso.typedarrays.DataView; -import org.teavm.jso.typedarrays.Uint8Array; +import org.teavm.jso.typedarrays.Int32Array; import org.teavm.jso.typedarrays.Uint8ClampedArray; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain; import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; -import net.lax1dude.eaglercraft.v1_8.internal.vfs.SYS; import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformAssets { @@ -55,7 +52,7 @@ public class PlatformAssets { byte[] data = assets.get(path); if(data == null && path.startsWith("assets/minecraft/lang/") && !path.endsWith(".mcmeta")) { ArrayBuffer file = PlatformRuntime.downloadRemoteURI( - MainClass.configLocalesFolder + "/" + path.substring(22)); + ClientMain.configLocalesFolder + "/" + path.substring(22)); if(file != null && file.getByteLength() > 0) { data = TeaVMUtils.arrayBufferToBytes(file); assets.put(path, data); @@ -82,9 +79,7 @@ public class PlatformAssets { private static CanvasRenderingContext2D imageLoadContext = null; public static ImageData loadImageFile(byte[] data) { - Uint8Array buf = Uint8Array.create(data.length); - buf.set(data); - return loadImageFile(buf.getBuffer()); + return loadImageFile(TeaVMUtils.unwrapUnsignedByteArray(data).getBuffer()); } @JSBody(params = { }, script = "return { willReadFrequently: true };") @@ -121,12 +116,7 @@ public class PlatformAssets { ret.complete(null); return; } - DataView view = DataView.create(pxls.getBuffer()); - int[] pixels = new int[totalPixels]; - for(int i = 0; i < pixels.length; ++i) { - pixels[i] = view.getUint32(i << 2, true); - } - ret.complete(new ImageData(pxlsDat.getWidth(), pxlsDat.getHeight(), pixels, true)); + ret.complete(new ImageData(pxlsDat.getWidth(), pxlsDat.getHeight(), TeaVMUtils.wrapIntArray(Int32Array.create(pxls.getBuffer())), true)); } }); toLoad.addEventListener("error", new EventListener() { @@ -144,64 +134,4 @@ public class PlatformAssets { } } - public static String[] listFilesInDirectory(String directoryPath, String[] prefixes, String[] suffixes) { - ArrayList fileNames = new ArrayList<>(); - - for(String resourcePackName : SYS.getResourcePackNames()) { - String resourcePack = "resourcepacks/" + resourcePackName + "/" + directoryPath; - List vfsFiles = SYS.VFS.listFiles(resourcePack); - for (String vfsFile : vfsFiles) { - if (!vfsFile.endsWith("/")) { - String fileName = vfsFile; - if (matchesPrefixesAndSuffixes(fileName, prefixes, suffixes)) { - if(!fileNames.contains(fileName)) { - fileNames.add(fileName); - } - } - } else { - String[] filesInSubfolder = listFilesInDirectory(vfsFile, prefixes, suffixes); - for(String file : Arrays.asList(filesInSubfolder)) { - if(!fileNames.contains(file)) { - fileNames.add(file); - } - } - } - } - } - - for (String path : assets.keySet()) { - if (path.startsWith(directoryPath)) { - if (!path.endsWith("/")) { - String fileName = path.substring(directoryPath.length() + 1); - if (matchesPrefixesAndSuffixes(fileName, prefixes, suffixes)) { - if(!fileNames.contains(fileName)) { - fileNames.add(fileName); - } - } - } else { - String[] filesInSubfolder = listFilesInDirectory(path, prefixes, suffixes); - for(String file : Arrays.asList(filesInSubfolder)) { - if(!fileNames.contains(file)) { - fileNames.add(file); - } - } - } - } - } - - return fileNames.toArray(new String[0]); - } - - private static boolean matchesPrefixesAndSuffixes(String fileName, String[] prefixes, String[] suffixes) { - for (String prefix : prefixes) { - if (fileName.startsWith(prefix)) { - for (String suffix : suffixes) { - if (fileName.endsWith(suffix)) { - return true; - } - } - } - } - return false; - } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java index 3b1b3ba..b0087b1 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java @@ -24,6 +24,7 @@ import org.teavm.jso.webaudio.MediaStream; import org.teavm.jso.webaudio.MediaStreamAudioDestinationNode; import org.teavm.jso.webaudio.PannerNode; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.minecraft.util.MathHelper; @@ -211,9 +212,7 @@ public class PlatformAudio { if(buffer == null) { byte[] file = PlatformAssets.getResourceBytes(filename); if(file == null) return null; - Uint8Array buf = Uint8Array.create(file.length); - buf.set(file); - buffer = new BrowserAudioResource(decodeAudioAsync(buf.getBuffer(), filename)); + buffer = new BrowserAudioResource(decodeAudioAsync(TeaVMUtils.unwrapUnsignedByteArray(file).getBuffer(), filename)); if(holdInCache) { synchronized(soundCache) { soundCache.put(filename, buffer); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java index 2f8f2f0..17f28cc 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformBufferFunctions.java @@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformBufferFunctions { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java new file mode 100644 index 0000000..f32d725 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java @@ -0,0 +1,354 @@ +package net.lax1dude.eaglercraft.v1_8.internal; + +import org.teavm.interop.Async; +import org.teavm.interop.AsyncCallback; +import org.teavm.jso.JSBody; +import org.teavm.jso.JSObject; +import org.teavm.jso.dom.events.EventListener; +import org.teavm.jso.indexeddb.EventHandler; +import org.teavm.jso.indexeddb.IDBCountRequest; +import org.teavm.jso.indexeddb.IDBCursor; +import org.teavm.jso.indexeddb.IDBCursorRequest; +import org.teavm.jso.indexeddb.IDBDatabase; +import org.teavm.jso.indexeddb.IDBFactory; +import org.teavm.jso.indexeddb.IDBGetRequest; +import org.teavm.jso.indexeddb.IDBObjectStoreParameters; +import org.teavm.jso.indexeddb.IDBOpenDBRequest; +import org.teavm.jso.indexeddb.IDBRequest; +import org.teavm.jso.indexeddb.IDBTransaction; +import org.teavm.jso.indexeddb.IDBVersionChangeEvent; +import org.teavm.jso.typedarrays.ArrayBuffer; +import org.teavm.jso.typedarrays.DataView; + +import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerArrayBufferAllocator; +import net.lax1dude.eaglercraft.v1_8.internal.vfs.BooleanResult; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2; +import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer; + +/** + * 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 PlatformFilesystem { + + private static String filesystemDB = null; + private static IDBDatabase database = null; + + public static void initialize() { + filesystemDB = "_net_lax1dude_eaglercraft_v1_8_internal_PlatformFilesystem_1_8_8_" + + ServerPlatformSingleplayer.getClientConfigAdapter().getWorldsDB(); + DatabaseOpen dbOpen = AsyncHandlers.openDB(filesystemDB); + + if(dbOpen.failedLocked) { + throw new WorldsDatabaseLockedException(dbOpen.failedError); + } + + if(dbOpen.failedInit) { + throw new WorldsDatabaseInitializationException(dbOpen.failedError); + } + + if(dbOpen.database == null) { + throw new NullPointerException("IDBDatabase is null!"); + } + + database = dbOpen.database; + } + + public static class WorldsDatabaseLockedException extends RuntimeException { + public WorldsDatabaseLockedException(String message) { + super(message); + } + } + + public static class WorldsDatabaseInitializationException extends RuntimeException { + public WorldsDatabaseInitializationException(String message) { + super(message); + } + } + + public static boolean eaglerDelete(String pathName) { + return AsyncHandlers.deleteFile(database, pathName).bool; + } + + public static ByteBuffer eaglerRead(String pathName) { + ArrayBuffer ar = AsyncHandlers.readWholeFile(database, pathName); + if(ar == null) { + return null; + } + return EaglerArrayBufferAllocator.wrapByteBufferTeaVM(DataView.create(ar)); + } + + public static void eaglerWrite(String pathName, ByteBuffer data) { + if(!AsyncHandlers.writeWholeFile(database, pathName, EaglerArrayBufferAllocator.getDataViewStupid(data).getBuffer()).bool) { + throw new RuntimeException("Failed to write " + data.remaining() + " byte file to indexeddb table: " + pathName); + } + } + + public static boolean eaglerExists(String pathName) { + return AsyncHandlers.fileExists(database, pathName).bool; + } + + public static boolean eaglerMove(String pathNameOld, String pathNameNew) { + ArrayBuffer old = AsyncHandlers.readWholeFile(database, pathNameOld); + return old != null && AsyncHandlers.writeWholeFile(database, pathNameNew, old).bool && AsyncHandlers.deleteFile(database, pathNameOld).bool; + } + + public static int eaglerCopy(String pathNameOld, String pathNameNew) { + ArrayBuffer old = AsyncHandlers.readWholeFile(database, pathNameOld); + if(old != null && AsyncHandlers.writeWholeFile(database, pathNameNew, old).bool) { + return old.getByteLength(); + }else { + return -1; + } + } + + public static int eaglerSize(String pathName) { + ArrayBuffer old = AsyncHandlers.readWholeFile(database, pathName); + return old == null ? -1 : old.getByteLength(); + } + + private static class VFSFilenameIteratorNonRecursive implements VFSFilenameIterator { + + private final VFSFilenameIterator child; + private final int pathCount; + + private VFSFilenameIteratorNonRecursive(VFSFilenameIterator child, int pathCount) { + this.child = child; + this.pathCount = pathCount; + } + + @Override + public void next(String entry) { + if(countSlashes(entry) == pathCount) { + child.next(entry); + } + } + + } + + private static int countSlashes(String str) { + int j = 0; + for(int i = 0, l = str.length(); i < l; ++i) { + if(str.charAt(i) == '/') { + ++j; + } + } + return j; + } + + public static void eaglerIterate(String pathName, VFSFilenameIterator itr, boolean recursive) { + if(recursive) { + AsyncHandlers.iterateFiles(database, pathName, false, itr); + }else { + AsyncHandlers.iterateFiles(database, pathName, false, new VFSFilenameIteratorNonRecursive(itr, countSlashes(pathName) + 1)); + } + } + + protected static class DatabaseOpen { + + protected final boolean failedInit; + protected final boolean failedLocked; + protected final String failedError; + + protected final IDBDatabase database; + + protected DatabaseOpen(boolean init, boolean locked, String error, IDBDatabase db) { + failedInit = init; + failedLocked = locked; + failedError = error; + database = db; + } + + } + + @JSBody(script = "return ((typeof indexedDB) !== 'undefined') ? indexedDB : null;") + protected static native IDBFactory createIDBFactory(); + + protected static class AsyncHandlers { + + @Async + protected static native DatabaseOpen openDB(String name); + + private static void openDB(String name, final AsyncCallback cb) { + IDBFactory i = createIDBFactory(); + if(i == null) { + cb.complete(new DatabaseOpen(false, false, "window.indexedDB was null or undefined", null)); + return; + } + final IDBOpenDBRequest f = i.open(name, 1); + f.setOnBlocked(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(new DatabaseOpen(false, true, null, null)); + } + }); + f.setOnSuccess(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(new DatabaseOpen(false, false, null, f.getResult())); + } + }); + f.setOnError(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(new DatabaseOpen(false, false, "open error", null)); + } + }); + f.setOnUpgradeNeeded(new EventListener() { + @Override + public void handleEvent(IDBVersionChangeEvent evt) { + f.getResult().createObjectStore("filesystem", IDBObjectStoreParameters.create().keyPath("path")); + } + }); + } + + @Async + protected static native BooleanResult deleteFile(IDBDatabase db, String name); + + private static void deleteFile(IDBDatabase db, String name, final AsyncCallback cb) { + IDBTransaction tx = db.transaction("filesystem", "readwrite"); + final IDBRequest r = tx.objectStore("filesystem").delete(makeTheFuckingKeyWork(name)); + + r.setOnSuccess(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(BooleanResult.TRUE); + } + }); + r.setOnError(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(BooleanResult.FALSE); + } + }); + } + + @JSBody(params = { "obj" }, script = "return (typeof obj === \"undefined\") ? null : ((typeof obj.data === \"undefined\") ? null : obj.data);") + protected static native ArrayBuffer readRow(JSObject obj); + + @JSBody(params = { "obj" }, script = "return [obj];") + private static native JSObject makeTheFuckingKeyWork(String k); + + @Async + protected static native ArrayBuffer readWholeFile(IDBDatabase db, String name); + + private static void readWholeFile(IDBDatabase db, String name, final AsyncCallback cb) { + IDBTransaction tx = db.transaction("filesystem", "readonly"); + final IDBGetRequest r = tx.objectStore("filesystem").get(makeTheFuckingKeyWork(name)); + r.setOnSuccess(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(readRow(r.getResult())); + } + }); + r.setOnError(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(null); + } + }); + + } + + @JSBody(params = { "k" }, script = "return ((typeof k) === \"string\") ? k : (((typeof k) === \"undefined\") ? null : (((typeof k[0]) === \"string\") ? k[0] : null));") + private static native String readKey(JSObject k); + + @JSBody(params = { "k" }, script = "return ((typeof k) === \"undefined\") ? null : (((typeof k.path) === \"undefined\") ? null : (((typeof k.path) === \"string\") ? k[0] : null));") + private static native String readRowKey(JSObject r); + + @Async + protected static native Integer iterateFiles(IDBDatabase db, final String prefix, boolean rw, final VFSFilenameIterator itr); + + private static void iterateFiles(IDBDatabase db, final String prefix, boolean rw, final VFSFilenameIterator itr, final AsyncCallback cb) { + IDBTransaction tx = db.transaction("filesystem", rw ? "readwrite" : "readonly"); + final IDBCursorRequest r = tx.objectStore("filesystem").openCursor(); + final int[] res = new int[1]; + r.setOnSuccess(new EventHandler() { + @Override + public void handleEvent() { + IDBCursor c = r.getResult(); + if(c == null || c.getKey() == null || c.getValue() == null) { + cb.complete(res[0]); + return; + } + String k = readKey(c.getKey()); + if(k != null) { + if(k.startsWith(prefix)) { + int ci = res[0]++; + try { + itr.next(k); + }catch(VFSIterator2.BreakLoop ex) { + cb.complete(res[0]); + return; + } + } + } + c.doContinue(); + } + }); + r.setOnError(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(res[0] > 0 ? res[0] : -1); + } + }); + } + + @Async + protected static native BooleanResult fileExists(IDBDatabase db, String name); + + private static void fileExists(IDBDatabase db, String name, final AsyncCallback cb) { + IDBTransaction tx = db.transaction("filesystem", "readonly"); + final IDBCountRequest r = tx.objectStore("filesystem").count(makeTheFuckingKeyWork(name)); + r.setOnSuccess(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(BooleanResult._new(r.getResult() > 0)); + } + }); + r.setOnError(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(BooleanResult.FALSE); + } + }); + } + + @JSBody(params = { "pat", "dat" }, script = "return { path: pat, data: dat };") + protected static native JSObject writeRow(String name, ArrayBuffer data); + + @Async + protected static native BooleanResult writeWholeFile(IDBDatabase db, String name, ArrayBuffer data); + + private static void writeWholeFile(IDBDatabase db, String name, ArrayBuffer data, final AsyncCallback cb) { + IDBTransaction tx = db.transaction("filesystem", "readwrite"); + final IDBRequest r = tx.objectStore("filesystem").put(writeRow(name, data)); + + r.setOnSuccess(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(BooleanResult.TRUE); + } + }); + r.setOnError(new EventHandler() { + @Override + public void handleEvent() { + cb.complete(BooleanResult.FALSE); + } + }); + } + + } +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java index 3925eda..7c27bf3 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java @@ -25,16 +25,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext; import static net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext.*; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformInput { @@ -104,7 +106,7 @@ public class PlatformInput { static void initHooks(Window window, HTMLCanvasElement canvaz) { win = window; canvas = canvaz; - + canvas.getStyle().setProperty("cursor", "default"); win.addEventListener("contextmenu", contextmenu = new EventListener() { @Override public void handleEvent(MouseEvent evt) { @@ -545,7 +547,7 @@ public class PlatformInput { if(mouseEvents.isEmpty() && keyEvents.isEmpty() && !hasBeenActive()) { EarlyLoadScreen.paintEnable(); - while(!PlatformRuntime.returnHasUserInteractionHappened()) { + while(mouseEvents.isEmpty() && keyEvents.isEmpty()) { EagUtils.sleep(100l); } } @@ -596,5 +598,20 @@ public class PlatformInput { @JSBody(params = { "element" }, script = "element.requestFullscreen();") private static native void requestFullscreen(HTMLElement element); + + public static void showCursor(EnumCursorType cursor) { + switch(cursor) { + case DEFAULT: + default: + canvas.getStyle().setProperty("cursor", "default"); + break; + case HAND: + canvas.getStyle().setProperty("cursor", "pointer"); + break; + case TEXT: + canvas.getStyle().setProperty("cursor", "text"); + break; + } + } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java index 1b69cc0..17c32c3 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformNetworking.java @@ -1,6 +1,8 @@ package net.lax1dude.eaglercraft.v1_8.internal; +import java.util.ArrayList; import java.util.LinkedList; +import java.util.List; import org.teavm.interop.Async; import org.teavm.interop.AsyncCallback; @@ -19,16 +21,18 @@ 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformNetworking { @@ -115,13 +119,8 @@ public class PlatformNetworking { serverRateLimit = EnumServerRateLimit.LOCKED_OUT; } }else { - Uint8Array a = Uint8Array.create(evt.getDataAsArray()); - byte[] b = new byte[a.getByteLength()]; - for(int i = 0; i < b.length; ++i) { - b[i] = (byte) a.get(i); - } synchronized(readPackets) { - readPackets.add(b); + readPackets.add(TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(evt.getDataAsArray()))); } } } @@ -155,6 +154,18 @@ public class PlatformNetworking { } } + public static List readAllPacket() { + synchronized(readPackets) { + if(!readPackets.isEmpty()) { + List ret = new ArrayList<>(readPackets); + readPackets.clear(); + return ret; + }else { + return null; + } + } + } + public static int countAvailableReadData() { int total = 0; synchronized(readPackets) { @@ -166,13 +177,11 @@ public class PlatformNetworking { } @JSBody(params = { "sock", "buffer" }, script = "sock.send(buffer);") - private static native void nativeBinarySend(WebSocket sock, ArrayBuffer buffer); + protected static native void nativeBinarySend(WebSocket sock, ArrayBuffer buffer); public static void writePlayPacket(byte[] pkt) { if(sock != null && !sockIsConnecting) { - Uint8Array arr = Uint8Array.create(pkt.length); - arr.set(pkt); - nativeBinarySend(sock, arr.getBuffer()); + nativeBinarySend(sock, TeaVMUtils.unwrapUnsignedByteArray(pkt).getBuffer()); } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java index a25f3a5..ded7ab2 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformOpenGL.java @@ -13,16 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformOpenGL { @@ -405,7 +407,7 @@ public class PlatformOpenGL { public static final int _wglGetUniformBlockIndex(IProgramGL obj, String name) { int i = ctx.getUniformBlockIndex(((OpenGLObjects.ProgramGL)obj).ptr, name); - if(i == 0xFFFFFFFFl) { + if(i > 2147483647) { i = -1; } return i; diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index 565878f..1434e6d 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -7,7 +7,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.function.Consumer; -import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; import org.teavm.interop.Async; @@ -42,8 +42,10 @@ 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.teavm.EPKLoader; import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass.EPKFileEntry; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.FixWebMDurationJS; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain.EPKFileEntry; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.DebugConsoleWindow; import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMClientConfigAdapter; import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext; @@ -52,16 +54,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 PlatformRuntime { @@ -79,12 +83,13 @@ public class PlatformRuntime { public static void create() { win = Window.current(); doc = win.getDocument(); + DebugConsoleWindow.initialize(win); logger.info("Creating main game canvas"); - parent = doc.getElementById(MainClass.configRootElement); + parent = doc.getElementById(ClientMain.configRootElementId); if(parent == null) { - throw new RuntimeInitializationFailureException("Root element \"" + MainClass.configRootElement + "\" was not found in this document!"); + throw new RuntimeInitializationFailureException("Root element \"" + ClientMain.configRootElementId + "\" was not found in this document!"); } CSSStyleDeclaration style = parent.getStyle(); @@ -136,7 +141,7 @@ public class PlatformRuntime { EarlyLoadScreen.paintScreen(); - EPKFileEntry[] epkFiles = MainClass.configEPKFiles; + EPKFileEntry[] epkFiles = ClientMain.configEPKFiles; for(int i = 0; i < epkFiles.length; ++i) { String url = epkFiles[i].url; @@ -150,13 +155,10 @@ public class PlatformRuntime { throw new RuntimeInitializationFailureException("Could not download EPK file \"" + url + "\""); } - showDecompressing(); logger.info("Decompressing: {}", logURL); - EagUtils.sleep(200l); try { EPKLoader.loadEPK(epkFileData, epkFiles[i].path, PlatformAssets.assets); - }catch(Throwable t) { throw new RuntimeInitializationFailureException("Could not extract EPK file \"" + url + "\"", t); } @@ -168,20 +170,17 @@ public class PlatformRuntime { logger.info("Initializing sound engine..."); - showEnableScreen(); - EagUtils.sleep(400l); PlatformInput.pressAnyKeyScreen(); PlatformAudio.initialize(); - showEaglerLoadingScreen(); - EagUtils.sleep(400l); - if(finalLoadScreen != null) { EarlyLoadScreen.paintFinal(finalLoadScreen); } logger.info("Platform initialization complete"); + + FixWebMDurationJS.checkOldScriptStillLoaded(); } @JSBody(params = { }, script = "return {antialias: false, depth: false, powerPreference: \"high-performance\", desynchronized: true, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};") @@ -266,7 +265,11 @@ public class PlatformRuntime { } public static void downloadRemoteURI(String assetPackageURI, final Consumer cb) { - downloadRemoteURI(assetPackageURI, new AsyncCallback() { + downloadRemoteURI(assetPackageURI, false, cb); + } + + public static void downloadRemoteURI(String assetPackageURI, boolean useCache, final Consumer cb) { + downloadRemoteURI(assetPackageURI, useCache, new AsyncCallback() { @Override public void complete(ArrayBuffer result) { cb.accept(result); @@ -274,16 +277,16 @@ public class PlatformRuntime { @Override public void error(Throwable e) { - e.printStackTrace(); + EagRuntime.debugPrintStackTrace(e); cb.accept(null); } }); } @Async - public static native ArrayBuffer downloadRemoteURI(String assetPackageURI); + public static native ArrayBuffer downloadRemoteURIOld(String assetPackageURI); - private static void downloadRemoteURI(String assetPackageURI, final AsyncCallback cb) { + private static void downloadRemoteURIOld(String assetPackageURI, final AsyncCallback cb) { final XMLHttpRequest request = XMLHttpRequest.create(); request.setResponseType("arraybuffer"); request.open("GET", assetPackageURI, true); @@ -299,13 +302,6 @@ public class PlatformRuntime { } } }); - - TeaVMUtils.addEventListener(request, "progress", new EventListener() { - @Override - public void handleEvent(Event evt) { - updateLoading(evt); - } - }); TeaVMUtils.addEventListener(request, "error", new EventListener() { @Override @@ -317,12 +313,33 @@ public class PlatformRuntime { request.send(); } + @JSFunctor + private static interface FetchHandler extends JSObject { + void onFetch(ArrayBuffer data); + } + + @JSBody(params = { "uri", "forceCache", "callback" }, script = "fetch(uri, { cache: forceCache, mode: \"cors\" })" + + ".then(function(res) { return res.arrayBuffer(); }).then(function(arr) { callback(arr); })" + + ".catch(function(err) { console.error(err); callback(null); });") + private static native void doFetchDownload(String uri, String forceCache, FetchHandler callback); + + public static ArrayBuffer downloadRemoteURI(String assetPackageURI) { + return downloadRemoteURI(assetPackageURI, true); + } + + @Async + public static native ArrayBuffer downloadRemoteURI(String assetPackageURI, boolean forceCache); + + private static void downloadRemoteURI(String assetPackageURI, boolean useCache, final AsyncCallback cb) { + doFetchDownload(assetPackageURI, useCache ? "force-cache" : "no-store", (bb) -> cb.complete(bb)); + } + public static boolean isDebugRuntime() { return false; } public static void writeCrashReport(String crashDump) { - MainClass.showCrashScreen(crashDump); + ClientMain.showCrashScreen(crashDump); } public static void removeEventHandlers() { @@ -370,13 +387,13 @@ public class PlatformRuntime { } @JSBody(params = { "o" }, script = "console.error(o);") - private static native void printNativeExceptionToConsole(JSObject o); + public static native void printNativeExceptionToConsoleTeaVM(JSObject o); public static boolean printJSExceptionIfBrowser(Throwable t) { if(t != null) { JSObject o = JSExceptions.getJSException(t); if(o != null) { - printNativeExceptionToConsole(o); + printNativeExceptionToConsoleTeaVM(o); return true; } } @@ -388,7 +405,7 @@ public class PlatformRuntime { } public static void setThreadName(String string) { - // no teavm support + currentThreadName = string; } public static long maxMemory() { @@ -426,6 +443,9 @@ public class PlatformRuntime { @JSBody(params = { }, script = "return window.location.protocol && window.location.protocol.toLowerCase().startsWith(\"https\");") public static native boolean requireSSL(); + @JSBody(params = { }, script = "return window.location.protocol && window.location.protocol.toLowerCase().startsWith(\"file\");") + public static native boolean isOfflineDownloadURL(); + public static IClientConfigAdapter getClientConfigAdapter() { return TeaVMClientConfigAdapter.instance; } @@ -453,14 +473,6 @@ public class PlatformRuntime { @JSBody(params = { }, script = "return \"MediaRecorder\" in window;") private static native boolean canRec(); - @JSFunctor - private static interface RecUrlHandler extends JSObject { - void onUrl(String url); - } - - @JSBody(params = { "e", "duration", "cb" }, script = "if (\"ysFixWebmDuration\" in window) { ysFixWebmDuration(e.data, duration, function(b) { cb(URL.createObjectURL(b)); }); } else { cb(URL.createObjectURL(e.data)); }") - private static native void getRecUrl(Event e, int duration, RecUrlHandler cb); - public static boolean recSupported() { return true; } @@ -532,7 +544,7 @@ public class PlatformRuntime { return null; } - private static final SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd hh-mm-ss"); + private static final SimpleDateFormat fmt = EagRuntime.fixDateFormat(new SimpleDateFormat("yyyy-MM-dd hh-mm-ss")); private static final Date dateInstance = new Date(); public static void toggleRec() { @@ -558,12 +570,15 @@ public class PlatformRuntime { TeaVMUtils.addEventListener(mediaRec, "dataavailable", new EventListener() { @Override public void handleEvent(Event evt) { - getRecUrl(evt, (int) (System.currentTimeMillis() - startTime), url -> { + FixWebMDurationJS.getRecUrl(evt, (int) (System.currentTimeMillis() - startTime), url -> { HTMLAnchorElement a = (HTMLAnchorElement) doc.createElement("a"); dateInstance.setTime(startTime); a.setDownload(EaglercraftVersion.mainMenuStringB + " - " + EaglerProfile.getName() + " - " + fmt.format(dateInstance) + ".webm"); a.setHref(url); a.click(); + TeaVMUtils.freeDataURL(url); + }, (msg) -> { + logger.info(msg); }); } }); @@ -574,24 +589,13 @@ public class PlatformRuntime { } } - @JSBody(params = { "evt" }, script = "updateLoadingScreen(evt)") - public static native void updateLoading(Event evt); + public static long randomSeed() { + return (long)(Math.random() * 9007199254740991.0); + } - @JSBody(params = { }, script = "showDecompressing()") - public static native void showDecompressing(); + private static String currentThreadName = "main"; - @JSBody(params = { }, script = "showEnableScreen()") - public static native void showEnableScreen(); - - @JSBody(params = { }, script = "showEaglerLoadingScreen()") - public static native void showEaglerLoadingScreen(); - - @JSBody(params = { }, script = "showMojangScreen()") - public static native void showMojangScreen(); - - @JSBody(params = { }, script = "die()") - public static native void die(); - - @JSBody(params = { }, script = "return returnHasUserInteractionHappened()") - public static native boolean returnHasUserInteractionHappened(); + public static String currentThreadName() { + return currentThreadName; + } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformUpdateSvc.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformUpdateSvc.java new file mode 100644 index 0000000..7a1dcc0 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformUpdateSvc.java @@ -0,0 +1,97 @@ +package net.lax1dude.eaglercraft.v1_8.internal; + +import org.teavm.jso.JSBody; +import org.teavm.jso.typedarrays.ArrayBuffer; +import org.teavm.jso.typedarrays.Uint8Array; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUpdateThread; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +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 Logger logger = LogManager.getLogger("PlatformUpdateSvc"); + + private static byte[] eaglercraftXClientSignature = null; + private static byte[] eaglercraftXClientBundle = null; + + private static final UpdateProgressStruct progressStruct = new UpdateProgressStruct(); + + @JSBody(params = { }, script = "if(typeof window.eaglercraftXClientSignature !== \"string\") return null; var ret = window.eaglercraftXClientSignature; window.eaglercraftXClientSignature = null; return ret;") + private static native String grabEaglercraftXClientSignature(); + + @JSBody(params = { }, script = "if(typeof window.eaglercraftXClientBundle !== \"string\") return null; var ret = window.eaglercraftXClientBundle; window.eaglercraftXClientBundle = null; return ret;") + private static native String grabEaglercraftXClientBundle(); + + public static Thread updateThread = null; + + public static boolean supported() { + return true; + } + + public static void initialize() { + eaglercraftXClientSignature = loadClientData(grabEaglercraftXClientSignature()); + eaglercraftXClientBundle = loadClientData(grabEaglercraftXClientBundle()); + } + + private static byte[] loadClientData(String url) { + if(url == null) { + return null; + } + ArrayBuffer buf = PlatformRuntime.downloadRemoteURI(url); + if(buf == null) { + logger.error("Failed to download client bundle or signature URL!"); + return null; + } + return TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(buf)); + } + + public static byte[] getClientSignatureData() { + return eaglercraftXClientSignature; + } + + public static byte[] getClientBundleData() { + return eaglercraftXClientBundle; + } + + public static void startClientUpdateFrom(UpdateCertificate clientUpdate) { + if(updateThread == null || !updateThread.isAlive()) { + updateThread = new Thread(new TeaVMUpdateThread(clientUpdate, progressStruct), "EaglerUpdateThread"); + updateThread.setDaemon(true); + updateThread.start(); + }else { + logger.error("Tried to start a new download while the current download thread was still alive!"); + } + } + + public static UpdateProgressStruct getUpdatingStatus() { + return progressStruct; + } + + public static void quine(String filename, byte[] cert, byte[] data, String date) { + EagRuntime.downloadFileWithName(filename, TeaVMUpdateThread.generateSignedOffline(cert, data, date)); + } + + public static void quine(UpdateCertificate clientUpdate, byte[] data) { + TeaVMUpdateThread.downloadSignedOffline(clientUpdate, data); + } +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java new file mode 100644 index 0000000..8363c48 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java @@ -0,0 +1,1437 @@ +package net.lax1dude.eaglercraft.v1_8.internal; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.sp.lan.LANPeerEvent; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +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; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.*; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; + +import org.json.JSONObject; +import org.json.JSONWriter; +import org.teavm.jso.JSBody; +import org.teavm.jso.JSFunctor; +import org.teavm.jso.JSObject; +import org.teavm.jso.browser.Window; +import org.teavm.jso.core.JSError; +import org.teavm.jso.dom.events.Event; +import org.teavm.jso.dom.events.EventListener; +import org.teavm.jso.json.JSON; +import org.teavm.jso.typedarrays.ArrayBuffer; +import org.teavm.jso.typedarrays.Uint8Array; +import org.teavm.jso.websocket.WebSocket; + +import com.google.common.collect.LinkedListMultimap; +import com.google.common.collect.ListMultimap; + +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.*; + +/** + * Copyright (c) 2022-2024 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 { + + private static final Logger logger = LogManager.getLogger("PlatformWebRTC"); + + @JSBody(script = "return typeof window.RTCPeerConnection !== \"undefined\";") + public static native boolean supported(); + + @JSBody(params = { "item" }, script = "return item.close();") + static native void closeIt(JSObject item); + + @JSBody(params = { "item" }, script = "return item.readyState;") + static native String getReadyState(JSObject item); + + @JSBody(params = { "item", "buffer" }, script = "return item.send(buffer);") + static native void sendIt(JSObject item, ArrayBuffer buffer); + + @JSBody(params = { "item" }, script = "return !!item.candidate;") + static native boolean hasCandidate(JSObject item); + + @JSBody(params = { "item" }, script = "return item.connectionState;") + static native String getConnectionState(JSObject item); + + @JSBody(params = { "item" }, script = "return item.candidate.sdpMLineIndex;") + static native int getSdpMLineIndex(JSObject item); + + @JSBody(params = { "item" }, script = "return item.candidate.candidate;") + static native String getCandidate(JSObject item); + + @JSBody(params = { "iceServers" }, script = "return new RTCPeerConnection({ iceServers: JSON.parse(iceServers), optional: [ { DtlsSrtpKeyAgreement: true } ] });") + static native JSObject createRTCPeerConnection(String iceServers); + + @JSBody(params = { "peerConnection", "name" }, script = "return peerConnection.createDataChannel(name);") + static native JSObject createDataChannel(JSObject peerConnection, String name); + + @JSBody(params = { "item", "type" }, script = "return (item.binaryType = type);") + static native void setBinaryType(JSObject item, String type); + + @JSBody(params = { "item" }, script = "return item.data;") + static native ArrayBuffer getData(JSObject item); + + @JSBody(params = { "item" }, script = "return item.channel;") + static native JSObject getChannel(JSObject item); + + @JSBody(params = { "peerConnection", "h1", "h2" }, script = "return peerConnection.createOffer(h1, h2);") + static native void createOffer(JSObject peerConnection, DescHandler h1, ErrorHandler h2); + + @JSBody(params = { "peerConnection", "desc", "h1", "h2" }, script = "return peerConnection.setLocalDescription(desc, h1, h2);") + static native void setLocalDescription(JSObject peerConnection, JSObject desc, EmptyHandler h1, ErrorHandler h2); + + @JSBody(params = { "peerConnection", "str" }, script = "return peerConnection.setRemoteDescription(JSON.parse(str));") + static native void setRemoteDescription(JSObject peerConnection, String str); + + @JSBody(params = { "peerConnection", "str" }, script = "const candidateList = JSON.parse(str); for (let i = 0; i < candidateList.length; ++i) { peerConnection.addIceCandidate(candidateList[i]); }; return null;") + static native void addIceCandidates(JSObject peerConnection, String str); + + @JSBody(params = { "peerConnection", "str" }, script = "const candidateList = JSON.parse(str); for (let i = 0; i < candidateList.length; ++i) { peerConnection.addIceCandidate(new RTCIceCandidate(candidateList[i])); }; return null;") + static native void addIceCandidates2(JSObject peerConnection, String str); + + @JSBody(params = { "peerConnection", "str", "h1", "h2" }, script = "return peerConnection.setRemoteDescription(JSON.parse(str), h1, h2);") + static native void setRemoteDescription2(JSObject peerConnection, String str, EmptyHandler h1, ErrorHandler h2); + + @JSBody(params = { "peerConnection", "h1", "h2" }, script = "return peerConnection.createAnswer(h1, h2);") + static native void createAnswer(JSObject peerConnection, DescHandler h1, ErrorHandler h2); + + private static final Map fuckTeaVM = new HashMap<>(); + + public static class LANClient { + public static final byte READYSTATE_INIT_FAILED = -2; + public static final byte READYSTATE_FAILED = -1; + public static final byte READYSTATE_DISCONNECTED = 0; + public static final byte READYSTATE_CONNECTING = 1; + public static final byte READYSTATE_CONNECTED = 2; + + public Set> iceServers = new HashSet<>(); + public JSObject peerConnection = null; + public JSObject dataChannel = null; + + public byte readyState = READYSTATE_CONNECTING; + + public void initialize() { + try { + if (dataChannel != null) { + closeIt(dataChannel); + dataChannel = null; + } + if (peerConnection != null) { + closeIt(peerConnection); + } + this.peerConnection = createRTCPeerConnection(JSONWriter.valueToString(iceServers)); + this.readyState = READYSTATE_CONNECTING; + } catch (Throwable t) { + readyState = READYSTATE_INIT_FAILED; + } + } + + public void setIceServers(String[] urls) { + iceServers.clear(); + for (String url : urls) { + String[] etr = url.split(";"); + if (etr.length == 1) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + iceServers.add(m); + } else if (etr.length == 3) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + m.put("username", etr[1]); + m.put("credential", etr[2]); + iceServers.add(m); + } + } + } + + public void sendPacketToServer(ArrayBuffer buffer) { + if (dataChannel != null && "open".equals(getReadyState(dataChannel))) { + try { + sendIt(dataChannel, buffer); + } catch (Throwable e) { + signalRemoteDisconnect(false); + } + }else { + signalRemoteDisconnect(false); + } + } + + public void signalRemoteConnect() { + List> iceCandidates = new ArrayList<>(); + + TeaVMUtils.addEventListener(peerConnection, "icecandidate", (EventListener) evt -> { + if (hasCandidate(evt)) { + if (iceCandidates.isEmpty()) { + Window.setTimeout(() -> { + if (peerConnection != null && !"disconnected".equals(getConnectionState(peerConnection))) { + clientICECandidate = JSONWriter.valueToString(iceCandidates); + iceCandidates.clear(); + } + }, 3000); + } + Map m = new HashMap<>(); + m.put("sdpMLineIndex", "" + getSdpMLineIndex(evt)); + m.put("candidate", getCandidate(evt)); + iceCandidates.add(m); + } + }); + + dataChannel = createDataChannel(peerConnection, "lan"); + setBinaryType(dataChannel, "arraybuffer"); + + final Object[] evtHandler = new Object[1]; + evtHandler[0] = (EventListener) evt -> { + if (!iceCandidates.isEmpty()) { + Window.setTimeout(() -> ((EventListener)evtHandler[0]).handleEvent(evt), 1); + return; + } + clientDataChannelClosed = false; + clientDataChannelOpen = true; + }; + + TeaVMUtils.addEventListener(dataChannel, "open", (EventListener)evtHandler[0]); + + TeaVMUtils.addEventListener(dataChannel, "message", (EventListener) evt -> { + synchronized(clientLANPacketBuffer) { + clientLANPacketBuffer.add(TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(getData(evt)))); + } + }); + + createOffer(peerConnection, desc -> { + setLocalDescription(peerConnection, desc, () -> { + clientDescription = JSON.stringify(desc); + }, err -> { + logger.error("Failed to set local description! {}", err.getMessage()); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + }); + }, err -> { + logger.error("Failed to set create offer! {}", err.getMessage()); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + }); + + TeaVMUtils.addEventListener(peerConnection, "connectionstatechange", (EventListener) evt -> { + String connectionState = getConnectionState(peerConnection); + if ("disconnected".equals(connectionState)) { + signalRemoteDisconnect(false); + } else if ("connected".equals(connectionState)) { + readyState = READYSTATE_CONNECTED; + } else if ("failed".equals(connectionState)) { + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + }); + } + + public void signalRemoteDescription(String json) { + try { + setRemoteDescription(peerConnection, json); + } catch (Throwable t) { + EagRuntime.debugPrintStackTrace(t); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + } + + public void signalRemoteICECandidate(String candidates) { + try { + addIceCandidates(peerConnection, candidates); + } catch (Throwable t) { + EagRuntime.debugPrintStackTrace(t); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + } + + public void signalRemoteDisconnect(boolean quiet) { + if (dataChannel != null) { + closeIt(dataChannel); + dataChannel = null; + } + if (peerConnection != null) { + closeIt(peerConnection); + } + if (!quiet) clientDataChannelClosed = true; + readyState = READYSTATE_DISCONNECTED; + } + } + + public static final byte PEERSTATE_FAILED = 0; + public static final byte PEERSTATE_SUCCESS = 1; + public static final byte PEERSTATE_LOADING = 2; + + public static class LANPeer { + public LANServer client; + public String peerId; + public JSObject peerConnection; + + public LANPeer(LANServer client, String peerId, JSObject peerConnection) { + this.client = client; + this.peerId = peerId; + this.peerConnection = peerConnection; + + List> iceCandidates = new ArrayList<>(); + + TeaVMUtils.addEventListener(peerConnection, "icecandidate", (EventListener) evt -> { + if (hasCandidate(evt)) { + if (iceCandidates.isEmpty()) { + Window.setTimeout(() -> { + if (peerConnection != null && !"disconnected".equals(getConnectionState(peerConnection))) { + LANPeerEvent.LANPeerICECandidateEvent e = new LANPeerEvent.LANPeerICECandidateEvent(peerId, JSONWriter.valueToString(iceCandidates)); + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, e); + } + iceCandidates.clear(); + } + }, 3000); + } + Map m = new HashMap<>(); + m.put("sdpMLineIndex", "" + getSdpMLineIndex(evt)); + m.put("candidate", getCandidate(evt)); + iceCandidates.add(m); + } + }); + + final Object[] evtHandler = new Object[1]; + evtHandler[0] = (EventListener) evt -> { + if (!iceCandidates.isEmpty()) { + Window.setTimeout(() -> ((EventListener)evtHandler[0]).handleEvent(evt), 1); + return; + } + if (getChannel(evt) == null) return; + JSObject dataChannel = getChannel(evt); + synchronized(fuckTeaVM) { + fuckTeaVM.put(peerId, dataChannel); + } + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, new LANPeerEvent.LANPeerDataChannelEvent(peerId)); + } + TeaVMUtils.addEventListener(dataChannel, "message", (EventListener) evt2 -> { + LANPeerEvent.LANPeerPacketEvent e = new LANPeerEvent.LANPeerPacketEvent(peerId, TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(getData(evt2)))); + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, e); + } + }); + }; + + TeaVMUtils.addEventListener(peerConnection, "datachannel", (EventListener)evtHandler[0]); + + TeaVMUtils.addEventListener(peerConnection, "connectionstatechange", (EventListener) evt -> { + String connectionState = getConnectionState(peerConnection); + if ("disconnected".equals(connectionState)) { + client.signalRemoteDisconnect(peerId); + } else if ("connected".equals(connectionState)) { + if (client.peerState != PEERSTATE_SUCCESS) client.peerState = PEERSTATE_SUCCESS; + } else if ("failed".equals(connectionState)) { + if (client.peerState == PEERSTATE_LOADING) client.peerState = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + }); + } + + public void disconnect() { + synchronized(fuckTeaVM) { + if (fuckTeaVM.get(peerId) != null) { + closeIt(fuckTeaVM.get(peerId)); + fuckTeaVM.remove(peerId); + } + } + closeIt(peerConnection); + } + + public void setRemoteDescription(String descJSON) { + try { + JSONObject remoteDesc = new JSONObject(descJSON); + setRemoteDescription2(peerConnection, descJSON, () -> { + if (remoteDesc.has("type") && "offer".equals(remoteDesc.getString("type"))) { + createAnswer(peerConnection, desc -> { + setLocalDescription(peerConnection, desc, () -> { + LANPeerEvent.LANPeerDescriptionEvent e = new LANPeerEvent.LANPeerDescriptionEvent(peerId, JSON.stringify(desc)); + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, e); + } + if (client.peerStateDesc != PEERSTATE_SUCCESS) client.peerStateDesc = PEERSTATE_SUCCESS; + }, err -> { + logger.error("Failed to set local description for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateDesc == PEERSTATE_LOADING) client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + }); + }, err -> { + logger.error("Failed to create answer for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateDesc == PEERSTATE_LOADING) client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + }); + } + }, err -> { + logger.error("Failed to set remote description for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateDesc == PEERSTATE_LOADING) client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + }); + } catch (Throwable err) { + logger.error("Failed to parse remote description for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateDesc == PEERSTATE_LOADING) client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + } + + public void addICECandidate(String candidates) { + try { + addIceCandidates2(peerConnection, candidates); + if (client.peerStateIce != PEERSTATE_SUCCESS) client.peerStateIce = PEERSTATE_SUCCESS; + } catch (Throwable err) { + logger.error("Failed to parse ice candidate for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateIce == PEERSTATE_LOADING) client.peerStateIce = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + } + } + + public static class LANServer { + public Set> iceServers = new HashSet<>(); + public Map peerList = new HashMap<>(); + public byte peerState = PEERSTATE_LOADING; + public byte peerStateConnect = PEERSTATE_LOADING; + public byte peerStateInitial = PEERSTATE_LOADING; + public byte peerStateDesc = PEERSTATE_LOADING; + public byte peerStateIce = PEERSTATE_LOADING; + + public void setIceServers(String[] urls) { + iceServers.clear(); + for (String url : urls) { + String[] etr = url.split(";"); + if (etr.length == 1) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + iceServers.add(m); + } else if (etr.length == 3) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + m.put("username", etr[1]); + m.put("credential", etr[2]); + iceServers.add(m); + } + } + } + + public void sendPacketToRemoteClient(String peerId, ArrayBuffer buffer) { + LANPeer thePeer = this.peerList.get(peerId); + if (thePeer != null) { + boolean b = false; + synchronized(fuckTeaVM) { + if (fuckTeaVM.get(thePeer.peerId) != null && "open".equals(getReadyState(fuckTeaVM.get(thePeer.peerId)))) { + try { + sendIt(fuckTeaVM.get(thePeer.peerId), buffer); + } catch (Throwable e) { + b = true; + } + } else { + b = true; + } + } + if(b) { + signalRemoteDisconnect(peerId); + } + } + } + + public void resetPeerStates() { + peerState = peerStateConnect = peerStateInitial = peerStateDesc = peerStateIce = PEERSTATE_LOADING; + } + + public void signalRemoteConnect(String peerId) { + try { + JSObject peerConnection = createRTCPeerConnection(JSONWriter.valueToString(iceServers)); + LANPeer peerInstance = new LANPeer(this, peerId, peerConnection); + peerList.put(peerId, peerInstance); + if (peerStateConnect != PEERSTATE_SUCCESS) peerStateConnect = PEERSTATE_SUCCESS; + } catch (Throwable e) { + if (peerStateConnect == PEERSTATE_LOADING) peerStateConnect = PEERSTATE_FAILED; + } + } + + public void signalRemoteDescription(String peerId, String descJSON) { + LANPeer thePeer = peerList.get(peerId); + if (thePeer != null) { + thePeer.setRemoteDescription(descJSON); + } + } + + public void signalRemoteICECandidate(String peerId, String candidate) { + LANPeer thePeer = peerList.get(peerId); + if (thePeer != null) { + thePeer.addICECandidate(candidate); + } + } + + public void signalRemoteDisconnect(String peerId) { + if (peerId == null || peerId.isEmpty()) { + for (LANPeer thePeer : peerList.values()) { + if (thePeer != null) { + try { + thePeer.disconnect(); + } catch (Throwable ignored) {} + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.put(thePeer.peerId, new LANPeerEvent.LANPeerDisconnectEvent(thePeer.peerId)); + } + } + } + peerList.clear(); + synchronized(fuckTeaVM) { + fuckTeaVM.clear(); + } + return; + } + LANPeer thePeer = peerList.get(peerId); + if(thePeer != null) { + peerList.remove(peerId); + try { + thePeer.disconnect(); + } catch (Throwable ignored) {} + synchronized(fuckTeaVM) { + fuckTeaVM.remove(peerId); + } + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.put(thePeer.peerId, new LANPeerEvent.LANPeerDisconnectEvent(peerId)); + } + } + } + + public int countPeers() { + return peerList.size(); + } + } + + @JSFunctor + public interface EmptyHandler extends JSObject { + void call(); + } + + @JSFunctor + public interface DescHandler extends JSObject { + void call(JSObject desc); + } + + @JSFunctor + public interface ErrorHandler extends JSObject { + void call(JSError err); + } + + @JSBody(params = { "obj" }, script = "return typeof obj === \"string\";") + private static native boolean isString(JSObject obj); + + private static ArrayBuffer convertToArrayBuffer(byte[] arr) { + return TeaVMUtils.unwrapUnsignedByteArray(arr).getBuffer(); + } + + private static final Map relayQueryLimited = new HashMap<>(); + private static final Map relayQueryBlocked = new HashMap<>(); + + private static class RelayQueryImpl implements RelayQuery { + + private final WebSocket sock; + private final String uri; + + private boolean open; + private boolean failed; + + private boolean hasRecievedAnyData = false; + + private int vers = -1; + private String comment = ""; + private String brand = ""; + + private long connectionOpenedAt; + private long connectionPingStart = -1; + private long connectionPingTimer = -1; + + private RateLimit rateLimitStatus = RateLimit.NONE; + + private VersionMismatch versError = VersionMismatch.UNKNOWN; + + private RelayQueryImpl(String uri) { + this.uri = uri; + WebSocket s; + try { + connectionOpenedAt = System.currentTimeMillis(); + s = WebSocket.create(uri); + s.setBinaryType("arraybuffer"); + open = true; + failed = false; + }catch(Throwable t) { + connectionOpenedAt = 0l; + sock = null; + open = false; + failed = true; + return; + } + sock = s; + sock.onOpen(evt -> { + try { + connectionPingStart = System.currentTimeMillis(); + PlatformNetworking.nativeBinarySend(sock, convertToArrayBuffer( + IPacket.writePacket(new IPacket00Handshake(0x03, RelayManager.preferredRelayVersion, "")) + )); + } catch (IOException e) { + logger.error(e.toString()); + sock.close(); + failed = true; + } + }); + sock.onMessage(evt -> { + if(evt.getData() != null && !isString(evt.getData())) { + hasRecievedAnyData = true; + byte[] arr = TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(evt.getDataAsArray())); + if(arr.length == 2 && arr[0] == (byte)0xFC) { + long millis = System.currentTimeMillis(); + if(arr[1] == (byte)0x00 || arr[1] == (byte)0x01) { + rateLimitStatus = RateLimit.BLOCKED; + relayQueryLimited.put(RelayQueryImpl.this.uri, millis); + }else if(arr[1] == (byte)0x02) { + rateLimitStatus = RateLimit.NOW_LOCKED; + relayQueryLimited.put(RelayQueryImpl.this.uri, millis); + relayQueryBlocked.put(RelayQueryImpl.this.uri, millis); + }else { + rateLimitStatus = RateLimit.LOCKED; + relayQueryBlocked.put(RelayQueryImpl.this.uri, millis); + } + failed = true; + open = false; + sock.close(); + }else { + if(open) { + try { + IPacket pkt = IPacket.readPacket(new DataInputStream(new ByteArrayInputStream(arr))); + if(pkt instanceof IPacket69Pong) { + IPacket69Pong ipkt = (IPacket69Pong)pkt; + versError = VersionMismatch.COMPATIBLE; + if(connectionPingTimer == -1) { + connectionPingTimer = System.currentTimeMillis() - connectionPingStart; + } + vers = ipkt.protcolVersion; + comment = ipkt.comment; + brand = ipkt.brand; + open = false; + failed = false; + sock.close(); + }else if(pkt instanceof IPacket70SpecialUpdate) { + IPacket70SpecialUpdate ipkt = (IPacket70SpecialUpdate)pkt; + if(ipkt.operation == IPacket70SpecialUpdate.OPERATION_UPDATE_CERTIFICATE) { + UpdateService.addCertificateToSet(ipkt.updatePacket); + } + }else if(pkt instanceof IPacketFFErrorCode) { + IPacketFFErrorCode ipkt = (IPacketFFErrorCode)pkt; + if(ipkt.code == IPacketFFErrorCode.TYPE_PROTOCOL_VERSION) { + String s1 = ipkt.desc.toLowerCase(); + if(s1.contains("outdated client") || s1.contains("client outdated")) { + versError = VersionMismatch.CLIENT_OUTDATED; + }else if(s1.contains("outdated server") || s1.contains("server outdated") || + s1.contains("outdated relay") || s1.contains("server relay")) { + versError = VersionMismatch.RELAY_OUTDATED; + }else { + versError = VersionMismatch.UNKNOWN; + } + } + logger.error("{}\": Recieved query error code {}: {}", uri, ipkt.code, ipkt.desc); + open = false; + failed = true; + sock.close(); + }else { + throw new IOException("Unexpected packet '" + pkt.getClass().getSimpleName() + "'"); + } + } catch (IOException e) { + logger.error("Relay Query Error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + open = false; + failed = true; + sock.close(); + } + } + } + } + }); + sock.onClose(evt -> { + open = false; + if(!hasRecievedAnyData) { + failed = true; + Long l = relayQueryBlocked.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 400000l) { + rateLimitStatus = RateLimit.LOCKED; + return; + } + } + l = relayQueryLimited.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 900000l) { + rateLimitStatus = RateLimit.BLOCKED; + return; + } + } + } + }); + } + + @Override + public boolean isQueryOpen() { + return open; + } + + @Override + public boolean isQueryFailed() { + return failed; + } + + @Override + public RateLimit isQueryRateLimit() { + return rateLimitStatus; + } + + @Override + public void close() { + if(sock != null && open) { + sock.close(); + } + open = false; + } + + @Override + public int getVersion() { + return vers; + } + + @Override + public String getComment() { + return comment; + } + + @Override + public String getBrand() { + return brand; + } + + @Override + public long getPing() { + return connectionPingTimer < 1 ? 1 : connectionPingTimer; + } + + @Override + public VersionMismatch getCompatible() { + return versError; + } + + } + + private static class RelayQueryRatelimitDummy implements RelayQuery { + + private final RateLimit type; + + private RelayQueryRatelimitDummy(RateLimit type) { + this.type = type; + } + + @Override + public boolean isQueryOpen() { + return false; + } + + @Override + public boolean isQueryFailed() { + return true; + } + + @Override + public RateLimit isQueryRateLimit() { + return type; + } + + @Override + public void close() { + } + + @Override + public int getVersion() { + return RelayManager.preferredRelayVersion; + } + + @Override + public String getComment() { + return "this query was rate limited"; + } + + @Override + public String getBrand() { + return "lax1dude"; + } + + @Override + public long getPing() { + return 0l; + } + + @Override + public VersionMismatch getCompatible() { + return VersionMismatch.COMPATIBLE; + } + + } + + public static RelayQuery openRelayQuery(String addr) { + long millis = System.currentTimeMillis(); + + Long l = relayQueryBlocked.get(addr); + if(l != null && millis - l.longValue() < 60000l) { + return new RelayQueryRatelimitDummy(RelayQuery.RateLimit.LOCKED); + } + + l = relayQueryLimited.get(addr); + if(l != null && millis - l.longValue() < 10000l) { + return new RelayQueryRatelimitDummy(RelayQuery.RateLimit.BLOCKED); + } + + return new RelayQueryImpl(addr); + } + + private static class RelayWorldsQueryImpl implements RelayWorldsQuery { + + private final WebSocket sock; + private final String uri; + + private boolean open; + private boolean failed; + + private boolean hasRecievedAnyData = false; + private RelayQuery.RateLimit rateLimitStatus = RelayQuery.RateLimit.NONE; + + private RelayQuery.VersionMismatch versError = RelayQuery.VersionMismatch.UNKNOWN; + + private List worlds = null; + + private RelayWorldsQueryImpl(String uri) { + this.uri = uri; + WebSocket s; + try { + s = WebSocket.create(uri); + s.setBinaryType("arraybuffer"); + open = true; + failed = false; + }catch(Throwable t) { + sock = null; + open = false; + failed = true; + return; + } + sock = s; + sock.onOpen(evt -> { + try { + PlatformNetworking.nativeBinarySend(sock, convertToArrayBuffer( + IPacket.writePacket(new IPacket00Handshake(0x04, RelayManager.preferredRelayVersion, "")) + )); + } catch (IOException e) { + logger.error(e.toString()); + sock.close(); + open = false; + failed = true; + } + }); + sock.onMessage(evt -> { + if(evt.getData() != null && !isString(evt.getData())) { + hasRecievedAnyData = true; + byte[] arr = TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(evt.getDataAsArray())); + if(arr.length == 2 && arr[0] == (byte)0xFC) { + long millis = System.currentTimeMillis(); + if(arr[1] == (byte)0x00 || arr[1] == (byte)0x01) { + rateLimitStatus = RelayQuery.RateLimit.BLOCKED; + relayQueryLimited.put(RelayWorldsQueryImpl.this.uri, millis); + }else if(arr[1] == (byte)0x02) { + rateLimitStatus = RelayQuery.RateLimit.NOW_LOCKED; + relayQueryLimited.put(RelayWorldsQueryImpl.this.uri, millis); + relayQueryBlocked.put(RelayWorldsQueryImpl.this.uri, millis); + }else { + rateLimitStatus = RelayQuery.RateLimit.LOCKED; + relayQueryBlocked.put(RelayWorldsQueryImpl.this.uri, millis); + } + open = false; + failed = true; + sock.close(); + }else { + if(open) { + try { + IPacket pkt = IPacket.readPacket(new DataInputStream(new ByteArrayInputStream(arr))); + if(pkt instanceof IPacket07LocalWorlds) { + worlds = ((IPacket07LocalWorlds)pkt).worldsList; + sock.close(); + open = false; + failed = false; + }else if(pkt instanceof IPacket70SpecialUpdate) { + IPacket70SpecialUpdate ipkt = (IPacket70SpecialUpdate)pkt; + if(ipkt.operation == IPacket70SpecialUpdate.OPERATION_UPDATE_CERTIFICATE) { + UpdateService.addCertificateToSet(ipkt.updatePacket); + } + }else if(pkt instanceof IPacketFFErrorCode) { + IPacketFFErrorCode ipkt = (IPacketFFErrorCode)pkt; + if(ipkt.code == IPacketFFErrorCode.TYPE_PROTOCOL_VERSION) { + String s1 = ipkt.desc.toLowerCase(); + if(s1.contains("outdated client") || s1.contains("client outdated")) { + versError = RelayQuery.VersionMismatch.CLIENT_OUTDATED; + }else if(s1.contains("outdated server") || s1.contains("server outdated") || + s1.contains("outdated relay") || s1.contains("server relay")) { + versError = RelayQuery.VersionMismatch.RELAY_OUTDATED; + }else { + versError = RelayQuery.VersionMismatch.UNKNOWN; + } + } + logger.error("{}: Recieved query error code {}: {}", uri, ipkt.code, ipkt.desc); + open = false; + failed = true; + sock.close(); + }else { + throw new IOException("Unexpected packet '" + pkt.getClass().getSimpleName() + "'"); + } + } catch (IOException e) { + logger.error("Relay World Query Error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + open = false; + failed = true; + sock.close(); + } + } + } + } + }); + sock.onClose(evt -> { + open = false; + if(!hasRecievedAnyData) { + failed = true; + Long l = relayQueryBlocked.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 400000l) { + rateLimitStatus = RelayQuery.RateLimit.LOCKED; + return; + } + } + l = relayQueryLimited.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 900000l) { + rateLimitStatus = RelayQuery.RateLimit.BLOCKED; + return; + } + } + } + }); + } + + @Override + public boolean isQueryOpen() { + return open; + } + + @Override + public boolean isQueryFailed() { + return failed; + } + + @Override + public RelayQuery.RateLimit isQueryRateLimit() { + return rateLimitStatus; + } + + @Override + public void close() { + if(open && sock != null) { + sock.close(); + } + open = false; + } + + @Override + public List getWorlds() { + return worlds; + } + + @Override + public RelayQuery.VersionMismatch getCompatible() { + return versError; + } + + } + + private static class RelayWorldsQueryRatelimitDummy implements RelayWorldsQuery { + + private final RelayQuery.RateLimit rateLimit; + + private RelayWorldsQueryRatelimitDummy(RelayQuery.RateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + @Override + public boolean isQueryOpen() { + return false; + } + + @Override + public boolean isQueryFailed() { + return true; + } + + @Override + public RelayQuery.RateLimit isQueryRateLimit() { + return rateLimit; + } + + @Override + public void close() { + } + + @Override + public List getWorlds() { + return new ArrayList(0); + } + + @Override + public RelayQuery.VersionMismatch getCompatible() { + return RelayQuery.VersionMismatch.COMPATIBLE; + } + } + + public static RelayWorldsQuery openRelayWorldsQuery(String addr) { + long millis = System.currentTimeMillis(); + + Long l = relayQueryBlocked.get(addr); + if(l != null && millis - l.longValue() < 60000l) { + return new RelayWorldsQueryRatelimitDummy(RelayQuery.RateLimit.LOCKED); + } + + l = relayQueryLimited.get(addr); + if(l != null && millis - l.longValue() < 10000l) { + return new RelayWorldsQueryRatelimitDummy(RelayQuery.RateLimit.BLOCKED); + } + + return new RelayWorldsQueryImpl(addr); + } + + private static class RelayServerSocketImpl implements RelayServerSocket { + + private final WebSocket sock; + private final String uri; + + private boolean open; + private boolean closed; + private boolean failed; + + private boolean hasRecievedAnyData; + + private final List exceptions = new LinkedList(); + private final List packets = new LinkedList(); + + private RelayServerSocketImpl(String uri, int timeout) { + this.uri = uri; + WebSocket s; + try { + s = WebSocket.create(uri); + s.setBinaryType("arraybuffer"); + open = false; + closed = false; + failed = false; + }catch(Throwable t) { + exceptions.add(t); + sock = null; + open = false; + closed = true; + failed = true; + return; + } + sock = s; + sock.onOpen(evt -> open = true); + sock.onMessage(evt -> { + if(evt.getData() != null && !isString(evt.getData())) { + hasRecievedAnyData = true; + try { + IPacket pkt = IPacket.readPacket(new DataInputStream(new ByteArrayInputStream(TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(evt.getDataAsArray()))))); + if(pkt instanceof IPacket70SpecialUpdate) { + IPacket70SpecialUpdate ipkt = (IPacket70SpecialUpdate)pkt; + if(ipkt.operation == IPacket70SpecialUpdate.OPERATION_UPDATE_CERTIFICATE) { + UpdateService.addCertificateToSet(ipkt.updatePacket); + } + }else { + packets.add(pkt); + } + } catch (IOException e) { + exceptions.add(e); + logger.error("Relay Socket Error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + open = false; + failed = true; + closed = true; + sock.close(); + } + } + }); + sock.onClose(evt -> { + if (!hasRecievedAnyData) { + failed = true; + } + open = false; + closed = true; + }); + Window.setTimeout(() -> { + if(!open && !closed) { + closed = true; + sock.close(); + } + }, timeout); + } + + @Override + public boolean isOpen() { + return open; + } + + @Override + public boolean isClosed() { + return closed; + } + + @Override + public void close() { + if(open && sock != null) { + sock.close(); + } + open = false; + closed = true; + } + + @Override + public boolean isFailed() { + return failed; + } + + @Override + public Throwable getException() { + if(!exceptions.isEmpty()) { + return exceptions.remove(0); + }else { + return null; + } + } + + @Override + public void writePacket(IPacket pkt) { + try { + PlatformNetworking.nativeBinarySend(sock, convertToArrayBuffer(IPacket.writePacket(pkt))); + } catch (Throwable e) { + logger.error("Relay connection error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + exceptions.add(e); + failed = true; + open = false; + closed = true; + sock.close(); + } + } + + @Override + public IPacket readPacket() { + if(!packets.isEmpty()) { + return packets.remove(0); + }else { + return null; + } + } + + @Override + public IPacket nextPacket() { + if(!packets.isEmpty()) { + return packets.get(0); + }else { + return null; + } + } + + @Override + public RelayQuery.RateLimit getRatelimitHistory() { + if(relayQueryBlocked.containsKey(uri)) { + return RelayQuery.RateLimit.LOCKED; + } + if(relayQueryLimited.containsKey(uri)) { + return RelayQuery.RateLimit.BLOCKED; + } + return RelayQuery.RateLimit.NONE; + } + + @Override + public String getURI() { + return uri; + } + + } + + private static class RelayServerSocketRatelimitDummy implements RelayServerSocket { + + private final RelayQuery.RateLimit limit; + + private RelayServerSocketRatelimitDummy(RelayQuery.RateLimit limit) { + this.limit = limit; + } + + @Override + public boolean isOpen() { + return false; + } + + @Override + public boolean isClosed() { + return true; + } + + @Override + public void close() { + } + + @Override + public boolean isFailed() { + return true; + } + + @Override + public Throwable getException() { + return null; + } + + @Override + public void writePacket(IPacket pkt) { + } + + @Override + public IPacket readPacket() { + return null; + } + + @Override + public IPacket nextPacket() { + return null; + } + + @Override + public RelayQuery.RateLimit getRatelimitHistory() { + return limit; + } + + @Override + public String getURI() { + return ""; + } + + } + + public static RelayServerSocket openRelayConnection(String addr, int timeout) { + long millis = System.currentTimeMillis(); + + Long l = relayQueryBlocked.get(addr); + if(l != null && millis - l.longValue() < 60000l) { + return new RelayServerSocketRatelimitDummy(RelayQuery.RateLimit.LOCKED); + } + + l = relayQueryLimited.get(addr); + if(l != null && millis - l.longValue() < 10000l) { + return new RelayServerSocketRatelimitDummy(RelayQuery.RateLimit.BLOCKED); + } + + return new RelayServerSocketImpl(addr, timeout); + } + + private static LANClient rtcLANClient = null; + + public static void startRTCLANClient() { + if (rtcLANClient == null) { + rtcLANClient = new LANClient(); + } + } + + private static final List clientLANPacketBuffer = new ArrayList<>(); + + private static String clientICECandidate = null; + private static String clientDescription = null; + private static boolean clientDataChannelOpen = false; + private static boolean clientDataChannelClosed = true; + + public static int clientLANReadyState() { + return rtcLANClient.readyState; + } + + public static void clientLANCloseConnection() { + rtcLANClient.signalRemoteDisconnect(false); + } + + // todo: ArrayBuffer version + public static void clientLANSendPacket(byte[] pkt) { + rtcLANClient.sendPacketToServer(convertToArrayBuffer(pkt)); + } + + public static byte[] clientLANReadPacket() { + synchronized(clientLANPacketBuffer) { + return !clientLANPacketBuffer.isEmpty() ? clientLANPacketBuffer.remove(0) : null; + } + } + + public static List clientLANReadAllPacket() { + synchronized(clientLANPacketBuffer) { + if(!clientLANPacketBuffer.isEmpty()) { + List ret = new ArrayList(clientLANPacketBuffer); + clientLANPacketBuffer.clear(); + return ret; + }else { + return null; + } + } + } + + public static void clientLANSetICEServersAndConnect(String[] servers) { + rtcLANClient.setIceServers(servers); + if(clientLANReadyState() == LANClient.READYSTATE_CONNECTED || clientLANReadyState() == LANClient.READYSTATE_CONNECTING) { + rtcLANClient.signalRemoteDisconnect(true); + } + rtcLANClient.initialize(); + rtcLANClient.signalRemoteConnect(); + } + + public static void clearLANClientState() { + clientICECandidate = null; + clientDescription = null; + clientDataChannelOpen = false; + clientDataChannelClosed = true; + } + + public static String clientLANAwaitICECandidate() { + if(clientICECandidate != null) { + String ret = clientICECandidate; + clientICECandidate = null; + return ret; + }else { + return null; + } + } + + public static String clientLANAwaitDescription() { + if(clientDescription != null) { + String ret = clientDescription; + clientDescription = null; + return ret; + }else { + return null; + } + } + + public static boolean clientLANAwaitChannel() { + if(clientDataChannelOpen) { + clientDataChannelOpen = false; + return true; + }else { + return false; + } + } + + public static boolean clientLANClosed() { + return clientDataChannelClosed; + } + + public static void clientLANSetICECandidate(String candidate) { + rtcLANClient.signalRemoteICECandidate(candidate); + } + + public static void clientLANSetDescription(String description) { + rtcLANClient.signalRemoteDescription(description); + } + + private static LANServer rtcLANServer = null; + + public static void startRTCLANServer() { + if (rtcLANServer == null) { + rtcLANServer = new LANServer(); + } + } + + private static final ListMultimap serverLANEventBuffer = LinkedListMultimap.create(); + + public static void serverLANInitializeServer(String[] servers) { + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.clear(); + } + rtcLANServer.resetPeerStates(); + rtcLANServer.setIceServers(servers); + } + + public static void serverLANCloseServer() { + rtcLANServer.signalRemoteDisconnect(""); + } + + public static LANPeerEvent serverLANGetEvent(String clientId) { + synchronized(serverLANEventBuffer) { + if(!serverLANEventBuffer.isEmpty()) { + List l = serverLANEventBuffer.get(clientId); + if(!l.isEmpty()) { + return l.remove(0); + } + } + return null; + } + } + + public static List serverLANGetAllEvent(String clientId) { + synchronized(serverLANEventBuffer) { + if(!serverLANEventBuffer.isEmpty()) { + List l = serverLANEventBuffer.removeAll(clientId); + if(l.isEmpty()) { + return null; + } + return l; + } + return null; + } + } + + public static void serverLANWritePacket(String peer, byte[] data) { + rtcLANServer.sendPacketToRemoteClient(peer, TeaVMUtils.unwrapUnsignedByteArray(data).getBuffer()); + } + + public static void serverLANCreatePeer(String peer) { + rtcLANServer.signalRemoteConnect(peer); + } + + public static void serverLANPeerICECandidates(String peer, String iceCandidates) { + rtcLANServer.signalRemoteICECandidate(peer, iceCandidates); + } + + public static void serverLANPeerDescription(String peer, String description) { + rtcLANServer.signalRemoteDescription(peer, description); + } + + public static void serverLANDisconnectPeer(String peer) { + rtcLANServer.signalRemoteDisconnect(peer); + } + + public static int countPeers() { + if (rtcLANServer == null) { + return 0; + } + return rtcLANServer.countPeers(); + } +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayBufferAllocator.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayBufferAllocator.java index a4eed43..ad086fe 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayBufferAllocator.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayBufferAllocator.java @@ -7,16 +7,18 @@ import org.teavm.jso.typedarrays.Uint16Array; import org.teavm.jso.typedarrays.Uint8Array; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerArrayBufferAllocator { @@ -31,13 +33,25 @@ public class EaglerArrayBufferAllocator { return new EaglerArrayByteBuffer(DataView.create(ArrayBuffer.create(size))); } + public static ByteBuffer wrapByteBufferTeaVM(DataView dv) { + return new EaglerArrayByteBuffer(dv); + } + public static IntBuffer allocateIntBuffer(int size) { return new EaglerArrayIntBuffer(DataView.create(ArrayBuffer.create(size << 2))); } + public static IntBuffer wrapIntBufferTeaVM(DataView dv) { + return new EaglerArrayIntBuffer(dv); + } + public static FloatBuffer allocateFloatBuffer(int size) { return new EaglerArrayFloatBuffer(DataView.create(ArrayBuffer.create(size << 2))); } + + public static FloatBuffer wrapFloatBufferTeaVM(DataView dv) { + return new EaglerArrayFloatBuffer(dv); + } public static DataView getDataView(ByteBuffer buffer) { if(buffer instanceof EaglerArrayByteBuffer) { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayByteBuffer.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayByteBuffer.java index 80c7030..5f2760c 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayByteBuffer.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayByteBuffer.java @@ -5,16 +5,18 @@ import org.teavm.jso.typedarrays.DataView; import org.teavm.jso.typedarrays.Uint8Array; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerArrayByteBuffer implements ByteBuffer { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayFloatBuffer.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayFloatBuffer.java index c8aea4c..d69d580 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayFloatBuffer.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayFloatBuffer.java @@ -5,16 +5,18 @@ import org.teavm.jso.typedarrays.DataView; import org.teavm.jso.typedarrays.Uint8Array; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerArrayFloatBuffer implements FloatBuffer { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayIntBuffer.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayIntBuffer.java index fb60c1e..e2eaba8 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayIntBuffer.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayIntBuffer.java @@ -5,16 +5,18 @@ import org.teavm.jso.typedarrays.DataView; import org.teavm.jso.typedarrays.Uint8Array; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerArrayIntBuffer implements IntBuffer { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayShortBuffer.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayShortBuffer.java index 2a294ea..a21e63e 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayShortBuffer.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/EaglerArrayShortBuffer.java @@ -5,16 +5,18 @@ import org.teavm.jso.typedarrays.DataView; import org.teavm.jso.typedarrays.Uint8Array; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EaglerArrayShortBuffer implements ShortBuffer { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/EventHandler.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/EventHandler.java deleted file mode 100644 index d085e54..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/EventHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSFunctor; -import org.teavm.jso.JSObject; - -@JSFunctor -public interface EventHandler extends JSObject { - void handleEvent(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCountRequest.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCountRequest.java deleted file mode 100644 index 6a808fd..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCountRequest.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSProperty; - -public interface IDBCountRequest extends IDBRequest { - @JSProperty - int getResult(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursor.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursor.java deleted file mode 100644 index 81ed2a9..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSMethod; -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; - -public interface IDBCursor extends JSObject { - String DIRECTION_NEXT = "next"; - - String DIRECTION_NEXT_UNIQUE = "nextunique"; - - String DIRECTION_PREVIOUS = "prev"; - - String DIRECTION_PREVIOUS_UNIQUE = "prevunique"; - - @JSProperty - IDBCursorSource getSource(); - - @JSProperty - String getDirection(); - - @JSProperty - JSObject getKey(); - - @JSProperty - JSObject getValue(); - - @JSProperty - JSObject getPrimaryKey(); - - IDBRequest update(JSObject value); - - void advance(int count); - - @JSMethod("continue") - void doContinue(); - - IDBRequest delete(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursorRequest.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursorRequest.java deleted file mode 100644 index 9382da7..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursorRequest.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSProperty; - -public interface IDBCursorRequest extends IDBRequest { - @JSProperty - IDBCursor getResult(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursorSource.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursorSource.java deleted file mode 100644 index 86803e0..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBCursorSource.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSObject; - -public interface IDBCursorSource extends JSObject { -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBDatabase.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBDatabase.java deleted file mode 100644 index d6942c1..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBDatabase.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSProperty; -import org.teavm.jso.dom.events.EventTarget; - -public interface IDBDatabase extends EventTarget { - String TRANSACTION_READONLY = "readonly"; - - String TRANSACTION_READWRITE = "readwrite"; - - String TRANSACTION_VERSIONCHANGE = "versionchange"; - - @JSProperty - String getName(); - - @JSProperty - int getVersion(); - - @JSProperty - String[] getObjectStoreNames(); - - IDBObjectStore createObjectStore(String name, IDBObjectStoreParameters optionalParameters); - - IDBObjectStore createObjectStore(String name); - - void deleteObjectStore(String name); - - IDBTransaction transaction(String storeName, String transactionMode); - - IDBTransaction transaction(String storeName); - - IDBTransaction transaction(String[] storeNames, String transactionMode); - - IDBTransaction transaction(String[] storeNames); - - void close(); - - @JSProperty("onabort") - void setOnAbort(EventHandler handler); - - @JSProperty("onerror") - void setOnError(EventHandler handler); - - @JSProperty("onversionchange") - void setOnVersionChange(EventHandler handler); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBError.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBError.java deleted file mode 100644 index a29ec46..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBError.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; - -public abstract class IDBError implements JSObject { - @JSProperty - public abstract String getName(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBFactory.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBFactory.java deleted file mode 100644 index bebcd85..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; - -public abstract class IDBFactory implements JSObject { - public static boolean isSupported() { - return !getInstanceImpl().isUndefined(); - } - - @JSBody(script = "return typeof this === 'undefined';") - private native boolean isUndefined(); - - public static IDBFactory getInstance() { - IDBFactory factory = getInstanceImpl(); - if (!factory.isUndefined()) { - throw new IllegalStateException("IndexedDB is not supported in this browser"); - } - return factory; - } - - @JSBody(script = "return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || " - + "window.msIndexedDB;") - static native IDBFactory getInstanceImpl(); - - public abstract IDBOpenDBRequest open(String name, int version); - - public abstract IDBOpenDBRequest deleteDatabase(String name); - - public abstract int cmp(JSObject a, JSObject b); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBGetRequest.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBGetRequest.java deleted file mode 100644 index 3109e55..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBGetRequest.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; - -public interface IDBGetRequest extends IDBRequest { - @JSProperty - JSObject getResult(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBIndex.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBIndex.java deleted file mode 100644 index 613bd15..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBIndex.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; -import org.teavm.jso.core.JSString; - -public abstract class IDBIndex implements JSObject, IDBCursorSource { - @JSProperty - public abstract String getName(); - - @JSProperty("keyPath") - abstract JSObject getKeyPathImpl(); - - public final String[] getKeyPath() { - JSObject result = getKeyPathImpl(); - if (JSString.isInstance(result)) { - return new String[] { result.cast().stringValue() }; - } else { - return unwrapStringArray(result); - } - } - - @JSBody(params = { "obj" }, script = "return this;") - private native String[] unwrapStringArray(JSObject obj); - - @JSProperty - public abstract boolean isMultiEntry(); - - @JSProperty - public abstract boolean isUnique(); - - public abstract IDBCursorRequest openCursor(); - - public abstract IDBCursorRequest openCursor(IDBKeyRange range); - - public abstract IDBCursorRequest openKeyCursor(); - - public abstract IDBGetRequest get(JSObject key); - - public abstract IDBGetRequest getKey(JSObject key); - - public abstract IDBCountRequest count(JSObject key); - - public abstract IDBCountRequest count(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBKeyRange.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBKeyRange.java deleted file mode 100644 index f6d09a9..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBKeyRange.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; - -public abstract class IDBKeyRange implements JSObject { - @JSProperty - public abstract JSObject getLower(); - - @JSProperty - public abstract JSObject getUpper(); - - @JSProperty - public abstract boolean isLowerOpen(); - - @JSProperty - public abstract boolean isUpperOpen(); - - @JSBody(params = "value", script = "return IDBKeyRange.only(value);") - public static native IDBKeyRange only(JSObject value); - - @JSBody(params = { "lower", "open" }, script = "return IDBKeyRange.lowerBound(lower, open);") - public static native IDBKeyRange lowerBound(JSObject lower, boolean open); - - public static IDBKeyRange lowerBound(JSObject lower) { - return lowerBound(lower, false); - } - - @JSBody(params = { "upper", "open" }, script = "return IDBKeyRange.upperBound(upper, open);") - public static native IDBKeyRange upperBound(JSObject upper, boolean open); - - public static IDBKeyRange upperBound(JSObject upper) { - return upperBound(upper, false); - } - - @JSBody(params = { "lower", "upper", "lowerOpen", "upperOpen" }, - script = "return IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen);") - public static native IDBKeyRange bound(JSObject lower, JSObject upper, boolean lowerOpen, boolean upperOpen); - - public static IDBKeyRange bound(JSObject lower, JSObject upper) { - return bound(lower, upper, false, false); - } -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBObjectStore.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBObjectStore.java deleted file mode 100644 index 51ffdeb..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBObjectStore.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; -import org.teavm.jso.core.JSString; - -public abstract class IDBObjectStore implements JSObject, IDBCursorSource { - @JSProperty - public abstract String getName(); - - @JSProperty("keyPath") - abstract JSObject getKeyPathImpl(); - - public final String[] getKeyPath() { - JSObject result = getKeyPathImpl(); - if (JSString.isInstance(result)) { - return new String[] { result.cast().stringValue() }; - } else { - return unwrapStringArray(result); - } - } - - @JSBody(params = { "obj" }, script = "return this;") - private native String[] unwrapStringArray(JSObject obj); - - @JSProperty - public abstract String[] getIndexNames(); - - @JSProperty - public abstract boolean isAutoIncrement(); - - public abstract IDBRequest put(JSObject value, JSObject key); - - public abstract IDBRequest put(JSObject value); - - public abstract IDBRequest add(JSObject value, JSObject key); - - public abstract IDBRequest add(JSObject value); - - public abstract IDBRequest delete(JSObject key); - - public abstract IDBGetRequest get(JSObject key); - - public abstract IDBRequest clear(); - - public abstract IDBCursorRequest openCursor(); - - public abstract IDBCursorRequest openCursor(IDBKeyRange range); - - public abstract IDBIndex createIndex(String name, String key); - - public abstract IDBIndex createIndex(String name, String[] keys); - - public abstract IDBIndex index(String name); - - public abstract void deleteIndex(String name); - - public abstract IDBCountRequest count(); - - public abstract IDBCountRequest count(JSObject key); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBObjectStoreParameters.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBObjectStoreParameters.java deleted file mode 100644 index a3e1053..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBObjectStoreParameters.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; - -public abstract class IDBObjectStoreParameters implements JSObject { - @JSBody(script = "return {};") - public static native IDBObjectStoreParameters create(); - - public final IDBObjectStoreParameters keyPath(String... keys) { - setKeyPath(keys); - return this; - } - - public final IDBObjectStoreParameters autoIncrement(boolean autoIncrement) { - setAutoIncrement(autoIncrement); - return this; - } - - @JSProperty - abstract void setKeyPath(String[] keys); - - @JSProperty - abstract void setAutoIncrement(boolean autoIncrement); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBOpenDBRequest.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBOpenDBRequest.java deleted file mode 100644 index c476ada..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBOpenDBRequest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSProperty; -import org.teavm.jso.dom.events.EventListener; - -public interface IDBOpenDBRequest extends IDBRequest { - @JSProperty - IDBDatabase getResult(); - - @JSProperty - void setOnBlocked(EventHandler handler); - - @JSProperty("onupgradeneeded") - void setOnUpgradeNeeded(EventListener listener); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBRequest.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBRequest.java deleted file mode 100644 index 677d904..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSProperty; -import org.teavm.jso.dom.events.EventTarget; - -public interface IDBRequest extends EventTarget { - String STATE_PENDING = "pending"; - String STATE_DONE = "done"; - - @JSProperty - IDBError getError(); - - @JSProperty - IDBRequestSource getSource(); - - @JSProperty - IDBTransaction getTransaction(); - - @JSProperty - String getReadyState(); - - @JSProperty("onerror") - void setOnError(EventHandler handler); - - @JSProperty("onsuccess") - void setOnSuccess(EventHandler handler); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBRequestSource.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBRequestSource.java deleted file mode 100644 index ec39341..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBRequestSource.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSObject; - -public interface IDBRequestSource extends JSObject { -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBTransaction.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBTransaction.java deleted file mode 100644 index 0bf0f1f..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBTransaction.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; -import org.teavm.jso.dom.events.EventTarget; - -public interface IDBTransaction extends JSObject, EventTarget { - @JSProperty - String getMode(); - - @JSProperty - IDBDatabase getDb(); - - @JSProperty - IDBError getError(); - - IDBObjectStore objectStore(String name); - - void abort(); - - @JSProperty("onabort") - void setOnAbort(EventHandler handler); - - @JSProperty("oncomplete") - void setOnComplete(EventHandler handler); - - @JSProperty("onerror") - void setOnError(EventHandler handler); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBVersionChangeEvent.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBVersionChangeEvent.java deleted file mode 100644 index 56dce48..0000000 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/indexeddb/IDBVersionChangeEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * 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 - * - * http://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. - */ -package net.lax1dude.eaglercraft.v1_8.internal.indexeddb; - -import org.teavm.jso.JSProperty; -import org.teavm.jso.dom.events.Event; - -public interface IDBVersionChangeEvent extends Event { - @JSProperty - int getOldVersion(); - - @JSProperty - int getNewVersion(); -} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ArrayBufferInputStream.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ArrayBufferInputStream.java index 9b423e3..6112d4d 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ArrayBufferInputStream.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ArrayBufferInputStream.java @@ -6,16 +6,18 @@ import org.teavm.jso.typedarrays.ArrayBuffer; import org.teavm.jso.typedarrays.Uint8Array; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 ArrayBufferInputStream extends InputStream { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ClientMain.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ClientMain.java new file mode 100644 index 0000000..9a45236 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/ClientMain.java @@ -0,0 +1,522 @@ +package net.lax1dude.eaglercraft.v1_8.internal.teavm; + +import java.io.PrintStream; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.teavm.jso.JSBody; +import org.teavm.jso.JSFunctor; +import org.teavm.jso.JSObject; +import org.teavm.jso.browser.Window; +import org.teavm.jso.core.JSError; +import org.teavm.jso.dom.css.CSSStyleDeclaration; +import org.teavm.jso.dom.html.HTMLCanvasElement; +import org.teavm.jso.dom.html.HTMLDocument; +import org.teavm.jso.dom.html.HTMLElement; +import org.teavm.jso.webgl.WebGLRenderingContext; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; +import net.lax1dude.eaglercraft.v1_8.log4j.ILogRedirector; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; +import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; +import net.minecraft.client.main.Main; + +/** + * 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 ClientMain { + + private static final String crashImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATEAAABxCAYAAAC9SpSwAAAQtnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZlrkly7jYT/cxVeAt8gl0OAZMTsYJY/H1jdsqQrh+2Y2yXV4/QpPoBEZoIdzv/+zw3/4KemFkNtMvrsPfJTZ5158WbEz896zynW9/x+Svp6l369HuTrTcxcKn7n5+Pon9f0ff37vq/XtHjXfhpo2Ncv9NdfzPo1/vhtoPLTyjJv9tdA82ugkj+/SF8DrM+2Yp9Dft6Cns/r1/c/YeB/8Kcib+wfg/z+uQrR242LJedTUok851I/Cyj+P4eyeJN45hfZ39V35fM8v1ZCQP4Up/jTqsLvWfnx7restPPnpJT+uSNw4ddg9h+vf7wOZP4Y/PBC/DNO7Otd/vX6rfH8vp3v//fuEe49n92t2glp/9rU9xbfO25UQl7e1zoP4X/jvbzH5DEC6DWys6NF5WFppkxabqppp5VuOu/VkrHEmk8WXnO2XN61USTPbCWGlyce6WYps+wyyJ+R3sLV/GMt6c0733SWBhPvxJ05MVj6pD//PY9/OdC9DvmUPJikPr38pOxAZRmeOX/mLhKS7jeO2gvw9+P3H89rIYPthXmwwRX1M4S29IUtx1F5iS7c2Hj9lEWS/TUAIWLuxmJSIQOxp9JST1FylpSI4yA/i4GG14aSgtRa3qwy11I6yRnZ5+Y7kt69ueXPZTiLRLTSi5CaWRa5qhAb+JE6wNBqpdXWWm/SRptt9dJrb7136U5+S4pUadJFZMiUNcqoo40+ZIww5lgzzwI5ttmnzDHnXItJFyMvvr24YS3NWrRq066iQ6cuAz5WrVk3sRFs2tp5lw1P7L5ljz33OukApVNPO/3IGWeedYHaLbfedvuVO+6860fWUvik9S+P/zxr6Ttr+WXKb5QfWeOrIt9DJKeT5jkjYxnFIGOeAQCdPWdxpFpz8NR5zuLMVEXLrLJ5cnbyjJHBelJuN/3I3T8z90veQq3/r7zl78wFT93fkbngqfsXmftr3v6Qte1qY7GElyEvQw9qLJQfN608+Icm/eev4b/9wt8/0In35Clj53MtbQbay3TJha/Pkal9UOin9o2snXLdVJzrX8x6El9Up6p2YeDZ7wV5Y/ZWZzDrsVZAxUREcEtXINlSba6zTUo7DqNNZZ7E0GlIa3OfMnNv2cYao2mOEnZWMnx6MUFcO2kfd3QoZ7IO65tFgligM06VYamjx10GGcZxALBZbupiJbS1j5a+V9tDt/GvGR/r3nEymiW+cplN17qzsLtxyazNKjvJParJP+8Y0tKjru0vjl+vc9j299JPInSpnbbXGwBy3FFMWMZI5Uw7N5pqa6FLzXXavN2aLGB6zMbTnLuwLg3RomLPiV3HgUku87QbJ/vPsqlllauVYKcDOZfiTyyjorvMlm2f3G+8RnHU26nhpTqhsBk7QSEPiSKACKic+QARYJfY662kSbJyz20y4WC4mxqDTLRvdiqn4XOONR0EhnG4or7ZVKSV3SRYHcXIcdzjpK7spLVzqLEac1lnJ7T3trXSAgEbJb917dLbbgUs5cy+0mgiQa2kju+LR8HSIRLpggxyCUvEO5hWkQyq/UJFkMvIOmO9ZkIOtggga2opgLhVd2LLrZ6LMPGFTTjGXQBFsi8/GtWg+xxlaYQtH4WpABhgjToaKW0BWEBqZ7Y9xSprJzQ4EBIz9EBImNHdT7FThzuVx8CT7d25bm06r5Y7TGu4MJT0wm74vCZBJPbp4jZI7ny5A1NsEWq8x86u0RbOxjTLOXgVIZTNDfssWH8lcOSOaDIXN5OAWiFCpBuA4hObzbQJ2jLbnaKdN1H96XZFoVm6BGh3b2Pxslg5TpdBdNiNwEFbnxTSYvEwY1WBMoou0quCj2erCyAMT/EM5c4tk7ITRwOpJb98gV0Il6/gw4jLnqSA/MbVxAVtuan02dhz39d6C8uBxw0yG4qguQ8tE9Jm3Y1NqxiqA4OkzSC7rmOJSQ0FA6+TYqSCZM4bjl1+2TcoQAQQiWK9wts5euIHQkcNIQwogqJEiaVFG6cpl7rXy6vIuAP1VJ0J7yC3G7Xy3XXwnNGTm/CratGOxFJ8InCPUc3crSdDUCmfyZ1XQ+sehTxAakljQkbCHUTrIcSUhXU2v+m72mUcWwqiL5AZaA52YBaWoTnI7dBKVmOjR0gmpWJOfqwuFp8ecJTuAiaiS/ds2PPqVhqkZmQZ+WaTgUZIWTLEjKceUE2bxicDi9PrCi43qCEDowuMjkcOXrnQQKJEIK6tCoeFTmhZy4QzjTXCgQDTOerenNAaalzHI4ziLMR64mnMRN8KDUKviZqL47hkAzKzBUHYxXAcah6yVw88vlPGrWUkoRYzvgP/Oy+sQ8sCA+anbvRz17B+SM51PQdXw43GKZBNupUqE+e2jQRUihD2jXclhnCpS9QJXFkzHQN0SLAHqM6Z5oAqhb1ZdzN3FUtBdFEh+g1CgvNJ+GoQBby22qMXaoqw5IbDD/V5N5g68zUS2+eN+0IxOKFxk+3nahRGavBX1kwG8c3XnRD5Rwevl9IIWg60XPMS7FWOw5BK7W8+34HrNGFs6AKiuTtQRS4vrdHqUrQn6BI1GiVQ29QxSrQoLFKEgG7WfZR9fqSvbnG12rhGw+wutwG7Yc4obQqqysLVUWvMCTq8PduHQAHBtSfM53L44Hv6E3Hg4ClgEmpTLh1lX5fpG8WzzgxbcocKWyeLKH1TYuOKEtn8rAXD3fZW58hbKmZPF/fiRvGJ+EDA5/3xXCeQdAHTdKLU4llYinQGxd8Nwpm44WTUlYzM0BiBYy5q1SGZ4fiizmbQggZEkU2fgzftJR13OLaEeihuGy8a1yCjBjZc24kRECWrCZuCYaaqWK5SO2FNInPp7SbaQSdKr4XngTInYZuQhPL+uvt+RiY197sHtYRmV4Z+J6leOYcN7hy2hdmJ3HCa2Smz45pWgc2nIuUT6UTz6HmxEr65thqqTn43ecYfWJB6pvusxL1EcbVJvdaCaaCCqLlqVBob2cTVzf+HOROZ6PkSnYc4nDdbW1R5r3WjZvKYHi5sh8LGasG7/QMFGGS5HyMh4/g01IU12spNOMlQKLSOJBsNeZhRDBq2Ca6wS+3rvhvwIWp1RAhK6CeQlLMbdxUnvUFoFSCEjq5hHYSFetT4Fc0nOXJeZ6x2n/oPNL9UrJnrMqNHdzlVend/tolGDriXJWAYm+RcstiIk8XO6xL3jmO79BNwILKp0H0GynCHw2Gft4erFLqFg+JUcrEhNDaxoPl89vCTMfxCLwvYu7Ok/vVQDKVgYeFT/Dfliu/FqhYBR3i1ZUxQKoveQhAVycoHW00NemeHVzF5fvVO2ATGplIaUKLrmS6IlNXIwXPhEQJLhtPyksOctOc7PVeveGFurBNcBXkPLJnLMI3SPngyJEqIBlmrhYLYyzuJPPBr0BtWZMC3eCqaUQiFNvJiHRIG5Sz6OfqHXeVspDaxKN9bwONqMTfVbAUVceMH8zZc3jVwCaxhLLKeGMNPG/B9mD6bznYXT4xIYPopEYp8u1+l9pTmoj92nJAQVUuJbLzTQCUIO9saYB2rh33FUdOcQnnUo1dkeF0IvhSM2RCMEp4P37SIK87IDtx4rpNjceB2DCCQEDwm8xwcNrwPZ5F+BlbvZ+iUKGndCyCYpYVwUpYlOp2s6oLGXgZb78N5Zafup1V1Is6VPuu1WVRDnt3GhtwEIcN2swl3R03rwr3jOTdNG6R1n5O9NPzg0/ud5ITrDBeIuLnpXMC+Og/Q7R8luPA1C4sbQdw7pwhJ4liQABaNYRKmBwZ0/4YvXjmgG7sBb8xlN0jQCwmvTHjhw4yPw0ZGsEchK734RqoWcVsULPn1rlAJ69ru2FwNuHczIXJeux54qcA2NHrY0lxeR6Bkb7P749pB0XunMyr1pd614vx1jF3gmOLOFWX1GhOY/uM09wD43swqRZxrtuOIoorpNWlmMNMVZJPHAPXofVEyPfgAmOMg+AkePn7wiF+ODmt7ZYuPw3YDnF1KBUg0Xi6PuOWAn8gdssLzOjTbddueqHPtiDhMTysJVTvNA1bnDYonejAj6fEAgsYlNTDngDDZRaK5modo0JRdvvIQHmH/V76NFt2dAyWApSHTNMjcKJWVOSWFpuiMa1k3P2RB2jAqQ2DlgssUsASTYRZ3Nu/wsBxEFV+DVLUBj2IP8Z5lhEML/XBh8fXPM2HDvH1GN+4krwRoAdbsfPZO2WkycKDChN40J9wiYk0LwRLhgyOVBG9kBmntrMzQtVgRlaW9REcw5YO2YAc+PZxC4cttFyigJwh4KGI9xTkKDp6XIeGSwjS5K5bfT7kSfQglvDZ9pzCsxgqQysRl5EnJE2eK1k0QqtH+DSMeVJE0Z0KcjsdiFUV01TsinsN0MmeWnDo4XN7HDe8NvUEin+4QsFKUA02X293xBIuUj5Kun3O/1n1D/gN+IH6wJyPSqy7NsE3OTn14xNYoqwZ+/ESBRtAgEqz+PYOdT6KKGPspRUD8Bshj0bTMluEwgtGxl158e08/KLm0ITgFmhTgMG+rNICG7uNvsQk4MmoeHOHCqhFm2hBGY4HtyEe/5dElQJfh6MOtdAoMLLjppIvGmyJLfr78VkQzd8gpJVCQNkoP64jBwznSiqsfeOIX8B74EUQeaoFIWTEstV4vTDOGHQh92XQS8aaXqhx+lKXkkShCYpimC5N6t3fBGETtWe3s3Q8mqF2ak4NFKjN4Xlitx571mru5Nb271cL4F5iyYD8qEidIKAqFhsgu6k4m0BznhqkW8Jcld6GIbHnVwjjdMD5IS8EBDRejTmvvUMM/k0L2Qsil9kd2uI0Kn/Xg1cDOlcjSs0PHNRr0QKzxiGPhI1FJPx6dyc2EL2awLcKOTPixghGwjYdEDUQxA6Wiu62MMUgVvouX1q8f1A03jEx6HCUIip8OY/KgrARQAVrbADc4wg6qh8yiQXCyHyusipfJljJU54koJTZfG7J1SCqmFRkg+Xt6tSeKd2G0WCXRYmgWMhD8RABpAJ2GQJQSDoLdhe5Y+/BjSHx4MUgCZqKxYXr3RQFCzB+yYe90qd3PEJEhP/zFmFLyaCnvWuJuqET84A+6O9WJaNDcQ1l9WsDLGGaGrn/7qWAmngb7l4+N1te44P38EBk/SI/FvntzlgL04qfJpIAbQ8emODPjRtJEjpA0erPKenW8v86hJ6D8xzmt/w2odn/ClBI6NoT1ySmgy7dxlzcEP91ObRjLJrXIEf4yAZtJC71sNbgAoHdcVHdf1RcdxA1YL2/DIC7aBqrAOnLrR/XJkQi1OpfNzDfdjoEQPN3BCezs1AsY/IQVyQmV9orsT8yf/3HU/BO9Y4I9GIwGiYL2Y2B6H/WWEUR5awuPszBvaYr/daJL8NOHCQrdHuF6EadM9yfU2hp0hKy60KdTfMSK1g+w4QUajQkyDWpaxt3glWfAkk0ylLxeBw4isbTkHRI9ZYMxZcJg6SMJ5gaT5tvTNegyS+0oPxaymQZECg+qa0HX9dI6M/Eq8C0+kWD4oYafVHrcticUeio06LAhyMOLXBjX5SewUOQLeMRBHw/Nt/SOX18Oc0yuNRmX43iPBam3TosB1vG96acj9PDjLP23V8OwMW4rER1BD+iK4vKDk11fK1l68WOfsRs6ktd6f6YvxGxi4djsB3OsxTHy3/w9IfwNf8n440BILET+f7LnjZBrgBfeAAABhGlDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw1AUhU9TRZGKg0GKOGSoThZERRylikWwUNoKrTqYvPQPmjQkKS6OgmvBwZ/FqoOLs64OroIg+APi6OSk6CIl3pcUWsR44fE+zrvn8N59gNCoMM3qmgA03TZT8ZiUza1KPa8IIIwhCBBlZhmJ9GIGvvV1T91Ud1Ge5d/3Z/WreYsBAYl4jhmmTbxBPLNpG5z3iUVWklXic+Jxky5I/Mh1xeM3zkWXBZ4pmpnUPLFILBU7WOlgVjI14mniiKrplC9kPVY5b3HWKjXWuid/YSivr6S5TmsEcSwhgSQkKKihjApsRGnXSbGQovOYj3/Y9SfJpZCrDEaOBVShQXb94H/we7ZWYWrSSwrFgO4Xx/kYBXp2gWbdcb6PHad5AgSfgSu97a82gNlP0uttLXIEDGwDF9dtTdkDLneA8JMhm7IrBWkJhQLwfkbflAMGb4G+NW9urXOcPgAZmtXyDXBwCIwVKXvd5929nXP7t6c1vx8743KRRjbQVgAADfdpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDQuNC4wLUV4aXYyIj4KIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgIHhtbG5zOkdJTVA9Imh0dHA6Ly93d3cuZ2ltcC5vcmcveG1wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICB4bXBNTTpEb2N1bWVudElEPSJnaW1wOmRvY2lkOmdpbXA6NDJlMTU3MGEtNmMyZS00Y2E1LWI3ZTMtOGI4ODI1MmMwZDMwIgogICB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjU1NGY3N2UwLTc4NmEtNGFlZS1iYjhmLWNhYTBiZGNiYzE3MSIKICAgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmNmMWYyMjUxLWIwY2QtNDE1NS1hMjAyLTExNGI0ZGM2MmFhNSIKICAgZGM6Rm9ybWF0PSJpbWFnZS9wbmciCiAgIEdJTVA6QVBJPSIyLjAiCiAgIEdJTVA6UGxhdGZvcm09IldpbmRvd3MiCiAgIEdJTVA6VGltZVN0YW1wPSIxNjQzMDYxODUwNDk0OTc0IgogICBHSU1QOlZlcnNpb249IjIuMTAuMjQiCiAgIHRpZmY6T3JpZW50YXRpb249IjEiCiAgIHhtcDpDcmVhdG9yVG9vbD0iR0lNUCAyLjEwIj4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiCiAgICAgIHN0RXZ0OmNoYW5nZWQ9Ii8iCiAgICAgIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODUyMGQ4YTMtMWRhZC00ZjIwLWFjOTktODg4OTJkZDExNDQ0IgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKFdpbmRvd3MpIgogICAgICBzdEV2dDp3aGVuPSIyMDIxLTEyLTE3VDE3OjIyOjQ4Ii8+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjJkY2U5N2M4LTBkZjItNGQzNi1iMzE1LWE0YjdmMmUyMjJiNSIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChXaW5kb3dzKSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMi0wMS0yNFQxNDowNDoxMCIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz61xwk6AAAABmJLR0QAnQCdAJ2roJyEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5gEYFgQKOBb3JwAAIABJREFUeNrtvXl0lFWePv7UvlelKvu+koSQRQiyBJGISEB0hFYZwW1sp4/2csaZ1jlz5sz80cc5c7rnaI8zju2o09qiIrKowEGURXYI+5IASQjZl0plT2rff3/073O/byVVlUQSRPs+5+QkkMpbb9333ud+lufzuaJgMBgEBwcHxw8UYj4EHBwcnMQ4ODg4OIlxcHBwcBLj4ODgJMbBwcHBSYyDg4ODkxgHBwcHJzEODg5OYhwcHBycxDg4ODg4iXFw/GWAqgHHfv+ufyv8+q7XvVMh4rWTHBwc3BLj4ODg4CTGwcHBwUmMg4ODkxgHBwcHJzEODg4OTmIcHBwcnMQ4ODg4iXFwcHBwEuPg4ODgJMbBwcHBSYyDg+NHBCkfAo6/ZAiLov1+P3w+H/x+P/x+P4LBIDQaDWQyGR+oSYyjSCSK+G9OYhwctwiHw4Guri44HA54vV74fD72FQgE4Pf74Xa74XA44Ha74Xa7EQgEsGrVKqSnp9+2BTlT5EJETT+PJZxgMAixWMx+FwgEIBb/2VGjn4W/o78P9/qxPSXo2pFez0mMg2MSC7mrqwt/+MMfYDabYbfb4XQ64XQ64XA42HeHw4HBwUFIJBJIJBLExMRg4cKFSEtL+0GSmJAwxsLn80EqlSIQCIRYomKxGD6fD2KxGH6/n31un88HiUQCv98fcm26Pr2H0LIlkhLeg/B3RIbCa30XS46TGMePHn6/HxaLBVu2bIFcLg9ZXLRQpFIpDAYDDAYDW0RyufwHRV7ChU9kQeQhtHyInLxeL7OwyFoS/o7caCI1+k7XlEgkjIiEJOXz+SASiSCVStl9SKX/j2pEIhH8fj8kEkmI1Sa0Gqcy7pzEOH708Hq9GBoagtPphEaj+dF+zrEEJvw/oTtHxCMWi0NcTaG7SeQmvMZYt3Ts/wnJSPh9rLUVjqTGur1TITKeneT40UMsFsNoNGLjxo3IyMiAyWSCSqX6wca5JrLGxhIDEVYwGGRJC7vdDofDAb/fz6wocifJQqPfjf0/YZdYkUjEXHOKMXo8HhZ39Hq9zJqj1wvd1bEu6Fi3M1yMjVtiHBEhjJ0Id9ofOuRyORYsWIDS0lIMDw+js7MTp0+fxs6dO9HZ2fmjs8aE1pbQPZRIJBCLxXC5XLDb7VAoFFAoFAgEArDZbJBKpZBKpZDL5XA4HFCpVAAAp9MJhUIBh8MBpVIJt9sNsVgMmUwGt9vNMroej4f9rFarYbVaEQwG4fF4EB8fz0hOrVZDJBJBIpEwciNSI8KUyWRRkxGcxDjC7uCtra1wOByQy+WQy+VQqVRQKBSQyWSQy+U/WKmBSCRin0mn0yEtLQ2JiYmoq6tDR0fHj4KoiQCECz8QCDCioCwsEQK9zuVyQSwWQ61Ww+PxIBgMwmazQavVMotJqVTC6XSy10gkEuam03vp9Xq4XC4olUq4XC60trbCaDQiEAjAaDTC4XBAo9EwCzgQCITE5AKBAKRSKSMwipmNjedxEuOIGjf69NNP8dVXXyEQCLAFn5SUhOTkZGzYsAGzZ89mE+uHbKmIRCLIZLJpS/HfCRAG2YWkRmRAlo3L5YLNZoPNZoPX62UWkVwuZ1aWVqsNIUWynnw+HxQKBQvc0/WlUincbjdkMhmGhoZw9uxZdHR0YMmSJYiJicHQ0BBMJhMkEgm8Xi/kcjl8Ph/kcjl7HyI2IjBKBIyVfnAS44iIwcFBNDU1obe3NyQGUVdXB6/Xi6qqKvAzZe5sSzpcZpJcSrK+Tp06hT179qCvrw9xcXFITExEQUEBli1bhmAwiJGRESQlJUGpVIaQIhGX8FokrSC5RktLC7Zt24a6ujrIZDLcuHEDOp0OFRUVyM3NRUZGBrO2iGjpGmKxeFycLFoigJMYxzh0dnZiYGAgLFGFy0Bx3FkEJnw+JN4F/ixtcDqdzLru7u7GoUOHUF9fz17/wgsvID4+HkajEXFxcbBarRCLxZDL5ex6ZIUR6dB7+nw+RnLDw8N47bXXYLfb2bWfeeYZmM1maLVaJCcnM6kGWY6kVRNaaGQhC63+aCTGs5McCAaDqK+vR19fHx+MH+jzE36nBU9EQe4aiXiFmi0AuH79OrZv346+vj7o9XrI5XLY7fYQl1Emk41T7stkMhYzHR4eRjAYhFqtDiGejz76CDt27EBHRwcjV6HmjK5D90rvMzZ2F20T5STGAafTiaamJgwNDfHB+AGCLBdhjI8sHKlUCoVCAY1Gg2AwCLvdDrfbHfL3x48fx7vvvgsA0Ov10Gq1UKvVLFutUqmYJRYMBiGVShlRKhQKuFwuZrWNJdf09HRcvHgRVqsVEomEXUutVjO5BxEaxcjofYhEJ7LEuDvJgf7+fpjNZrjd7h+ldurHDmHsi6wbl8vFYkqk16LAvtVqDXsdt9vNpBcej4dlo+12O5RKJex2O1QqFcto0u9IIxYMBjE8PBxyzRUrViA7OxuLFi2CWCyGw+GAQqHA6Ogo9Ho9vF4vI1uPxwOpVAqXy8Vc12AwOGFWnFtiHOjo6EBvby8fiB8ohPWLfr8fLpcLHo+H/dvn8zEiWLx4Mf7t3/4NTz31FHP9qqqq8PrrryMpKQlutxsjIyNQqVRMsCqXy2G1WqFQKOB0OhEMBuH1elmxvMPhgM1mg16vx5tvvomKigoAwEsvvYSqqirce++9MJlMTIM2OjrKZBvkMlJG0uVyQSqVMtd3Mtnw226JCdW+Xq+X7RCUSpXJZCHp7+myDMYqgClYSfqZkEH5/0V/QrP5dlkowvEh8SDttDQJ6MFOxz35/X40NTVNSi8108F9YVaN5gZ9duHnp39zqzHUpaR5LRS2isViRkgqlQoZGRkQi8W4dOkSMjMz4XA4UF5ejtWrV0Or1SIYDEKv18Pj8UClUjHrTavVwuv1QqlUMq2YRCJh1lMgEEBMTAzmzJmDhx56CK2trbhx4waqqqqQn58Po9HI6i71ej3cbjc0Gk1I9pNcSYrZTfYZS2/XwvT5fLBarejs7ERrayva2trQ3d2N0dFRlnKVy+XQ6/VIS0tDRkYGcnNzkZycDK1WC4lEMqVJS+weCATgcDhgtVrR29uL/v5+DAwMoL+/H729vcwcFha1qtVqGI1GpKWlIT09HZmZmYiPj4dWq2Xm+nSPj9/vh81mg9lsRlNTE9rb29HZ2YnR0VF4PB6IxWLodDqkp6cjLy8Ps2bNgk6nm9S9KJVK6PV6iEQiuN3uEJPfZrOhoaEB/f39Ya9FAdaBgQFYLJawpn0wGIRKpYJOp5uy9oo+u9VqhdlsRktLC9ra2tDV1YWRkRF4PB42N7RaLVJTU5GZmYmsrCykpaVBr9dPeW7MVFzRZrOF7RgRzYIyGAxQKBTTcg80DiqVKkS2QBuzSCRCXFwcVCoVXn75ZfzTP/0Ts9JiYmJY0F8mk4Vs3nR/dH2aAySEjY2NZdcvLi5GRkYGHnvsMUgkEuj1eqhUqhBSJbIiMa5YLGbF4uRC3jEF4MFgEG63G11dXaiursaRI0fQ0tLC2p643W6mO6EBk0gkUCqVUKvV0Gg0mDVrFh544AFUVFSwwZoIPp8PnZ2duHz5Murr69HY2Aiz2Qyn0wmPxxPyJawdE04GqVQKpVIJlUoFrVaL/Px8LF++HAsWLEB8fHyIlXYr4+P1emGxWHD27FkcOnQIjY2NsNlscDgccLlcIeNDY6PRaFizvonuQSKRYN26dXjqqacgkUjQ2tqKX//61+z3Xq8XPT09Ua8jl8vx+uuvw2AwhCUpr9eLDRs24LHHHoNOp5vSZ+/u7mafvampidX0UTnL2LmhUCjY3MjOzsaKFSuwZMkSJCYmfq8VBWfPnsWHH34Ii8Uy6XlhMpnw8ssvo6ys7Jbm0tisJFmzwp+pjQ4RhE6ng9FoZNYuWfc0p+RyOUsAiMViuN1uqNVqZnAIu1PQ60ltTxsmCWz9fj+TUIhEIng8HiaspcQDbZZkRd4RJObz+dDb24vDhw9j69ataGpqYo3mxj4A4Q1TDdbo6CgAoLW1FdXV1ViyZAmeeeYZlJWVTbhz2Ww27Nu3D6+99hqkUmlYlzHaJCCT3Ol0soxdU1MTDh8+jAULFuDJJ5/E/PnzJ20JRQrGjoyM4OzZs9iyZQsuXLjASCva33i93oiB2bAPWCrFtWvX2HX7+vpw7tw5aLXaKd1vT08Penp6wv7OarVi+fLlcDgckyIxv9+P/v5+HDt2DDt27EB9fT0rRp7M3KDPT3OjoqICzzzzDObNmxeS4r+dMJvNqK2txeDg4KT/JjU1FT09PSgrK5uWuBiRFMXCKGBOJCSXy5kRoNfrWaAeADweD7Rabch4kzrfarVCrVbD6XRCLpezwL5IJGKB+pGRESiVypCMIs1ZymxSfE4ikaCnpwcqlQoejwcKhYLdR7iNmdZuJCt/RkjM7XajoaEBmzdvxvbt28e5lWRO6nQ6xvjDw8Ms7jF2wo+MjOCrr77CwMAAfv7zn2PRokVhU7pj/25wcBAxMTFhCdbn8zGrhlK65HaSeTv2ena7HYcOHcKVK1fw8ssvo6qqCkajccpEFggEYDabsWfPHrz33nsYHBwc1xDO4/Ew91oqlcJms8Fut7NJGe1zU5yRHnxnZyfbcbu7u9nPt1J2I4zd+f1+9PX1hYgcI8Hj8aCpqQnbt2/Htm3b4HA4QtxKCiTrdDooFAoWaCZCHjuODocD+/btQ0dHB1555RVUVFSwBXG7QELPwcHBkJq/icbPZrOho6Pjlls5U2BfSGD0M4HKeajO0eFwsPIichnJQhq7CWq1WvZ6ioGRYaBSqRhxk1VGsS8iOoqjUf1qY2Mj+vv72fpXq9VQKpVQKBSw2WxQq9WQy+Uhsetohsu0k5jH48GFCxfwhz/8AceOHWMmvt/vh16vx4IFC5CdnY2EhAQWz/B4POjp6cGFCxdQXV0dNmgtEolw7NgxGAwGmEwmzJkz5zs9eLlcjmXLlqGoqAgmkwlqtZotDqfTiZ6eHly+fBnnzp1jpRZj72NgYACvvvoq5HI5Vq9ePaXdPxgMwmKxYOvWrXjjjTfGuaUikQgZGRm47777kJyczMbIbrejra0Np06dQkNDQ1gC8vv9qKioQGFhYUjDOZ1Ox3ZAuVzOAq83b95kE3EiQvN4PHC5XGx3T0lJQXx8PEwmE2JiYpCWljapuVFbW4sPPvgAX375ZciCoU4T+fn5iI+Ph8FggEwmg8fjQV9fH86fP4+zZ8/C4/GMeyYSiQRXr17F//7v/yIuLg5z5syZVNhhOud8TEwMVqxYgYGBARYSiER4LpcLGRkZKCwsDGkcOB3upNPpZIXVtFELyUcikbD6SHL/iPjGEhhtFB6PBxqNBl6vl20sJFAlN9PpdLKYl7BUiLKQSqUSwWAQPT09sNls2LNnD27cuIGnn34aS5cuZfer0+ngcDhYsoAqDW5b7aTf70dtbS3eeOMNnD17lhFYIBBAXl4enn76acybNw9JSUkwGAzMRw4EArBarViyZAnS0tKwa9cu5nsLoVAosHPnTpSVlSE1NRVGo3HK9xgXF4eNGzdi/vz50Gq1ISRCVl9TUxP27t2L7du3M0thLJG5XC689957yMvLQ0lJyaStGrvdjgMHDuDNN98MG8NRqVRYv3491q5di9jYWDZGPp8P/f39KC8vx8cff4xz586FHf/09HSsXr0a6enpIVlMcn0XL16MrKws9PX1wWKxoKmpCUeOHEFra2vESRIIBLBy5UoUFxdDq9VCo9EgJiaGiSI1Gg0MBgNiY2Ojzo3Gxkb86U9/wrZt20LcTqPRiBdffBHl5eVITU1lwW5aDDabDUuWLMHu3buxa9eusO60TCbDiRMnsGfPHqSnp8NkMt02ElMqlVi+fDlKS0vR0dGBd955B7W1teNCGHa7HZWVlbj33nuRnZ2NxMREVoozXa6kRCKB1WrFwMAA7HY71Go1tFotDAYDtFoti3+5XC5mnZEVR9YSuY+0YYjFYthsNvY+9DyFbit5KqOjo1CpVEzN73a7YbPZWNueEydOsHlG4tbOzk5kZ2dDo9GwzCfFy4RdYG+LJdbW1oZNmzbh0qVLIW/qcDiwdOlSrFq1CklJSWHTwwaDAQsWLIBUKkVvby++/fbbsItcJpPh4MGDWLx4MWJiYqZkjYlEIqSkpKCkpCQsAUokEphMJhiNRphMJvT29mL//v1h41QikQhNTU346quvkJeXN6mOoX6/H3V1dfjwww8j3ndMTAzuvfdeJCcnh7xGKpUiKSkJK1asgFQqhdVqDal/o7E5fPgw4uPjsX79emRkZIx7n8TERCQmJgL4cxuW5uZm9Pf3o6mpKaL14vP5sGbNGtxzzz3M1J9K62ayPrdv347t27eHEJhIJMLs2bPxyCOPICEhIew463Q6FoNsaWlBdXV12BinWq3Gl19+iVWrVsFgMNy2jhtisRgJCQlQKBS4efMm3G73OEmP0+nE+vXrsX79ehQXF0957k40vmKxmJGO1WrF5cuXUVNTA5lMhlmzZiEvL4/Fk4WCVgrIk6SChKs2mw0ajQYSiQROp5PNF51Ox1r2kOXX2dkJsVgMhUKBffv2oaSkhM0zkUiEoaEhRq4XLlzAJ598AovFgueee471FqPNklxI8iSEh4zMOImRiXjkyJFxE8xms6GgoGDCYLJYLEZRUREWL16M8+fPh7WCZDIZjh07hps3byI/P39KrpxMJkNZWVnYONnYhZOZmYm1a9fi9OnTEctxAoEAjh49iscffxx5eXkTTkqn04mvv/4abW1tEeUMubm5SElJiXgtpVKJiooKXL58GZ2dnSFui0gkQl9fH9566y1IpVI8/fTTiIuLi2pBxMbGsh060gIRiUSIj4+fdHY43Oc+fPgwtmzZMo7sRSIRSktLodfrJ7xOTk4OVq5ciWvXro1ThhMGBgZw9uxZFBUV3dbYWE9PD7755ht89NFHaG1tDZkjCoUCf/u3f4t169YhLy9vwnjudwUFxWNjY1FQUID29nacPHkS/f39OH/+PG7cuAGFQoGenh4kJSXBbrcjMzMTZrOZlQRZLBYYDAZYLBYkJiYyAjEYDMydbG5uZhsZSZcozLB161ZUVFQgISEBCQkJEIlEIZZYbW0tW082m41ZhGKxmMkthPKQ20pily9fxsGDB8fFAoLBIDObJ6OHUavVyM/PR3Z2Nq5evRpxsdfV1WHp0qVTIjGFQoHy8vJJpeIlEgnKysqQm5uL8+fPR3zd0NAQGhsbkZubG5XEgsEgzGYzTp48GTEGIhKJMGvWrAk/k06nw4IFC/Dtt9+OG2+aBJ988gkKCwtx3333hY11jI2nTDbu8l2ysG1tbdiyZUvYeJZYLGYxvMlkWufOnQuj0RiRxCh2+vjjj7Ns2UyCmknu2rUL27ZtQ3d3d8hRZ2lpaXj22Wfx4IMPIikpaUasw7EF1S6XC7GxsdDpdKitrcX+/fvDzu8lS5agtLQUPp8PhYWF2LRpE44ePRryOoPBgLVr18JoNGLu3Lk4efIk/uu//ivq/dy8eXNS9221WiGVShETE8NE3BSnE3azELYECvv5p2MQR0ZGcPToUTQ1NYWdxDk5OTAajZPW8aSlpSElJSXiwlEqlbhy5cqUpAYUe5mIbISLQavVYt68eVFf73Q60djYGFUaQePQ2NiIgYGBqO85a9asCXceshQjWS9isZi5wpPJGM4k3G43Dh48iIaGhrDjKJPJkJKSMqm4EIUD4uPjoz6T5uZm9PX1zXiFgd/vx7Vr1/D+++/j448/htlsDinGLisrwyuvvIL169cjJSVlxtxbqpkk6UNsbCzcbjeSkpKwcePGca/XaDRYs2YNli1bhr6+PqSkpOD06dOoq6sb91qXy4UzZ87g5MmT2L17N06dOsWe22R0ipGeIwAUFRUhMzOTGTdUckRZeMq0C09YmjFLrKGhAbW1tcx3HhtPyc3NnZIuyWAwQKfTRZyElI0aGRmJKBWgwyFInxIMBpmvPtlAqlQqRU5OTtR+Wh6PB52dnaxdSTQSu3HjBlwuV9SHGxsbO6mJodFoorolMpkMx48fx9DQECv5uN0g6/Obb76JSPJGo3HSn5kSH/QMI13T7XbDYrEgPz9/RjOSNTU1+NOf/oTDhw/D6XSyz6BUKrF48WI8//zzmDdvXlRLeLosMdKBUb1jeno6nE4nrFYrMjIyYLfbYbVaWZaS2udUVlbigw8+QGNjY1jr1ufzYXBwkMWq4uPjsWLFCmRkZMDn8+HcuXNhyQ8A4uPjmdRJiOTkZDz++ONYu3Yt5HI5qwTRarWw2WxQqVSsnz+pF6KNoXS6dqOxQWbhw05PT5+S26dSqaKeRiMSiTA4OAibzcZ2obELuLCwEC+99BKGh4cxOjoKt9uNysrKKZV4kKYm2gILBAKw2+0T7vper5fptSZyeSezoCl+MJGFbLPZvreGhoFAADU1NRFFshRq0Ov1kyZZsVg8IYmRmHamPrfdbseZM2fw7rvv4tKlSyFSnNjYWNx///147rnnkJubO+NSDyIXuVzOOk9IpVIMDw8jNzcXPp8PjzzyCLxeL86fP4/z588jIyMDP/nJT6DX6zEyMoLKykrY7fawJJaZmYmHH34YMTExuP/+++F2uzE4OIji4mKIxWK89dZbaGhoCGspPf7443C5XPjggw9C/j8rKwv33HMP8vLyWMyQEg2kSaNWQH6/H3K5PKqu8ZZHeGBgAG1tbSwDEY7E9Hr9lEpCpFIpS9NGmqik3BZW6AutlHvvvRf33HMPGwiqkp9qUHUiUiGR5kQLxufzYWRkZEK3cybqMr8vkGYwkksbDAaRkpIypYUuEokQExMzoeC3v79/SnWMkx3L0dFRHDt2DK+//jo6OztDmvbl5ORg3bp1eOyxx5CQkHBbrF+huFTYl56ErPHx8cjNzcX169cZ2RYVFTFLTKlUwmAwRDz1aXh4GPX19UhNTUVnZyckEklI4XZycjKKiopQV1c3bm673e5xvcsAsMy2xWIJCe8I+4mRrEJ4DuaMWWIWiyXkYYabyFMtcpXJZNDpdKyHUaQJZbfbI05UYfHrrU6S6dwxp4t0hMfPT7QhfF8YHh5GXV0dK+IO9xmmGisSi8UwmUxRn20gEGCdRqfTquzv78fXX3+N//mf/wlxkQKBAIqLi/HMM89g1apVt1SOdqtxMap6IBJJSkrCgw8+CLlcjtraWqxduxaJiYnYvHkzBgcHsXz5clRXV0OtVrNSPyEGBwdx/PhxFBYWQqFQQK/Xo729HVlZWcjKyoJUKmWHgIwlsUhr0Ol0wu/3Iykpid0r9Q3zer0sHkZdLMJ5W9NOYi0tLREnokajgcPhgMViCTtIkR5IJMWzcHGSOzmTu9x075iTcVUms/ioTU80mEymcfVwtzMe1t3dPWHyheJmkw03UC1ftDGiutTpssT8fj+6urqwY8cOvP/+++OsC4/Hg4ULF+L++++flFRkpghMqMonz4i6n6SmpqK8vByZmZnYtm0bE0srlUqUl5fDbDZHdPtJMaBWq9HS0oL8/Hx4PB44HA50dHSgr68v7Dr8v//7v4gxy/7+fvT39yMmJoa13yGBq9PphF6vZ4F9KiSfEcU+mdfRerNrtVrs2rULNTU1k7YKvF4vrl+/HlYnNlOuElXQU00Y7WjTFVOSyWRsx4q0uCiDWVlZOaH7bbVaw5rqwok9b96879QeZ7rQ398fNZEhlUrx9ddfo729fdJzIxAIoK6uLupnp9dNx5yw2Wy4fv06tm3bhh07doSNacpkMly5cgVms5m1tLmdoK6oSqWSzV+j0cjKjiQSCXQ6HfLz80MIDAAOHDiAAwcOTPgcP/vss7C/e/XVV5GZmYmWlhbEx8ejoKBgnEwjnGGjVqvR29uLlJQUphOjMyspRjr2WLgZscSoOHd0dDTiQhGLxWhoaMDVq1envOhnavEFAgGMjo6yoL/NZmP9oOx2O2vIR6Uy07EgZDIZCgoKoFAoIgb3g8EgTpw4gXXr1iE1NTWqBdXV1RXVWnU4HFiyZMn31tWBVPrhMtZCdHR0oLm5+Y6ZG0LL2e/348CBA2htbcXJkycjWr4SiYSdKJ6cnAyTyXTbrV+hKyaRSFhwnCyZtLQ0WCwWFBQU4ObNmxGtru8SMqAOJElJSSgvL5+QxEZHR9Hc3AyxWMzKr6ioXFjHS7WTwkNKZoTErFYrq3CPFseYrsZvtxrTaG9vR0dHBzo7O9HV1YXOzk40NTVheHgYIyMjzA0hf5yaut0qxGIxysvLERsbG5F8gsEg6urqcPDgQaxfvz4iARG5RqokoELw8vLyGU/vTzTeE1lMd8LciEbEb7/9NjsBPRrkcjm2b9+O0tJSrFq1asZU+dHcbOFp39Q0gIqzVSoViouLUV9fH3G88/PzsXTpUjQ1NSE2NhaXL18Oq/0UgpoUxMTEID09HR6PBw899BD27NkT1Yvw+/0oLCxkB4bQGNIp4sJ4Gp1rOSOWGPmsE1kq4RoP3iomK+KkAtMLFy7g6tWrqKurQ01NDfr7+1nLHcqCKJXKGVv0YrEYubm5ePDBB/Huu+9GHA+73Y4tW7ZAr9dj+fLlYUukLBYLrl+/HjXGuGHDBqSnp39vriRJTyaK283E3LjV1jZjXZ/Jwmq1YuvWrSgoKEB+fv5ttcaEqn06kIMaD9L/0XFskZ7Jxo0bsXr1aly6dIklzp5//nl88MEHmDdvHlJTU/HGG2+E/M25c+fQ1tYGuVyOnJwcLFmyBCUlJSgpKUFvby/ef//9ce8TExODnJwcpKSkMK+HLDFhQwbhwbpR3enpILFoD0skEuHv//7vcffdd09L2xEhkpKSolpJIyMjqK6uxsGDB3HmzBm0t7ezBx5ucgp7t48dyOmAWq3GI488gpqaGpw8eTLiAmxqasI777yDxsZGVFRUIC0tjYn+LBYLTp48iYsXL4aKXQI8AAAa20lEQVS9L5/Ph1/96ldYunTplBbgTIA690azHv7u7/4OCxYsmNaurGRBT6c1JJVKkZaWBrvdHjUGfOnSJezcuRO/+MUvJt3ldjpAGzF5EdQfn8IXMTEx8Pl8KCsrw7p16zAwMACTyQSVSoWenh588sknKCkpQUFBAbq6unD+/HlYLBZcvHgRQ0NDaG5uDqsj27ZtGwAgNzcX2dnZWLJkCbv2119/HfZedTodEhMTWRss6pFHWUmKi1M9JT3TGSGxiYLrtCPm5+dj/vz5005iwg859n17e3uxe/dubN++HS0tLczEHvvgVSoV1Go1a9eblpaGzMxMFhBvaGjAtm3bpuW+KQbw61//GsFgEGfPng27KwYCAdy8eZPVWpLi3ufzYXR0FO3t7eOsMCqT2rBhA9avXz+uC8b34YpNJAPx+/3Izc1lqvbpmhu0CU1XgF2n0+Ghhx7Cxo0bcfXqVbz66qsRY31utxsHDhxAaWkpqqqqbqslLNyAybIRlkHJZDIYjUYkJSXB6/XCYDBArVbD4XCw1ljkOlutVla4L5VK0d7ejosXL0YleWqbPjg4iMHBQXY9av1DaGhowI4dO+D3+7Fo0SIYDIaQeUNERvN3onlxW0REVOZwO7I2dKjF559/jj/+8Y8YGhoad2qKTCZDeno6CgsLUV5ejtmzZyM5OZk9SLpPn8+H6upqNuDTFYAtLi7GP//zP2PLli04dOhQxBS13W6fMCFCu25eXh7Wrl2L1atXs+4Bdzqo/xWpzO9EJCUl4cknn8Sjjz6KuLg4xMXF4cKFC9i+fXvYMQ4Gg2hvb8euXbuQn5+P3Nzc2zaW1KyQOkdoNBrY7XbIZDLWMTU1NRULFy6E3+9nPeHcbjdMJhN8Ph88Hg8yMzPxwAMPsBbWcXFxsNls+N3vfhfVy6D+dzqdDpWVlUhMTIRGo0FNTU1IBpQO66FzKmUyGVQqFSudstlsrOyQRLwzqtifjMs5WWHmdMDhcODIkSN4++232VHsY62vefPm4Ze//CVKSkqYjirc8VBk4k43IchkMhQVFeEf/uEfMHv2bLz33ntoa2tjD2misQoGg1AqlTCZTMjIyEBZWRmqqqpQVFQ06bKl22kdRPvd7Zwb3yVY/vOf/xwPP/wwDAYDRCIRTCYT1q9fj0uXLqGxsTHswqKawr179+KnP/3pbXHricBIGkT1h3q9HqOjo8ytpP+z2+3YvHkzAoEAnE4nurq6WFdY8kyo46rL5cLly5cBABkZGVAqlWhvb2cH9GZnZyM9PR3JyckIBoOIj4/H4OAgSktLAfw5A11UVMRO7woEAtizZw/uuusuLFy4kAll1Wo1bDYbvF4vC/BTsiJauOGWSSyauUwN2sIdEDJTweSuri68//77YQkM+PMBCVVVVVi8ePFt1/OMJSJSKdN9BINBZGdnIysrC06nk53ORONMrYb1ej0rJ7nrrruQlZUVtdb0+yKviU6toflxJ5JYMBiEWq1GaWlpiAKfpDJPPvkkfvvb34ZtLwT8Wel++PBhlJSUYOnSpTM616hUhwLj1BlVp9OxVtSUoTQYDKyffV9fX0iGm7KGVLhN9adUOSMWi7Fq1SqkpaXhyJEjOHToEKRSKe655x6UlpZCq9WyInS9Xg+fz4fKykpIpVLU19djx44dOH36NHs/m80Gi8XCjt6jBph00hg9BwpDzYjYlVrQTrRDDA8PM1NxJuHxeHDq1Clcv3494qTR6/VTaic9U2Tb09OD3bt346233mIq/bKyMjz11FMoKSkJObqM3C6qc4uNjYVer//eNGCTJTFq/x1JZiEWi9Hd3T2jVRe3SmThLHStVovKykpcuXIFW7duDZvRFolEuHjxIvbt24ecnBxkZGTM2H1S7aRwM6QgOWUjqU+9yWRCa2srhoaGxukV6YxX6oOWkZHBsswAsHnzZqSlpaGoqAg9PT04dOgQOzuTevvRe1O1gM/nw3333QeTyYRvv/025P1u3ryJq1evsvbmUqk0pO+/MCY2Y2VHcrkcGo0maoZQLpeju7sbdrt9xrM1drsdR48ejbrraTQa1p75+1oYPT09+Pzzz/Haa6+xNrw5OTl4/vnn8cADD9z203pmAhKJBHFxcawdcqTXXLt2jVkLPxRQX7NHHnmEdXAJF9MTiUQ4ePAgiouLsXbt2hlzK4VF6PSdPB+hy07F1FqtFgkJCeP0ij6fj204QguIDJDOzk52buyRI0eY4ZCbm4v4+HjWA1AYIqCDRgKBAObPn4/6+nq0tLQA+LPUQq1WsxPQ6LRxiuvROp7Iir0lc0SlUiE2NhZGozGiS6BWq3Ht2rWIwszptG6Gh4ejBsJFIhEj3e+rnnB4eBi7d+/Gf/7nf7KHI5fL8Td/8zdYtmzZHUtgUx0vkUiE9PT0qAtXJBKhvr6etTf+IUEul6OkpARr166NGK8RiUQwm83Yu3cvrl+/flvqfMlyJOtF+J2ylmq1GiaTCb/5zW8wb968cZ4VdZOgmDAdqfbiiy8iLi4OZrOZkd1zzz3HTpgXKu3pO1ljfr8fxcXFIWdbkLXmdrsZ0dHf0f1OJk4svtWBS0xMRE5OTsQ3kUqlOH36NBobGycsQZkOgphIIS7MPk73wp0IXq8Xp06dYoWxdBry8uXLsXTp0u+leHgyY0CC5qnErujouYmsj6GhIVRXV0/YZ+1OhMlkwrJly1BVVRWxRlQul+PIkSM4cOAALBbLjLmTwu90IjcRk1gshlwuZ7/XaDSoqqrCo48+iqysrJC1Si296QAPoQi8srISKpUKmzZtQlNTE1avXo17770XarWabb4k5aDvZPmlp6dDoVDgvvvuY6di9fb2MheXOsUS8Qld0onW4i0HhjIyMjBr1qyIOymdiLJ//35YLJYZDeJOpljb7XZPesH4fD60t7dPWzGx2WzG1q1bmeyD3iMxMfF76zZBuqBoMYeRkRE4nc4pj0NKSgpmzZoVVT4RCASwd+9etLe337FZymhEnZeXh6qqKhQUFEQcH5lMhi+++AIXLlyYkY1c6CqO7S9G+kiKmZFoOjs7e9wBMeROKpVKFpui11NHFOE8IT2Y3++Hy+UKEdxSTI6ObVOpVNDpdEhOTkZhYSF+//vf45e//CWKiorYGaOUmKBeYpM97eiWSSwpKQnFxcVR40wKhQIHDx7EwYMH2WnOM2XiT9TA0Gq1YnR0dMIF4/F4cPz4cezatWtaSCwQCODcuXPj3F2lUomzZ89i3759uHLlCpqamtDS0hL1q62tDd3d3RgcHBx3PNhUoVAoJnWgxuDgYMS+YJGgVqtx//33R42FBoNBXL9+HV988cW4NsY/BCgUCixevBgPPPBARLdSLBbDbDZjx44daG1tnXbXWajUp5gUWdB0+AZZ/R6PBwqFAhaLBWq1OsT6l0ql7BRumUwGp9PJ4mHDw8MsAE84c+YME5zTKd/UeJHOj3Q6nawmUiaTMX1YbGwsiouLkZCQwN6L3G3KtAqPcIuGW5ZYyGQyLFy4ECdPnsTBgwfDLiiRSAS3242PPvoIcrkcf/VXfzWllsQ02SnIaLfbodVqQ7JCpOGZSDQ5NDSEq1evIjs7O6JY0Wq14uDBg/j000+ZPmYy9zaRBXj+/PlxQW6JRIKGhgb88Y9/RHJy8qTidTRxaHeLiYlBVlYWcnJykJ6eztrBTMayk8lk0Gg0bPcNB6PRiPPnz6OysjIiIYVLgUskEixcuBDz5s3D4cOHI05Gl8uFnTt3Qq1W44knnkBcXNyUrFIaf6/Xi8HBQSa6jBYEp0Uymc1H2BAgHOLj47Fy5UrU1dVFLCdTKBQ4duwYysrKkJCQAKPRGPWaU7XEhEedAWDta8iqoV5jIpEIIyMjiImJQWtrK1QqFf71X/8VmzdvZjoylUrFBKfAn7tOkOBVuOao+zL19ouNjUUgEGDWHx3xNjIywjRlCxYsgF6vR05ODtOVCYP31KaaVA+T2aAlv/nNb35zq4NIRcpNTU0RA/gikQijo6O4ceMG+vv7Q8xTYVaFvmjyeL1e2Gw2NDc34+TJk/jss8/Q3NyMnJyccQvK7/fj9OnTMJvNUcnE5/Nhzpw5bBei9/N6vWhubsZHH32ELVu24MaNG+wE5WhugF6vR2lpaQgBjZ2gTqcTu3fvRnNzc9gHMzo6iq6uLrS1taG1tTXqV0tLC5qbm9HY2Ii6ujrU1tbi8uXLqK6uRnV1NQYGBmAwGNjhp9EWikQiQXd3N65duxaxoFwikaCjowMlJSWsnbTwOXk8HvT19cHj8YTIPiieEh8fjwsXLkS1wh0OB27evIne3l7o9fpxm9zYuSHs99bW1obTp09j27ZtOHr0KMrLy0MOZaVSFqvVis7OTly+fBn79u3DqVOnInYUoVY8wsNiqcaPel0JXxsbGwu73Y6GhoaoLZJaW1vhdrvhdDpZtcJkzkuYbFB/rHVGandhyZ9SqYTT6YROp0NnZycOHTqErKwsVFZWIicnh/UhE76exmJ0dBRbtmwB8Oce+gsXLkRpaSmSk5PZ+5IrSC4iWX50Xujdd9+N7Oxs6PV6Nj8phiZssy3sZDGjtZNkhi5fvhxmsxmbN29Gd3d3RAbt7u7G1q1bceLECZSUlGDBggXIzMwMaSbn8XgwMDCA7u5utLS0oLa2Fr29vRgdHUVvby+efvrpcbsoFf2uXLkSly9fjpgJ8vl8OHHiBABg7dq1yM7OBgD09fXhwoULOH78OBoaGuByuZCRkYHVq1dDq9Xit7/9bVgrLxgM4tq1a3j55ZeRlpaG0tJSFBYWYu7cuezBksUTFxcXto3vrbioRL52ux1dXV2oq6vDxYsXsXv3bqxfvx4rVqxAfHx8xGQG1bZmZ2ejo6Mj4mvsdjt+//vfo6OjA/Pnz2diRrPZjIsXL+LatWv4xS9+wYK2wrlx11134YUXXsDbb7+Njo6OiBZwX18fvvzyS1RXV6OsrAzz589HdnY2jEYjG3uPx4ORkRF0dHSgvb0dtbW1MJvNsFqtGB4eRmlp6bi54Xa7UV1djU2bNsFsNsNms2F0dHTCppsikQifffYZvvrqK1a0vHLlSjz22GPjtGEKhQIrV67ElStX8PXXX4d1velw448//hhffvklYmJiUFJSgmeffRZFRUXT4laOXXdj5RfCnylbT38XyYsS1qLSPFq2bBkyMjJQWlrKqhmEmdGx7ynUylHGU/j7sXNiKhbqtJUd6XQ6PPHEExCLxdi1axeuX78e8WacTidu3ryJlpYW7Nu3D3K5fFwLDuqySt9pB3Y4HBGb4lH24+jRozh+/HjEhet0OnHo0CFUV1ezyUilDm63GyKRCCUlJXj00Ufx8MMPo6enB1u2bEF7e3vY9yULrrW1FdXV1dDpdHjttdeQlJQUcgjCkiVLcOTIEXR3d89YEJ9aM4+OjuJ3v/sdamtr8cILLyArKyvibp+bm4u7774bNTU1UQ+lbW1txZtvvgmVSsV2W4/HA6fTieTk5IjkrNFosHr1aohEInz66aeora2NqMB2uVxobW1FR0cH9u/fz+aGMH0vnBderzfEchc21RMuWpvNhp07d8JkMk1pPO12O+x2O3p6etDV1YWCgoKIzy4pKQnr1q3DjRs3UF9fH3Ejt9lssNls6OnpYY0LpyuwL5wH5NKR4JhixnRASG9vLxITEzF//nxs2bKFNTiUy+UsZENWslwux+joKPx+PxYuXIif/vSnjMD0ej1cLhcjJgrQe71eVgsplG5QDFZ4yA49Q7FYzP6O/l+YtJhREiO38sknn0R6ejoz1zs7OxnpjL0Jv98Ph8MRcUekD+nz+WAwGJCfn4/Zs2dj0aJFYWMzYrEY6enp+NnPfsa6pAr97bHvTZNJSJxpaWksbV5RUQGVSgW/349Vq1bhv//7v6NKBugamZmZISfC0L0tWrQIP/nJT/D555+zHkwzRWbBYBAOhwM7d+6ERCLBSy+9FDH5olKpsHr1anR1deGLL75grk6k+BXJCYTuZGFhYdT6NoPBgIceegiJiYnYu3cvqqur2dkMkeYGlV5NNDc0Gg3mzJmDwsJCLFq0KMSVpJ3fYDBEbQ0+GahUKqSkpESMt4nFYtx9991Ys2YN2traJjwngor3w/WM+y4WmPA7PQuKLQndfJPJhJ6eHhiNRoyMjGD//v1sPqrValitVtaskO7RarUyly8jIwPp6elIS0uDwWCAw+GARqNhr6dsN1nPRHLkPpOrTqRFMUciMGEs77acdhRu1125ciXy8/NRUVGBK1euoKamBteuXcPAwADkcjn7kMKJRjupx+OB2+2GXq9Heno6Zs2ahZycHGRnZyMnJwd5eXlITEyMuMgUCgUWLlwIpVKJgoICnDhxAjU1Ncw3F/4dpYZlMhnmzJmDefPmYf78+Vi0aFFIQ0GtVov58+ezBAUtILIG6IGQWLCgoGDcxBSJRDAajXj66aeRkZGB6upqnD17Fl1dXSHjMJnj3+h64RZ/OCtx//79KC4uxuOPPx6RaLKzs/Hss88iPj4e3377Lc6fP88Cs8K4GhE1dT4oLS3FvHnzMHfuXKSnp084N5YuXYrs7GwsXrwYV65cwaVLl1BfX4+enh4m9xgbxxO6zW63G2q1GhkZGcjJycGsWbOQmZmJ3NxczJo1C0lJSePcfqlUCqPRiIULF2J0dPQ7bxwmkykkRBAOSqUSa9aswfXr13HlypUJn2FiYmKIAHQ642LRXpuQkIDu7m4AwD/+4z/i+vXr0Gq18Hg8rOaSepK53W4YDAbY7XZoNBrk5uYiLS0NRqMRXq+XxQ0VCgWzlMcSvVKpZLFM6psv1IURWVFgn/5+MhILUXAGxTlerxc9PT3o7OxEd3c3LBYL+vr60NPTw4SpVBeoVqthNBpZ5sZkMrHWJwkJCYiNjZ1SG2OqT2xsbERLSwtrRd3f38+yJwkJCUhPT0dqairS09ORlZWF1NTUcQ8gGAyiubkZb7/9Ngua63Q66PV6KJVKRswkFkxJSUFJSUlIOnrsuNTX1+Ozzz7DRx99xIjF4/GgqKhoQoGo3+9np1zX19dDIpHAaDRGtRCWLl2Kf//3f0dKSkrUa/f397PSEBozCtpTd9DU1FQkJSUhKSkJqampyMjIYH3SJwufz4fe3l50dHSwk3b6+/thNpuZW0P3Tqn9sXMjNjYWSUlJrLnfRFlpOnvxu0IikbCOpBN9tvr6egwMDEx4Ta1Wi7vuuuu2NyMgGQXV5w4NDSE2NhaxsbHs1CEhKZJO8OzZs/jwww/xyiuvoLi4OMRlFc63scQj7G1GRDbWDSZyGyvenYicZ5TExi5cii84HA54PJ6Q5mcSiQQKhYKpf1Uq1bT0Xqc2u1arlXXUoMFTKpWMjCaSNjidTnR3d7NdQi6Xs6OmKOBJX8IYTjhYrVacOXMGX3zxBfbs2cNOq/nZz36GqqqqCQu7yRK02WwYGRlBV1cXzpw5g8OHD497+IT8/Hz8y7/8C5YuXTqpcXM4HGzMXC4XM/lJkqHVaqHRaKalqN/n87G5Ybfbw84NcnWEc+OH0DPt+4BwSRMpENFQmQ+51XSoCB1yTfOTxpsSI7QG2tvbcenSJSxbtgy5ublMviEs2g43/8jVJIuaYqrCLP7Y7OodR2Ic/69h4969e7F161ZcvHiRNYP767/+a7z44ovIy8ubdLqdTHdqmVxdXY133nkHZrN53DUSExPxq1/9Chs3buSL/0c6t4TPVZhtHKt1E/6brB/aNAKBANvoqbsxhUwoQUAaMq1WO2kLkkiMAv/kgQl1YtG6Vsy4xIJjcpNscHAQn332GZOhUNKgvLwcGzZsQE5OzpT0QlQTJ5fLERMTA6PRCI/Hg1dffXXcdUjIyPHjRDSJArl3RBjCwDllMYWlSkJyoUA9NSaUyWQsuzjZzVBocQm7U9A9CX8vJLDJXl/MH//tgd1ux44dO/DJJ5/AYrGwB+n3+/HEE0+gsLDwllo0i0QixMfHo6ysDLNnzx4nd5gudTjHD88yo+9EZmRVkUsplDdQkJ2sNLKcqGssvWYqAl3hXAynVxMmqKZKYJzEbhMCgQBOnjyJL7/8MuSkHK/Xi6VLl6KsrGzaeq3pdDqkpaWNIzGlUomYmBhOZH9BltlYIiOrhzRcwsaDwt+PJRXhwbzkFk7GjSQCFFqBdF3hKUZj7yGcaDcauDt5G9DX14e9e/eOKzlyOp2YO3cu4uLippUwSbArRExMDKtO4PjLcjHHumnkQgoJayzJjH09ySfIgpvobE+y7sIduUbXFXaiDXfPnMTuINTX1+PmzZvj0vukXp7Ok37sdvu4wL5EIkF6evqMtkjm+GEQmpBEwv0uHMZ2WJ2MFRbNWruVEiPuTn5P6OjoCNtmRqVS4caNG+jr65uWXlpOpxOdnZ24ceNGyAQymUyszzkHx48N3BK7DYh05qZCocA333yD2bNnQywWIzExESqVakKdmdCS83g8cLlcsNvtaG1txbFjx0LiYSKRCA8++CAqKyu/19OdODg4if2AQQcpUJmHkGD8fj/+4z/+AzU1NVi0aBGSkpKg0+mYkFTYOYDiB1SsTp0bzGYz6urqcPr0aSbdoKDqk08+iQ0bNkxr3I2D445ylbnYdeZhtVqxadMmvPPOO7DZbGGtLLfbjdHRUbhcLqSlpSE3NxdGo3Fc5UIgEIDVakV3dzfq6upYsa5arWYF5S6XC4mJiXj22WexZs2aKQloOTg4iXGERVdXF/bs2YNNmzahpaUFCoUiIrEIW8uE6/MUTqdDWUmVSoU1a9ZgzZo1mDt3LhISErisgoOTGMf0YHBwEE1NTTh+/Di+/fZb1NTUAAgtuZgM4QibzpHyurCwEPfccw8qKiqQl5eHhISEsIe6cnBwEuO4JVCt48jICLq7u9HW1oabN29iYGAAFosFPT09zK0cK8mQyWRQqVSse0RcXBzrypqamsoOI53pk9Y5ODiJcYQ09aN+ZG63m50BQL2XhK+nDhl0QpGwa4awMy4HBycxju+N2ML9HPLAvoOimYODkxgHBwfHHQqed+fg4OAkxsHBwcFJjIODg4OTGAcHBycxDg4ODk5iHBwcHJzEODg4ODiJcXBwcBLj4ODg4CTGwcHBwUmMg4ODg5MYBwcHJzEODg4OTmIcHBwcnMQ4ODg4iXFwcHBwEuPg4ODgJMbBwcHBSYyDg+MvCv8foPuErXNuO3cAAAAASUVORK5CYII="; + + // avoid inlining of constant + private static String crashImageWrapper() { + return crashImage.substring(0); + } + + private static String crashScreenOptsDump = null; + + @JSBody(params = {}, script = "if((typeof window.__isEaglerX188Running === \"string\") && window.__isEaglerX188Running === \"yes\") return true; window.__isEaglerX188Running = \"yes\"; return false;") + private static native boolean getRunningFlag(); + + public static void _main() { + PrintStream systemOut = System.out; + PrintStream systemErr = System.err; + if(getRunningFlag()) { + systemErr.println("ClientMain: [ERROR] eaglercraftx is already running!"); + return; + } + try { + systemOut.println("ClientMain: [INFO] eaglercraftx is starting..."); + String opts = getEaglerXOpts(); + + if(opts == null) { + systemErr.println("ClientMain: [ERROR] the \"window.eaglercraftXOpts\" variable is undefined"); + systemErr.println("ClientMain: [ERROR] eaglercraftx cannot start"); + Window.alert("ERROR: game cannot start, the \"window.eaglercraftXOpts\" variable is undefined"); + return; + } + + try { + JSONObject eaglercraftOpts = new JSONObject(opts); + + configRootElementId = eaglercraftOpts.getString("container"); + configRootElement = Window.current().getDocument().getElementById(configRootElementId); + + Object epkConfig = eaglercraftOpts.get("assetsURI"); + if(epkConfig instanceof JSONArray) { + JSONArray epkConfigArr = (JSONArray)epkConfig; + if(epkConfigArr.length() == 0) { + throw new JSONException("assetsURI array cannot be empty!"); + } + configEPKFiles = new EPKFileEntry[epkConfigArr.length()]; + for(int i = 0, l = configEPKFiles.length; i < l; ++i) { + configEPKFiles[i] = parseEntry(epkConfigArr.getJSONObject(i)); + } + }else if(epkConfig instanceof JSONObject) { + configEPKFiles = new EPKFileEntry[] { parseEntry((JSONObject)epkConfig) }; + }else if(epkConfig instanceof String) { + String epkConfigStr = (String)epkConfig; + configEPKFiles = new EPKFileEntry[] { new EPKFileEntry(epkConfigStr, "") }; + if(epkConfigStr.length() > 128) { + eaglercraftOpts.put("assetsURI", epkConfigStr.substring(0, 128) + " ... "); + } + } + + configLocalesFolder = eaglercraftOpts.optString("localesURI", "lang"); + if(configLocalesFolder.endsWith("/")) { + configLocalesFolder = configLocalesFolder.substring(0, configLocalesFolder.length() - 1); + } + + ((TeaVMClientConfigAdapter)TeaVMClientConfigAdapter.instance).loadJSON(eaglercraftOpts); + crashScreenOptsDump = eaglercraftOpts.toString(); + + systemOut.println("ClientMain: [INFO] configuration was successful"); + }catch(Throwable t) { + systemErr.println("ClientMain: [ERROR] the \"window.eaglercraftXOpts\" variable is invalid"); + EagRuntime.debugPrintStackTraceToSTDERR(t); + systemErr.println("ClientMain: [ERROR] eaglercraftx cannot start"); + Window.alert("ERROR: game cannot start, the \"window.eaglercraftXOpts\" variable is invalid: " + t.toString()); + return; + } + + systemOut.println("ClientMain: [INFO] registering crash handlers"); + + setWindowErrorHandler(new WindowErrorHandler() { + + @Override + public void call(String message, String file, int line, int col, JSError error) { + StringBuilder str = new StringBuilder(); + + str.append("Native Browser Exception\n"); + str.append("----------------------------------\n"); + str.append(" Line: ").append((file == null ? "unknown" : file) + ":" + line + ":" + col).append('\n'); + str.append(" Type: ").append(error == null ? "generic" : error.getName()).append('\n'); + + if(error != null) { + str.append(" Desc: ").append(error.getMessage() == null ? "null" : error.getMessage()).append('\n'); + } + + if(message != null) { + if(error == null || error.getMessage() == null || !message.endsWith(error.getMessage())) { + str.append(" Desc: ").append(message).append('\n'); + } + } + + str.append("----------------------------------\n\n"); + str.append(error.getStack() == null ? "No stack trace is available" : error.getStack()).append('\n'); + + showCrashScreen(str.toString()); + } + + }); + + systemOut.println("ClientMain: [INFO] initializing eaglercraftx runtime"); + + LogManager.logRedirector = new ILogRedirector() { + @Override + public void log(String txt, boolean err) { + PlatformApplication.addLogMessage(txt, err); + } + }; + + try { + EagRuntime.create(); + }catch(PlatformRuntime.PlatformIncompatibleException ex) { + systemErr.println("ClientMain: [ERROR] this browser is incompatible with eaglercraftx!"); + systemErr.println("ClientMain: [ERROR] Reason: " + ex.getMessage()); + try { + showIncompatibleScreen(ex.getMessage()); + }catch(Throwable t) { + } + return; + }catch(Throwable t) { + systemErr.println("ClientMain: [ERROR] eaglercraftx's runtime could not be initialized!"); + EagRuntime.debugPrintStackTraceToSTDERR(t); + showCrashScreen("EaglercraftX's runtime could not be initialized!", t); + systemErr.println("ClientMain: [ERROR] eaglercraftx cannot start"); + return; + } + + systemOut.println("ClientMain: [INFO] launching eaglercraftx main thread"); + + try { + Main.appMain(new String[0]); + }catch(Throwable t) { + systemErr.println("ClientMain: [ERROR] unhandled exception caused main thread to exit"); + EagRuntime.debugPrintStackTraceToSTDERR(t); + showCrashScreen("Unhandled exception caused main thread to exit!", t); + } + + }finally { + systemErr.println("ClientMain: [ERROR] eaglercraftx main thread has exited"); + } + } + + @JSBody(params = {}, script = "if(typeof window.eaglercraftXOpts === \"undefined\") {return null;}" + + "else if(typeof window.eaglercraftXOpts === \"string\") {return window.eaglercraftXOpts;}" + + "else {return JSON.stringify(window.eaglercraftXOpts);}") + private static native String getEaglerXOpts(); + + public static class EPKFileEntry { + + public final String url; + public final String path; + + protected EPKFileEntry(String url, String path) { + this.url = url; + this.path = path; + } + } + + private static EPKFileEntry parseEntry(JSONObject obj) { + String url = obj.getString("url"); + String path = obj.optString("path", ""); + if(url.length() > 128) { + obj.put("url", url.substring(0, 128) + " ... "); + } + if(path == null) { + path = ""; + } + return new EPKFileEntry(url, path); + } + + public static String configRootElementId = null; + public static HTMLElement configRootElement = null; + public static EPKFileEntry[] configEPKFiles = null; + public static String configLocalesFolder = null; + + @JSFunctor + private static interface WindowErrorHandler extends JSObject { + void call(String message, String file, int line, int col, JSError error); + } + + @JSBody(params = { "handler" }, script = "window.addEventListener(\"error\", function(e) { handler(" + + "(typeof e.message === \"string\") ? e.message : null," + + "(typeof e.filename === \"string\") ? e.filename : null," + + "(typeof e.lineno === \"number\") ? e.lineno : 0," + + "(typeof e.colno === \"number\") ? e.colno : 0," + + "(typeof e.error === \"undefined\") ? null : e.error); });") + public static native void setWindowErrorHandler(WindowErrorHandler handler); + + public static void showCrashScreen(String message, Throwable t) { + try { + showCrashScreen(message + "\n\n" + EagRuntime.getStackTrace(t)); + }catch(Throwable tt) { + } + } + + private static boolean isCrashed = false; + + public static void showCrashScreen(String t) { + if(!isCrashed) { + isCrashed = true; + + HTMLDocument doc = Window.current().getDocument(); + if(configRootElement == null) { + configRootElement = doc.getElementById(configRootElementId); + } + + HTMLElement el = configRootElement; + + StringBuilder str = new StringBuilder(); + str.append("Game Crashed! I have fallen and I can't get up!\n\n"); + str.append(t); + str.append('\n').append('\n'); + str.append("eaglercraft.version = \"").append(EaglercraftVersion.projectForkVersion).append("\"\n"); + str.append("eaglercraft.minecraft = \"1.8.8\"\n"); + str.append("eaglercraft.brand = \"" + EaglercraftVersion.projectForkVendor + "\"\n"); + str.append("eaglercraft.username = \"").append(EaglerProfile.getName()).append("\"\n"); + str.append('\n'); + str.append(addWebGLToCrash()); + str.append('\n'); + str.append("window.eaglercraftXOpts = "); + str.append(crashScreenOptsDump).append('\n'); + str.append('\n'); + str.append("currentTime = "); + str.append(EagRuntime.fixDateFormat(new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z")).format(new Date())).append('\n'); + str.append('\n'); + addDebugNav(str, "userAgent"); + addDebugNav(str, "vendor"); + addDebugNav(str, "language"); + addDebugNav(str, "hardwareConcurrency"); + addDebugNav(str, "deviceMemory"); + addDebugNav(str, "platform"); + addDebugNav(str, "product"); + str.append('\n'); + str.append("rootElement.clientWidth = ").append(el == null ? "undefined" : el.getClientWidth()).append('\n'); + str.append("rootElement.clientHeight = ").append(el == null ? "undefined" : el.getClientHeight()).append('\n'); + addDebug(str, "innerWidth"); + addDebug(str, "innerHeight"); + addDebug(str, "outerWidth"); + addDebug(str, "outerHeight"); + addDebug(str, "devicePixelRatio"); + addDebugScreen(str, "availWidth"); + addDebugScreen(str, "availHeight"); + addDebugScreen(str, "colorDepth"); + addDebugScreen(str, "pixelDepth"); + str.append('\n'); + addDebug(str, "currentContext"); + str.append('\n'); + addDebugLocation(str, "href"); + str.append('\n'); + + if(el == null) { + Window.alert("Root element not found, crash report was printed to console"); + System.err.println(str.toString()); + return; + } + + String s = el.getAttribute("style"); + el.setAttribute("style", (s == null ? "" : s) + "position:relative;"); + HTMLElement img = doc.createElement("img"); + HTMLElement div = doc.createElement("div"); + img.setAttribute("style", "z-index:100;position:absolute;top:10px;left:calc(50% - 151px);"); + img.setAttribute("src", crashImageWrapper()); + div.setAttribute("style", "z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:1px solid #cccccc;overflow-x:hidden;overflow-y:scroll;overflow-wrap:break-word;white-space:pre-wrap;font: 14px monospace;padding:10px;"); + el.appendChild(img); + el.appendChild(div); + div.appendChild(doc.createTextNode(str.toString())); + + PlatformRuntime.removeEventHandlers(); + + }else { + System.err.println(); + System.err.println("An additional crash report was supressed:"); + for(String l : t.split("[\\r\\n]+")) { + System.err.println(" " + l); + } + } + } + + private static String addWebGLToCrash() { + StringBuilder ret = new StringBuilder(); + + WebGLRenderingContext ctx = PlatformRuntime.webgl; + + if(ctx == null) { + HTMLCanvasElement cvs = (HTMLCanvasElement) Window.current().getDocument().createElement("canvas"); + + cvs.setWidth(64); + cvs.setHeight(64); + + ctx = (WebGLRenderingContext)cvs.getContext("webgl"); + } + + if(ctx != null) { + if(PlatformRuntime.webgl != null) { + ret.append("webgl.version = ").append(ctx.getParameterString(WebGLRenderingContext.VERSION)).append('\n'); + } + if(ctx.getExtension("WEBGL_debug_renderer_info") != null) { + ret.append("webgl.renderer = ").append(ctx.getParameterString(/* UNMASKED_RENDERER_WEBGL */ 0x9246)).append('\n'); + ret.append("webgl.vendor = ").append(ctx.getParameterString(/* UNMASKED_VENDOR_WEBGL */ 0x9245)).append('\n'); + }else { + ret.append("webgl.renderer = ").append(ctx.getParameterString(WebGLRenderingContext.RENDERER) + " [masked]").append('\n'); + ret.append("webgl.vendor = ").append(ctx.getParameterString(WebGLRenderingContext.VENDOR) + " [masked]").append('\n'); + } + //ret.append('\n').append("\nwebgl.anisotropicGlitch = ").append(DetectAnisotropicGlitch.hasGlitch()).append('\n'); //TODO + ret.append('\n').append("webgl.ext.HDR16f = ").append(ctx.getExtension("EXT_color_buffer_half_float") != null).append('\n'); + ret.append("webgl.ext.HDR32f = ").append(ctx.getExtension("EXT_color_buffer_float") != null).append('\n'); + + }else { + ret.append("Failed to query GPU info!\n"); + } + + return ret.toString(); + } + + public static void showIncompatibleScreen(String t) { + if(!isCrashed) { + isCrashed = true; + + HTMLDocument doc = Window.current().getDocument(); + if(configRootElement == null) { + configRootElement = doc.getElementById(configRootElementId); + } + + HTMLElement el = configRootElement; + + if(el == null) { + System.err.println("Compatibility error: " + t); + return; + } + + String s = el.getAttribute("style"); + el.setAttribute("style", (s == null ? "" : s) + "position:relative;"); + HTMLElement img = doc.createElement("img"); + HTMLElement div = doc.createElement("div"); + img.setAttribute("style", "z-index:100;position:absolute;top:10px;left:calc(50% - 151px);"); + img.setAttribute("src", crashImageWrapper()); + div.setAttribute("style", "z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:1px solid #cccccc;overflow-x:hidden;overflow-y:scroll;font:18px sans-serif;padding:40px;"); + el.appendChild(img); + el.appendChild(div); + div.setInnerHTML("

+ This device is incompatible with Eaglercraft :(

" + + "
" + + "

Issue:

" + + "

" + + "

" + + "

Current Date: " + EagRuntime.fixDateFormat(new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z")).format(new Date()) + "

" + + "


Things you can try:

" + + "
    " + + "
  1. Just try using Eaglercraft on a different device, it isn't a bug it's common sense
  2. " + + "
  3. If you are on a mobile device, please try a proper desktop or a laptop computer
  4. " + + "
  5. If you are using a device with no mouse cursor, please use a device with a mouse cursor
  6. " + + "
  7. If you are not using Chrome/Edge, try installing the latest Google Chrome
  8. " + + "
  9. If your browser is out of date, please update it to the latest version
  10. " + + "
  11. If you are using an old OS such as Windows 7, please try Windows 10 or 11
  12. " + + "
  13. If you have a GPU launched before 2009, WebGL 2.0 support may be impossible
  14. " + + "
" + + "
"); + + div.querySelector("#crashReason").appendChild(doc.createTextNode(t)); + div.querySelector("#crashUserAgent").appendChild(doc.createTextNode(getStringNav("userAgent"))); + + PlatformRuntime.removeEventHandlers(); + + String webGLRenderer = "No GL_RENDERER string could be queried"; + + try { + HTMLCanvasElement cvs = (HTMLCanvasElement) Window.current().getDocument().createElement("canvas"); + + cvs.setWidth(64); + cvs.setHeight(64); + + WebGLRenderingContext ctx = (WebGLRenderingContext)cvs.getContext("webgl"); + + if(ctx != null) { + String r; + if(ctx.getExtension("WEBGL_debug_renderer_info") != null) { + r = ctx.getParameterString(/* UNMASKED_RENDERER_WEBGL */ 0x9246); + }else { + r = ctx.getParameterString(WebGLRenderingContext.RENDERER); + if(r != null) { + r += " [masked]"; + } + } + if(r != null) { + webGLRenderer = r; + } + } + }catch(Throwable tt) { + } + + div.querySelector("#crashWebGL").appendChild(doc.createTextNode(webGLRenderer)); + + } + } + + private static HTMLElement integratedServerCrashPanel = null; + + public static void showIntegratedServerCrashReportOverlay(String report, int x, int y, int w, int h) { + if(integratedServerCrashPanel == null) { + HTMLDocument doc = Window.current().getDocument(); + if(configRootElement == null) { + configRootElement = doc.getElementById(configRootElementId); + } + + integratedServerCrashPanel = doc.createElement("div"); + integratedServerCrashPanel.setAttribute("style", "z-index:99;position:absolute;background-color:black;color:white;overflow-x:hidden;overflow-y:scroll;overflow-wrap:break-word;white-space:pre-wrap;font:18px sans-serif;padding:20px;display:none;"); + configRootElement.appendChild(integratedServerCrashPanel); + } + String sourceURL = ClientPlatformSingleplayer.getLoadedWorkerSourceURLTeaVM(); + String workerURL = ClientPlatformSingleplayer.getLoadedWorkerURLTeaVM(); + String currentDate = EagRuntime.fixDateFormat(new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z")).format(new Date()); + if(workerURL != null) { + report = "WORKER SRC: " + sourceURL +"\nWORKER URL: " + workerURL + "\n\nCURRENT DATE: " + currentDate + "\n\n" + report.replaceAll(workerURL, ""); + }else { + report = "CURRENT DATE: " + currentDate + "\n\n" + report; + } + setInnerText(integratedServerCrashPanel, ""); + setInnerText(integratedServerCrashPanel, report); + CSSStyleDeclaration style = integratedServerCrashPanel.getStyle(); + float s = (float)Window.current().getDevicePixelRatio(); + style.setProperty("top", "" + (y / s) + "px"); + style.setProperty("left", "" + (x / s) + "px"); + style.setProperty("width", "" + ((w / s) - 20) + "px"); + style.setProperty("height", "" + ((h / s) - 20) + "px"); + style.setProperty("display", "block"); + } + + public static void hideIntegratedServerCrashReportOverlay() { + if(integratedServerCrashPanel != null) { + integratedServerCrashPanel.getStyle().setProperty("display", "none"); + } + } + + @JSBody(params = { "el", "str" }, script = "el.innerText = str;") + private static native void setInnerText(HTMLElement el, String str); + + @JSBody(params = { "v" }, script = "try { return \"\"+window[v]; } catch(e) { return \"\"; }") + private static native String getString(String var); + + @JSBody(params = { "v" }, script = "try { return \"\"+window.navigator[v]; } catch(e) { return \"\"; }") + private static native String getStringNav(String var); + + @JSBody(params = { "v" }, script = "try { return \"\"+window.screen[v]; } catch(e) { return \"\"; }") + private static native String getStringScreen(String var); + + @JSBody(params = { "v" }, script = "try { return \"\"+window.location[v]; } catch(e) { return \"\"; }") + private static native String getStringLocation(String var); + + private static void addDebug(StringBuilder str, String var) { + str.append("window.").append(var).append(" = ").append(getString(var)).append('\n'); + } + + private static void addDebugNav(StringBuilder str, String var) { + str.append("window.navigator.").append(var).append(" = ").append(getStringNav(var)).append('\n'); + } + + private static void addDebugScreen(StringBuilder str, String var) { + str.append("window.screen.").append(var).append(" = ").append(getStringScreen(var)).append('\n'); + } + + private static void addDebugLocation(StringBuilder str, String var) { + str.append("window.location.").append(var).append(" = ").append(getStringLocation(var)).append('\n'); + } + + private static void addArray(StringBuilder str, String var) { + str.append("window.").append(var).append(" = ").append(getArray(var)).append('\n'); + } + + @JSBody(params = { "v" }, script = "try { return (typeof window[v] !== \"undefined\") ? JSON.stringify(window[v]) : \"[\\\"\\\"]\"; } catch(e) { return \"[\\\"\\\"]\"; }") + private static native String getArray(String var); + +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/DebugConsoleWindow.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/DebugConsoleWindow.java new file mode 100644 index 0000000..f00fa87 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/DebugConsoleWindow.java @@ -0,0 +1,173 @@ +package net.lax1dude.eaglercraft.v1_8.internal.teavm; + +import java.util.LinkedList; +import java.util.List; + +import org.teavm.jso.JSBody; +import org.teavm.jso.browser.Window; +import org.teavm.jso.dom.events.Event; +import org.teavm.jso.dom.events.EventListener; +import org.teavm.jso.dom.html.HTMLBodyElement; +import org.teavm.jso.dom.html.HTMLCollection; +import org.teavm.jso.dom.html.HTMLDocument; +import org.teavm.jso.dom.html.HTMLElement; + +import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; + +/** + * 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 DebugConsoleWindow { + + private static class LogMessage { + + private final boolean err; + private final String msg; + + public LogMessage(boolean err, String msg) { + this.err = err; + this.msg = msg; + } + + } + + private static final int bufferSpoolSize = 256; + private static final int windowMaxMessages = 2048; + + private static final List messageBuffer = new LinkedList(); + + public static Window parent = null; + public static Window logger = null; + private static HTMLDocument loggerDoc = null; + private static HTMLBodyElement loggerBody = null; + private static HTMLElement loggerMessageContainer = null; + + public static void initialize(Window parentWindow) { + parent = parentWindow; + parent.addEventListener("unload", new EventListener() { + @Override + public void handleEvent(Event evt) { + destroyWindow(); + } + }); + if("true".equals(parent.getLocalStorage().getItem("_eaglercraftX.showDebugConsole"))) { + showDebugConsole0(); + } + } + + public static void showDebugConsole() { + parent.getLocalStorage().setItem("_eaglercraftX.showDebugConsole", "true"); + showDebugConsole0(); + } + + @JSBody(params = { "doc", "str" }, script = "doc.write(str);doc.close();") + private static native void documentWrite(HTMLDocument doc, String str); + + private static void showDebugConsole0() { + if(logger == null) { + int w = (int)(1000 * parent.getDevicePixelRatio()); + int h = (int)(400 * parent.getDevicePixelRatio()); + int x = (parent.getScreen().getWidth() - w) / 2; + int y = (parent.getScreen().getHeight() - h) / 2; + logger = parent.open("", "_blank", "top=" + y + ",left=" + x + ",width=" + w + ",height=" + h + ",menubar=0,status=0,titlebar=0,toolbar=0"); + if(logger == null) { + LogManager.getLogger("DebugConsoleWindow").error("Logger popup was blocked!"); + Window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!"); + return; + } + logger.focus(); + documentWrite(logger.getDocument(), "" + + "Debug Console" + + "

"); + loggerDoc = logger.getDocument(); + loggerBody = loggerDoc.getBody(); + loggerMessageContainer = loggerDoc.getElementById("loggerMessageContainer"); + synchronized(messageBuffer) { + for(LogMessage msg : messageBuffer) { + appendLogMessage(msg.msg + "\n", msg.err ? "#DD0000" : "#000000"); + } + messageBuffer.clear(); + } + scrollToEnd0(logger, loggerDoc); + EventListener unloadListener = new EventListener() { + @Override + public void handleEvent(Event evt) { + if(logger != null) { + logger = null; + parent.getLocalStorage().setItem("_eaglercraftX.showDebugConsole", "false"); + } + } + }; + logger.addEventListener("beforeunload", unloadListener); + logger.addEventListener("unload", unloadListener); + }else { + logger.focus(); + } + } + + public static void addLogMessage(String text, boolean isErr) { + if(logger == null) { + synchronized(messageBuffer) { + if(logger == null) { + messageBuffer.add(new LogMessage(isErr, text)); + while(messageBuffer.size() > bufferSpoolSize) { + messageBuffer.remove(0); + } + return; + } + } + } + appendLogMessageAndScroll(text + "\n", isErr ? "#DD0000" : "#000000"); + } + + private static void appendLogMessageAndScroll(String text, String color) { + boolean b = isScrollToEnd(logger, loggerDoc); + appendLogMessage(text, color); + if(b) { + scrollToEnd0(logger, loggerDoc); + } + } + + private static void appendLogMessage(String text, String color) { + HTMLElement el = loggerDoc.createElement("span"); + el.setInnerText(text); + el.getStyle().setProperty("color", color); + loggerMessageContainer.appendChild(el); + HTMLCollection children = loggerMessageContainer.getChildren(); + while(children.getLength() > windowMaxMessages) { + children.get(0).delete(); + } + } + + @JSBody(params = { "win", "doc" }, script = "return (win.innerHeight + win.pageYOffset) >= doc.body.offsetHeight;") + private static native boolean isScrollToEnd(Window win, HTMLDocument doc); + + @JSBody(params = { "win", "doc" }, script = "setTimeout(function(){win.scrollTo(0, doc.body.scrollHeight || doc.body.clientHeight);}, 1);") + private static native void scrollToEnd0(Window win, HTMLDocument doc); + + public static void destroyWindow() { + if(logger != null) { + Window w = logger; + logger = null; + w.close(); + } + } + + public static boolean isShowingDebugConsole() { + return logger != null; + } + +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EPKLoader.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EPKLoader.java index 764f483..ac12c2b 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EPKLoader.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EPKLoader.java @@ -12,16 +12,18 @@ import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.InflaterInputStream; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EPKLoader { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java index f17ce45..15d75f6 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java @@ -20,16 +20,18 @@ import net.lax1dude.eaglercraft.v1_8.Base64; import net.lax1dude.eaglercraft.v1_8.EagUtils; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 EarlyLoadScreen { @@ -53,7 +55,7 @@ public class EarlyLoadScreen { ImageData img = PlatformAssets.loadImageFile(Base64.decodeBase64(loadScreen)); ByteBuffer upload = PlatformRuntime.allocateByteBuffer(192*192*4); IntBuffer pixelUpload = upload.asIntBuffer(); - pixelUpload.put(img.getPixels()); + pixelUpload.put(img.pixels); pixelUpload.flip(); _wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 192, 192, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixelUpload); @@ -142,7 +144,7 @@ public class EarlyLoadScreen { _wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ImageData img = PlatformAssets.loadImageFile(Base64.decodeBase64(enableScreen)); IntBuffer upload = PlatformRuntime.allocateIntBuffer(128*128); - upload.put(img.getPixels()); + upload.put(img.pixels); upload.flip(); _wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, upload); @@ -199,7 +201,7 @@ public class EarlyLoadScreen { _wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ImageData img = PlatformAssets.loadImageFile(image); IntBuffer upload = PlatformRuntime.allocateIntBuffer(256*256); - upload.put(img.getPixels()); + upload.put(img.pixels); upload.flip(); _wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, upload); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/FixWebMDurationJS.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/FixWebMDurationJS.java new file mode 100644 index 0000000..8ff06ff --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/FixWebMDurationJS.java @@ -0,0 +1,115 @@ +package net.lax1dude.eaglercraft.v1_8.internal.teavm; + +import org.teavm.jso.JSBody; +import org.teavm.jso.JSFunctor; +import org.teavm.jso.JSObject; +import org.teavm.jso.dom.events.Event; + +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +/** + * 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 FixWebMDurationJS { + + private static final Logger logger = LogManager.getLogger("FixWebMDurationJS"); + + private static JSObject fixWebMDurationHandle = null; + + @JSBody(params = {}, script = "return typeof window.ysFixWebmDuration !== \"undefined\"") + private static native boolean isOldScriptStillLoaded(); + + public static void checkOldScriptStillLoaded() { + if(isOldScriptStillLoaded()) { + logger.error("The \"fix-webm-duration.js\" script is no longer required for EaglercraftX 1.8 u20 and up, it can be safely removed from this page"); + } + } + + public static void getRecUrl(Event e, int duration, RecUrlHandler cb, LogMsgHandler logger) { + checkOldScriptStillLoaded(); + if(fixWebMDurationHandle == null) { + fixWebMDurationHandle = register(); + } + getRecUrlImpl(fixWebMDurationHandle, e, duration, cb, logger); + } + + @JSFunctor + public static interface RecUrlHandler extends JSObject { + void onUrl(String url); + } + + @JSFunctor + public static interface LogMsgHandler extends JSObject { + void onMsg(String url); + } + + @JSBody(params = { "lib", "e", "duration", "cb", "lgg" }, script = "lib(e.data, duration, function(b) { cb(URL.createObjectURL(b)); }, { logger: lgg });") + private static native void getRecUrlImpl(JSObject lib, Event e, int duration, RecUrlHandler cb, LogMsgHandler logger); + + /* + * The MIT license (for fix-webm-duration) + * + * Copyright (c) 2018 Yury Sitnikov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + @JSBody(params = {}, script = "function m(a,b){a.prototype=Object.create(b.prototype);a.prototype.constructor=a}function e(a,b){this.name=a||\"Unknown\";this.type=b||\"Unknown\"}function l(a,b){e.call(this,a,b||\"Uint\")}function k(a,b){e.call(this,a,b||\"Float\")}function h(a,b){e.call(this,a,b||\"Container\")}function n(a){h.call(this,\"File\",\"File\");" + + "this.setSource(a)}function p(a,b,c,d){\"object\"===typeof c&&(d=c,c=void 0);if(!c)return new Promise(function(g){p(a,b,g,d)});try{var f=new FileReader;f.onloadend=function(){try{var g=new n(new Uint8Array(f.result));g.fixDuration(b,d)&&(a=g.toBlob(a.type))}catch(q){}c(a)};f.readAsArrayBuffer(a)}catch(g){c(a)}}var r={172351395:{name:\"EBML\",type:\"Container\"},646:{name:\"EBMLVersion\",type:\"Uint\"},759:{name:\"EBMLReadVersion\",type:\"Uint\"},754:{name:\"EBMLMaxIDLength\",type:\"Uint\"},755:{name:\"EBMLMaxSizeLength\"," + + "type:\"Uint\"},642:{name:\"DocType\",type:\"String\"},647:{name:\"DocTypeVersion\",type:\"Uint\"},645:{name:\"DocTypeReadVersion\",type:\"Uint\"},108:{name:\"Void\",type:\"Binary\"},63:{name:\"CRC-32\",type:\"Binary\"},190023271:{name:\"SignatureSlot\",type:\"Container\"},16010:{name:\"SignatureAlgo\",type:\"Uint\"},16026:{name:\"SignatureHash\",type:\"Uint\"},16037:{name:\"SignaturePublicKey\",type:\"Binary\"},16053:{name:\"Signature\",type:\"Binary\"},15963:{name:\"SignatureElements\",type:\"Container\"},15995:{name:\"SignatureElementList\"," + + "type:\"Container\"},9522:{name:\"SignedElement\",type:\"Binary\"},139690087:{name:\"Segment\",type:\"Container\"},21863284:{name:\"SeekHead\",type:\"Container\"},3515:{name:\"Seek\",type:\"Container\"},5035:{name:\"SeekID\",type:\"Binary\"},5036:{name:\"SeekPosition\",type:\"Uint\"},88713574:{name:\"Info\",type:\"Container\"},13220:{name:\"SegmentUID\",type:\"Binary\"},13188:{name:\"SegmentFilename\",type:\"String\"},1882403:{name:\"PrevUID\",type:\"Binary\"},1868715:{name:\"PrevFilename\",type:\"String\"},2013475:{name:\"NextUID\",type:\"Binary\"}," + + "1999803:{name:\"NextFilename\",type:\"String\"},1092:{name:\"SegmentFamily\",type:\"Binary\"},10532:{name:\"ChapterTranslate\",type:\"Container\"},10748:{name:\"ChapterTranslateEditionUID\",type:\"Uint\"},10687:{name:\"ChapterTranslateCodec\",type:\"Uint\"},10661:{name:\"ChapterTranslateID\",type:\"Binary\"},710577:{name:\"TimecodeScale\",type:\"Uint\"},1161:{name:\"Duration\",type:\"Float\"},1121:{name:\"DateUTC\",type:\"Date\"},15273:{name:\"Title\",type:\"String\"},3456:{name:\"MuxingApp\",type:\"String\"},5953:{name:\"WritingApp\",type:\"String\"}," + + "103:{name:\"Timecode\",type:\"Uint\"},6228:{name:\"SilentTracks\",type:\"Container\"},6359:{name:\"SilentTrackNumber\",type:\"Uint\"},39:{name:\"Position\",type:\"Uint\"},43:{name:\"PrevSize\",type:\"Uint\"},35:{name:\"SimpleBlock\",type:\"Binary\"},32:{name:\"BlockGroup\",type:\"Container\"},33:{name:\"Block\",type:\"Binary\"},34:{name:\"BlockVirtual\",type:\"Binary\"},13729:{name:\"BlockAdditions\",type:\"Container\"},38:{name:\"BlockMore\",type:\"Container\"},110:{name:\"BlockAddID\",type:\"Uint\"},37:{name:\"BlockAdditional\",type:\"Binary\"}," + + "27:{name:\"BlockDuration\",type:\"Uint\"},122:{name:\"ReferencePriority\",type:\"Uint\"},123:{name:\"ReferenceBlock\",type:\"Int\"},125:{name:\"ReferenceVirtual\",type:\"Int\"},36:{name:\"CodecState\",type:\"Binary\"},13730:{name:\"DiscardPadding\",type:\"Int\"},14:{name:\"Slices\",type:\"Container\"},104:{name:\"TimeSlice\",type:\"Container\"},76:{name:\"LaceNumber\",type:\"Uint\"},77:{name:\"FrameNumber\",type:\"Uint\"},75:{name:\"BlockAdditionID\",type:\"Uint\"},78:{name:\"Delay\",type:\"Uint\"},79:{name:\"SliceDuration\",type:\"Uint\"},72:{name:\"ReferenceFrame\"," + + "type:\"Container\"},73:{name:\"ReferenceOffset\",type:\"Uint\"},74:{name:\"ReferenceTimeCode\",type:\"Uint\"},47:{name:\"EncryptedBlock\",type:\"Binary\"},106212971:{name:\"Tracks\",type:\"Container\"},46:{name:\"TrackEntry\",type:\"Container\"},87:{name:\"TrackNumber\",type:\"Uint\"},13253:{name:\"TrackUID\",type:\"Uint\"},3:{name:\"TrackType\",type:\"Uint\"},57:{name:\"FlagEnabled\",type:\"Uint\"},8:{name:\"FlagDefault\",type:\"Uint\"},5546:{name:\"FlagForced\",type:\"Uint\"},28:{name:\"FlagLacing\",type:\"Uint\"},11751:{name:\"MinCache\",type:\"Uint\"}," + + "11768:{name:\"MaxCache\",type:\"Uint\"},254851:{name:\"DefaultDuration\",type:\"Uint\"},216698:{name:\"DefaultDecodedFieldDuration\",type:\"Uint\"},209231:{name:\"TrackTimecodeScale\",type:\"Float\"},4991:{name:\"TrackOffset\",type:\"Int\"},5614:{name:\"MaxBlockAdditionID\",type:\"Uint\"},4974:{name:\"Name\",type:\"String\"},177564:{name:\"Language\",type:\"String\"},6:{name:\"CodecID\",type:\"String\"},9122:{name:\"CodecPrivate\",type:\"Binary\"},362120:{name:\"CodecName\",type:\"String\"},13382:{name:\"AttachmentLink\",type:\"Uint\"},1742487:{name:\"CodecSettings\"," + + "type:\"String\"},1785920:{name:\"CodecInfoURL\",type:\"String\"},438848:{name:\"CodecDownloadURL\",type:\"String\"},42:{name:\"CodecDecodeAll\",type:\"Uint\"},12203:{name:\"TrackOverlay\",type:\"Uint\"},5802:{name:\"CodecDelay\",type:\"Uint\"},5819:{name:\"SeekPreRoll\",type:\"Uint\"},9764:{name:\"TrackTranslate\",type:\"Container\"},9980:{name:\"TrackTranslateEditionUID\",type:\"Uint\"},9919:{name:\"TrackTranslateCodec\",type:\"Uint\"},9893:{name:\"TrackTranslateTrackID\",type:\"Binary\"},96:{name:\"Video\",type:\"Container\"},26:{name:\"FlagInterlaced\"," + + "type:\"Uint\"},5048:{name:\"StereoMode\",type:\"Uint\"},5056:{name:\"AlphaMode\",type:\"Uint\"},5049:{name:\"OldStereoMode\",type:\"Uint\"},48:{name:\"PixelWidth\",type:\"Uint\"},58:{name:\"PixelHeight\",type:\"Uint\"},5290:{name:\"PixelCropBottom\",type:\"Uint\"},5307:{name:\"PixelCropTop\",type:\"Uint\"},5324:{name:\"PixelCropLeft\",type:\"Uint\"},5341:{name:\"PixelCropRight\",type:\"Uint\"},5296:{name:\"DisplayWidth\",type:\"Uint\"},5306:{name:\"DisplayHeight\",type:\"Uint\"},5298:{name:\"DisplayUnit\",type:\"Uint\"},5299:{name:\"AspectRatioType\"," + + "type:\"Uint\"},963876:{name:\"ColourSpace\",type:\"Binary\"},1029411:{name:\"GammaValue\",type:\"Float\"},230371:{name:\"FrameRate\",type:\"Float\"},97:{name:\"Audio\",type:\"Container\"},53:{name:\"SamplingFrequency\",type:\"Float\"},14517:{name:\"OutputSamplingFrequency\",type:\"Float\"},31:{name:\"Channels\",type:\"Uint\"},15739:{name:\"ChannelPositions\",type:\"Binary\"},8804:{name:\"BitDepth\",type:\"Uint\"},98:{name:\"TrackOperation\",type:\"Container\"},99:{name:\"TrackCombinePlanes\",type:\"Container\"},100:{name:\"TrackPlane\",type:\"Container\"}," + + "101:{name:\"TrackPlaneUID\",type:\"Uint\"},102:{name:\"TrackPlaneType\",type:\"Uint\"},105:{name:\"TrackJoinBlocks\",type:\"Container\"},109:{name:\"TrackJoinUID\",type:\"Uint\"},64:{name:\"TrickTrackUID\",type:\"Uint\"},65:{name:\"TrickTrackSegmentUID\",type:\"Binary\"},70:{name:\"TrickTrackFlag\",type:\"Uint\"},71:{name:\"TrickMasterTrackUID\",type:\"Uint\"},68:{name:\"TrickMasterTrackSegmentUID\",type:\"Binary\"},11648:{name:\"ContentEncodings\",type:\"Container\"},8768:{name:\"ContentEncoding\",type:\"Container\"},4145:{name:\"ContentEncodingOrder\"," + + "type:\"Uint\"},4146:{name:\"ContentEncodingScope\",type:\"Uint\"},4147:{name:\"ContentEncodingType\",type:\"Uint\"},4148:{name:\"ContentCompression\",type:\"Container\"},596:{name:\"ContentCompAlgo\",type:\"Uint\"},597:{name:\"ContentCompSettings\",type:\"Binary\"},4149:{name:\"ContentEncryption\",type:\"Container\"},2017:{name:\"ContentEncAlgo\",type:\"Uint\"},2018:{name:\"ContentEncKeyID\",type:\"Binary\"},2019:{name:\"ContentSignature\",type:\"Binary\"},2020:{name:\"ContentSigKeyID\",type:\"Binary\"},2021:{name:\"ContentSigAlgo\",type:\"Uint\"}," + + "2022:{name:\"ContentSigHashAlgo\",type:\"Uint\"},206814059:{name:\"Cues\",type:\"Container\"},59:{name:\"CuePoint\",type:\"Container\"},51:{name:\"CueTime\",type:\"Uint\"},55:{name:\"CueTrackPositions\",type:\"Container\"},119:{name:\"CueTrack\",type:\"Uint\"},113:{name:\"CueClusterPosition\",type:\"Uint\"},112:{name:\"CueRelativePosition\",type:\"Uint\"},50:{name:\"CueDuration\",type:\"Uint\"},4984:{name:\"CueBlockNumber\",type:\"Uint\"},106:{name:\"CueCodecState\",type:\"Uint\"},91:{name:\"CueReference\",type:\"Container\"},22:{name:\"CueRefTime\"," + + "type:\"Uint\"},23:{name:\"CueRefCluster\",type:\"Uint\"},4959:{name:\"CueRefNumber\",type:\"Uint\"},107:{name:\"CueRefCodecState\",type:\"Uint\"},155296873:{name:\"Attachments\",type:\"Container\"},8615:{name:\"AttachedFile\",type:\"Container\"},1662:{name:\"FileDescription\",type:\"String\"},1646:{name:\"FileName\",type:\"String\"},1632:{name:\"FileMimeType\",type:\"String\"},1628:{name:\"FileData\",type:\"Binary\"},1710:{name:\"FileUID\",type:\"Uint\"},1653:{name:\"FileReferral\",type:\"Binary\"},1633:{name:\"FileUsedStartTime\",type:\"Uint\"}," + + "1634:{name:\"FileUsedEndTime\",type:\"Uint\"},4433776:{name:\"Chapters\",type:\"Container\"},1465:{name:\"EditionEntry\",type:\"Container\"},1468:{name:\"EditionUID\",type:\"Uint\"},1469:{name:\"EditionFlagHidden\",type:\"Uint\"},1499:{name:\"EditionFlagDefault\",type:\"Uint\"},1501:{name:\"EditionFlagOrdered\",type:\"Uint\"},54:{name:\"ChapterAtom\",type:\"Container\"},13252:{name:\"ChapterUID\",type:\"Uint\"},5716:{name:\"ChapterStringUID\",type:\"String\"},17:{name:\"ChapterTimeStart\",type:\"Uint\"},18:{name:\"ChapterTimeEnd\",type:\"Uint\"}," + + "24:{name:\"ChapterFlagHidden\",type:\"Uint\"},1432:{name:\"ChapterFlagEnabled\",type:\"Uint\"},11879:{name:\"ChapterSegmentUID\",type:\"Binary\"},11964:{name:\"ChapterSegmentEditionUID\",type:\"Uint\"},9155:{name:\"ChapterPhysicalEquiv\",type:\"Uint\"},15:{name:\"ChapterTrack\",type:\"Container\"},9:{name:\"ChapterTrackNumber\",type:\"Uint\"},0:{name:\"ChapterDisplay\",type:\"Container\"},5:{name:\"ChapString\",type:\"String\"},892:{name:\"ChapLanguage\",type:\"String\"},894:{name:\"ChapCountry\",type:\"String\"},10564:{name:\"ChapProcess\"," + + "type:\"Container\"},10581:{name:\"ChapProcessCodecID\",type:\"Uint\"},1293:{name:\"ChapProcessPrivate\",type:\"Binary\"},10513:{name:\"ChapProcessCommand\",type:\"Container\"},10530:{name:\"ChapProcessTime\",type:\"Uint\"},10547:{name:\"ChapProcessData\",type:\"Binary\"},39109479:{name:\"Tags\",type:\"Container\"},13171:{name:\"Tag\",type:\"Container\"},9152:{name:\"Targets\",type:\"Container\"},10442:{name:\"TargetTypeValue\",type:\"Uint\"},9162:{name:\"TargetType\",type:\"String\"},9157:{name:\"TagTrackUID\",type:\"Uint\"},9161:{name:\"TagEditionUID\"," + + "type:\"Uint\"},9156:{name:\"TagChapterUID\",type:\"Uint\"},9158:{name:\"TagAttachmentUID\",type:\"Uint\"},10184:{name:\"SimpleTag\",type:\"Container\"},1443:{name:\"TagName\",type:\"String\"},1146:{name:\"TagLanguage\",type:\"String\"},1156:{name:\"TagDefault\",type:\"Uint\"},1159:{name:\"TagString\",type:\"String\"},1157:{name:\"TagBinary\",type:\"Binary\"}};e.prototype.updateBySource=function(){};e.prototype.setSource=function(a){this.source=a;this.updateBySource()};e.prototype.updateByData=function(){};e.prototype.setData=function(a){this.data=" + + "a;this.updateByData()};m(l,e);l.prototype.updateBySource=function(){this.data=\"\";for(var a=0;a=d&&8>c;c++,d*=128);if(!b)for(a=d+a,b=c-1;0<=b;b--)d=a%256,this.source[this.offset+b]=d,a=(a-d)/256;this.offset+=c};h.prototype.writeSections=function(a){for(var b=this.offset=0;b=g.getValue())b(\"[fix-webm-duration] Duration section is present, but the value is empty\"),g.setValue(a);else return b(\"[fix-webm-duration] Duration section is present\"),!1;else b(\"[fix-webm-duration] Duration section is missing\"),g=new k(\"Duration\",\"Float\")," + + "g.setValue(a),d.data.push({id:1161,data:g});f.setValue(1E6);d.updateByData();c.updateByData();this.updateByData();return!0};n.prototype.toBlob=function(a){return new Blob([this.source.buffer],{type:a||\"video/webm\"})};return p.default=p;") + private static native JSObject register(); + +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java index f15d13c..5369ca2 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java @@ -1,447 +1,42 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm; -import java.io.PrintStream; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.teavm.jso.JSBody; -import org.teavm.jso.JSFunctor; -import org.teavm.jso.JSObject; -import org.teavm.jso.browser.Window; -import org.teavm.jso.core.JSError; -import org.teavm.jso.dom.html.HTMLCanvasElement; -import org.teavm.jso.dom.html.HTMLDocument; -import org.teavm.jso.dom.html.HTMLElement; -import org.teavm.jso.webgl.WebGLRenderingContext; - -import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; -import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; -import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; -import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; -import net.minecraft.client.main.Main; +import net.lax1dude.eaglercraft.v1_8.sp.server.internal.teavm.WorkerMain; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 MainClass { - - private static final String crashImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATEAAABxCAYAAAC9SpSwAAAQtnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZlrkly7jYT/cxVeAt8gl0OAZMTsYJY/H1jdsqQrh+2Y2yXV4/QpPoBEZoIdzv/+zw3/4KemFkNtMvrsPfJTZ5158WbEz896zynW9/x+Svp6l369HuTrTcxcKn7n5+Pon9f0ff37vq/XtHjXfhpo2Ncv9NdfzPo1/vhtoPLTyjJv9tdA82ugkj+/SF8DrM+2Yp9Dft6Cns/r1/c/YeB/8Kcib+wfg/z+uQrR242LJedTUok851I/Cyj+P4eyeJN45hfZ39V35fM8v1ZCQP4Up/jTqsLvWfnx7restPPnpJT+uSNw4ddg9h+vf7wOZP4Y/PBC/DNO7Otd/vX6rfH8vp3v//fuEe49n92t2glp/9rU9xbfO25UQl7e1zoP4X/jvbzH5DEC6DWys6NF5WFppkxabqppp5VuOu/VkrHEmk8WXnO2XN61USTPbCWGlyce6WYps+wyyJ+R3sLV/GMt6c0733SWBhPvxJ05MVj6pD//PY9/OdC9DvmUPJikPr38pOxAZRmeOX/mLhKS7jeO2gvw9+P3H89rIYPthXmwwRX1M4S29IUtx1F5iS7c2Hj9lEWS/TUAIWLuxmJSIQOxp9JST1FylpSI4yA/i4GG14aSgtRa3qwy11I6yRnZ5+Y7kt69ueXPZTiLRLTSi5CaWRa5qhAb+JE6wNBqpdXWWm/SRptt9dJrb7136U5+S4pUadJFZMiUNcqoo40+ZIww5lgzzwI5ttmnzDHnXItJFyMvvr24YS3NWrRq066iQ6cuAz5WrVk3sRFs2tp5lw1P7L5ljz33OukApVNPO/3IGWeedYHaLbfedvuVO+6860fWUvik9S+P/zxr6Ttr+WXKb5QfWeOrIt9DJKeT5jkjYxnFIGOeAQCdPWdxpFpz8NR5zuLMVEXLrLJ5cnbyjJHBelJuN/3I3T8z90veQq3/r7zl78wFT93fkbngqfsXmftr3v6Qte1qY7GElyEvQw9qLJQfN608+Icm/eev4b/9wt8/0In35Clj53MtbQbay3TJha/Pkal9UOin9o2snXLdVJzrX8x6El9Up6p2YeDZ7wV5Y/ZWZzDrsVZAxUREcEtXINlSba6zTUo7DqNNZZ7E0GlIa3OfMnNv2cYao2mOEnZWMnx6MUFcO2kfd3QoZ7IO65tFgligM06VYamjx10GGcZxALBZbupiJbS1j5a+V9tDt/GvGR/r3nEymiW+cplN17qzsLtxyazNKjvJParJP+8Y0tKjru0vjl+vc9j299JPInSpnbbXGwBy3FFMWMZI5Uw7N5pqa6FLzXXavN2aLGB6zMbTnLuwLg3RomLPiV3HgUku87QbJ/vPsqlllauVYKcDOZfiTyyjorvMlm2f3G+8RnHU26nhpTqhsBk7QSEPiSKACKic+QARYJfY662kSbJyz20y4WC4mxqDTLRvdiqn4XOONR0EhnG4or7ZVKSV3SRYHcXIcdzjpK7spLVzqLEac1lnJ7T3trXSAgEbJb917dLbbgUs5cy+0mgiQa2kju+LR8HSIRLpggxyCUvEO5hWkQyq/UJFkMvIOmO9ZkIOtggga2opgLhVd2LLrZ6LMPGFTTjGXQBFsi8/GtWg+xxlaYQtH4WpABhgjToaKW0BWEBqZ7Y9xSprJzQ4EBIz9EBImNHdT7FThzuVx8CT7d25bm06r5Y7TGu4MJT0wm74vCZBJPbp4jZI7ny5A1NsEWq8x86u0RbOxjTLOXgVIZTNDfssWH8lcOSOaDIXN5OAWiFCpBuA4hObzbQJ2jLbnaKdN1H96XZFoVm6BGh3b2Pxslg5TpdBdNiNwEFbnxTSYvEwY1WBMoou0quCj2erCyAMT/EM5c4tk7ITRwOpJb98gV0Il6/gw4jLnqSA/MbVxAVtuan02dhz39d6C8uBxw0yG4qguQ8tE9Jm3Y1NqxiqA4OkzSC7rmOJSQ0FA6+TYqSCZM4bjl1+2TcoQAQQiWK9wts5euIHQkcNIQwogqJEiaVFG6cpl7rXy6vIuAP1VJ0J7yC3G7Xy3XXwnNGTm/CratGOxFJ8InCPUc3crSdDUCmfyZ1XQ+sehTxAakljQkbCHUTrIcSUhXU2v+m72mUcWwqiL5AZaA52YBaWoTnI7dBKVmOjR0gmpWJOfqwuFp8ecJTuAiaiS/ds2PPqVhqkZmQZ+WaTgUZIWTLEjKceUE2bxicDi9PrCi43qCEDowuMjkcOXrnQQKJEIK6tCoeFTmhZy4QzjTXCgQDTOerenNAaalzHI4ziLMR64mnMRN8KDUKviZqL47hkAzKzBUHYxXAcah6yVw88vlPGrWUkoRYzvgP/Oy+sQ8sCA+anbvRz17B+SM51PQdXw43GKZBNupUqE+e2jQRUihD2jXclhnCpS9QJXFkzHQN0SLAHqM6Z5oAqhb1ZdzN3FUtBdFEh+g1CgvNJ+GoQBby22qMXaoqw5IbDD/V5N5g68zUS2+eN+0IxOKFxk+3nahRGavBX1kwG8c3XnRD5Rwevl9IIWg60XPMS7FWOw5BK7W8+34HrNGFs6AKiuTtQRS4vrdHqUrQn6BI1GiVQ29QxSrQoLFKEgG7WfZR9fqSvbnG12rhGw+wutwG7Yc4obQqqysLVUWvMCTq8PduHQAHBtSfM53L44Hv6E3Hg4ClgEmpTLh1lX5fpG8WzzgxbcocKWyeLKH1TYuOKEtn8rAXD3fZW58hbKmZPF/fiRvGJ+EDA5/3xXCeQdAHTdKLU4llYinQGxd8Nwpm44WTUlYzM0BiBYy5q1SGZ4fiizmbQggZEkU2fgzftJR13OLaEeihuGy8a1yCjBjZc24kRECWrCZuCYaaqWK5SO2FNInPp7SbaQSdKr4XngTInYZuQhPL+uvt+RiY197sHtYRmV4Z+J6leOYcN7hy2hdmJ3HCa2Smz45pWgc2nIuUT6UTz6HmxEr65thqqTn43ecYfWJB6pvusxL1EcbVJvdaCaaCCqLlqVBob2cTVzf+HOROZ6PkSnYc4nDdbW1R5r3WjZvKYHi5sh8LGasG7/QMFGGS5HyMh4/g01IU12spNOMlQKLSOJBsNeZhRDBq2Ca6wS+3rvhvwIWp1RAhK6CeQlLMbdxUnvUFoFSCEjq5hHYSFetT4Fc0nOXJeZ6x2n/oPNL9UrJnrMqNHdzlVend/tolGDriXJWAYm+RcstiIk8XO6xL3jmO79BNwILKp0H0GynCHw2Gft4erFLqFg+JUcrEhNDaxoPl89vCTMfxCLwvYu7Ok/vVQDKVgYeFT/Dfliu/FqhYBR3i1ZUxQKoveQhAVycoHW00NemeHVzF5fvVO2ATGplIaUKLrmS6IlNXIwXPhEQJLhtPyksOctOc7PVeveGFurBNcBXkPLJnLMI3SPngyJEqIBlmrhYLYyzuJPPBr0BtWZMC3eCqaUQiFNvJiHRIG5Sz6OfqHXeVspDaxKN9bwONqMTfVbAUVceMH8zZc3jVwCaxhLLKeGMNPG/B9mD6bznYXT4xIYPopEYp8u1+l9pTmoj92nJAQVUuJbLzTQCUIO9saYB2rh33FUdOcQnnUo1dkeF0IvhSM2RCMEp4P37SIK87IDtx4rpNjceB2DCCQEDwm8xwcNrwPZ5F+BlbvZ+iUKGndCyCYpYVwUpYlOp2s6oLGXgZb78N5Zafup1V1Is6VPuu1WVRDnt3GhtwEIcN2swl3R03rwr3jOTdNG6R1n5O9NPzg0/ud5ITrDBeIuLnpXMC+Og/Q7R8luPA1C4sbQdw7pwhJ4liQABaNYRKmBwZ0/4YvXjmgG7sBb8xlN0jQCwmvTHjhw4yPw0ZGsEchK734RqoWcVsULPn1rlAJ69ru2FwNuHczIXJeux54qcA2NHrY0lxeR6Bkb7P749pB0XunMyr1pd614vx1jF3gmOLOFWX1GhOY/uM09wD43swqRZxrtuOIoorpNWlmMNMVZJPHAPXofVEyPfgAmOMg+AkePn7wiF+ODmt7ZYuPw3YDnF1KBUg0Xi6PuOWAn8gdssLzOjTbddueqHPtiDhMTysJVTvNA1bnDYonejAj6fEAgsYlNTDngDDZRaK5modo0JRdvvIQHmH/V76NFt2dAyWApSHTNMjcKJWVOSWFpuiMa1k3P2RB2jAqQ2DlgssUsASTYRZ3Nu/wsBxEFV+DVLUBj2IP8Z5lhEML/XBh8fXPM2HDvH1GN+4krwRoAdbsfPZO2WkycKDChN40J9wiYk0LwRLhgyOVBG9kBmntrMzQtVgRlaW9REcw5YO2YAc+PZxC4cttFyigJwh4KGI9xTkKDp6XIeGSwjS5K5bfT7kSfQglvDZ9pzCsxgqQysRl5EnJE2eK1k0QqtH+DSMeVJE0Z0KcjsdiFUV01TsinsN0MmeWnDo4XN7HDe8NvUEin+4QsFKUA02X293xBIuUj5Kun3O/1n1D/gN+IH6wJyPSqy7NsE3OTn14xNYoqwZ+/ESBRtAgEqz+PYOdT6KKGPspRUD8Bshj0bTMluEwgtGxl158e08/KLm0ITgFmhTgMG+rNICG7uNvsQk4MmoeHOHCqhFm2hBGY4HtyEe/5dElQJfh6MOtdAoMLLjppIvGmyJLfr78VkQzd8gpJVCQNkoP64jBwznSiqsfeOIX8B74EUQeaoFIWTEstV4vTDOGHQh92XQS8aaXqhx+lKXkkShCYpimC5N6t3fBGETtWe3s3Q8mqF2ak4NFKjN4Xlitx571mru5Nb271cL4F5iyYD8qEidIKAqFhsgu6k4m0BznhqkW8Jcld6GIbHnVwjjdMD5IS8EBDRejTmvvUMM/k0L2Qsil9kd2uI0Kn/Xg1cDOlcjSs0PHNRr0QKzxiGPhI1FJPx6dyc2EL2awLcKOTPixghGwjYdEDUQxA6Wiu62MMUgVvouX1q8f1A03jEx6HCUIip8OY/KgrARQAVrbADc4wg6qh8yiQXCyHyusipfJljJU54koJTZfG7J1SCqmFRkg+Xt6tSeKd2G0WCXRYmgWMhD8RABpAJ2GQJQSDoLdhe5Y+/BjSHx4MUgCZqKxYXr3RQFCzB+yYe90qd3PEJEhP/zFmFLyaCnvWuJuqET84A+6O9WJaNDcQ1l9WsDLGGaGrn/7qWAmngb7l4+N1te44P38EBk/SI/FvntzlgL04qfJpIAbQ8emODPjRtJEjpA0erPKenW8v86hJ6D8xzmt/w2odn/ClBI6NoT1ySmgy7dxlzcEP91ObRjLJrXIEf4yAZtJC71sNbgAoHdcVHdf1RcdxA1YL2/DIC7aBqrAOnLrR/XJkQi1OpfNzDfdjoEQPN3BCezs1AsY/IQVyQmV9orsT8yf/3HU/BO9Y4I9GIwGiYL2Y2B6H/WWEUR5awuPszBvaYr/daJL8NOHCQrdHuF6EadM9yfU2hp0hKy60KdTfMSK1g+w4QUajQkyDWpaxt3glWfAkk0ylLxeBw4isbTkHRI9ZYMxZcJg6SMJ5gaT5tvTNegyS+0oPxaymQZECg+qa0HX9dI6M/Eq8C0+kWD4oYafVHrcticUeio06LAhyMOLXBjX5SewUOQLeMRBHw/Nt/SOX18Oc0yuNRmX43iPBam3TosB1vG96acj9PDjLP23V8OwMW4rER1BD+iK4vKDk11fK1l68WOfsRs6ktd6f6YvxGxi4djsB3OsxTHy3/w9IfwNf8n440BILET+f7LnjZBrgBfeAAABhGlDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw1AUhU9TRZGKg0GKOGSoThZERRylikWwUNoKrTqYvPQPmjQkKS6OgmvBwZ/FqoOLs64OroIg+APi6OSk6CIl3pcUWsR44fE+zrvn8N59gNCoMM3qmgA03TZT8ZiUza1KPa8IIIwhCBBlZhmJ9GIGvvV1T91Ud1Ge5d/3Z/WreYsBAYl4jhmmTbxBPLNpG5z3iUVWklXic+Jxky5I/Mh1xeM3zkWXBZ4pmpnUPLFILBU7WOlgVjI14mniiKrplC9kPVY5b3HWKjXWuid/YSivr6S5TmsEcSwhgSQkKKihjApsRGnXSbGQovOYj3/Y9SfJpZCrDEaOBVShQXb94H/we7ZWYWrSSwrFgO4Xx/kYBXp2gWbdcb6PHad5AgSfgSu97a82gNlP0uttLXIEDGwDF9dtTdkDLneA8JMhm7IrBWkJhQLwfkbflAMGb4G+NW9urXOcPgAZmtXyDXBwCIwVKXvd5929nXP7t6c1vx8743KRRjbQVgAADfdpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDQuNC4wLUV4aXYyIj4KIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgIHhtbG5zOkdJTVA9Imh0dHA6Ly93d3cuZ2ltcC5vcmcveG1wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICB4bXBNTTpEb2N1bWVudElEPSJnaW1wOmRvY2lkOmdpbXA6NDJlMTU3MGEtNmMyZS00Y2E1LWI3ZTMtOGI4ODI1MmMwZDMwIgogICB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjU1NGY3N2UwLTc4NmEtNGFlZS1iYjhmLWNhYTBiZGNiYzE3MSIKICAgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmNmMWYyMjUxLWIwY2QtNDE1NS1hMjAyLTExNGI0ZGM2MmFhNSIKICAgZGM6Rm9ybWF0PSJpbWFnZS9wbmciCiAgIEdJTVA6QVBJPSIyLjAiCiAgIEdJTVA6UGxhdGZvcm09IldpbmRvd3MiCiAgIEdJTVA6VGltZVN0YW1wPSIxNjQzMDYxODUwNDk0OTc0IgogICBHSU1QOlZlcnNpb249IjIuMTAuMjQiCiAgIHRpZmY6T3JpZW50YXRpb249IjEiCiAgIHhtcDpDcmVhdG9yVG9vbD0iR0lNUCAyLjEwIj4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiCiAgICAgIHN0RXZ0OmNoYW5nZWQ9Ii8iCiAgICAgIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODUyMGQ4YTMtMWRhZC00ZjIwLWFjOTktODg4OTJkZDExNDQ0IgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKFdpbmRvd3MpIgogICAgICBzdEV2dDp3aGVuPSIyMDIxLTEyLTE3VDE3OjIyOjQ4Ii8+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjJkY2U5N2M4LTBkZjItNGQzNi1iMzE1LWE0YjdmMmUyMjJiNSIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChXaW5kb3dzKSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMi0wMS0yNFQxNDowNDoxMCIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz61xwk6AAAABmJLR0QAnQCdAJ2roJyEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5gEYFgQKOBb3JwAAIABJREFUeNrtvXl0lFWePv7UvlelKvu+koSQRQiyBJGISEB0hFYZwW1sp4/2csaZ1jlz5sz80cc5c7rnaI8zju2o09qiIrKowEGURXYI+5IASQjZl0plT2rff3/073O/byVVlUQSRPs+5+QkkMpbb9333ud+lufzuaJgMBgEBwcHxw8UYj4EHBwcnMQ4ODg4OIlxcHBwcBLj4ODgJMbBwcHBSYyDg4ODkxgHBwcHJzEODg5OYhwcHBycxDg4ODg4iXFw/GWAqgHHfv+ufyv8+q7XvVMh4rWTHBwc3BLj4ODg4CTGwcHBwUmMg4ODkxgHBwcHJzEODg4OTmIcHBwcnMQ4ODg4iXFwcHBwEuPg4ODgJMbBwcHBSYyDg+NHBCkfAo6/ZAiLov1+P3w+H/x+P/x+P4LBIDQaDWQyGR+oSYyjSCSK+G9OYhwctwiHw4Guri44HA54vV74fD72FQgE4Pf74Xa74XA44Ha74Xa7EQgEsGrVKqSnp9+2BTlT5EJETT+PJZxgMAixWMx+FwgEIBb/2VGjn4W/o78P9/qxPSXo2pFez0mMg2MSC7mrqwt/+MMfYDabYbfb4XQ64XQ64XA42HeHw4HBwUFIJBJIJBLExMRg4cKFSEtL+0GSmJAwxsLn80EqlSIQCIRYomKxGD6fD2KxGH6/n31un88HiUQCv98fcm26Pr2H0LIlkhLeg/B3RIbCa30XS46TGMePHn6/HxaLBVu2bIFcLg9ZXLRQpFIpDAYDDAYDW0RyufwHRV7ChU9kQeQhtHyInLxeL7OwyFoS/o7caCI1+k7XlEgkjIiEJOXz+SASiSCVStl9SKX/j2pEIhH8fj8kEkmI1Sa0Gqcy7pzEOH708Hq9GBoagtPphEaj+dF+zrEEJvw/oTtHxCMWi0NcTaG7SeQmvMZYt3Ts/wnJSPh9rLUVjqTGur1TITKeneT40UMsFsNoNGLjxo3IyMiAyWSCSqX6wca5JrLGxhIDEVYwGGRJC7vdDofDAb/fz6wocifJQqPfjf0/YZdYkUjEXHOKMXo8HhZ39Hq9zJqj1wvd1bEu6Fi3M1yMjVtiHBEhjJ0Id9ofOuRyORYsWIDS0lIMDw+js7MTp0+fxs6dO9HZ2fmjs8aE1pbQPZRIJBCLxXC5XLDb7VAoFFAoFAgEArDZbJBKpZBKpZDL5XA4HFCpVAAAp9MJhUIBh8MBpVIJt9sNsVgMmUwGt9vNMroej4f9rFarYbVaEQwG4fF4EB8fz0hOrVZDJBJBIpEwciNSI8KUyWRRkxGcxDjC7uCtra1wOByQy+WQy+VQqVRQKBSQyWSQy+U/WKmBSCRin0mn0yEtLQ2JiYmoq6tDR0fHj4KoiQCECz8QCDCioCwsEQK9zuVyQSwWQ61Ww+PxIBgMwmazQavVMotJqVTC6XSy10gkEuam03vp9Xq4XC4olUq4XC60trbCaDQiEAjAaDTC4XBAo9EwCzgQCITE5AKBAKRSKSMwipmNjedxEuOIGjf69NNP8dVXXyEQCLAFn5SUhOTkZGzYsAGzZ89mE+uHbKmIRCLIZLJpS/HfCRAG2YWkRmRAlo3L5YLNZoPNZoPX62UWkVwuZ1aWVqsNIUWynnw+HxQKBQvc0/WlUincbjdkMhmGhoZw9uxZdHR0YMmSJYiJicHQ0BBMJhMkEgm8Xi/kcjl8Ph/kcjl7HyI2IjBKBIyVfnAS44iIwcFBNDU1obe3NyQGUVdXB6/Xi6qqKvAzZe5sSzpcZpJcSrK+Tp06hT179qCvrw9xcXFITExEQUEBli1bhmAwiJGRESQlJUGpVIaQIhGX8FokrSC5RktLC7Zt24a6ujrIZDLcuHEDOp0OFRUVyM3NRUZGBrO2iGjpGmKxeFycLFoigJMYxzh0dnZiYGAgLFGFy0Bx3FkEJnw+JN4F/ixtcDqdzLru7u7GoUOHUF9fz17/wgsvID4+HkajEXFxcbBarRCLxZDL5ex6ZIUR6dB7+nw+RnLDw8N47bXXYLfb2bWfeeYZmM1maLVaJCcnM6kGWY6kVRNaaGQhC63+aCTGs5McCAaDqK+vR19fHx+MH+jzE36nBU9EQe4aiXiFmi0AuH79OrZv346+vj7o9XrI5XLY7fYQl1Emk41T7stkMhYzHR4eRjAYhFqtDiGejz76CDt27EBHRwcjV6HmjK5D90rvMzZ2F20T5STGAafTiaamJgwNDfHB+AGCLBdhjI8sHKlUCoVCAY1Gg2AwCLvdDrfbHfL3x48fx7vvvgsA0Ov10Gq1UKvVLFutUqmYJRYMBiGVShlRKhQKuFwuZrWNJdf09HRcvHgRVqsVEomEXUutVjO5BxEaxcjofYhEJ7LEuDvJgf7+fpjNZrjd7h+ldurHDmHsi6wbl8vFYkqk16LAvtVqDXsdt9vNpBcej4dlo+12O5RKJex2O1QqFcto0u9IIxYMBjE8PBxyzRUrViA7OxuLFi2CWCyGw+GAQqHA6Ogo9Ho9vF4vI1uPxwOpVAqXy8Vc12AwOGFWnFtiHOjo6EBvby8fiB8ohPWLfr8fLpcLHo+H/dvn8zEiWLx4Mf7t3/4NTz31FHP9qqqq8PrrryMpKQlutxsjIyNQqVRMsCqXy2G1WqFQKOB0OhEMBuH1elmxvMPhgM1mg16vx5tvvomKigoAwEsvvYSqqirce++9MJlMTIM2OjrKZBvkMlJG0uVyQSqVMtd3Mtnw226JCdW+Xq+X7RCUSpXJZCHp7+myDMYqgClYSfqZkEH5/0V/QrP5dlkowvEh8SDttDQJ6MFOxz35/X40NTVNSi8108F9YVaN5gZ9duHnp39zqzHUpaR5LRS2isViRkgqlQoZGRkQi8W4dOkSMjMz4XA4UF5ejtWrV0Or1SIYDEKv18Pj8UClUjHrTavVwuv1QqlUMq2YRCJh1lMgEEBMTAzmzJmDhx56CK2trbhx4waqqqqQn58Po9HI6i71ej3cbjc0Gk1I9pNcSYrZTfYZS2/XwvT5fLBarejs7ERrayva2trQ3d2N0dFRlnKVy+XQ6/VIS0tDRkYGcnNzkZycDK1WC4lEMqVJS+weCATgcDhgtVrR29uL/v5+DAwMoL+/H729vcwcFha1qtVqGI1GpKWlIT09HZmZmYiPj4dWq2Xm+nSPj9/vh81mg9lsRlNTE9rb29HZ2YnR0VF4PB6IxWLodDqkp6cjLy8Ps2bNgk6nm9S9KJVK6PV6iEQiuN3uEJPfZrOhoaEB/f39Ya9FAdaBgQFYLJawpn0wGIRKpYJOp5uy9oo+u9VqhdlsRktLC9ra2tDV1YWRkRF4PB42N7RaLVJTU5GZmYmsrCykpaVBr9dPeW7MVFzRZrOF7RgRzYIyGAxQKBTTcg80DiqVKkS2QBuzSCRCXFwcVCoVXn75ZfzTP/0Ts9JiYmJY0F8mk4Vs3nR/dH2aAySEjY2NZdcvLi5GRkYGHnvsMUgkEuj1eqhUqhBSJbIiMa5YLGbF4uRC3jEF4MFgEG63G11dXaiursaRI0fQ0tLC2p643W6mO6EBk0gkUCqVUKvV0Gg0mDVrFh544AFUVFSwwZoIPp8PnZ2duHz5Murr69HY2Aiz2Qyn0wmPxxPyJawdE04GqVQKpVIJlUoFrVaL/Px8LF++HAsWLEB8fHyIlXYr4+P1emGxWHD27FkcOnQIjY2NsNlscDgccLlcIeNDY6PRaFizvonuQSKRYN26dXjqqacgkUjQ2tqKX//61+z3Xq8XPT09Ua8jl8vx+uuvw2AwhCUpr9eLDRs24LHHHoNOp5vSZ+/u7mafvampidX0UTnL2LmhUCjY3MjOzsaKFSuwZMkSJCYmfq8VBWfPnsWHH34Ii8Uy6XlhMpnw8ssvo6ys7Jbm0tisJFmzwp+pjQ4RhE6ng9FoZNYuWfc0p+RyOUsAiMViuN1uqNVqZnAIu1PQ60ltTxsmCWz9fj+TUIhEIng8HiaspcQDbZZkRd4RJObz+dDb24vDhw9j69ataGpqYo3mxj4A4Q1TDdbo6CgAoLW1FdXV1ViyZAmeeeYZlJWVTbhz2Ww27Nu3D6+99hqkUmlYlzHaJCCT3Ol0soxdU1MTDh8+jAULFuDJJ5/E/PnzJ20JRQrGjoyM4OzZs9iyZQsuXLjASCva33i93oiB2bAPWCrFtWvX2HX7+vpw7tw5aLXaKd1vT08Penp6wv7OarVi+fLlcDgckyIxv9+P/v5+HDt2DDt27EB9fT0rRp7M3KDPT3OjoqICzzzzDObNmxeS4r+dMJvNqK2txeDg4KT/JjU1FT09PSgrK5uWuBiRFMXCKGBOJCSXy5kRoNfrWaAeADweD7Rabch4kzrfarVCrVbD6XRCLpezwL5IJGKB+pGRESiVypCMIs1ZymxSfE4ikaCnpwcqlQoejwcKhYLdR7iNmdZuJCt/RkjM7XajoaEBmzdvxvbt28e5lWRO6nQ6xvjDw8Ms7jF2wo+MjOCrr77CwMAAfv7zn2PRokVhU7pj/25wcBAxMTFhCdbn8zGrhlK65HaSeTv2ena7HYcOHcKVK1fw8ssvo6qqCkajccpEFggEYDabsWfPHrz33nsYHBwc1xDO4/Ew91oqlcJms8Fut7NJGe1zU5yRHnxnZyfbcbu7u9nPt1J2I4zd+f1+9PX1hYgcI8Hj8aCpqQnbt2/Htm3b4HA4QtxKCiTrdDooFAoWaCZCHjuODocD+/btQ0dHB1555RVUVFSwBXG7QELPwcHBkJq/icbPZrOho6Pjlls5U2BfSGD0M4HKeajO0eFwsPIichnJQhq7CWq1WvZ6ioGRYaBSqRhxk1VGsS8iOoqjUf1qY2Mj+vv72fpXq9VQKpVQKBSw2WxQq9WQy+Uhsetohsu0k5jH48GFCxfwhz/8AceOHWMmvt/vh16vx4IFC5CdnY2EhAQWz/B4POjp6cGFCxdQXV0dNmgtEolw7NgxGAwGmEwmzJkz5zs9eLlcjmXLlqGoqAgmkwlqtZotDqfTiZ6eHly+fBnnzp1jpRZj72NgYACvvvoq5HI5Vq9ePaXdPxgMwmKxYOvWrXjjjTfGuaUikQgZGRm47777kJyczMbIbrejra0Np06dQkNDQ1gC8vv9qKioQGFhYUjDOZ1Ox3ZAuVzOAq83b95kE3EiQvN4PHC5XGx3T0lJQXx8PEwmE2JiYpCWljapuVFbW4sPPvgAX375ZciCoU4T+fn5iI+Ph8FggEwmg8fjQV9fH86fP4+zZ8/C4/GMeyYSiQRXr17F//7v/yIuLg5z5syZVNhhOud8TEwMVqxYgYGBARYSiER4LpcLGRkZKCwsDGkcOB3upNPpZIXVtFELyUcikbD6SHL/iPjGEhhtFB6PBxqNBl6vl20sJFAlN9PpdLKYl7BUiLKQSqUSwWAQPT09sNls2LNnD27cuIGnn34aS5cuZfer0+ngcDhYsoAqDW5b7aTf70dtbS3eeOMNnD17lhFYIBBAXl4enn76acybNw9JSUkwGAzMRw4EArBarViyZAnS0tKwa9cu5nsLoVAosHPnTpSVlSE1NRVGo3HK9xgXF4eNGzdi/vz50Gq1ISRCVl9TUxP27t2L7du3M0thLJG5XC689957yMvLQ0lJyaStGrvdjgMHDuDNN98MG8NRqVRYv3491q5di9jYWDZGPp8P/f39KC8vx8cff4xz586FHf/09HSsXr0a6enpIVlMcn0XL16MrKws9PX1wWKxoKmpCUeOHEFra2vESRIIBLBy5UoUFxdDq9VCo9EgJiaGiSI1Gg0MBgNiY2Ojzo3Gxkb86U9/wrZt20LcTqPRiBdffBHl5eVITU1lwW5aDDabDUuWLMHu3buxa9eusO60TCbDiRMnsGfPHqSnp8NkMt02ElMqlVi+fDlKS0vR0dGBd955B7W1teNCGHa7HZWVlbj33nuRnZ2NxMREVoozXa6kRCKB1WrFwMAA7HY71Go1tFotDAYDtFoti3+5XC5mnZEVR9YSuY+0YYjFYthsNvY+9DyFbit5KqOjo1CpVEzN73a7YbPZWNueEydOsHlG4tbOzk5kZ2dDo9GwzCfFy4RdYG+LJdbW1oZNmzbh0qVLIW/qcDiwdOlSrFq1CklJSWHTwwaDAQsWLIBUKkVvby++/fbbsItcJpPh4MGDWLx4MWJiYqZkjYlEIqSkpKCkpCQsAUokEphMJhiNRphMJvT29mL//v1h41QikQhNTU346quvkJeXN6mOoX6/H3V1dfjwww8j3ndMTAzuvfdeJCcnh7xGKpUiKSkJK1asgFQqhdVqDal/o7E5fPgw4uPjsX79emRkZIx7n8TERCQmJgL4cxuW5uZm9Pf3o6mpKaL14vP5sGbNGtxzzz3M1J9K62ayPrdv347t27eHEJhIJMLs2bPxyCOPICEhIew463Q6FoNsaWlBdXV12BinWq3Gl19+iVWrVsFgMNy2jhtisRgJCQlQKBS4efMm3G73OEmP0+nE+vXrsX79ehQXF0957k40vmKxmJGO1WrF5cuXUVNTA5lMhlmzZiEvL4/Fk4WCVgrIk6SChKs2mw0ajQYSiQROp5PNF51Ox1r2kOXX2dkJsVgMhUKBffv2oaSkhM0zkUiEoaEhRq4XLlzAJ598AovFgueee471FqPNklxI8iSEh4zMOImRiXjkyJFxE8xms6GgoGDCYLJYLEZRUREWL16M8+fPh7WCZDIZjh07hps3byI/P39KrpxMJkNZWVnYONnYhZOZmYm1a9fi9OnTEctxAoEAjh49iscffxx5eXkTTkqn04mvv/4abW1tEeUMubm5SElJiXgtpVKJiooKXL58GZ2dnSFui0gkQl9fH9566y1IpVI8/fTTiIuLi2pBxMbGsh060gIRiUSIj4+fdHY43Oc+fPgwtmzZMo7sRSIRSktLodfrJ7xOTk4OVq5ciWvXro1ThhMGBgZw9uxZFBUV3dbYWE9PD7755ht89NFHaG1tDZkjCoUCf/u3f4t169YhLy9vwnjudwUFxWNjY1FQUID29nacPHkS/f39OH/+PG7cuAGFQoGenh4kJSXBbrcjMzMTZrOZlQRZLBYYDAZYLBYkJiYyAjEYDMydbG5uZhsZSZcozLB161ZUVFQgISEBCQkJEIlEIZZYbW0tW082m41ZhGKxmMkthPKQ20pily9fxsGDB8fFAoLBIDObJ6OHUavVyM/PR3Z2Nq5evRpxsdfV1WHp0qVTIjGFQoHy8vJJpeIlEgnKysqQm5uL8+fPR3zd0NAQGhsbkZubG5XEgsEgzGYzTp48GTEGIhKJMGvWrAk/k06nw4IFC/Dtt9+OG2+aBJ988gkKCwtx3333hY11jI2nTDbu8l2ysG1tbdiyZUvYeJZYLGYxvMlkWufOnQuj0RiRxCh2+vjjj7Ns2UyCmknu2rUL27ZtQ3d3d8hRZ2lpaXj22Wfx4IMPIikpaUasw7EF1S6XC7GxsdDpdKitrcX+/fvDzu8lS5agtLQUPp8PhYWF2LRpE44ePRryOoPBgLVr18JoNGLu3Lk4efIk/uu//ivq/dy8eXNS9221WiGVShETE8NE3BSnE3azELYECvv5p2MQR0ZGcPToUTQ1NYWdxDk5OTAajZPW8aSlpSElJSXiwlEqlbhy5cqUpAYUe5mIbISLQavVYt68eVFf73Q60djYGFUaQePQ2NiIgYGBqO85a9asCXceshQjWS9isZi5wpPJGM4k3G43Dh48iIaGhrDjKJPJkJKSMqm4EIUD4uPjoz6T5uZm9PX1zXiFgd/vx7Vr1/D+++/j448/htlsDinGLisrwyuvvIL169cjJSVlxtxbqpkk6UNsbCzcbjeSkpKwcePGca/XaDRYs2YNli1bhr6+PqSkpOD06dOoq6sb91qXy4UzZ87g5MmT2L17N06dOsWe22R0ipGeIwAUFRUhMzOTGTdUckRZeMq0C09YmjFLrKGhAbW1tcx3HhtPyc3NnZIuyWAwQKfTRZyElI0aGRmJKBWgwyFInxIMBpmvPtlAqlQqRU5OTtR+Wh6PB52dnaxdSTQSu3HjBlwuV9SHGxsbO6mJodFoorolMpkMx48fx9DQECv5uN0g6/Obb76JSPJGo3HSn5kSH/QMI13T7XbDYrEgPz9/RjOSNTU1+NOf/oTDhw/D6XSyz6BUKrF48WI8//zzmDdvXlRLeLosMdKBUb1jeno6nE4nrFYrMjIyYLfbYbVaWZaS2udUVlbigw8+QGNjY1jr1ufzYXBwkMWq4uPjsWLFCmRkZMDn8+HcuXNhyQ8A4uPjmdRJiOTkZDz++ONYu3Yt5HI5qwTRarWw2WxQqVSsnz+pF6KNoXS6dqOxQWbhw05PT5+S26dSqaKeRiMSiTA4OAibzcZ2obELuLCwEC+99BKGh4cxOjoKt9uNysrKKZV4kKYm2gILBAKw2+0T7vper5fptSZyeSezoCl+MJGFbLPZvreGhoFAADU1NRFFshRq0Ov1kyZZsVg8IYmRmHamPrfdbseZM2fw7rvv4tKlSyFSnNjYWNx///147rnnkJubO+NSDyIXuVzOOk9IpVIMDw8jNzcXPp8PjzzyCLxeL86fP4/z588jIyMDP/nJT6DX6zEyMoLKykrY7fawJJaZmYmHH34YMTExuP/+++F2uzE4OIji4mKIxWK89dZbaGhoCGspPf7443C5XPjggw9C/j8rKwv33HMP8vLyWMyQEg2kSaNWQH6/H3K5PKqu8ZZHeGBgAG1tbSwDEY7E9Hr9lEpCpFIpS9NGmqik3BZW6AutlHvvvRf33HMPGwiqkp9qUHUiUiGR5kQLxufzYWRkZEK3cybqMr8vkGYwkksbDAaRkpIypYUuEokQExMzoeC3v79/SnWMkx3L0dFRHDt2DK+//jo6OztDmvbl5ORg3bp1eOyxx5CQkHBbrF+huFTYl56ErPHx8cjNzcX169cZ2RYVFTFLTKlUwmAwRDz1aXh4GPX19UhNTUVnZyckEklI4XZycjKKiopQV1c3bm673e5xvcsAsMy2xWIJCe8I+4mRrEJ4DuaMWWIWiyXkYYabyFMtcpXJZNDpdKyHUaQJZbfbI05UYfHrrU6S6dwxp4t0hMfPT7QhfF8YHh5GXV0dK+IO9xmmGisSi8UwmUxRn20gEGCdRqfTquzv78fXX3+N//mf/wlxkQKBAIqLi/HMM89g1apVt1SOdqtxMap6IBJJSkrCgw8+CLlcjtraWqxduxaJiYnYvHkzBgcHsXz5clRXV0OtVrNSPyEGBwdx/PhxFBYWQqFQQK/Xo729HVlZWcjKyoJUKmWHgIwlsUhr0Ol0wu/3Iykpid0r9Q3zer0sHkZdLMJ5W9NOYi0tLREnokajgcPhgMViCTtIkR5IJMWzcHGSOzmTu9x075iTcVUms/ioTU80mEymcfVwtzMe1t3dPWHyheJmkw03UC1ftDGiutTpssT8fj+6urqwY8cOvP/+++OsC4/Hg4ULF+L++++flFRkpghMqMonz4i6n6SmpqK8vByZmZnYtm0bE0srlUqUl5fDbDZHdPtJMaBWq9HS0oL8/Hx4PB44HA50dHSgr68v7Dr8v//7v4gxy/7+fvT39yMmJoa13yGBq9PphF6vZ4F9KiSfEcU+mdfRerNrtVrs2rULNTU1k7YKvF4vrl+/HlYnNlOuElXQU00Y7WjTFVOSyWRsx4q0uCiDWVlZOaH7bbVaw5rqwok9b96879QeZ7rQ398fNZEhlUrx9ddfo729fdJzIxAIoK6uLupnp9dNx5yw2Wy4fv06tm3bhh07doSNacpkMly5cgVms5m1tLmdoK6oSqWSzV+j0cjKjiQSCXQ6HfLz80MIDAAOHDiAAwcOTPgcP/vss7C/e/XVV5GZmYmWlhbEx8ejoKBgnEwjnGGjVqvR29uLlJQUphOjMyspRjr2WLgZscSoOHd0dDTiQhGLxWhoaMDVq1envOhnavEFAgGMjo6yoL/NZmP9oOx2O2vIR6Uy07EgZDIZCgoKoFAoIgb3g8EgTpw4gXXr1iE1NTWqBdXV1RXVWnU4HFiyZMn31tWBVPrhMtZCdHR0oLm5+Y6ZG0LL2e/348CBA2htbcXJkycjWr4SiYSdKJ6cnAyTyXTbrV+hKyaRSFhwnCyZtLQ0WCwWFBQU4ObNmxGtru8SMqAOJElJSSgvL5+QxEZHR9Hc3AyxWMzKr6ioXFjHS7WTwkNKZoTErFYrq3CPFseYrsZvtxrTaG9vR0dHBzo7O9HV1YXOzk40NTVheHgYIyMjzA0hf5yaut0qxGIxysvLERsbG5F8gsEg6urqcPDgQaxfvz4iARG5RqokoELw8vLyGU/vTzTeE1lMd8LciEbEb7/9NjsBPRrkcjm2b9+O0tJSrFq1asZU+dHcbOFp39Q0gIqzVSoViouLUV9fH3G88/PzsXTpUjQ1NSE2NhaXL18Oq/0UgpoUxMTEID09HR6PBw899BD27NkT1Yvw+/0oLCxkB4bQGNIp4sJ4Gp1rOSOWGPmsE1kq4RoP3iomK+KkAtMLFy7g6tWrqKurQ01NDfr7+1nLHcqCKJXKGVv0YrEYubm5ePDBB/Huu+9GHA+73Y4tW7ZAr9dj+fLlYUukLBYLrl+/HjXGuGHDBqSnp39vriRJTyaK283E3LjV1jZjXZ/Jwmq1YuvWrSgoKEB+fv5ttcaEqn06kIMaD9L/0XFskZ7Jxo0bsXr1aly6dIklzp5//nl88MEHmDdvHlJTU/HGG2+E/M25c+fQ1tYGuVyOnJwcLFmyBCUlJSgpKUFvby/ef//9ce8TExODnJwcpKSkMK+HLDFhQwbhwbpR3enpILFoD0skEuHv//7vcffdd09L2xEhkpKSolpJIyMjqK6uxsGDB3HmzBm0t7ezBx5ucgp7t48dyOmAWq3GI488gpqaGpw8eTLiAmxqasI777yDxsZGVFRUIC0tjYn+LBYLTp48iYsXL4aKXQI8AAAa20lEQVS9L5/Ph1/96ldYunTplBbgTIA690azHv7u7/4OCxYsmNaurGRBT6c1JJVKkZaWBrvdHjUGfOnSJezcuRO/+MUvJt3ldjpAGzF5EdQfn8IXMTEx8Pl8KCsrw7p16zAwMACTyQSVSoWenh588sknKCkpQUFBAbq6unD+/HlYLBZcvHgRQ0NDaG5uDqsj27ZtGwAgNzcX2dnZWLJkCbv2119/HfZedTodEhMTWRss6pFHWUmKi1M9JT3TGSGxiYLrtCPm5+dj/vz5005iwg859n17e3uxe/dubN++HS0tLczEHvvgVSoV1Go1a9eblpaGzMxMFhBvaGjAtm3bpuW+KQbw61//GsFgEGfPng27KwYCAdy8eZPVWpLi3ufzYXR0FO3t7eOsMCqT2rBhA9avXz+uC8b34YpNJAPx+/3Izc1lqvbpmhu0CU1XgF2n0+Ghhx7Cxo0bcfXqVbz66qsRY31utxsHDhxAaWkpqqqqbqslLNyAybIRlkHJZDIYjUYkJSXB6/XCYDBArVbD4XCw1ljkOlutVla4L5VK0d7ejosXL0YleWqbPjg4iMHBQXY9av1DaGhowI4dO+D3+7Fo0SIYDIaQeUNERvN3onlxW0REVOZwO7I2dKjF559/jj/+8Y8YGhoad2qKTCZDeno6CgsLUV5ejtmzZyM5OZk9SLpPn8+H6upqNuDTFYAtLi7GP//zP2PLli04dOhQxBS13W6fMCFCu25eXh7Wrl2L1atXs+4Bdzqo/xWpzO9EJCUl4cknn8Sjjz6KuLg4xMXF4cKFC9i+fXvYMQ4Gg2hvb8euXbuQn5+P3Nzc2zaW1KyQOkdoNBrY7XbIZDLWMTU1NRULFy6E3+9nPeHcbjdMJhN8Ph88Hg8yMzPxwAMPsBbWcXFxsNls+N3vfhfVy6D+dzqdDpWVlUhMTIRGo0FNTU1IBpQO66FzKmUyGVQqFSudstlsrOyQRLwzqtifjMs5WWHmdMDhcODIkSN4++232VHsY62vefPm4Ze//CVKSkqYjirc8VBk4k43IchkMhQVFeEf/uEfMHv2bLz33ntoa2tjD2misQoGg1AqlTCZTMjIyEBZWRmqqqpQVFQ06bKl22kdRPvd7Zwb3yVY/vOf/xwPP/wwDAYDRCIRTCYT1q9fj0uXLqGxsTHswqKawr179+KnP/3pbXHricBIGkT1h3q9HqOjo8ytpP+z2+3YvHkzAoEAnE4nurq6WFdY8kyo46rL5cLly5cBABkZGVAqlWhvb2cH9GZnZyM9PR3JyckIBoOIj4/H4OAgSktLAfw5A11UVMRO7woEAtizZw/uuusuLFy4kAll1Wo1bDYbvF4vC/BTsiJauOGWSSyauUwN2sIdEDJTweSuri68//77YQkM+PMBCVVVVVi8ePFt1/OMJSJSKdN9BINBZGdnIysrC06nk53ORONMrYb1ej0rJ7nrrruQlZUVtdb0+yKviU6toflxJ5JYMBiEWq1GaWlpiAKfpDJPPvkkfvvb34ZtLwT8Wel++PBhlJSUYOnSpTM616hUhwLj1BlVp9OxVtSUoTQYDKyffV9fX0iGm7KGVLhN9adUOSMWi7Fq1SqkpaXhyJEjOHToEKRSKe655x6UlpZCq9WyInS9Xg+fz4fKykpIpVLU19djx44dOH36NHs/m80Gi8XCjt6jBph00hg9BwpDzYjYlVrQTrRDDA8PM1NxJuHxeHDq1Clcv3494qTR6/VTaic9U2Tb09OD3bt346233mIq/bKyMjz11FMoKSkJObqM3C6qc4uNjYVer//eNGCTJTFq/x1JZiEWi9Hd3T2jVRe3SmThLHStVovKykpcuXIFW7duDZvRFolEuHjxIvbt24ecnBxkZGTM2H1S7aRwM6QgOWUjqU+9yWRCa2srhoaGxukV6YxX6oOWkZHBsswAsHnzZqSlpaGoqAg9PT04dOgQOzuTevvRe1O1gM/nw3333QeTyYRvv/025P1u3ryJq1evsvbmUqk0pO+/MCY2Y2VHcrkcGo0maoZQLpeju7sbdrt9xrM1drsdR48ejbrraTQa1p75+1oYPT09+Pzzz/Haa6+xNrw5OTl4/vnn8cADD9z203pmAhKJBHFxcawdcqTXXLt2jVkLPxRQX7NHHnmEdXAJF9MTiUQ4ePAgiouLsXbt2hlzK4VF6PSdPB+hy07F1FqtFgkJCeP0ij6fj204QguIDJDOzk52buyRI0eY4ZCbm4v4+HjWA1AYIqCDRgKBAObPn4/6+nq0tLQA+LPUQq1WsxPQ6LRxiuvROp7Iir0lc0SlUiE2NhZGozGiS6BWq3Ht2rWIwszptG6Gh4ejBsJFIhEj3e+rnnB4eBi7d+/Gf/7nf7KHI5fL8Td/8zdYtmzZHUtgUx0vkUiE9PT0qAtXJBKhvr6etTf+IUEul6OkpARr166NGK8RiUQwm83Yu3cvrl+/flvqfMlyJOtF+J2ylmq1GiaTCb/5zW8wb968cZ4VdZOgmDAdqfbiiy8iLi4OZrOZkd1zzz3HTpgXKu3pO1ljfr8fxcXFIWdbkLXmdrsZ0dHf0f1OJk4svtWBS0xMRE5OTsQ3kUqlOH36NBobGycsQZkOgphIIS7MPk73wp0IXq8Xp06dYoWxdBry8uXLsXTp0u+leHgyY0CC5qnErujouYmsj6GhIVRXV0/YZ+1OhMlkwrJly1BVVRWxRlQul+PIkSM4cOAALBbLjLmTwu90IjcRk1gshlwuZ7/XaDSoqqrCo48+iqysrJC1Si296QAPoQi8srISKpUKmzZtQlNTE1avXo17770XarWabb4k5aDvZPmlp6dDoVDgvvvuY6di9fb2MheXOsUS8Qld0onW4i0HhjIyMjBr1qyIOymdiLJ//35YLJYZDeJOpljb7XZPesH4fD60t7dPWzGx2WzG1q1bmeyD3iMxMfF76zZBuqBoMYeRkRE4nc4pj0NKSgpmzZoVVT4RCASwd+9etLe337FZymhEnZeXh6qqKhQUFEQcH5lMhi+++AIXLlyYkY1c6CqO7S9G+kiKmZFoOjs7e9wBMeROKpVKFpui11NHFOE8IT2Y3++Hy+UKEdxSTI6ObVOpVNDpdEhOTkZhYSF+//vf45e//CWKiorYGaOUmKBeYpM97eiWSSwpKQnFxcVR40wKhQIHDx7EwYMH2WnOM2XiT9TA0Gq1YnR0dMIF4/F4cPz4cezatWtaSCwQCODcuXPj3F2lUomzZ89i3759uHLlCpqamtDS0hL1q62tDd3d3RgcHBx3PNhUoVAoJnWgxuDgYMS+YJGgVqtx//33R42FBoNBXL9+HV988cW4NsY/BCgUCixevBgPPPBARLdSLBbDbDZjx44daG1tnXbXWajUp5gUWdB0+AZZ/R6PBwqFAhaLBWq1OsT6l0ql7BRumUwGp9PJ4mHDw8MsAE84c+YME5zTKd/UeJHOj3Q6nawmUiaTMX1YbGwsiouLkZCQwN6L3G3KtAqPcIuGW5ZYyGQyLFy4ECdPnsTBgwfDLiiRSAS3242PPvoIcrkcf/VXfzWllsQ02SnIaLfbodVqQ7JCpOGZSDQ5NDSEq1evIjs7O6JY0Wq14uDBg/j000+ZPmYy9zaRBXj+/PlxQW6JRIKGhgb88Y9/RHJy8qTidTRxaHeLiYlBVlYWcnJykJ6eztrBTMayk8lk0Gg0bPcNB6PRiPPnz6OysjIiIYVLgUskEixcuBDz5s3D4cOHI05Gl8uFnTt3Qq1W44knnkBcXNyUrFIaf6/Xi8HBQSa6jBYEp0Uymc1H2BAgHOLj47Fy5UrU1dVFLCdTKBQ4duwYysrKkJCQAKPRGPWaU7XEhEedAWDta8iqoV5jIpEIIyMjiImJQWtrK1QqFf71X/8VmzdvZjoylUrFBKfAn7tOkOBVuOao+zL19ouNjUUgEGDWHx3xNjIywjRlCxYsgF6vR05ODtOVCYP31KaaVA+T2aAlv/nNb35zq4NIRcpNTU0RA/gikQijo6O4ceMG+vv7Q8xTYVaFvmjyeL1e2Gw2NDc34+TJk/jss8/Q3NyMnJyccQvK7/fj9OnTMJvNUcnE5/Nhzpw5bBei9/N6vWhubsZHH32ELVu24MaNG+wE5WhugF6vR2lpaQgBjZ2gTqcTu3fvRnNzc9gHMzo6iq6uLrS1taG1tTXqV0tLC5qbm9HY2Ii6ujrU1tbi8uXLqK6uRnV1NQYGBmAwGNjhp9EWikQiQXd3N65duxaxoFwikaCjowMlJSWsnbTwOXk8HvT19cHj8YTIPiieEh8fjwsXLkS1wh0OB27evIne3l7o9fpxm9zYuSHs99bW1obTp09j27ZtOHr0KMrLy0MOZaVSFqvVis7OTly+fBn79u3DqVOnInYUoVY8wsNiqcaPel0JXxsbGwu73Y6GhoaoLZJaW1vhdrvhdDpZtcJkzkuYbFB/rHVGandhyZ9SqYTT6YROp0NnZycOHTqErKwsVFZWIicnh/UhE76exmJ0dBRbtmwB8Oce+gsXLkRpaSmSk5PZ+5IrSC4iWX50Xujdd9+N7Oxs6PV6Nj8phiZssy3sZDGjtZNkhi5fvhxmsxmbN29Gd3d3RAbt7u7G1q1bceLECZSUlGDBggXIzMwMaSbn8XgwMDCA7u5utLS0oLa2Fr29vRgdHUVvby+efvrpcbsoFf2uXLkSly9fjpgJ8vl8OHHiBABg7dq1yM7OBgD09fXhwoULOH78OBoaGuByuZCRkYHVq1dDq9Xit7/9bVgrLxgM4tq1a3j55ZeRlpaG0tJSFBYWYu7cuezBksUTFxcXto3vrbioRL52ux1dXV2oq6vDxYsXsXv3bqxfvx4rVqxAfHx8xGQG1bZmZ2ejo6Mj4mvsdjt+//vfo6OjA/Pnz2diRrPZjIsXL+LatWv4xS9+wYK2wrlx11134YUXXsDbb7+Njo6OiBZwX18fvvzyS1RXV6OsrAzz589HdnY2jEYjG3uPx4ORkRF0dHSgvb0dtbW1MJvNsFqtGB4eRmlp6bi54Xa7UV1djU2bNsFsNsNms2F0dHTCppsikQifffYZvvrqK1a0vHLlSjz22GPjtGEKhQIrV67ElStX8PXXX4d1velw448//hhffvklYmJiUFJSgmeffRZFRUXT4laOXXdj5RfCnylbT38XyYsS1qLSPFq2bBkyMjJQWlrKqhmEmdGx7ynUylHGU/j7sXNiKhbqtJUd6XQ6PPHEExCLxdi1axeuX78e8WacTidu3ryJlpYW7Nu3D3K5fFwLDuqySt9pB3Y4HBGb4lH24+jRozh+/HjEhet0OnHo0CFUV1ezyUilDm63GyKRCCUlJXj00Ufx8MMPo6enB1u2bEF7e3vY9yULrrW1FdXV1dDpdHjttdeQlJQUcgjCkiVLcOTIEXR3d89YEJ9aM4+OjuJ3v/sdamtr8cILLyArKyvibp+bm4u7774bNTU1UQ+lbW1txZtvvgmVSsV2W4/HA6fTieTk5IjkrNFosHr1aohEInz66aeora2NqMB2uVxobW1FR0cH9u/fz+aGMH0vnBderzfEchc21RMuWpvNhp07d8JkMk1pPO12O+x2O3p6etDV1YWCgoKIzy4pKQnr1q3DjRs3UF9fH3Ejt9lssNls6OnpYY0LpyuwL5wH5NKR4JhixnRASG9vLxITEzF//nxs2bKFNTiUy+UsZENWslwux+joKPx+PxYuXIif/vSnjMD0ej1cLhcjJgrQe71eVgsplG5QDFZ4yA49Q7FYzP6O/l+YtJhREiO38sknn0R6ejoz1zs7OxnpjL0Jv98Ph8MRcUekD+nz+WAwGJCfn4/Zs2dj0aJFYWMzYrEY6enp+NnPfsa6pAr97bHvTZNJSJxpaWksbV5RUQGVSgW/349Vq1bhv//7v6NKBugamZmZISfC0L0tWrQIP/nJT/D555+zHkwzRWbBYBAOhwM7d+6ERCLBSy+9FDH5olKpsHr1anR1deGLL75grk6k+BXJCYTuZGFhYdT6NoPBgIceegiJiYnYu3cvqqur2dkMkeYGlV5NNDc0Gg3mzJmDwsJCLFq0KMSVpJ3fYDBEbQ0+GahUKqSkpESMt4nFYtx9991Ys2YN2traJjwngor3w/WM+y4WmPA7PQuKLQndfJPJhJ6eHhiNRoyMjGD//v1sPqrValitVtaskO7RarUyly8jIwPp6elIS0uDwWCAw+GARqNhr6dsN1nPRHLkPpOrTqRFMUciMGEs77acdhRu1125ciXy8/NRUVGBK1euoKamBteuXcPAwADkcjn7kMKJRjupx+OB2+2GXq9Heno6Zs2ahZycHGRnZyMnJwd5eXlITEyMuMgUCgUWLlwIpVKJgoICnDhxAjU1Ncw3F/4dpYZlMhnmzJmDefPmYf78+Vi0aFFIQ0GtVov58+ezBAUtILIG6IGQWLCgoGDcxBSJRDAajXj66aeRkZGB6upqnD17Fl1dXSHjMJnj3+h64RZ/OCtx//79KC4uxuOPPx6RaLKzs/Hss88iPj4e3377Lc6fP88Cs8K4GhE1dT4oLS3FvHnzMHfuXKSnp084N5YuXYrs7GwsXrwYV65cwaVLl1BfX4+enh4m9xgbxxO6zW63G2q1GhkZGcjJycGsWbOQmZmJ3NxczJo1C0lJSePcfqlUCqPRiIULF2J0dPQ7bxwmkykkRBAOSqUSa9aswfXr13HlypUJn2FiYmKIAHQ642LRXpuQkIDu7m4AwD/+4z/i+vXr0Gq18Hg8rOaSepK53W4YDAbY7XZoNBrk5uYiLS0NRqMRXq+XxQ0VCgWzlMcSvVKpZLFM6psv1IURWVFgn/5+MhILUXAGxTlerxc9PT3o7OxEd3c3LBYL+vr60NPTw4SpVBeoVqthNBpZ5sZkMrHWJwkJCYiNjZ1SG2OqT2xsbERLSwtrRd3f38+yJwkJCUhPT0dqairS09ORlZWF1NTUcQ8gGAyiubkZb7/9Ngua63Q66PV6KJVKRswkFkxJSUFJSUlIOnrsuNTX1+Ozzz7DRx99xIjF4/GgqKhoQoGo3+9np1zX19dDIpHAaDRGtRCWLl2Kf//3f0dKSkrUa/f397PSEBozCtpTd9DU1FQkJSUhKSkJqampyMjIYH3SJwufz4fe3l50dHSwk3b6+/thNpuZW0P3Tqn9sXMjNjYWSUlJrLnfRFlpOnvxu0IikbCOpBN9tvr6egwMDEx4Ta1Wi7vuuuu2NyMgGQXV5w4NDSE2NhaxsbHs1CEhKZJO8OzZs/jwww/xyiuvoLi4OMRlFc63scQj7G1GRDbWDSZyGyvenYicZ5TExi5cii84HA54PJ6Q5mcSiQQKhYKpf1Uq1bT0Xqc2u1arlXXUoMFTKpWMjCaSNjidTnR3d7NdQi6Xs6OmKOBJX8IYTjhYrVacOXMGX3zxBfbs2cNOq/nZz36GqqqqCQu7yRK02WwYGRlBV1cXzpw5g8OHD497+IT8/Hz8y7/8C5YuXTqpcXM4HGzMXC4XM/lJkqHVaqHRaKalqN/n87G5Ybfbw84NcnWEc+OH0DPt+4BwSRMpENFQmQ+51XSoCB1yTfOTxpsSI7QG2tvbcenSJSxbtgy5ublMviEs2g43/8jVJIuaYqrCLP7Y7OodR2Ic/69h4969e7F161ZcvHiRNYP767/+a7z44ovIy8ubdLqdTHdqmVxdXY133nkHZrN53DUSExPxq1/9Chs3buSL/0c6t4TPVZhtHKt1E/6brB/aNAKBANvoqbsxhUwoQUAaMq1WO2kLkkiMAv/kgQl1YtG6Vsy4xIJjcpNscHAQn332GZOhUNKgvLwcGzZsQE5OzpT0QlQTJ5fLERMTA6PRCI/Hg1dffXXcdUjIyPHjRDSJArl3RBjCwDllMYWlSkJyoUA9NSaUyWQsuzjZzVBocQm7U9A9CX8vJLDJXl/MH//tgd1ux44dO/DJJ5/AYrGwB+n3+/HEE0+gsLDwllo0i0QixMfHo6ysDLNnzx4nd5gudTjHD88yo+9EZmRVkUsplDdQkJ2sNLKcqGssvWYqAl3hXAynVxMmqKZKYJzEbhMCgQBOnjyJL7/8MuSkHK/Xi6VLl6KsrGzaeq3pdDqkpaWNIzGlUomYmBhOZH9BltlYIiOrhzRcwsaDwt+PJRXhwbzkFk7GjSQCFFqBdF3hKUZj7yGcaDcauDt5G9DX14e9e/eOKzlyOp2YO3cu4uLippUwSbArRExMDKtO4PjLcjHHumnkQgoJayzJjH09ySfIgpvobE+y7sIduUbXFXaiDXfPnMTuINTX1+PmzZvj0vukXp7Ok37sdvu4wL5EIkF6evqMtkjm+GEQmpBEwv0uHMZ2WJ2MFRbNWruVEiPuTn5P6OjoCNtmRqVS4caNG+jr65uWXlpOpxOdnZ24ceNGyAQymUyszzkHx48N3BK7DYh05qZCocA333yD2bNnQywWIzExESqVakKdmdCS83g8cLlcsNvtaG1txbFjx0LiYSKRCA8++CAqKyu/19OdODg4if2AQQcpUJmHkGD8fj/+4z/+AzU1NVi0aBGSkpKg0+mYkFTYOYDiB1SsTp0bzGYz6urqcPr0aSbdoKDqk08+iQ0bNkxr3I2D445ylbnYdeZhtVqxadMmvPPOO7DZbGGtLLfbjdHRUbhcLqSlpSE3NxdGo3Fc5UIgEIDVakV3dzfq6upYsa5arWYF5S6XC4mJiXj22WexZs2aKQloOTg4iXGERVdXF/bs2YNNmzahpaUFCoUiIrEIW8uE6/MUTqdDWUmVSoU1a9ZgzZo1mDt3LhISErisgoOTGMf0YHBwEE1NTTh+/Di+/fZb1NTUAAgtuZgM4QibzpHyurCwEPfccw8qKiqQl5eHhISEsIe6cnBwEuO4JVCt48jICLq7u9HW1oabN29iYGAAFosFPT09zK0cK8mQyWRQqVSse0RcXBzrypqamsoOI53pk9Y5ODiJcYQ09aN+ZG63m50BQL2XhK+nDhl0QpGwa4awMy4HBycxju+N2ML9HPLAvoOimYODkxgHBwfHHQqed+fg4OAkxsHBwcFJjIODg4OTGAcHBycxDg4ODk5iHBwcHJzEODg4ODiJcXBwcBLj4ODg4CTGwcHBwUmMg4ODg5MYBwcHJzEODg4OTmIcHBwcnMQ4ODg4iXFwcHBwEuPg4ODgJMbBwcHBSYyDg+MvCv8foPuErXNuO3cAAAAASUVORK5CYII="; - - // avoid inlining of constant - private static String crashImageWrapper() { - return crashImage.substring(0); - } - - private static String crashScreenOptsDump = null; public static void main(String[] args) { - PrintStream systemOut = System.out; - PrintStream systemErr = System.err; - try { - systemOut.println("MainClass: [INFO] eaglercraftx is starting..."); - String opts = getEaglerXOpts(); - - if(opts == null) { - systemErr.println("MainClass: [ERROR] the \"window.eaglercraftXOpts\" variable is undefined"); - systemErr.println("MainClass: [ERROR] eaglercraftx cannot start"); - Window.alert("ERROR: game cannot start, the \"window.eaglercraftXOpts\" variable is undefined"); + if(args.length == 1) { + if("_worker_process_".equalsIgnoreCase(args[0])) { + workerMain(); return; } - - try { - crashScreenOptsDump = opts; - JSONObject eaglercraftOpts = new JSONObject(opts); - - configRootElement = eaglercraftOpts.getString("container"); - - Object epkConfig = eaglercraftOpts.get("assetsURI"); - if(epkConfig instanceof JSONArray) { - JSONArray epkConfigArr = (JSONArray)epkConfig; - if(epkConfigArr.length() == 0) { - throw new JSONException("assetsURI array cannot be empty!"); - } - configEPKFiles = new EPKFileEntry[epkConfigArr.length()]; - for(int i = 0, l = configEPKFiles.length; i < l; ++i) { - configEPKFiles[i] = parseEntry(epkConfigArr.getJSONObject(i)); - } - }else if(epkConfig instanceof JSONObject) { - configEPKFiles = new EPKFileEntry[] { parseEntry((JSONObject)epkConfig) }; - }else if(epkConfig instanceof String) { - String epkConfigStr = (String)epkConfig; - configEPKFiles = new EPKFileEntry[] { new EPKFileEntry(epkConfigStr, "") }; - if(epkConfigStr.length() > 128) { - eaglercraftOpts.put("assetsURI", epkConfigStr.substring(0, 128) + " ... "); - } - } - - configLocalesFolder = eaglercraftOpts.optString("localesURI", "lang"); - if(configLocalesFolder.endsWith("/")) { - configLocalesFolder = configLocalesFolder.substring(0, configLocalesFolder.length() - 1); - } - - DeferredStateManager.doCheckErrors = eaglercraftOpts.optBoolean("checkShaderGLErrors", false); - - ((TeaVMClientConfigAdapter)TeaVMClientConfigAdapter.instance).loadJSON(eaglercraftOpts); - - systemOut.println("MainClass: [INFO] configuration was successful"); - }catch(Throwable t) { - systemErr.println("MainClass: [ERROR] the \"window.eaglercraftXOpts\" variable is invalid"); - EagRuntime.debugPrintStackTraceToSTDERR(t); - systemErr.println("MainClass: [ERROR] eaglercraftx cannot start"); - Window.alert("ERROR: game cannot start, the \"window.eaglercraftXOpts\" variable is invalid: " + t.toString()); - return; - } - - systemOut.println("MainClass: [INFO] registering crash handlers"); - - setWindowErrorHandler(new WindowErrorHandler() { - - @Override - public void call(String message, String file, int line, int col, JSError error) { - StringBuilder str = new StringBuilder(); - - str.append("Native Browser Exception\n"); - str.append("----------------------------------\n"); - str.append(" Line: ").append((file == null ? "unknown" : file) + ":" + line + ":" + col).append('\n'); - str.append(" Type: ").append(error == null ? "generic" : error.getName()).append('\n'); - - if(error != null) { - str.append(" Desc: ").append(error.getMessage() == null ? "null" : error.getMessage()).append('\n'); - } - - if(message != null) { - if(error == null || error.getMessage() == null || !message.endsWith(error.getMessage())) { - str.append(" Desc: ").append(message).append('\n'); - } - } - - str.append("----------------------------------\n\n"); - str.append(error.getStack() == null ? "No stack trace is available" : error.getStack()).append('\n'); - - showCrashScreen(str.toString()); - } - - }); - - systemOut.println("MainClass: [INFO] initializing eaglercraftx runtime"); - - try { - EagRuntime.create(); - }catch(PlatformRuntime.PlatformIncompatibleException ex) { - systemErr.println("MainClass: [ERROR] this browser is incompatible with eaglercraftx!"); - systemErr.println("MainClass: [ERROR] Reason: " + ex.getMessage()); - try { - showIncompatibleScreen(ex.getMessage()); - }catch(Throwable t) { - } - return; - }catch(Throwable t) { - systemErr.println("MainClass: [ERROR] eaglercraftx's runtime could not be initialized!"); - EagRuntime.debugPrintStackTraceToSTDERR(t); - showCrashScreen("EaglercraftX's runtime could not be initialized!", t); - systemErr.println("MainClass: [ERROR] eaglercraftx cannot start"); - return; - } - - systemOut.println("MainClass: [INFO] launching eaglercraftx main thread"); - - try { - Main.appMain(new String[0]); - }catch(Throwable t) { - systemErr.println("MainClass: [ERROR] unhandled exception caused main thread to exit"); - EagRuntime.debugPrintStackTraceToSTDERR(t); - showCrashScreen("Unhandled exception caused main thread to exit!", t); - } - - }finally { - systemErr.println("MainClass: [ERROR] eaglercraftx main thread has exited"); - } - } - - @JSBody(params = {}, script = "if(typeof window.eaglercraftXOpts === \"undefined\") {return null;}" - + "else if(typeof window.eaglercraftXOpts === \"string\") {return window.eaglercraftXOpts;}" - + "else {return JSON.stringify(window.eaglercraftXOpts);}") - private static native String getEaglerXOpts(); - - public static class EPKFileEntry { - - public final String url; - public final String path; - - protected EPKFileEntry(String url, String path) { - this.url = url; - this.path = path; + }else if(args.length == 0) { + clientMain(); + return; } + System.out.println("???"); } - private static EPKFileEntry parseEntry(JSONObject obj) { - String url = obj.getString("url"); - String path = obj.optString("path", ""); - if(url.length() > 128) { - obj.put("url", url.substring(0, 128) + " ... "); - } - if(path == null) { - path = ""; - } - return new EPKFileEntry(url, path); + private static void clientMain() { + ClientMain._main(); } - public static String configRootElement = null; - public static EPKFileEntry[] configEPKFiles = null; - public static String configLocalesFolder = null; - - @JSFunctor - private static interface WindowErrorHandler extends JSObject { - void call(String message, String file, int line, int col, JSError error); + private static void workerMain() { + WorkerMain._main(); } - - @JSBody(params = { "handler" }, script = "window.addEventListener(\"error\", function(e) { handler(" - + "(typeof e.message === \"string\") ? e.message : null," - + "(typeof e.filename === \"string\") ? e.filename : null," - + "(typeof e.lineno === \"number\") ? e.lineno : 0," - + "(typeof e.colno === \"number\") ? e.colno : 0," - + "(typeof e.error === \"undefined\") ? null : e.error); });") - public static native void setWindowErrorHandler(WindowErrorHandler handler); - - public static void showCrashScreen(String message, Throwable t) { - try { - showCrashScreen(message + "\n\n" + EagRuntime.getStackTrace(t)); - }catch(Throwable tt) { - } - } - - private static boolean isCrashed = false; - - public static void showCrashScreen(String t) { - if(!isCrashed) { - isCrashed = true; - - HTMLDocument doc = Window.current().getDocument(); - HTMLElement el = doc.getElementById(configRootElement); - - StringBuilder str = new StringBuilder(); - str.append("Game Crashed! I have fallen and I can't get up!\n\n"); - str.append(t); - str.append('\n').append('\n'); - str.append("eaglercraft.version = \"").append(EaglercraftVersion.projectForkVersion).append("\"\n"); - str.append("eaglercraft.minecraft = \"1.8.8\"\n"); - str.append("eaglercraft.brand = \"" + EaglercraftVersion.projectForkVendor + "\"\n"); - str.append("eaglercraft.username = \"").append(EaglerProfile.getName()).append("\"\n"); - str.append('\n'); - str.append(addWebGLToCrash()); - str.append('\n'); - str.append("window.eaglercraftXOpts = "); - str.append(crashScreenOptsDump).append('\n'); - str.append('\n'); - addDebugNav(str, "userAgent"); - addDebugNav(str, "vendor"); - addDebugNav(str, "language"); - addDebugNav(str, "hardwareConcurrency"); - addDebugNav(str, "deviceMemory"); - addDebugNav(str, "platform"); - addDebugNav(str, "product"); - str.append('\n'); - str.append("rootElement.clientWidth = ").append(el == null ? "undefined" : el.getClientWidth()).append('\n'); - str.append("rootElement.clientHeight = ").append(el == null ? "undefined" : el.getClientHeight()).append('\n'); - addDebug(str, "innerWidth"); - addDebug(str, "innerHeight"); - addDebug(str, "outerWidth"); - addDebug(str, "outerHeight"); - addDebug(str, "devicePixelRatio"); - addDebugScreen(str, "availWidth"); - addDebugScreen(str, "availHeight"); - addDebugScreen(str, "colorDepth"); - addDebugScreen(str, "pixelDepth"); - str.append('\n'); - addDebug(str, "currentContext"); - str.append('\n'); - addDebugLocation(str, "href"); - str.append('\n'); - - if(el == null) { - Window.alert("Root element not found, crash report was printed to console"); - System.err.println(str.toString()); - return; - } - - String s = el.getAttribute("style"); - el.setAttribute("style", (s == null ? "" : s) + "position:relative;"); - HTMLElement img = doc.createElement("img"); - HTMLElement div = doc.createElement("div"); - img.setAttribute("style", "z-index:100;position:absolute;top:10px;left:calc(50% - 151px);"); - img.setAttribute("src", crashImageWrapper()); - div.setAttribute("style", "z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:1px solid #cccccc;overflow-x:hidden;overflow-y:scroll;overflow-wrap:break-word;white-space:pre-wrap;font: 14px monospace;padding:10px;"); - el.appendChild(img); - el.appendChild(div); - div.appendChild(doc.createTextNode(str.toString())); - - PlatformRuntime.removeEventHandlers(); - - }else { - System.err.println(); - System.err.println("An additional crash report was supressed:"); - for(String l : t.split("[\\r\\n]+")) { - System.err.println(" " + l); - } - } - } - - private static String addWebGLToCrash() { - StringBuilder ret = new StringBuilder(); - - WebGLRenderingContext ctx = PlatformRuntime.webgl; - - if(ctx == null) { - HTMLCanvasElement cvs = (HTMLCanvasElement) Window.current().getDocument().createElement("canvas"); - - cvs.setWidth(64); - cvs.setHeight(64); - - ctx = (WebGLRenderingContext)cvs.getContext("webgl"); - } - - if(ctx != null) { - if(PlatformRuntime.webgl != null) { - ret.append("webgl.version = ").append(ctx.getParameterString(WebGLRenderingContext.VERSION)).append('\n'); - } - if(ctx.getExtension("WEBGL_debug_renderer_info") != null) { - ret.append("webgl.renderer = ").append(ctx.getParameterString(/* UNMASKED_RENDERER_WEBGL */ 0x9246)).append('\n'); - ret.append("webgl.vendor = ").append(ctx.getParameterString(/* UNMASKED_VENDOR_WEBGL */ 0x9245)).append('\n'); - }else { - ret.append("webgl.renderer = ").append(ctx.getParameterString(WebGLRenderingContext.RENDERER) + " [masked]").append('\n'); - ret.append("webgl.vendor = ").append(ctx.getParameterString(WebGLRenderingContext.VENDOR) + " [masked]").append('\n'); - } - //ret.append('\n').append("\nwebgl.anisotropicGlitch = ").append(DetectAnisotropicGlitch.hasGlitch()).append('\n'); //TODO - ret.append('\n').append("webgl.ext.HDR16f = ").append(ctx.getExtension("EXT_color_buffer_half_float") != null).append('\n'); - ret.append("webgl.ext.HDR32f = ").append(ctx.getExtension("EXT_color_buffer_float") != null).append('\n'); - - }else { - ret.append("Failed to query GPU info!\n"); - } - - return ret.toString(); - } - - public static void showIncompatibleScreen(String t) { - if(!isCrashed) { - isCrashed = true; - - HTMLDocument doc = Window.current().getDocument(); - HTMLElement el = doc.getElementById(configRootElement); - - if(el == null) { - System.err.println("Compatibility error: " + t); - return; - } - - String s = el.getAttribute("style"); - el.setAttribute("style", (s == null ? "" : s) + "position:relative;"); - HTMLElement img = doc.createElement("img"); - HTMLElement div = doc.createElement("div"); - img.setAttribute("style", "z-index:100;position:absolute;top:10px;left:calc(50% - 151px);"); - img.setAttribute("src", crashImageWrapper()); - div.setAttribute("style", "z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:1px solid #cccccc;overflow-x:hidden;overflow-y:scroll;font:18px sans-serif;padding:40px;"); - el.appendChild(img); - el.appendChild(div); - div.setInnerHTML("

+ This device is incompatible with Eaglercraft :(

" - + "
" - + "

Issue:

" - + "

" - + "

" - + "


Things you can try:

" - + "
    " - + "
  1. Just try using Eaglercraft on a different device, it isn't a bug it's common sense
  2. " - + "
  3. If you are on a mobile device, please try a proper desktop or a laptop computer
  4. " - + "
  5. If you are using a device with no mouse cursor, please use a device with a mouse cursor
  6. " - + "
  7. If you are not using Chrome/Edge, try installing the latest Google Chrome
  8. " - + "
  9. If your browser is out of date, please update it to the latest version
  10. " - + "
  11. If you are using an old OS such as Windows 7, please try Windows 10 or 11
  12. " - + "
  13. If you have a GPU launched before 2009, WebGL 2.0 support may be impossible
  14. " - + "
" - + "
"); - - div.querySelector("#crashReason").appendChild(doc.createTextNode(t)); - div.querySelector("#crashUserAgent").appendChild(doc.createTextNode(getStringNav("userAgent"))); - - PlatformRuntime.removeEventHandlers(); - - String webGLRenderer = "No GL_RENDERER string could be queried"; - - try { - HTMLCanvasElement cvs = (HTMLCanvasElement) Window.current().getDocument().createElement("canvas"); - - cvs.setWidth(64); - cvs.setHeight(64); - - WebGLRenderingContext ctx = (WebGLRenderingContext)cvs.getContext("webgl"); - - if(ctx != null) { - String r; - if(ctx.getExtension("WEBGL_debug_renderer_info") != null) { - r = ctx.getParameterString(/* UNMASKED_RENDERER_WEBGL */ 0x9246); - }else { - r = ctx.getParameterString(WebGLRenderingContext.RENDERER); - if(r != null) { - r += " [masked]"; - } - } - if(r != null) { - webGLRenderer = r; - } - } - }catch(Throwable tt) { - } - - div.querySelector("#crashWebGL").appendChild(doc.createTextNode(webGLRenderer)); - - } - } - - @JSBody(params = { "v" }, script = "try { return \"\"+window[v]; } catch(e) { return \"\"; }") - private static native String getString(String var); - - @JSBody(params = { "v" }, script = "try { return \"\"+window.navigator[v]; } catch(e) { return \"\"; }") - private static native String getStringNav(String var); - - @JSBody(params = { "v" }, script = "try { return \"\"+window.screen[v]; } catch(e) { return \"\"; }") - private static native String getStringScreen(String var); - - @JSBody(params = { "v" }, script = "try { return \"\"+window.location[v]; } catch(e) { return \"\"; }") - private static native String getStringLocation(String var); - - private static void addDebug(StringBuilder str, String var) { - str.append("window.").append(var).append(" = ").append(getString(var)).append('\n'); - } - - private static void addDebugNav(StringBuilder str, String var) { - str.append("window.navigator.").append(var).append(" = ").append(getStringNav(var)).append('\n'); - } - - private static void addDebugScreen(StringBuilder str, String var) { - str.append("window.screen.").append(var).append(" = ").append(getStringScreen(var)).append('\n'); - } - - private static void addDebugLocation(StringBuilder str, String var) { - str.append("window.location.").append(var).append(" = ").append(getStringLocation(var)).append('\n'); - } - - private static void addArray(StringBuilder str, String var) { - str.append("window.").append(var).append(" = ").append(getArray(var)).append('\n'); - } - - @JSBody(params = { "v" }, script = "try { return (typeof window[v] !== \"undefined\") ? JSON.stringify(window[v]) : \"[\\\"\\\"]\"; } catch(e) { return \"[\\\"\\\"]\"; }") - private static native String getArray(String var); - } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMClientConfigAdapter.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMClientConfigAdapter.java index a89eb40..048ce70 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMClientConfigAdapter.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMClientConfigAdapter.java @@ -1,24 +1,35 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; import org.json.JSONArray; import org.json.JSONObject; 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-2024 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TeaVMClientConfigAdapter implements IClientConfigAdapter { @@ -26,13 +37,40 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter { public static final IClientConfigAdapter instance = new TeaVMClientConfigAdapter(); private String defaultLocale = "en_US"; - private boolean hideDownDefaultServers = false; private List defaultServers = new ArrayList(); + private List relays = new ArrayList(); private String serverToJoin = null; + private String worldsDB = "worlds"; + private JSONObject originalEaglercraftOpts; + private boolean isCheckShaderGLErrors = false; + private boolean demoMode = EaglercraftVersion.forceDemoMode; + private boolean isAllowUpdateSvc = EaglercraftVersion.enableUpdateService; + private boolean isAllowUpdateDL = EaglercraftVersion.enableUpdateService; + private boolean isEnableDownloadOfflineButton = true; + private String downloadOfflineButtonLink = null; + private boolean useSpecialCursors = false; + private boolean logInvalidCerts = false; + private boolean checkRelaysForUpdates = false; + private boolean enableSignatureBadge = false; + private static final EaglercraftRandom random = new EaglercraftRandom(); - void loadJSON(JSONObject eaglercraftOpts) { + public void loadJSON(JSONObject eaglercraftOpts) { + originalEaglercraftOpts = eaglercraftOpts; defaultLocale = eaglercraftOpts.optString("lang", "en_US"); serverToJoin = eaglercraftOpts.optString("joinServer", null); + worldsDB = eaglercraftOpts.optString("worldsDB", "worlds"); + isCheckShaderGLErrors = eaglercraftOpts.optBoolean("checkShaderGLErrors", false); + if(EaglercraftVersion.forceDemoMode) { + eaglercraftOpts.put("demoMode", true); + } + demoMode = EaglercraftVersion.forceDemoMode || eaglercraftOpts.optBoolean("demoMode", false); + isAllowUpdateSvc = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftOpts.optBoolean("allowUpdateSvc", true); + isAllowUpdateDL = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftOpts.optBoolean("allowUpdateDL", true); + isEnableDownloadOfflineButton = eaglercraftOpts.optBoolean("enableDownloadOfflineButton", true); + downloadOfflineButtonLink = eaglercraftOpts.optString("downloadOfflineButtonLink", null); + useSpecialCursors = eaglercraftOpts.optBoolean("html5CursorSupport", false); + logInvalidCerts = !demoMode && eaglercraftOpts.optBoolean("logInvalidCerts", false); + enableSignatureBadge = eaglercraftOpts.optBoolean("enableSignatureBadge", false); JSONArray serversArray = eaglercraftOpts.optJSONArray("servers"); if(serversArray != null) { for(int i = 0, l = serversArray.length(); i < l; ++i) { @@ -44,6 +82,64 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter { } } } + + JSONArray relaysArray = eaglercraftOpts.optJSONArray("relays"); + if(relaysArray != null) { + boolean gotAPrimary = false; + for (int i = 0, l = relaysArray.length(); i < l; ++i) { + JSONObject relay = relaysArray.getJSONObject(i); + boolean p = relay.getBoolean("primary"); + if(p) { + if(gotAPrimary) { + p = false; + }else { + gotAPrimary = true; + } + } + relays.add(new RelayEntry(relay.getString("addr"), relay.getString("comment"), p)); + } + } + + if (relays.size() <= 0) { + int choice = random.nextInt(3); + relays.add(new RelayEntry("wss://relay.deev.is/", "lax1dude relay #1", choice == 0)); + relays.add(new RelayEntry("wss://relay.lax1dude.net/", "lax1dude relay #2", choice == 1)); + relays.add(new RelayEntry("wss://relay.shhnowisnottheti.me/", "ayunami relay #1", choice == 2)); + checkRelaysForUpdates = !demoMode && eaglercraftOpts.optBoolean("checkRelaysForUpdates", true); + }else { + boolean isOfficial = true; + for(int i = 0, l = relays.size(); i < l; ++i) { + String addr = relays.get(i).address; + if(!addr.contains("deev.is") && !addr.contains("lax1dude.net") && !addr.contains("shhnowisnottheti.me")) { + isOfficial = false; + break; + } + } + checkRelaysForUpdates = !demoMode && eaglercraftOpts.optBoolean("checkRelaysForUpdates", isOfficial); + } + + try { + byte[] localStorage = EagRuntime.getStorage("r"); + + if (localStorage != null) { + NBTTagCompound nbttagcompound = CompressedStreamTools + .readCompressed(new EaglerInputStream(localStorage)); + if (nbttagcompound == null) { + RelayManager.relayManager.load(null); + } else { + RelayManager.relayManager.load(nbttagcompound.getTagList("relays", 10)); + } + } else { + RelayManager.relayManager.load(null); + } + } catch (IOException e) { + EagRuntime.debugPrintStackTrace(e); + } + + if (RelayManager.relayManager.count() <= 0) { + RelayManager.relayManager.loadDefaults(); + RelayManager.relayManager.save(); + } } @Override @@ -61,4 +157,69 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter { return serverToJoin; } + @Override + public String getWorldsDB() { + return worldsDB; + } + + @Override + public JSONObject dumpConfig() { + return originalEaglercraftOpts; + } + + @Override + public List getRelays() { + return relays; + } + + @Override + public boolean checkShaderGLErrors() { + return isCheckShaderGLErrors; + } + + @Override + public boolean isDemo() { + return demoMode; + } + + @Override + public boolean allowUpdateSvc() { + return isAllowUpdateSvc; + } + + @Override + public boolean allowUpdateDL() { + return isAllowUpdateDL; + } + + @Override + public boolean isEnableDownloadOfflineButton() { + return isEnableDownloadOfflineButton; + } + + @Override + public String getDownloadOfflineButtonLink() { + return downloadOfflineButtonLink; + } + + @Override + public boolean useSpecialCursors() { + return useSpecialCursors; + } + + @Override + public boolean isLogInvalidCerts() { + return logInvalidCerts; + } + + @Override + public boolean isCheckRelaysForUpdates() { + return checkRelaysForUpdates; + } + + @Override + public boolean isEnableSignatureBadge() { + return enableSignatureBadge; + } + } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMServerQuery.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMServerQuery.java index bbb6a91..adeb7ab 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMServerQuery.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMServerQuery.java @@ -10,7 +10,7 @@ import org.teavm.jso.dom.events.Event; import org.teavm.jso.dom.events.EventListener; import org.teavm.jso.dom.events.MessageEvent; import org.teavm.jso.typedarrays.ArrayBuffer; -import org.teavm.jso.typedarrays.Int8Array; +import org.teavm.jso.typedarrays.Uint8Array; import org.teavm.jso.websocket.WebSocket; import net.lax1dude.eaglercraft.v1_8.internal.EnumServerRateLimit; @@ -20,16 +20,18 @@ 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 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TeaVMServerQuery implements IServerQuery { @@ -114,12 +116,7 @@ public class TeaVMServerQuery implements IServerQuery { } }else { synchronized(queryResponsesBytes) { - Int8Array packetBytes = Int8Array.create(evt.getDataAsArray()); - byte[] data = new byte[packetBytes.getLength()]; - for(int i = 0; i < data.length; ++i) { - data[i] = packetBytes.get(i); - } - queryResponsesBytes.add(data); + queryResponsesBytes.add(TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(evt.getDataAsArray()))); } } } @@ -146,9 +143,7 @@ public class TeaVMServerQuery implements IServerQuery { @Override public void send(byte[] bytes) { if(open) { - Int8Array arr = Int8Array.create(bytes.length); - arr.set(bytes, 0); - nativeBinarySend(sock, arr.getBuffer()); + nativeBinarySend(sock, TeaVMUtils.unwrapByteArray(bytes).getBuffer()); } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUpdateThread.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUpdateThread.java new file mode 100644 index 0000000..534e170 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUpdateThread.java @@ -0,0 +1,272 @@ +package net.lax1dude.eaglercraft.v1_8.internal.teavm; + +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.teavm.interop.Async; +import org.teavm.interop.AsyncCallback; +import org.teavm.jso.ajax.ProgressEvent; +import org.teavm.jso.ajax.XMLHttpRequest; +import org.teavm.jso.browser.Window; +import org.teavm.jso.dom.events.Event; +import org.teavm.jso.dom.events.EventListener; +import org.teavm.jso.typedarrays.ArrayBuffer; +import org.teavm.jso.typedarrays.Uint8Array; + +import com.google.common.collect.ListMultimap; + +import net.lax1dude.eaglercraft.v1_8.Base64; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformAssets; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformUpdateSvc; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate; +import net.lax1dude.eaglercraft.v1_8.update.UpdateProgressStruct; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; + +/** + * 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 TeaVMUpdateThread implements Runnable { + + private static final Logger logger = LogManager.getLogger("TeaVMUpdateThread"); + + public final UpdateCertificate updateCert; + public final UpdateProgressStruct updateProg; + + public TeaVMUpdateThread(UpdateCertificate updateCert, UpdateProgressStruct updateProg) { + this.updateCert = updateCert; + this.updateProg = updateProg; + } + + @Override + public void run() { + boolean success = false; + try { + logger.info("Starting update thread..."); + updateProg.clear(); + updateProg.isBusy = true; + updateProg.statusString1 = updateCert.bundleDisplayName + " - " + updateCert.bundleDisplayVersion; + updateProg.statusString2 = "Please Wait"; + + List urlListA = new ArrayList(); + ListMultimap downloadSources = updateCert.getSourceMultimap(); + + List ls = downloadSources.get("list"); + for(int k = 0, l = ls.size(); k < l; ++k) { + String str1 = ls.get(k); + updateProg.statusString2 = "Fetch List (" + (k + 1) + "/" + l + ")"; + byte[] b = downloadWithProgress(str1); + if(b == null) { + logger.error("Failed to load additional url list: {}", str1); + continue; + } + try { + String[] str2 = EagUtils.linesArray(new String(b, StandardCharsets.UTF_8)); + for(int i = 0; i < str2.length; ++i) { + if(!StringUtils.isAllBlank(str2[i]) && (str2[i] = str2[i].trim()).charAt(0) != '#') { + String[] strrr = str2[i].split(":", 2); + downloadSources.put(strrr[0].trim(), strrr[1].trim()); + } + } + }catch(Throwable t) { + logger.error("Failed to load/parse url list: {}", str1); + logger.error(t); + } + } + + updateProg.statusString2 = "Please Wait"; + + urlListA.addAll(downloadSources.get("url")); + + List ls2 = downloadSources.get("use-gateway"); + ls = downloadSources.get("ipfs"); + for(int k = 0, l = ls.size(); k < l; ++k) { + String str1 = ls.get(k); + String cid = str1; + String path = ""; + int pathSep = str1.indexOf('/'); + if(pathSep != -1) { + path = cid.substring(pathSep + 1); + cid = cid.substring(0, pathSep); + } + for(int p = 0, q = ls2.size(); p < q; ++p) { + String str2 = ls2.get(p); + urlListA.add(formatIPFSURL(cid, path, str2)); + } + } + + List urlListB = new ArrayList(); + ls = downloadSources.get("use-proxy"); + for(int k = 0, l = ls.size(); k < l; ++k) { + String str1 = ls.get(k); + for(int p = 0, q = urlListA.size(); p < q; ++p) { + String str2 = urlListA.get(p); + urlListB.add(formatProxyURL(str2, str1)); + } + } + + Collections.shuffle(urlListA); + Collections.shuffle(urlListB); + + urlListA.addAll(urlListB); + + for(int i = 0, l = urlListA.size(); i < l; ++i) { + String url = urlListA.get(i); + updateProg.statusString2 = "Attempt (" + (i + 1) + "/" + l + ")"; + byte[] b = downloadWithProgress(url); + if(b == null) { + updateProg.progressBar = 1.0f; + updateProg.statusString3 = "FAILED!"; + EagUtils.sleep(300l); + updateProg.progressBar = -1.0f; + updateProg.statusString3 = null; + continue; + } + updateProg.progressBar = 1.0f; + updateProg.statusString2 = "Verifying"; + logger.info("Verifying downloaded file..."); + if(updateCert.isBundleDataValid(b)) { + logger.info("Success! Signature is valid!"); + downloadSignedOffline(updateCert, b); + success = true; + return; + } + updateProg.statusString2 = "Signature Invalid!"; + logger.error("File signature is invalid: {}"); + EagUtils.sleep(1000l); + } + + updateProg.progressBar = -1.0f; + updateProg.statusString3 = null; + + }catch(Throwable t) { + logger.error("Uncaught exception downloading updates!"); + logger.error(t); + }finally { + PlatformUpdateSvc.updateThread = null; + updateProg.isBusy = false; + if(!success) { + logger.error("Failed to download updates! No valid URL was found for {}", updateCert.bundleDisplayVersion); + Window.alert("ERROR: Failed to download updates!\n\nIf you are on a device with restricted internet access, try a different device or connect to a different WiFi network\n\nCheck the debug console for more info"); + }else { + UpdateService.dismiss(updateCert); + } + } + } + + private byte[] downloadWithProgress(String url) { + updateProg.progressBar = 0.0f; + try { + updateProg.statusString3 = url; + logger.info("Trying to download: {}", url); + byte[] b = downloadWithProgress0(this, url); + if(b == null) { + logger.error("Failed to download: {}", url); + } + return b; + }finally { + updateProg.statusString3 = null; + } + } + + @Async + private static native byte[] downloadWithProgress0(TeaVMUpdateThread self, String url); + + private static void downloadWithProgress0(TeaVMUpdateThread self, String url, AsyncCallback cb) { + try { + self.downloadWithProgressImpl(url, cb); + }catch(Throwable t) { + logger.error("Exception caught downloading file: {}", url); + logger.error(t); + cb.complete(null); + } + } + + private void downloadWithProgressImpl(String url, final AsyncCallback cb) { + final XMLHttpRequest xhr = XMLHttpRequest.create(); + xhr.open("GET", url); + xhr.setResponseType("arraybuffer"); + TeaVMUtils.addEventListener(xhr, "progress", new EventListener() { + @Override + public void handleEvent(ProgressEvent evt) { + updateProg.progressBar = Math.min((float)evt.getLoaded() / (float)updateCert.bundleDataLength, 1.0f); + } + }); + TeaVMUtils.addEventListener(xhr, "readystatechange", new EventListener() { + @Override + public void handleEvent(Event evt) { + if(xhr.getReadyState() == 4) { + if(xhr.getStatus() == 200) { + ArrayBuffer data = (ArrayBuffer)xhr.getResponse(); + if(data.getByteLength() == updateCert.bundleDataLength) { + cb.complete(TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(data))); + }else { + logger.error("Unexpected response length {} (expect: {}) from URL: {}", xhr.getStatus(), xhr.getStatusText()); + cb.complete(null); + } + }else { + logger.error("Got response code {} \"{}\" for url: {}", xhr.getStatus(), xhr.getStatusText()); + cb.complete(null); + } + } + } + }); + TeaVMUtils.addEventListener(xhr, "error", new EventListener() { + @Override + public void handleEvent(ProgressEvent evt) { + logger.error("Exception caught downloading file: {}", url); + + } + }); + xhr.send(); + } + + private static String formatIPFSURL(String cid, String path, String pattern) { + return pattern.replace("$cid$", cid).replace("$path$", path); + } + + private static String formatProxyURL(String path, String pattern) { + return pattern.replace("$url$", Window.encodeURIComponent(path)); + } + + public static void downloadSignedOffline(UpdateCertificate cert, byte[] data) { + PlatformApplication.downloadFileWithName(cert.bundleDisplayName.replaceAll("[^a-zA-Z0-9\\-_]", "_") + "_" + cert.bundleDisplayVersion.replaceAll("[^a-zA-Z0-9\\-_]", "_") + "_Offline_Signed.html", generateSignedOffline(cert, data)); + } + + public static byte[] generateSignedOffline(UpdateCertificate cert, byte[] data) { + return generateSignedOffline(cert.rawCertData, data, EagRuntime.fixDateFormat(new SimpleDateFormat("MM/dd/yyyy")).format(new Date(cert.sigTimestamp))); + } + + public static byte[] generateSignedOffline(byte[] cert, byte[] data, String date) { + byte[] b = PlatformAssets.getResourceBytes("SignedClientTemplate.txt"); + if(b == null) { + throw new RuntimeException("Could not load SignedClientTemplate.txt from assets.epk!"); + } + String templateHtml = new String(b, StandardCharsets.UTF_8); + templateHtml = templateHtml.replace("${client_signature}", Base64.encodeBase64String(cert)); + templateHtml = templateHtml.replace("${client_bundle}", Base64.encodeBase64String(data)); + templateHtml = templateHtml.replace("${date}", date); + return templateHtml.getBytes(StandardCharsets.UTF_8); + } +} diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUtils.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUtils.java index 13592f5..a016aeb 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUtils.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/TeaVMUtils.java @@ -1,21 +1,33 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm; +import org.teavm.interop.Async; +import org.teavm.interop.AsyncCallback; import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; +import org.teavm.jso.browser.Window; import org.teavm.jso.typedarrays.ArrayBuffer; +import org.teavm.jso.typedarrays.ArrayBufferView; +import org.teavm.jso.typedarrays.Float32Array; +import org.teavm.jso.typedarrays.Int32Array; import org.teavm.jso.typedarrays.Int8Array; +import org.teavm.jso.typedarrays.Uint8Array; + +import net.lax1dude.eaglercraft.v1_8.EagUtils; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. + * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 TeaVMUtils { @@ -29,18 +41,105 @@ public class TeaVMUtils { @JSBody(params = { "obj", "name", "handler" }, script = "obj.addEventListener(name, handler);") public static native void addEventListener(JSObject obj, String name, JSObject handler); + @JSBody(params = {}, script = "return (new Error()).stack;") + public static native String dumpJSStackTrace(); + + private static abstract class TeaVMArrayObject implements JSObject { + @JSProperty + public abstract ArrayBufferView getData(); + } + + public static Int8Array unwrapByteArray(byte[] buf) { + return Int8Array.create(((TeaVMArrayObject)(Object)buf).getData().getBuffer()); + } + + @JSBody(params = { "buf" }, script = "return $rt_createByteArray(buf.buffer)") + private static native JSObject wrapByteArray0(JSObject buf); + + public static byte[] wrapByteArray(Int8Array buf) { + return (byte[])(Object)wrapByteArray0(buf); + } + + public static Uint8Array unwrapUnsignedByteArray(byte[] buf) { + return Uint8Array.create(((TeaVMArrayObject)(Object)buf).getData().getBuffer()); + } + + public static byte[] wrapUnsignedByteArray(Uint8Array buf) { + return (byte[])(Object)wrapByteArray0(buf); + } + + public static Int32Array unwrapIntArray(int[] buf) { + return Int32Array.create(((TeaVMArrayObject)(Object)buf).getData().getBuffer()); + } + + @JSBody(params = { "buf" }, script = "return $rt_createIntArray(buf.buffer)") + private static native JSObject wrapIntArray0(JSObject buf); + + public static int[] wrapIntArray(Int32Array buf) { + return (int[])(Object)wrapIntArray0(buf); + } + + public static Float32Array unwrapFloatArray(float[] buf) { + return Float32Array.create(((TeaVMArrayObject)(Object)buf).getData().getBuffer()); + } + + @JSBody(params = { "buf" }, script = "return $rt_createFloatArray(buf.buffer)") + private static native JSObject wrapFloatArray0(JSObject buf); + + public static float[] wrapFloatArray(Float32Array buf) { + return (float[])(Object)wrapFloatArray0(buf); + } + + @Async + public static native void sleepSetTimeout(int millis); + + private static void sleepSetTimeout(int millis, AsyncCallback cb) { + Window.setTimeout(() -> cb.complete(null), millis); + } + public static final byte[] arrayBufferToBytes(ArrayBuffer buf) { if(buf == null) { return null; } - Int8Array arr = Int8Array.create(buf); - byte[] ret = new byte[arr.getByteLength()]; - for(int i = 0; i < ret.length; ++i) { - ret[i] = arr.get(i); + return wrapUnsignedByteArray(Uint8Array.create(buf)); + } + + public static String tryResolveClassesSource() { + String str = dumpJSStackTrace(); + String[] frames = EagUtils.splitPattern.split(str); + if("Error".equals(frames[0])) { + // V8 stack trace + if(frames.length > 1) { + String framesTrim = frames[1].trim(); + if(framesTrim.startsWith("at")) { + //definitely V8 + int i = framesTrim.indexOf('('); + int j = framesTrim.indexOf(')'); + if(i != -1 && j != -1 && i < j) { + return tryResolveClassesSourceFromFrame(framesTrim.substring(i + 1, j)); + } + } + } + }else { + // Mozilla/WebKit stack trace + String framesTrim = frames[0].trim(); + int i = framesTrim.indexOf('@'); + if(i != -1) { + return tryResolveClassesSourceFromFrame(framesTrim.substring(i + 1)); + } } - - return ret; + return null; } + private static String tryResolveClassesSourceFromFrame(String fileLineCol) { + int i = fileLineCol.lastIndexOf(':'); + if(i > 0) { + i = fileLineCol.lastIndexOf(':', i - 1); + } + if(i != -1) { + return fileLineCol.substring(0, i); + } + return null; + } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGL2RenderingContext.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGL2RenderingContext.java index 579f1f6..84a9351 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGL2RenderingContext.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGL2RenderingContext.java @@ -9,16 +9,18 @@ import org.teavm.jso.webgl.WebGLTexture; import org.teavm.jso.webgl.WebGLUniformLocation; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface WebGL2RenderingContext extends WebGLRenderingContext { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLQuery.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLQuery.java index d536a84..2550aa5 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLQuery.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLQuery.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm; import org.teavm.jso.JSObject; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface WebGLQuery extends JSObject { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLVertexArray.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLVertexArray.java index dcfa35d..93cc822 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLVertexArray.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/WebGLVertexArray.java @@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm; import org.teavm.jso.JSObject; /** - * 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 - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) + * 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 interface WebGLVertexArray extends JSObject { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/BooleanResult.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/BooleanResult.java index a1c91ab..c08510a 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/BooleanResult.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/BooleanResult.java @@ -1,19 +1,20 @@ package net.lax1dude.eaglercraft.v1_8.internal.vfs; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 BooleanResult { public static final BooleanResult TRUE = new BooleanResult(true); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java index 7dcc5dd..2309875 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java @@ -8,19 +8,20 @@ import java.util.List; import java.util.Set; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 FolderResourcePack extends AbstractResourcePack { private final String prefix; diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java index 990761b..ed909c3 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java @@ -1,5 +1,6 @@ package net.lax1dude.eaglercraft.v1_8.internal.vfs; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.crypto.SHA1Digest; import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; import net.lax1dude.eaglercraft.v1_8.internal.teavm.ArrayBufferInputStream; @@ -18,19 +19,20 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022-2023 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 SYS { public static final VirtualFilesystem VFS; @@ -111,7 +113,7 @@ public class SYS { return false; } } catch (IOException e) { - e.printStackTrace(); + EagRuntime.debugPrintStackTrace(e); return false; } } @@ -154,7 +156,7 @@ public class SYS { zis.close(); return true; } catch (IOException e) { - e.printStackTrace(); + EagRuntime.debugPrintStackTrace(e); return false; } } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFSIterator.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFSIterator.java index 5212a8e..01a3fd1 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFSIterator.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFSIterator.java @@ -1,19 +1,20 @@ package net.lax1dude.eaglercraft.v1_8.internal.vfs; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022 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 interface VFSIterator { public static class BreakLoop extends RuntimeException { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFile.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFile.java index a700a13..c1712ba 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFile.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VFile.java @@ -7,19 +7,20 @@ import java.util.Arrays; import java.util.List; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022 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 VFile { public static final String pathSeperator = "/"; diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VIteratorFile.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VIteratorFile.java index cfa7106..c0c0881 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VIteratorFile.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VIteratorFile.java @@ -13,23 +13,27 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.dom.events.Event; import org.teavm.jso.dom.events.EventListener; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBCursor; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBRequest; +import org.teavm.jso.indexeddb.IDBCursor; +import org.teavm.jso.indexeddb.IDBRequest; import org.teavm.jso.typedarrays.ArrayBuffer; import org.teavm.jso.typedarrays.Uint8Array; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; + /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022 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. + * */ /** @@ -226,16 +230,8 @@ public class VIteratorFile extends VFile { if(arr == null) { return null; } - - Uint8Array a = Uint8Array.create(arr); - int ii = a.getByteLength(); - - byte[] array = new byte[ii]; - for(int i = 0; i < ii; ++i) { - array[i] = (byte)a.get(i); - } - - return array; + + return TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(arr)); } public String getAllChars() { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VirtualFilesystem.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VirtualFilesystem.java index 29a1818..7acb417 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VirtualFilesystem.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/VirtualFilesystem.java @@ -11,40 +11,43 @@ import java.util.Iterator; import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; + import org.teavm.interop.Async; import org.teavm.interop.AsyncCallback; import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.dom.events.EventListener; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.EventHandler; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBCountRequest; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBCursor; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBCursorRequest; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBDatabase; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBFactory; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBGetRequest; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBObjectStoreParameters; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBOpenDBRequest; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBRequest; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBTransaction; -import net.lax1dude.eaglercraft.v1_8.internal.indexeddb.IDBVersionChangeEvent; +import org.teavm.jso.indexeddb.EventHandler; +import org.teavm.jso.indexeddb.IDBCountRequest; +import org.teavm.jso.indexeddb.IDBCursor; +import org.teavm.jso.indexeddb.IDBCursorRequest; +import org.teavm.jso.indexeddb.IDBDatabase; +import org.teavm.jso.indexeddb.IDBFactory; +import org.teavm.jso.indexeddb.IDBGetRequest; +import org.teavm.jso.indexeddb.IDBObjectStoreParameters; +import org.teavm.jso.indexeddb.IDBOpenDBRequest; +import org.teavm.jso.indexeddb.IDBRequest; +import org.teavm.jso.indexeddb.IDBTransaction; +import org.teavm.jso.indexeddb.IDBVersionChangeEvent; import org.teavm.jso.typedarrays.ArrayBuffer; import org.teavm.jso.typedarrays.Uint8Array; /** - * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * - * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES - * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED - * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE - * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * - * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * Copyright (c) 2022 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 VirtualFilesystem { protected static class VirtualOutputStream extends ByteArrayOutputStream { @@ -203,10 +206,7 @@ public class VirtualFilesystem { } Uint8Array a = Uint8Array.create(b); this.fileSize = a.getByteLength(); - byte[] array = new byte[fileSize]; - for(int i = 0; i < a.getByteLength(); ++i) { - array[i] = (byte)a.get(i); - } + byte[] array = TeaVMUtils.wrapUnsignedByteArray(a); if(cacheEnabled) { if(copy) { cache = new byte[fileSize]; @@ -242,10 +242,7 @@ public class VirtualFilesystem { cache = copz; return sync(); }else { - ArrayBuffer a = ArrayBuffer.create(bytes.length); - Uint8Array ar = Uint8Array.create(a); - ar.set(bytes); - boolean s = AsyncHandlers.writeWholeFile(virtualFilesystem.indexeddb, filePath, a).bool; + boolean s = AsyncHandlers.writeWholeFile(virtualFilesystem.indexeddb, filePath, TeaVMUtils.unwrapUnsignedByteArray(bytes).getBuffer()).bool; hasBeenAccessed = true; exists = exists || s; return s; @@ -255,10 +252,7 @@ public class VirtualFilesystem { public boolean sync() { if(cacheEnabled && cache != null && !hasBeenDeleted) { cacheHit = System.currentTimeMillis(); - ArrayBuffer a = ArrayBuffer.create(cache.length); - Uint8Array ar = Uint8Array.create(a); - ar.set(cache); - boolean tryWrite = AsyncHandlers.writeWholeFile(virtualFilesystem.indexeddb, filePath, a).bool; + boolean tryWrite = AsyncHandlers.writeWholeFile(virtualFilesystem.indexeddb, filePath, TeaVMUtils.unwrapUnsignedByteArray(cache).getBuffer()).bool; hasBeenAccessed = true; exists = exists || tryWrite; return tryWrite; diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java new file mode 100644 index 0000000..166c109 --- /dev/null +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java @@ -0,0 +1,246 @@ +package net.lax1dude.eaglercraft.v1_8.sp.internal; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +import org.teavm.jso.JSBody; +import org.teavm.jso.JSFunctor; +import org.teavm.jso.JSObject; +import org.teavm.jso.dom.events.ErrorEvent; +import org.teavm.jso.dom.events.EventListener; +import org.teavm.jso.typedarrays.ArrayBuffer; +import org.teavm.jso.typedarrays.Uint8Array; +import org.teavm.jso.workers.Worker; + +import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +/** + * 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 ClientPlatformSingleplayer { + + private static final Logger logger = LogManager.getLogger("ClientPlatformSingleplayer"); + + private static final LinkedList messageQueue = new LinkedList(); + + @JSBody(params = {}, script = "return (typeof window.eaglercraftXClientScriptElement !== \"undefined\") ? window.eaglercraftXClientScriptElement : null;") + private static native JSObject loadIntegratedServerSourceOverride(); + + @JSBody(params = {}, script = "return (typeof window.eaglercraftXClientScriptURL === \"string\") ? window.eaglercraftXClientScriptURL : null;") + private static native String loadIntegratedServerSourceOverrideURL(); + + @JSBody(params = {}, script = "try{throw new Error();}catch(ex){return ex.stack;}return null;") + private static native String loadIntegratedServerSourceStack(); + + @JSBody(params = { "csc" }, script = "if(typeof csc.src === \"string\" && csc.src.length > 0) return csc.src; else return null;") + private static native String loadIntegratedServerSourceURL(JSObject scriptTag); + + @JSBody(params = { "csc", "tail" }, script = "const cscText = csc.text;" + + "if(typeof cscText === \"string\" && cscText.length > 0) return new Blob([cscText, tail], { type: \"text/javascript;charset=utf8\" });" + + "else return null;") + private static native JSObject loadIntegratedServerSourceInline(JSObject scriptTag, String tail); + + private static String integratedServerSource = null; + private static String integratedServerSourceOriginalURL = null; + private static boolean serverSourceLoaded = false; + + private static Worker workerObj = null; + + @JSFunctor + private static interface WorkerBinaryPacketHandler extends JSObject { + public void onMessage(String channel, ArrayBuffer buf); + } + + @JSBody(params = { "w", "wb" }, script = "w.onmessage = function(o) { wb(o.data.ch, o.data.dat); };") + private static native void registerPacketHandler(Worker w, WorkerBinaryPacketHandler wb); + + @JSBody(params = { "w", "ch", "dat" }, script = "w.postMessage({ ch: ch, dat : dat });") + private static native void sendWorkerPacket(Worker w, String channel, ArrayBuffer arr); + + @JSBody(params = { "w", "workerArgs" }, script = "w.postMessage({ msg : workerArgs });") + private static native void sendWorkerStartPacket(Worker w, String workerArgs); + + private static class WorkerBinaryPacketHandlerImpl implements WorkerBinaryPacketHandler { + + public void onMessage(String channel, ArrayBuffer buf) { + if(channel == null) { + logger.error("Recieved IPC packet with null channel"); + return; + } + + if(buf == null) { + logger.error("Recieved IPC packet with null buffer"); + return; + } + + synchronized(messageQueue) { + messageQueue.add(new IPCPacketData(channel, TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(buf)))); + } + } + + } + + @JSBody(params = { "blobObj" }, script = "return URL.createObjectURL(blobObj);") + private static native String createWorkerScriptURL(JSObject blobObj); + + @JSBody(params = { "cscText", "tail" }, script = "return new Blob([cscText, tail], { type: \"text/javascript;charset=utf8\" });") + private static native JSObject createBlobObj(ArrayBuffer buf, String tail); + + private static final String workerBootstrapCode = "\n\nmain([\"_worker_process_\"]);"; + + private static JSObject loadIntegratedServerSource() { + String str = loadIntegratedServerSourceOverrideURL(); + if(str != null) { + ArrayBuffer buf = PlatformRuntime.downloadRemoteURI(str); + if(buf != null) { + integratedServerSourceOriginalURL = str; + logger.info("Using integrated server at: {}", str); + return createBlobObj(buf, workerBootstrapCode); + }else { + logger.error("Failed to load integrated server: {}", str); + } + } + JSObject el = loadIntegratedServerSourceOverride(); + if(el != null) { + String url = loadIntegratedServerSourceURL(el); + if(url == null) { + el = loadIntegratedServerSourceInline(el, workerBootstrapCode); + if(el != null) { + integratedServerSourceOriginalURL = "inline script tag"; + logger.info("Loading integrated server from inline script tag"); + return el; + } + }else { + ArrayBuffer buf = PlatformRuntime.downloadRemoteURI(url); + if(buf != null) { + integratedServerSourceOriginalURL = url; + logger.info("Using integrated server from script tag src: {}", url); + return createBlobObj(buf, workerBootstrapCode); + }else { + logger.error("Failed to load integrated server from script tag src: {}", url); + } + } + } + str = TeaVMUtils.tryResolveClassesSource(); + if(str != null) { + ArrayBuffer buf = PlatformRuntime.downloadRemoteURI(str); + if(buf != null) { + integratedServerSourceOriginalURL = str; + logger.info("Using integrated server from script src: {}", str); + return createBlobObj(buf, workerBootstrapCode); + }else { + logger.error("Failed to load integrated server from script src: {}", str); + } + } + logger.info("Could not resolve the location of client's classes.js!"); + logger.info("Make sure client's classes.js is linked/embedded in a dedicated